From 70bfc6a733abe5596e436c902791080c6680499d Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 7 Jun 2004 16:43:12 +0000 Subject: fix for bug #5654, including support for both field specs and indexing in local constants. --- mixlib/mix_scanner.l | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mixlib') diff --git a/mixlib/mix_scanner.l b/mixlib/mix_scanner.l index 2d097ca..aaa3146 100644 --- a/mixlib/mix_scanner.l +++ b/mixlib/mix_scanner.l @@ -352,8 +352,18 @@ wexpr {expr}({fpart})?(,{expr}({fpart})?)* [+-]?{number}={ws}+.*\n { if (!lsf) RETURN_ERROR (MIX_PERR_INV_ADDRESS, yytext); mix_parser_define_ls (parser, mix_word_new (atol (yytext))); + lsf = FALSE; ADD_INS (); } + [+-]?{number}=[(,] { + int pos = yyleng - 3; + if (!lsf) RETURN_ERROR (MIX_PERR_INV_ADDRESS, yytext); + unput (yytext[yyleng - 1]); + while (pos >= 0) { + unput (yytext[pos]); + --pos; + } + } [+-]?{number}{ws}+.*\n | [+-]?{number}[(,\n] { ins.address = mix_short_new (atol (yytext)); @@ -426,6 +436,13 @@ wexpr {expr}({fpart})?(,{expr}({fpart})?)* else { ins.fspec = mix_byte_new (val); + if (lsf) + { + mix_parser_define_ls (parser, + mix_short_to_word_fast (ins.address)); + ins.address = MIX_WORD_ZERO; + lsf = FALSE; + } ADD_INS (); } } -- cgit v1.2.3