# HG changeset patch # User John W. Eaton # Date 1709133091 18000 # Node ID f3eb27de36cfdf8447100b3d0d9a0274af3e52bd # Parent 0cee23f74ae9fbf5217053134c8c69869a29ea59 fix grammar to explicitly disallow 'file' inside other statement lists * oct-parse.yy (input): Recognize 'file' here instead of in 'command'. diff -r 0cee23f74ae9 -r f3eb27de36cf libinterp/parse-tree/oct-parse.yy --- a/libinterp/parse-tree/oct-parse.yy Tue Feb 27 23:51:59 2024 -0500 +++ b/libinterp/parse-tree/oct-parse.yy Wed Feb 28 10:11:31 2024 -0500 @@ -434,6 +434,13 @@ else YYACCEPT; } + | file + { + lexer.m_end_of_input = true; + + $$ = $1; + YYACCEPT; + } | parse_error { $$ = nullptr; @@ -1038,8 +1045,6 @@ { $$ = $1; } | function { $$ = $1; } - | file - { $$ = $1; } ; // ======================