Mercurial > js-scanner
diff test_jsscan.py @ 4:30c1f55eff96
fixed greedy regexp bug
author | Atul Varma <avarma@mozilla.com> |
---|---|
date | Thu, 22 Apr 2010 17:31:32 -0700 |
parents | f82ff2c61c06 |
children |
line wrap: on
line diff
--- a/test_jsscan.py Thu Apr 22 13:38:20 2010 -0700 +++ b/test_jsscan.py Thu Apr 22 17:31:32 2010 -0700 @@ -25,6 +25,20 @@ >>> tokenize(' k', ignore='whitespace') ('name', 'k', (1, 2)) +Many double-quoted strings on the same line: + + >>> tokenize(r'"hello there "+" dude"') + ('string', '"hello there "', (1, 0)) + ('literal', '+', (1, 14)) + ('string', '" dude"', (1, 15)) + +Many single-quoted strings on the same line: + + >>> tokenize(r"'hello there '+' dude'") + ('string', "'hello there '", (1, 0)) + ('literal', '+', (1, 14)) + ('string', "' dude'", (1, 15)) + Escaped double-quoted strings: >>> tokenize(r'"i say \\"tomato\\""')