develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35777 - trunk/compilers/pirc/src

From:
kjs
Date:
January 19, 2009 14:57
Subject:
[svn:parrot] r35777 - trunk/compilers/pirc/src
Message ID:
20090119225716.18DEECB9AE@x12.develooper.com
Author: kjs
Date: Mon Jan 19 14:57:15 2009
New Revision: 35777

Modified:
   trunk/compilers/pirc/src/pircompunit.c
   trunk/compilers/pirc/src/pircompunit.h

Log:
[pirc] store PIR source line in the instruction for each, ehm, source line :-)

Modified: trunk/compilers/pirc/src/pircompunit.c
==============================================================================
--- trunk/compilers/pirc/src/pircompunit.c	(original)
+++ trunk/compilers/pirc/src/pircompunit.c	Mon Jan 19 14:57:15 2009
@@ -400,6 +400,9 @@
     /* the codesize so far will be the offset of this instruction. */
     instr->offset = lexer->codesize;
 
+    /* set the PIR source line number */
+    instr->sourceline = yypirget_lineno(lexer->yyscanner);
+
     /*
     fprintf(stderr, "offset of %s is: %d\n", opname, instr->offset);
     */

Modified: trunk/compilers/pirc/src/pircompunit.h
==============================================================================
--- trunk/compilers/pirc/src/pircompunit.h	(original)
+++ trunk/compilers/pirc/src/pircompunit.h	Mon Jan 19 14:57:15 2009
@@ -293,6 +293,7 @@
     int                 oplabelbits;  /* bits indicating which operands are labels */
     struct op_info_t   *opinfo;       /* pointer to the op_info containing this op's meta data */
     int                 opcode;       /* the opcode of this instruction */
+    int                 sourceline;   /* PIR source line */
 
     struct instruction *next;
 } instruction;



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About