summaryrefslogtreecommitdiffhomepage
path: root/mixlib/mix_scanner.l
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
commit5215f624bfc562a60f3563256e65738083d572f4 (patch)
tree2871293fbacae323102f26b7dac2f0b2da52843d /mixlib/mix_scanner.l
parentca19f9defbe730beda8b527ed7994be2f2518fee (diff)
downloadmdk-5215f624bfc562a60f3563256e65738083d572f4.tar.gz
mdk-5215f624bfc562a60f3563256e65738083d572f4.tar.bz2
fix for bug #5654, including support for both field specs and indexing in local constants.
Diffstat (limited to 'mixlib/mix_scanner.l')
-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 ();
}
}