Mercurial > hg > octave-terminal
changeset 627:739d16c30481
[project @ 1994-08-19 13:23:14 by jwe]
author | jwe |
---|---|
date | Fri, 19 Aug 1994 13:24:32 +0000 |
parents | 96be9eae023f |
children | aecbe369233b |
files | src/data.cc src/lex.l src/parse.y |
diffstat | 3 files changed, 25 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/src/data.cc +++ b/src/data.cc @@ -271,7 +271,7 @@ if ((nr == 1 && nc == 2) || (nr == 2 && nc == 1)) { - ColumnVector v = tmpa.to_vector (); + ColumnVector v = tmpa.vector_value (); nr = NINT (v.elem (0)); nc = NINT (v.elem (1));
--- a/src/lex.l +++ b/src/lex.l @@ -179,7 +179,7 @@ { error ("unterminated string constant"); current_input_column = 1; - jump_to_top_level (); + return LEXICAL_ERROR; } else { @@ -202,7 +202,7 @@ { error ("unterminated string constant"); current_input_column = 1; - jump_to_top_level (); + return LEXICAL_ERROR; } else { @@ -232,7 +232,7 @@ { error ("unterminated string constant"); current_input_column = 1; - jump_to_top_level (); + return LEXICAL_ERROR; } else { @@ -262,7 +262,7 @@ { error ("unterminated string constant"); current_input_column = 1; - jump_to_top_level (); + return LEXICAL_ERROR; } else { @@ -1043,7 +1043,7 @@ else error ("defining new function near line %d", input_line_number); - jump_to_top_level (); // XXX FIXME XXX + return LEXICAL_ERROR; } else {
--- a/src/parse.y +++ b/src/parse.y @@ -216,6 +216,7 @@ %token <tok_val> GLOBAL // Other tokens. +%token LEXICAL_ERROR %token FCN SCREW_TWO %token ELLIPSIS %token END_OF_INPUT @@ -240,7 +241,8 @@ %type <tree_global_init_list_type> global_decl1 %type <tree_global_command_type> global_decl %type <tree_statement_type> statement -%type <tree_statement_list_type> simple_list simple_list1 list list1 opt_list +%type <tree_statement_list_type> simple_list simple_list1 list list1 +%type <tree_statement_list_type> opt_list input1 %type <tree_plot_command_type> plot_command %type <subplot_type> plot_command2 plot_options %type <subplot_list_type> plot_command1 @@ -273,9 +275,9 @@ */ %% -input : '\n' +input : input1 { - global_command = 0; + global_command = $1; promptflag = 1; YYACCEPT; } @@ -285,36 +287,24 @@ promptflag = 1; YYABORT; } + | simple_list parse_error + { ABORT_PARSE; } + | parse_error + { ABORT_PARSE; } + ; + +input1 : '\n' + { $$ = 0; } | simple_list - { - global_command = $1; - promptflag = 1; - YYACCEPT; - } + { $$ = $1; } | simple_list '\n' - { - global_command = $1; - promptflag = 1; - YYACCEPT; - } + { $$ = $1; } | simple_list END_OF_INPUT - { - global_command = $1; - promptflag = 1; - YYACCEPT; - } + { $$ = $1; } + ; + +parse_error : LEXICAL_ERROR | error - { ABORT_PARSE; } - | error '\n' - { ABORT_PARSE; } - | error END_OF_INPUT - { ABORT_PARSE; } - | simple_list error - { ABORT_PARSE; } - | simple_list error '\n' - { ABORT_PARSE; } - | simple_list error END_OF_INPUT - { ABORT_PARSE; } ; simple_list : semi_comma