diff --git a/spec/parser.spec.js b/spec/parser.spec.js index 1103e3b..44703f6 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -68,6 +68,13 @@ describe("PEG.js grammar parser", function() { }); }); + /* Canonical singleLineComment is "// comment". */ + it("parses singleLineComment", function() { + expect('start =//\n"abcd"' ).toParseAs(trivialGrammar); + expect('start =//a\n"abcd"' ).toParseAs(trivialGrammar); + expect('start =//aaa\n"abcd"').toParseAs(trivialGrammar); + }); + // Canonical multiLineComment is "/* comment */". it("parses multiLineComment", function() { expect('start =/**/"abcd"' ).toParseAs(trivialGrammar); diff --git a/test/parser-test.js b/test/parser-test.js index 426cdb5..fd25e10 100644 --- a/test/parser-test.js +++ b/test/parser-test.js @@ -541,12 +541,5 @@ test("parses comment", function() { parserParses('start =// comment\n"abcd"', simpleGrammar); parserParses('start =/* comment */"abcd"', simpleGrammar); }); -/* Canonical singleLineComment is "// comment". */ -test("parses singleLineComment", function() { - parserParses('start =//\n"abcd"', simpleGrammar); - parserParses('start =//a\n"abcd"', simpleGrammar); - parserParses('start =//aaa\n"abcd"', simpleGrammar); - parserParses('start = "abcd"//', simpleGrammar); -}); })();