summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2004-06-07 16:43:12 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2004-06-07 16:43:12 +0000
commit70bfc6a733abe5596e436c902791080c6680499d (patch)
treec467a70fc4f3610ef5479c620c9e8f0f5f305567
parent8b690f18b30140d29f89eb04667bab8c15ec3870 (diff)
downloadmdk-70bfc6a733abe5596e436c902791080c6680499d.tar.gz
mdk-70bfc6a733abe5596e436c902791080c6680499d.tar.bz2
fix for bug #5654, including support for both field specs and indexing in local constants.
-rw-r--r--mixlib/mix_scanner.l17
1 files changed, 17 insertions, 0 deletions
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 ();
}
}