diff --git a/spec/generated-parser.spec.js b/spec/generated-parser.spec.js index 307d376..a26fce6 100644 --- a/spec/generated-parser.spec.js +++ b/spec/generated-parser.spec.js @@ -91,6 +91,21 @@ describe("generated parser", function() { }); }); + describe("rule reference matching", function() { + varyAll(function(options) { + it("follows rule references", function() { + var parser = PEG.buildParser([ + 'start = static / dynamic', + 'static = "C" / "C++" / "Java" / "C#"', + 'dynamic = "Ruby" / "Python" / "JavaScript"' + ].join("\n"), options); + + expect(parser).toParse("Java", "Java"); + expect(parser).toParse("Python", "Python"); + }); + }); + }); + describe("literal matching", function() { varyAll(function(options) { it("matches empty literal correctly", function() { diff --git a/test/compiler-test.js b/test/compiler-test.js index 9878ff3..3de8cd8 100644 --- a/test/compiler-test.js +++ b/test/compiler-test.js @@ -633,16 +633,6 @@ testWithVaryingTrackLineAndColumn("initializer", function(options) { parses(functionInSemanticNotParser, "a", ["a", ""]); }); -testWithVaryingTrackLineAndColumn("rule references", function(options) { - var parser = PEG.buildParser([ - 'start = static / dynamic', - 'static = "C" / "C++" / "Java" / "C#"', - 'dynamic = "Ruby" / "Python" / "JavaScript"' - ].join("\n"), options); - parses(parser, "Java", "Java"); - parses(parser, "Python", "Python"); -}); - testWithVaryingTrackLineAndColumn("cache", function(options) { var grammar = [ '{ var n = 0; }',