diff --git a/src/cheats/hll-grammar.pir b/src/cheats/hll-grammar.pir index 8173c8b..7895469 100644 --- a/src/cheats/hll-grammar.pir +++ b/src/cheats/hll-grammar.pir @@ -422,6 +422,13 @@ An operator precedence parser. .param string preclim :optional .param int has_preclim :opt_flag + .local pmc here, pos, debug + (here, pos) = self.'!cursor_start'() + debug = getattribute here, '$!debug' + if null debug goto debug_1 + here.'!cursor_debug'('START', 'EXPR') + debug_1: + if has_preclim goto have_preclim preclim = '' have_preclim: @@ -436,9 +443,6 @@ An operator precedence parser. termstack = new ['ResizablePMCArray'] .lex '@termstack', termstack - .local pmc here, from, pos - (here, pos) = self.'!cursor_start'() - term_loop: here = here.termishrx() unless here goto fail @@ -566,7 +570,14 @@ An operator precedence parser. setattribute here, '$!pos', pos setattribute here, '$!match', term here.'!reduce'('EXPR') + if null debug goto done + here.'!cursor_debug'('PASS', 'EXPR') + goto done + fail: + if null debug goto done + here.'!cursor_debug'('FAIL', 'EXPR') + done: .return (here) err_internal: