[svn:parrot] r40143 - trunk/compilers/pge/PGE
fperrad at svn.parrot.org
fperrad at svn.parrot.org
Sat Jul 18 14:10:56 UTC 2009
Author: fperrad
Date: Sat Jul 18 14:10:54 2009
New Revision: 40143
URL: https://trac.parrot.org/parrot/changeset/40143
Log:
[PGE] improve find_key
when no keys are specified, skip no Capture element, ie. optable specific element
for example, in :
<expr> => PMC 'Lua;Grammar' => "1.\n" @ 4 {
<type> => "term:"
<top> => Hash {
"assoc" => "left",
"expect" => 513,
"match" => "PGE::Match",
"name" => "term:",
"parsed" => PMC 'Sub' { ... },
"precclose" => "=",
"precedence" => \parse[0][0][0]["precclose"],
"syncat" => 16
}
<number> => PMC 'Lua;Grammar' => "1." @ 4
}
Modified:
trunk/compilers/pge/PGE/Match.pir
Modified: trunk/compilers/pge/PGE/Match.pir
==============================================================================
--- trunk/compilers/pge/PGE/Match.pir Sat Jul 18 11:32:19 2009 (r40142)
+++ trunk/compilers/pge/PGE/Match.pir Sat Jul 18 14:10:54 2009 (r40143)
@@ -299,9 +299,13 @@
.return ($S0)
first_key:
$P0 = self.'hash'()
- $P1 = new 'Iterator', $P0
+ $P1 = iter $P0
unless $P1 goto not_found
+ next:
$S0 = shift $P1
+ $P2 = $P0[$S0]
+ $I0 = isa $P2, 'Capture'
+ unless $I0 goto next
.return ($S0)
not_found:
.return ('')
More information about the parrot-commits
mailing list