Skip to content

Instantly share code, notes, and snippets.

@beatak
Created May 1, 2015 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beatak/0b8b29fbddc0a28ddad2 to your computer and use it in GitHub Desktop.
Save beatak/0b8b29fbddc0a28ddad2 to your computer and use it in GitHub Desktop.
diff --git a/tests/regexplexer.js b/tests/regexplexer.js
index 6128c47..79c38ea 100644
--- a/tests/regexplexer.js
+++ b/tests/regexplexer.js
@@ -1019,3 +1019,20 @@ exports["test yytext state after unput"] = function() {
assert.equal(lexer.lex(), "NUMBER");
assert.equal(lexer.lex(), "EOF");
};
+
+exports["test CSS string"] = function() {
+ var dict = {
+ options: {
+ flex: true,
+ "case-insensitive": true
+ },
+ macros: {
+ string: '"([^\n\r\f\u0022]|\\\n|\\\r\n|\\\r|\\\f|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*"'
+ },
+ rules: [
+ ["{string}", "return 'STRING'"]
+ ]
+ };
+
+ var lexer = new RegExpLexer(dict, null, {});
+};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment