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

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

From:
kjs
Date:
December 30, 2008 05:03
Subject:
[svn:parrot] r34643 - trunk/compilers/pirc/new
Message ID:
20081230130346.B7283CB9FA@x12.develooper.com
Author: kjs
Date: Tue Dec 30 05:03:45 2008
New Revision: 34643

Modified:
   trunk/compilers/pirc/new/pircompunit.c
   trunk/compilers/pirc/new/pirpcc.c

Log:
[pirc] disallow users to write full signatured ops; it's not practical, not necessary, and would add a lot of complexity to PIRC. Just don't do it. Stick to 'set' as opposed to e.g. 'set_i_ic' 
+ whitespace

Modified: trunk/compilers/pirc/new/pircompunit.c
==============================================================================
--- trunk/compilers/pirc/new/pircompunit.c	(original)
+++ trunk/compilers/pirc/new/pircompunit.c	Tue Dec 30 05:03:45 2008
@@ -1989,28 +1989,15 @@
 is_parrot_op(lexer_state * const lexer, char const * const name) {
     int opcode = lexer->interp->op_lib->op_code(name, 0); /* check short name, e.g. "set" */
 
-    /* if not found, try long name, e.g. "set_i_ic" */
-    if (opcode < 0)
-        opcode = lexer->interp->op_lib->op_code(name, 1); /* check long name */
-
-    if (opcode >= 0)
-        return TRUE;
-    else
-        return FALSE;
-
+    /* do *NOT* check for the "long" name variant, such as "set_i_ic";
+     * signatures (such as the _i_ic part) will be calculated by PIRC,
+     * adding it already will generate e.g. "set_i_ic_i_ic", which is
+     * incorrect, obviously.
+     */
+    return (opcode >= 0);
 }
 
 
-
-
-
-
-
-
-
-
-
-
 /*
 
 =item C<void
@@ -2053,7 +2040,7 @@
 
 /*
 
-=item C<static void
+=item C<void
 update_op(lexer_state * const lexer, instruction * const instr, int newop)>
 
 Update the instruction C<instr>; it is replaced by the op with opcode C<newop>.

Modified: trunk/compilers/pirc/new/pirpcc.c
==============================================================================
--- trunk/compilers/pirc/new/pirpcc.c	(original)
+++ trunk/compilers/pirc/new/pirpcc.c	Tue Dec 30 05:03:45 2008
@@ -240,7 +240,7 @@
 
 /*
 
-=item C<static void
+=item C<void
 emit_sub_epilogue(lexer_state * const lexer)>
 
 Emit final instructions for the current subroutine. In case



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