Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
unbust extra scope being introduced
When using the sugared object property form `{ say }`, the
property:method rule triggered (not the property:identifier rule
-- I think the former won simply by dint of being first), and
instead of failing outright, it got as far as entering a new
lexical scope, and *then* failing.
Which means that the function declared in the test code got
declared in a scope that was further nested than the one in
which it got called:
f();
my o = { say };
sub f() { say("Mr. Bond") }
And so it failed.
I *think* the lesson for future grammar authors is this: don't
run any side effects until you're sure you're in the right
rule. In this case, `property:method` had time to run a side
effect, and then immediately fail before the backtracking
carried the parser into the right rule, `property:identifier`.
Closes #150.- Loading branch information