Mercurial > octave-dspies
comparison libinterp/parse-tree/lex.ll @ 18774:4293f49795d9 stable
don't crash on empty script files (bug #42064)
* lex.ll (<INPUT_FILE_START><<EOF>>): New pattern.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 23 May 2014 12:20:05 -0400 |
parents | 04b4fb217b1a |
children | bd1fd4ed3d67 d8abf813c69f |
comparison
equal
deleted
inserted
replaced
18772:5e99fd6ea758 | 18774:4293f49795d9 |
---|---|
278 curr_lexer->pop_start_state (); | 278 curr_lexer->pop_start_state (); |
279 | 279 |
280 return curr_lexer->show_token (INPUT_FILE); | 280 return curr_lexer->show_token (INPUT_FILE); |
281 } | 281 } |
282 | 282 |
283 <INPUT_FILE_START><<EOF>> { | |
284 curr_lexer->lexer_debug ("<INPUT_FILE_START><<EOF>>"); | |
285 | |
286 // May be reset later if we see "function" or "classdef" appears | |
287 // as the first token. | |
288 curr_lexer->reading_script_file = true; | |
289 | |
290 curr_lexer->pop_start_state (); | |
291 | |
292 return curr_lexer->show_token (INPUT_FILE); | |
293 } | |
294 | |
283 %{ | 295 %{ |
284 // Help and other command-style functions. | 296 // Help and other command-style functions. |
285 %} | 297 %} |
286 | 298 |
287 <COMMAND_START>{NL} { | 299 <COMMAND_START>{NL} { |