Mercurial > hg > octave-lyh
comparison libinterp/parse-tree/lex.ll @ 16334:06aa4c0f2018
handle foo @... as command syntax
* lex.ll ("@"): Check for possible command.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 19 Mar 2013 17:06:22 -0400 |
parents | fc565603ccbb |
children | 6bfd8dbd7d3c |
comparison
equal
deleted
inserted
replaced
16333:100a7bd2590e | 16334:06aa4c0f2018 |
---|---|
704 return curr_lexer->count_token_internal (METAQUERY); | 704 return curr_lexer->count_token_internal (METAQUERY); |
705 } | 705 } |
706 } | 706 } |
707 | 707 |
708 "@" { | 708 "@" { |
709 curr_lexer->lexer_debug ("@"); | 709 if (curr_lexer->previous_token_may_be_command () |
710 | 710 && curr_lexer->space_follows_previous_token ()) |
711 curr_lexer->current_input_column++; | 711 { |
712 | 712 yyless (0); |
713 curr_lexer->looking_at_function_handle++; | 713 curr_lexer->push_start_state (COMMAND_START); |
714 curr_lexer->looking_for_object_index = false; | 714 } |
715 curr_lexer->at_beginning_of_statement = false; | 715 else |
716 | 716 { |
717 return curr_lexer->count_token ('@'); | 717 curr_lexer->lexer_debug ("@"); |
718 | |
719 curr_lexer->current_input_column++; | |
720 | |
721 curr_lexer->looking_at_function_handle++; | |
722 curr_lexer->looking_for_object_index = false; | |
723 curr_lexer->at_beginning_of_statement = false; | |
724 | |
725 return curr_lexer->count_token ('@'); | |
726 } | |
718 } | 727 } |
719 | 728 |
720 %{ | 729 %{ |
721 // A new line character. New line characters inside matrix constants | 730 // A new line character. New line characters inside matrix constants |
722 // are handled by the <MATRIX_START> start state code above. If closest | 731 // are handled by the <MATRIX_START> start state code above. If closest |