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

[svn:parrot] r34189 - in trunk/languages/lua/src: . lib

From:
fperrad
Date:
December 21, 2008 02:20
Subject:
[svn:parrot] r34189 - in trunk/languages/lua/src: . lib
Message ID:
20081221101959.8F22ECBA12@x12.develooper.com
Author: fperrad
Date: Sun Dec 21 02:19:58 2008
New Revision: 34189

Modified:
   trunk/languages/lua/src/POSTGrammar.tg
   trunk/languages/lua/src/lib/luabytecode.pir

Log:
[Lua]
- now, use :opt_flag

Modified: trunk/languages/lua/src/POSTGrammar.tg
==============================================================================
--- trunk/languages/lua/src/POSTGrammar.tg	(original)
+++ trunk/languages/lua/src/POSTGrammar.tg	Sun Dec 21 02:19:58 2008
@@ -931,7 +931,8 @@
     ops.'push_pirop'('.lex', $S0, pname)
     .local string vivilabel
     vivilabel = ops.'unique'('vivify_')
-    ops.'push_pirop'('unless_null', pname, vivilabel)
+    $S0 = concat 'has_', pname
+    ops.'push_pirop'('if', $S0, vivilabel)
     ops.'push_pirop'('new', pname, '"LuaNil"')
     $P0 = get_hll_global ['POST'], 'Label'
     $P0 = $P0.'new'('result'=>vivilabel)

Modified: trunk/languages/lua/src/lib/luabytecode.pir
==============================================================================
--- trunk/languages/lua/src/lib/luabytecode.pir	(original)
+++ trunk/languages/lua/src/lib/luabytecode.pir	Sun Dec 21 02:19:58 2008
@@ -167,7 +167,9 @@
     $S0 = i
     pir .= "    .param pmc loc_"
     pir .= $S0
-    pir .= " :optional\n"
+    pir .= " :optional\n    .param int has_loc_"
+    pir .= $S0
+    pir .= " :opt_flag\n"
     inc i
     goto L1
   L2:
@@ -184,7 +186,7 @@
   L5:
     unless i < numparams goto L6
     $S0 = i
-    pir .= "    unless_null loc_"
+    pir .= "    if has_loc_"
     pir .= $S0
     pir .= ", vivify_"
     pir .= $S0



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