diff options
-rw-r--r-- | mixlib/mix_eval_scanner.l | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/mixlib/mix_eval_scanner.l b/mixlib/mix_eval_scanner.l index af7fd67..7f759d9 100644 --- a/mixlib/mix_eval_scanner.l +++ b/mixlib/mix_eval_scanner.l @@ -1,7 +1,7 @@ /* -*-c-*- ------------------ mix_eval_scanner.l : * scanner used by mix_eval_t * ------------------------------------------------------------------ - * Last change: Time-stamp: <00/12/03 11:33:21 jose> + * Last change: Time-stamp: <00/12/30 03:11:51 jose> * ------------------------------------------------------------------ * Copyright (C) 2000 jose antonio ortega ruiz <jaortega@acm.org> * @@ -73,7 +73,8 @@ locsymbol {digit}H flocsymbol {digit}F blocsymbol {digit}B symbol {digit}*{letter}+[A-Z0-9]* -binop "+"|"-"|"*"|"/"|"//"|":" +binops "+"|"-"|"/"|"//"|":" +binop {binops}|"*" atexpr {digit}+|{symbol}|\* expr [+-]?{atexpr}({binop}{1}{atexpr})* fpart \({expr}\) @@ -145,10 +146,23 @@ wexpr {expr}({fpart})?(,{expr}({fpart})?)* wexpr_val); } } - {number} { + {number}/({ws}*\n) { wexpr_val = mix_word_new (atol (yytext)); } - {expr} yypos -= yyleng; yyless (0); yy_push_state (EVAL); + {expr}/({ws}*\n) { + if (yytext[0] != '*') + { + yypos -= yyleng; + yyless (0); + } + else + { + yypos -= yyleng - 1; + expr_val = mix_short_to_word_fast (data->loc); + yyless (1); + } + yy_push_state (EVAL); + } ,/{expr} /* eat comma if followed by expression */ [\t\n ] { /* ok if not inside an f-part */ if ( is_fp ) { @@ -175,16 +189,11 @@ wexpr {expr}({fpart})?(,{expr}({fpart})?)* expr_val = eval_binop_ (yytext, expr_val, mix_symbol_table_value (data->table, s)); } - "***" { - mix_word_t loc = mix_short_to_word_fast (data->loc); - (void)mix_word_mul (loc, loc, NULL, &loc); - yypos -= unput_word_ (loc); - } {binop}"*" { expr_val = eval_binop_ (yytext, expr_val, mix_short_to_word_fast (data->loc)); } - "*" yypos -= unput_word_ (mix_short_to_word_fast (data->loc)); + "*" yypos -= unput_word_ (mix_short_to_word_fast (data->loc)); {number} expr_val = mix_word_new (atol (yytext)); {symbol} { if ( !mix_symbol_table_is_defined (data->table, yytext) ) { |