diff options
-rw-r--r-- | mixlib/mix_eval_scanner.l | 6 | ||||
-rw-r--r-- | mixlib/mix_scanner.l | 18 |
2 files changed, 16 insertions, 8 deletions
diff --git a/mixlib/mix_eval_scanner.l b/mixlib/mix_eval_scanner.l index 7f759d9..055eb79 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/30 03:11:51 jose> + * Last change: Time-stamp: <00/12/30 03:39:59 jose> * ------------------------------------------------------------------ * Copyright (C) 2000 jose antonio ortega ruiz <jaortega@acm.org> * @@ -146,10 +146,10 @@ wexpr {expr}({fpart})?(,{expr}({fpart})?)* wexpr_val); } } - {number}/({ws}*\n) { + {number}/({ws}*\n)|[,()] { wexpr_val = mix_word_new (atol (yytext)); } - {expr}/({ws}*\n) { + {expr}/({ws}*\n)|[,()] { if (yytext[0] != '*') { yypos -= yyleng; diff --git a/mixlib/mix_scanner.l b/mixlib/mix_scanner.l index 084686f..4a6c1a3 100644 --- a/mixlib/mix_scanner.l +++ b/mixlib/mix_scanner.l @@ -1,4 +1,4 @@ -/* -*-flex-*- ------------------ mix_scanner.l : +/* ------------------ mix_scanner.l : * Lexical scanner used by mix_parser_t * ------------------------------------------------------------------ * Copyright (C) 2000 jose antonio ortega ruiz <jaortega@acm.org> @@ -70,8 +70,16 @@ #define ENTER_EVAL() \ do { \ - expr_val = MIX_WORD_ZERO; \ - yyless (0); \ + if (yytext[0] != '*') \ + { \ + expr_val = MIX_WORD_ZERO; \ + yyless (0); \ + } \ + else \ + { \ + expr_val = mix_short_to_word_fast (parser->loc_count); \ + yyless (1); \ + } \ yy_push_state (EVAL); \ } while (FALSE) @@ -457,8 +465,8 @@ wexpr {expr}({fpart})?(,{expr}({fpart})?)* wexpr_val = mix_word_store_field (mix_byte_new (val), wexpr_val_tmp, wexpr_val); } - {number} wexpr_val = mix_word_new (atol (yytext)); - {expr} ENTER_EVAL (); + {number}/[,()\n\t ] wexpr_val = mix_word_new (atol (yytext)); + {expr}/[,()\n\t ] ENTER_EVAL (); ,/{expr} /* eat comma if followed by expression */ [\n\t ] { /* ok if not inside an f-part */ if ( is_fp ) { |