Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

.namespace [''] in TGE

瀏覽次數:0 次
跳到第一則未讀訊息

Chip Salzenberg

未讀,
2006年7月6日 下午1:56:082006/7/6
收件者: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 則新訊息