--- parser3/src/main/compile.y 2001/02/21 17:50:02 1.13 +++ parser3/src/main/compile.y 2001/02/22 10:43:45 1.16 @@ -87,7 +87,7 @@ action: get | put | with | call; get: '$' any_name { $$=$2; /* stack: resulting value */ - OP($$, OP_WRITE); /* value=pop; write(value) */ + OP($$, OP_WRITE_VALUE); /* value=pop; write(value) */ }; any_name: name_without_curly_rdive EON | name_in_curly_rdive; @@ -127,11 +127,13 @@ constructor_value: | constructor_two_params_value /* $var(=;2*2) $var(%d;2*2) $var(+;1) */ ; constructor_one_param_value: - empty_value /* optimized $var() case */ -| STRING /* optimized $var(STRING) case */ + empty /* optimized $var() case */ +| string_value /* optimized $var(STRING) case */ | complex_constructor_param_value /* $var(something complex) */ ; -empty_value: empty; +string_value: STRING { + $$=LAS2LAVS($1); +}; complex_constructor_param_value: complex_constructor_param_body { $$=N(pool); OP($$, OP_CREATE_EWPOOL); /* stack: empty write context */ @@ -235,7 +237,7 @@ name_expr_with_subvar_value: STRING subv $$=N(pool); OP($$, OP_CREATE_EWPOOL); P($$, $1); - OP($$, OP_WRITE); + OP($$, OP_WRITE_STRING); P($$, $2); OP($$, OP_REDUCE_EWPOOL); }; @@ -250,7 +252,7 @@ subvar_ref_name_rdive: STRING { subvar_get_writes: subvar__get_write | subvar_get_writes subvar__get_write { $$=$1; P($$, $2) }; subvar__get_write: '$' subvar_ref_name_rdive { $$=$2; - OP($$, OP_GET_ELEMENT__WRITE); + OP($$, OP_GET_ELEMENT__WRITE_VALUE); }; @@ -261,7 +263,7 @@ with: '$' name_without_curly_rdive '{' c OP($$, OP_CREATE_RWPOOL); P($$, $4); OP($$, OP_REDUCE_RWPOOL); - OP($$, OP_WRITE); + OP($$, OP_WRITE_VALUE); }; /* codes_in_brackets */ @@ -281,7 +283,7 @@ codes__excluding_sole_str_literal: ; write_str_literal: STRING { $$=$1; - OP($$, OP_WRITE); + OP($$, OP_WRITE_STRING); }; /* */ @@ -621,7 +623,7 @@ break2: int real_yyerror(parse_control *pc, char *s) /* Called by yyparse on error */ { - fprintf(stderr, "[%s]\n", s); + //fprintf(stderr, "[%s]\n", s); s[MAX_STRING-1]=0; strcpy(pc->error, s); return 1;