Author: pmichaud
Date: Sun Oct 9 10:17:33 2005
New Revision: 9419
Modified:
trunk/compilers/pge/PGE/Exp.pir
trunk/compilers/pge/PGE/Match.pir
Log:
Changed code to clarify "yield" value (hopefully)
Modified: trunk/compilers/pge/PGE/Exp.pir
==============================================================================
--- trunk/compilers/pge/PGE/Exp.pir (original)
+++ trunk/compilers/pge/PGE/Exp.pir Sun Oct 9 10:17:33 2005
@@ -422,7 +422,7 @@ register.
emit(code, " .param pmc mob")
emit(code, " .param pmc pos :optional")
emit(code, " .param int has_pos :opt_flag")
- emit(code, " .local pmc yield")
+ emit(code, " .local pmc corou")
emit(code, " $I0 = isa mob, \"PGE::Match\"")
emit(code, " if $I0 goto init_pos")
emit(code, " new_match:")
@@ -441,9 +441,9 @@ register.
emit(code, " $P0 = getattribute mob, \"PGE::Match\\x0$:pos\"")
emit(code, " pos = $P0")
emit(code, " start_match:")
- emit(code, " newsub yield, .Coroutine, _pge_rule_coroutine")
- emit(code, " setattribute mob, \"PGE::Match\\x0&:yield\", yield")
- emit(code, " yield(mob, pos)")
+ emit(code, " newsub corou, .Coroutine, _pge_rule_coroutine")
+ emit(code, " setattribute mob, \"PGE::Match\\x0&:corou\", corou")
+ emit(code, " corou(mob, pos)")
emit(code, " .return (mob)")
emit(code, ".end")
emit(code, "")
Modified: trunk/compilers/pge/PGE/Match.pir
==============================================================================
--- trunk/compilers/pge/PGE/Match.pir (original)
+++ trunk/compilers/pge/PGE/Match.pir Sun Oct 9 10:17:33 2005
@@ -16,7 +16,7 @@ This file implements match objects retur
addattribute base, "$:target" # target
addattribute base, "$:from" # start of match
addattribute base, "$:pos" # current match position
- addattribute base, "&:yield" # match's yield
+ addattribute base, "&:corou" # match's corou
addattribute base, "@:capt" # subpattern captures
addattribute base, "%:capt" # subpattern captures
.return ()
@@ -60,17 +60,17 @@ it left off.
=cut
.sub "next" method
- .local pmc yield
+ .local pmc corou
- yield = getattribute self, "PGE::Match\x0&:yield"
- if_null yield, next_1
+ corou = getattribute self, "PGE::Match\x0&:corou"
+ if_null corou, next_1
goto next_2
next_1:
$P0 = getattribute self, "PGE::Match\x0$:pos"
$P0 = -1
goto end
next_2:
- .yield()
+ corou()
end:
.return ()
.end