# New Ticket Created by Kevin Falcone
# Please include the string: [netlabs #647]
# in the subject line of all future correspondence about this issue.
# <URL: http://bugs6.perl.org/rt2/Ticket/Display.html?id=647 >
As clint noticed with BASIC, the assembler right now can't handle
things like this:
LBL1:
LBL2:
print "hello\n"
this patch tweaks the part of the assembler which joins empty labels
with the following lines so that the assembler now sees.
LBL1: noop
LBL2: print "hello\n"
instead of LBL1:LBL2: print "hello\n" which was confusing the heck out
of it.
-kevin
Index: assemble.pl
===================================================================
RCS file: /cvs/public/parrot/assemble.pl,v
retrieving revision 1.54
diff -u -r1.54 assemble.pl
--- assemble.pl 1 Jun 2002 08:06:53 -0000 1.54
+++ assemble.pl 1 Jun 2002 19:42:14 -0000
@@ -399,8 +399,14 @@
# XXX This could fail if a label occurs at the end of a file.
#
if(@{$self->{contents}} and
- $self->{contents}[-1][0] =~ /:$/) {
+ $self->{contents}[-1][0] =~ /:$/ and
+ $line !~ /^[a-zA-Z0-9_]+:/) {
$self->{contents}[-1][0] .= $line;
+ }
+ elsif(@{$self->{contents}} and
+ $line =~ /:$/) {
+ $line .= 'noop';
+ push @{$self->{contents}},[$line,$self->{pc}];
}
else {
push @{$self->{contents}},[$line,$self->{pc}];
--
"Never go in against a sicilian when death is on the line"
-- Vizzini in "The Princess Bride"