diff --git a/spec/generated-parser.spec.js b/spec/generated-parser.spec.js index 8c1467f..9a342f5 100644 --- a/spec/generated-parser.spec.js +++ b/spec/generated-parser.spec.js @@ -91,6 +91,17 @@ describe("generated parser", function() { }); }); + describe("labeled matching", function() { + varyAll(function(options) { + it("delegates to the expression", function() { + var parser = PEG.buildParser('start = a:"a"', options); + + expect(parser).toParse("a", "a"); + expect(parser).toFailToParse("b"); + }); + }); + }); + describe("simple and matching", function() { varyAll(function(options) { it("matches correctly", function() { diff --git a/test/compiler-test.js b/test/compiler-test.js index 9cb990b..5d9089a 100644 --- a/test/compiler-test.js +++ b/test/compiler-test.js @@ -43,12 +43,6 @@ testWithVaryingTrackLineAndColumn("sequences", function(options) { parses(posTestParser, "a", "a"); }); -testWithVaryingTrackLineAndColumn("labels", function(options) { - var parser = PEG.buildParser('start = label:"a"', options); - parses(parser, "a", "a"); - doesNotParse(parser, "b"); -}); - testWithVaryingTrackLineAndColumn("initializer", function(options) { var variableInActionParser = PEG.buildParser( '{ a = 42; }; start = "a" { return a; }',