diff --git a/lib/ace/mode/scala_highlight_rules.js b/lib/ace/mode/scala_highlight_rules.js index 67f8e1b2..443e6350 100644 --- a/lib/ace/mode/scala_highlight_rules.js +++ b/lib/ace/mode/scala_highlight_rules.js @@ -75,11 +75,16 @@ var ScalaHighlightRules = function() { token : "string.regexp", regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + token : "string", + regex : '"""', + next : "tstring" }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + token : "string", + regex : '"', + next : "string" + }, { + token : "symbol.constant", // single line + regex : "'[\\w\\d_]+" }, { token : "constant.numeric", // hex regex : "0[xX][0-9a-fA-F]+\\b" @@ -131,6 +136,32 @@ var ScalaHighlightRules = function() { merge : true, regex : ".+" } + ], + "string" : [ + { + token : "escape", + regex : '\\\\"', + }, { + token : "string", + merge : true, + regex : '"', + next : "start" + }, { + token : "string", + regex : '[^"\\\\]+', + merge : true + } + ], + "tstring" : [ + { + token : "string", // closing comment + regex : '"{3,5}', + next : "start" + }, { + token : "string", // comment spanning whole line + merge : true, + regex : ".+?" + } ] };