Mercurial > octave-dspies
comparison libinterp/parse-tree/lex.ll @ 18341:02b349ccf0ec
Allow "end" method declaration/definition in classde files.
* lex.ll (octave_base_lexer::is_keyword_token): Allow "end" keyword as
function/method name in classdef files.
* oct-parse.in.yy (rule method_decl): Add mid-rule action to enable
proper function name parsing, e.g. allowing "end" as function/method
name.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Thu, 23 Jan 2014 10:38:10 -0500 |
parents | a91654d70f99 |
children | fc0ce9eb9d82 |
comparison
equal
deleted
inserted
replaced
18340:a91654d70f99 | 18341:02b349ccf0ec |
---|---|
2342 case until_kw: | 2342 case until_kw: |
2343 break; | 2343 break; |
2344 | 2344 |
2345 case end_kw: | 2345 case end_kw: |
2346 if (inside_any_object_index () | 2346 if (inside_any_object_index () |
2347 || (! reading_classdef_file | 2347 || (defining_func |
2348 && (defining_func | 2348 && ! (looking_at_return_list |
2349 && ! (looking_at_return_list | 2349 || parsed_function_name.top ()))) |
2350 || parsed_function_name.top ())))) | |
2351 { | 2350 { |
2352 at_beginning_of_statement = previous_at_bos; | 2351 at_beginning_of_statement = previous_at_bos; |
2353 return 0; | 2352 return 0; |
2354 } | 2353 } |
2355 | 2354 |