Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/NQP/Grammar.pm b/src/NQP/Grammar.pm
- index 3007cb3..5f5f1d0 100644
- --- a/src/NQP/Grammar.pm
- +++ b/src/NQP/Grammar.pm
- @@ -457,7 +457,7 @@ INIT {
- NQP::Grammar.O(':prec<k=>, :assoc<left>', '%tight_or');
- NQP::Grammar.O(':prec<j=>, :assoc<right>', '%conditional');
- NQP::Grammar.O(':prec<i=>, :assoc<right>', '%assignment');
- - NQP::Grammar.O(':prec<g=>, :assoc<list>, :nextterm<nulltermish>', '%comma');
- + NQP::Grammar.O(':prec<g=>, :assoc<list>, :lastterm<nulltermish>', '%comma');
- NQP::Grammar.O(':prec<f=>, :assoc<list>', '%list_infix');
- NQP::Grammar.O(':prec<e=>, :assoc<unary>', '%list_prefix');
- }
- diff --git a/src/cheats/hll-grammar.pir b/src/cheats/hll-grammar.pir
- index c616b03..cebccef 100644
- --- a/src/cheats/hll-grammar.pir
- +++ b/src/cheats/hll-grammar.pir
- @@ -439,9 +439,20 @@ An operator precedence parser.
- .local pmc here, from, pos
- (here, pos) = self.'!cursor_start'()
- + .local pmc oldhere # oha
- + .local int is_last # oha
- + .local string lasttermishrx # oha
- + is_last = 0 # oha
- term_loop:
- + oldhere = here # oha
- here = here.termishrx()
- + if here goto found_termish # oha
- + #unless here goto fail # oha
- + termishrx = lasttermishrx
- + here = oldhere.termishrx()
- unless here goto fail
- + inc is_last
- + found_termish: # oha
- .local pmc termish
- termish = here.'MATCH'()
- @@ -505,6 +516,8 @@ An operator precedence parser.
- $P0 = termish['term']
- push termstack, $P0
- + if is_last > 0 goto term_done # oha
- +
- # Now see if we can fetch an infix operator
- .local pmc infixcur, infix
- here = here.'ws'()
- @@ -515,6 +528,7 @@ An operator precedence parser.
- .local pmc inO
- $P0 = infix['OPER']
- inO = $P0['O']
- + lasttermishrx = inO['lastterm'] # oha
- termishrx = inO['nextterm']
- if termishrx goto have_termishrx
- termishrx = 'termish'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement