Label specs: Add missing test case
This commit is contained in:
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…
Reference in a new issue