cvsuser 01/09/23 13:29:38
Modified: . assemble.pl
Log:
Added __FILE__ equate, fixed __LINE__ equate.
Revision Changes Path
1.40 +7 -5 parrot/assemble.pl
Index: assemble.pl
===================================================================
RCS file: /home/perlcvs/parrot/assemble.pl,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -w -r1.39 -r1.40
--- assemble.pl 2001/09/22 20:13:17 1.39
+++ assemble.pl 2001/09/23 20:29:38 1.40
@@ -21,7 +21,7 @@
'listing=s'));
if($options{'version'}) {
- print $0,'Version $Id: assemble.pl,v 1.39 2001/09/22 20:13:17 simon Exp $
',"\n";
+ print $0,'Version $Id: assemble.pl,v 1.40 2001/09/23 20:29:38 bdwheele Exp $
',"\n";
exit;
}
@@ -72,14 +72,16 @@
my $pc=0; my $op_pc=0;
my ($bytecode,%label,%fixup,%constants,@constants);
my (%local_label, %local_fixup, $last_label, %macros);
-my $line=0;
+my ($file,$line,$pline,$sline);
my %equate=('*'=>sub { return $pc },
'__DATE__'=>'"'.scalar(localtime).'"',
- '__VERSION__'=>'" $Revision: 1.39 $ "',
- '__LINE__' => sub { return $line });
+ '__VERSION__'=>'" $Revision: 1.40 $ "',
+ '__LINE__' => sub { return $line },
+ '__FILE__' => sub { return "\"$file\"" });
+
my($code,$in_macro,$cur_macro);
while(my $l=shift(@program)) {
- my($file,$line,$pline,$sline)=@$l;
+ ($file,$line,$pline,$sline)=@$l;
if($in_macro) {
if($pline=~m/^endm$/i) {
# end of the macro