Author: pmichaud
Date: Sun Dec 14 07:47:24 2008
New Revision: 33882
Modified:
trunk/languages/perl6/src/parser/grammar.pg
Log:
[rakudo]: Adjust grammar to use <?{{...}}> assertion syntax.
Modified: trunk/languages/perl6/src/parser/grammar.pg
==============================================================================
--- trunk/languages/perl6/src/parser/grammar.pg (original)
+++ trunk/languages/perl6/src/parser/grammar.pg Sun Dec 14 07:47:24 2008
@@ -61,22 +61,24 @@
## last ws token matched.
token ws {
- ## STD.pm: <?{ $ยข.pos === $!ws_to }>
- {{ $P0 = get_global '$!ws'
- if null $P0 goto end
- $P1 = $P0.'to'()
- $P2 = match.'to'()
- if $P1 != $P2 goto end
- .return (1)
- end:
- set_global '$!ws', match
- }}
- <!ww>
- [
- | <.unsp>
- | \v+
- | <.unv>
- ]*
+ ## short circuit
+ [ <?{{ $P0 = get_global '$!ws'
+ if null $P0 goto noshort
+ $P1 = $P0.'to'()
+ $P2 = match.'to'()
+ if $P1 != $P2 goto noshort
+ .return (1)
+ noshort:
+ set_global '$!ws', match
+ .return (0)
+ }}>
+ | <!ww>
+ [
+ | <.unsp>
+ | \v+
+ | <.unv>
+ ]*
+ ]
}
token unsp {