From 7a3a84c8583d49f6acf5948ad6a386737fa7ee17 Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 2 Sep 2014 01:16:10 +0400 Subject: [PATCH] fix error in coffeeScript mode --- lib/ace/mode/_test/text_coffee.txt | 1 + lib/ace/mode/_test/tokens_coffee.json | 17 +++++++++++++++++ lib/ace/mode/_test/tokens_latex.json | 4 +++- lib/ace/mode/_test/tokens_php.json | 2 +- lib/ace/tokenizer.js | 8 +++++--- 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/lib/ace/mode/_test/text_coffee.txt b/lib/ace/mode/_test/text_coffee.txt index 094e61b7..2d9ba5ad 100644 --- a/lib/ace/mode/_test/text_coffee.txt +++ b/lib/ace/mode/_test/text_coffee.txt @@ -42,6 +42,7 @@ class Foo extends Bar foo.static.function #!test tokenize string with interpolation a = "#{ 22 / 7 + {x: "#{a + b}"} + 2}" +" #{ "" + {} } )" """heredoc """ do -> diff --git a/lib/ace/mode/_test/tokens_coffee.json b/lib/ace/mode/_test/tokens_coffee.json index 9c3967e4..b0703b37 100644 --- a/lib/ace/mode/_test/tokens_coffee.json +++ b/lib/ace/mode/_test/tokens_coffee.json @@ -466,6 +466,23 @@ ["constant.numeric","2"], ["paren.string","}"], ["string.end","\""] +],[ + "start", + ["string.start","\""], + ["string"," "], + ["paren.string","#{"], + ["text"," "], + ["string.start","\""], + ["string.end","\""], + ["text"," "], + ["keyword.operator","+"], + ["text"," "], + ["paren","{}"], + ["text"," "], + ["paren.string","}"], + ["string"," )"], + ["string.end","\""], + ["text"," "] ],[ "qqdoc", ["string","\"\"\"heredoc"] diff --git a/lib/ace/mode/_test/tokens_latex.json b/lib/ace/mode/_test/tokens_latex.json index 4ae69afa..52508e0d 100644 --- a/lib/ace/mode/_test/tokens_latex.json +++ b/lib/ace/mode/_test/tokens_latex.json @@ -92,7 +92,9 @@ ],[ "start", ["text"," E &= mc^2 "], - ["constant.character.escape","\\\\"], + ["constant.character.escape","\\\\"] +],[ + "start", ["text"," m &= "], ["storage.type","\\frac"], ["lparen","{"], diff --git a/lib/ace/mode/_test/tokens_php.json b/lib/ace/mode/_test/tokens_php.json index d1458a65..2134dccb 100644 --- a/lib/ace/mode/_test/tokens_php.json +++ b/lib/ace/mode/_test/tokens_php.json @@ -138,7 +138,7 @@ ["text"," "], ["support.php_tag"," 1) { if (stack[0] !== currentState) - stack.unshift(currentState); + stack.unshift("#tmp", currentState); } return { tokens : tokens,