Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

.namespace [''] in TGE

0 views
Skip to first unread message

Chip Salzenberg

unread,
Jul 6, 2006, 1:56:08 PM7/6/06
to Allison Randal, parrot-...@perl.org
I think this patch is advisable, or at least not wrong. Yes/no?

=== compilers/tge/TGE/Compiler.pir
==================================================================
--- compilers/tge/TGE/Compiler.pir (revision 13181)
+++ compilers/tge/TGE/Compiler.pir (local)
@@ -380,6 +380,9 @@
.return (code)
.end

+# NOTE - this code assumes that a type of '' is impossible
+# (in older versions of Parrot, it was)
+
.sub 'grammar_string' :method
.param pmc grammar
.local string code
@@ -387,9 +390,13 @@
.local string inherit
type = grammar["type"]
inherit = grammar["inherit"]
- code = "\n.namespace [ '"
+ code = "\n.namespace"
+ if type == '' goto no_type
+ code .= " [ '"
code .= type
- code .= "' ]\n\n"
+ code .= "' ]"
+ no_type:
+ code .= "\n\n"
code .= ".sub '__onload' :load\n"
code .= " load_bytecode 'TGE.pbc'\n"
code .= " $I0 = find_type '"

--
Chip Salzenberg <ch...@pobox.com>

0 new messages