Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #39908] [BUG] IMCC treats $S as a non-register instead of throwing an error

5 views
Skip to first unread message

Matt Diephouse

unread,
Jul 22, 2006, 8:38:37 PM7/22/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Matt Diephouse
# Please include the string: [perl #39908]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=39908 >


Example:

mini:~/Projects/parrot mdiep$ cat test.pir
.sub main :main
print $S
print "\n"
end
.end

mini:~/Projects/parrot mdiep$ parrot test.pir
error:imcc:The opcode 'print' (print<0>) was not found. Check the
type and number of the arguments
in file 'test.pir' line 2
mini:~/Projects/parrot mdiep$

That ought to throw an error. Instead, it parses it but doesn't treat
$S as a register. Note that this works for all register types.

--
Matt Diephouse

Jerry Gay

unread,
Mar 15, 2007, 9:31:46 AM3/15/07
to parrotbug...@parrotcode.org, perl6-i...@perl.org
On 3/14/07, Nuno Carvalho via RT <parrotbug...@parrotcode.org> wrote:
> Greetings,
>
> here are some examples running the changed lexer:
>
> $ cat 1.pir
> .sub main :main
> .macro SpinForever (Count)
> .local $LOOP: dec .COUNT # ".local $LOOP" defines a local label.
> branch .$LOOP # Jump to said label.
> .endm
> .end
> $ ./parrot 1.pir
> $
> $ cat 2.pir
> .sub main :main
> print $AA
> .end
> $ ./parrot 2.pir
> error:imcc:'$AA' is not a valid register name
> in file '2.pir' line 2
> $ cat 3.pir
> .sub main :main
> $I = 5
> .end
> $ ./parrot 3.pir
> error:imcc:'$I' is not a valid register name
> in file '3.pir' line 2
> $ cat 4.pir
> .sub main :main
> print "$A"
> .end
> $ ./parrot 4.pir
> $A
> $ cat 5.pir
> .sub main :main
> print $2
> .end
> $ ./parrot 5.pir
> error:imcc:'$2' is not a valid register name
> in file '5.pir' line 2
>
> With the new lexer the result of running 'make test' is the same, except
> for 't/compilers/imcc/syn/errors.t' because now we have a different
> error message. I attached a patch with the new lexer and the corrected test.
>
> More tests/comments welcome!
>
the above examples should be converted to tests. please place them in
t/compilers/imcc/syn/macro.t, and resubmit. that should allow us to do
a partial apply (tests only), see the failures, then apply the source,
rebuild, test, and see the failures disappear, with no other failures.
~jerry

Nuno Carvalho via RT

unread,
Mar 17, 2007, 6:13:58 PM3/17/07
to perl6-i...@perl.org
Greetings,

I added a new file 't/compilers/imcc/syn/symbols.t' in r17571 with tests
similar to those i pasted here. Tests are tagged todo until the actual
lexer patch is applied. I also added a couple of tests for macros, these
ones are passing.

Best regards,
./smash

Nuno Carvalho via RT

unread,
Mar 19, 2007, 5:32:38 PM3/19/07
to perl6-i...@perl.org
Greetins,

Applied the lexer patch in r17645. Removed the todo tag from previous
added tests, all passing. Also changed an older test because the error
message changed. To build the new lexer/parser i used:

Determining whether lex is installed...........................flex 2.5.33.
Determining whether yacc is installed............................bison 2.3.

Best regards,
./smash

Nuno Carvalho via RT

unread,
Mar 19, 2007, 6:52:31 PM3/19/07
to perl6-i...@perl.org
Greetings,

Got some positive feedback, resolved in r17645. Please reopen the ticket
if anyone finds any issue. Thks.

Best regards,
./smash

0 new messages