Skip to content
Browse files

add quote test

  • Loading branch information...
1 parent 14643f4 commit b176b56164017c4b5b5b0c66a3110a76536d3d7a @zaach committed Jan 27, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 tests/bnf_parse.js
View
13 tests/bnf_parse.js
@@ -151,3 +151,16 @@ exports["test expression action"] = function () {
assert.deepEqual(bnf.parse(grammar), expected, "grammar should be parsed correctly");
};
+
+exports["test quote in rule"] = function () {
+ var grammar = "%lex\n%%\n\\' return \"'\"\n/lex\n%% test: foo bar \"'\";";
+ console.log(grammar);
+ var expected = {lex: {
+ rules: [
+ ["'", "return \"'\""]
+ ]
+ },
+ bnf: {test: ["foo bar '"]}};
+
+ assert.deepEqual(bnf.parse(grammar), expected, "grammar should be parsed correctly");
+};

0 comments on commit b176b56

Please sign in to comment.
Something went wrong with that request. Please try again.