summaryrefslogtreecommitdiffhomepage
path: root/mixlib/mix_scanner.l
diff options
context:
space:
mode:
authorjaortega <jaortega>2000-12-30 02:54:41 +0000
committerjaortega <jaortega>2000-12-30 02:54:41 +0000
commit84ccc2fe81c3d57a4c7843a264b5737252e10189 (patch)
tree21e1f97ffb2dd358f89d3f23abce854b53636d5e /mixlib/mix_scanner.l
parent1b48163d8b757b5ed0b377ea6b11a30d7b70e891 (diff)
downloadmdk-84ccc2fe81c3d57a4c7843a264b5737252e10189.tar.gz
mdk-84ccc2fe81c3d57a4c7843a264b5737252e10189.tar.bz2
corrected handling of successive * in expressions
Diffstat (limited to 'mixlib/mix_scanner.l')
-rw-r--r--mixlib/mix_scanner.l18
1 files changed, 13 insertions, 5 deletions
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 ) {