Label specs: Add missing test case

redux
David Majda 9 years ago
parent f4385da177
commit 8487c9a0ff

@ -654,6 +654,15 @@ describe("generated parser behavior", function() {
expect(parser).toParse("abc");
});
it("can access label variables from preceding labeled elements in an outside sequence (group)", function() {
var parser = PEG.buildParser(
'start = a:"a" ("b" !{ return a !== "a"; })',
options
);
expect(parser).toParse("ab", ["a", ["b", undefined]]);
});
it("can access label variables from preceding labeled elements in an outside sequence (optional)", function() {
var parser = PEG.buildParser(
'start = a:"a" ("b" !{ return a !== "a"; })?',

Loading…
Cancel
Save