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

tene at svn.parrot.org tene at svn.parrot.org
Sat Mar 28 00:57:39 UTC 2009


Author: tene
Date: Sat Mar 28 00:57:38 2009
New Revision: 37783
URL: https://trac.parrot.org/parrot/changeset/37783

Log:
[pirc]: Set method_name on subs when appropriate... methods still don't work.

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

Modified: trunk/compilers/pirc/src/bcgen.c
==============================================================================
--- trunk/compilers/pirc/src/bcgen.c	Sat Mar 28 00:54:40 2009	(r37782)
+++ trunk/compilers/pirc/src/bcgen.c	Sat Mar 28 00:57:38 2009	(r37783)
@@ -1057,6 +1057,12 @@
     else
         sub->subid = subname_const->u.string;
 
+    /* if there was a :method, add it to the constants table, and set the method
+     * attribute to that STRING.
+     */
+    if (info->methodname)
+        sub->method_name = add_string_const_from_cstring(bc, info->methodname);
+
 
     /* store the sub in a namespace. XXX why, and in what namespace? sub->namespace_name?
      * XXX must this be done always? (this w.r.t. the recent discussion about :vtable/:method

Modified: trunk/compilers/pirc/src/bcgen.h
==============================================================================
--- trunk/compilers/pirc/src/bcgen.h	Sat Mar 28 00:54:40 2009	(r37782)
+++ trunk/compilers/pirc/src/bcgen.h	Sat Mar 28 00:57:38 2009	(r37783)
@@ -61,6 +61,7 @@
  */
 typedef struct sub_info {
     char const    *subname;
+    char const    *methodname;
     char const    *nsentry;
     char const    *subid;
     char const    *outersub;

Modified: trunk/compilers/pirc/src/pircompunit.c
==============================================================================
--- trunk/compilers/pirc/src/pircompunit.c	Sat Mar 28 00:54:40 2009	(r37782)
+++ trunk/compilers/pirc/src/pircompunit.c	Sat Mar 28 00:57:38 2009	(r37783)
@@ -256,6 +256,8 @@
         CURRENT_SUB(lexer)->methodname = methodname;
     else /* :method without a value defaults to the subname. */
         CURRENT_SUB(lexer)->methodname = CURRENT_SUB(lexer)->info.subname;
+    
+    CURRENT_SUB(lexer)->info.methodname = CURRENT_SUB(lexer)->methodname;
 
     /* :methods have an automatic "self" parameter */
     add_self_parameter(lexer);


More information about the parrot-commits mailing list