Index: t/compilers/imcc/syn/symbols.t
===================================================================
--- t/compilers/imcc/syn/symbols.t (revision 27038)
+++ t/compilers/imcc/syn/symbols.t (working copy)
@@ -7,7 +7,7 @@
use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Config;
-use Parrot::Test tests => 5;
+use Parrot::Test tests => 6;
# 1 ##########################
pir_error_output_like( <<'CODE', <<'OUT', "register names with one
letter only are invalid" );
@@ -56,6 +56,14 @@
1
OUT
+# 6 ##########################
+pasm_error_output_like(<<'CODE', <<'OUT', q|#52858: "$" vars in PASM
don't work, but aren't disallowed either| );
+ say $S0
+CODE
+/error:imcc:'\$S0' is not a valid register name in pasm mode/
+OUT
+
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Index: /Users/stef/svn/parrot/compilers/imcc/imcc.l
===================================================================
--- /Users/stef/svn/parrot/compilers/imcc/imcc.l (revision 27038)
+++ /Users/stef/svn/parrot/compilers/imcc/imcc.l (working copy)
@@ -629,21 +629,33 @@
<emit,INITIAL>\$I[0-9]+ {
if (valp) (valp)->s = yytext;
+ if (IMCC_INFO(interp)->state->pasm_file)
+ IMCC_fataly(interp, E_SyntaxError,
+ "'%s' is not a valid register name in pasm mode", yytext);
return IREG;
}
<emit,INITIAL>\$N[0-9]+ {
if (valp) (valp)->s = yytext;
+ if (IMCC_INFO(interp)->state->pasm_file)
+ IMCC_fataly(interp, E_SyntaxError,
+ "'%s' is not a valid register name in pasm mode", yytext);
return NREG;
}
<emit,INITIAL>\$S[0-9]+ {
if (valp) (valp)->s = yytext;
+ if (IMCC_INFO(interp)->state->pasm_file)
+ IMCC_fataly(interp, E_SyntaxError,
+ "'%s' is not a valid register name in pasm mode", yytext);
return SREG;
}
<emit,INITIAL>\$P[0-9]+ {
if (valp) (valp)->s = yytext;
+ if (IMCC_INFO(interp)->state->pasm_file)
+ IMCC_fataly(interp, E_SyntaxError,
+ "'%s' is not a valid register name in pasm mode", yytext);
return PREG;
}
--
cognominal stef