develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34526 - trunk/compilers/pirc/new

From:
kjs
Date:
December 28, 2008 14:36
Subject:
[svn:parrot] r34526 - trunk/compilers/pirc/new
Message ID:
20081228223651.4FE4BCB9FA@x12.develooper.com
Author: kjs
Date: Sun Dec 28 14:36:50 2008
New Revision: 34526

Modified:
   trunk/compilers/pirc/new/bcgen.c

Log:
[pirc] add bits from imcc/pbc.c to pirc/bcgen.c for lex_info creation.

Modified: trunk/compilers/pirc/new/bcgen.c
==============================================================================
--- trunk/compilers/pirc/new/bcgen.c	(original)
+++ trunk/compilers/pirc/new/bcgen.c	Sun Dec 28 14:36:50 2008
@@ -429,6 +429,36 @@
     return multi_signature;
 }
 
+static PMC *
+create_lexinfo(bytecode * const bc, PMC * sub, int lexflag) {
+
+    STRING *lex_name;
+    int outer; /* change type of this */
+
+    const INTVAL lex_info_id = Parrot_get_ctx_HLL_type(bc->interp, enum_class_LexInfo);
+
+    PMC * lex_info = pmc_new_noinit(bc->interp, lex_info_id);
+
+    VTABLE_init_pmc(bc->interp, lex_info, sub);
+
+/* for ... { */
+    Parrot_PCCINVOKE(bc->interp, lex_info,
+                            string_from_literal(bc->interp, "declare_lex_preg"),
+                            "SI->", lex_name, 0 /* color */);
+
+
+/* ... } */
+
+    if (lex_info == NULL && (outer || lexflag)) {
+        lex_info = pmc_new_noinit(bc->interp, lex_info_id);
+        VTABLE_init_pmc(bc->interp, lex_info, sub);
+    }
+
+    return lex_info;
+}
+
+
+
 /*
 
 =item C<void



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