From 4e4d8a553bc5265464203ab0cf019a5433b58f5b Mon Sep 17 00:00:00 2001 From: Builder's Brewery Date: Tue, 18 Feb 2014 17:22:47 +0100 Subject: [PATCH] fix lsl string - part one --- lib/ace/mode/lsl_highlight_rules.js | 41 ++++++++++++++++++----------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/lib/ace/mode/lsl_highlight_rules.js b/lib/ace/mode/lsl_highlight_rules.js index ecfd7118..a58bd2bb 100644 --- a/lib/ace/mode/lsl_highlight_rules.js +++ b/lib/ace/mode/lsl_highlight_rules.js @@ -62,23 +62,13 @@ function LSLHighlightRules() { token : "comment.line.double-slash.lsl", regex : "\\/\\/.*$" }, { - token : "comment.block.lsl", + token : "comment.block.begin.lsl", regex : "\\/\\*", next : "comment" }, { - token : "string.quoted.double.lsl", - start : '"', - end : '"', - next : [ - { - token : "constant.character.escape.lsl", - regex : /\\[tn"\\]/ - }, - { - token : "invalid.illegal.constant.character.escape.lsl", - regex : "\\." - } - ] + token : "string.quoted.double.begin.lsl", + regex : '"', + next : "string" }, { token : "constant.numeric.lsl", regex : "(0[xX][0-9a-fA-F]+|[+-]?[0-9]+(?:(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?)?)\\b" @@ -113,13 +103,32 @@ function LSLHighlightRules() { ], "comment" : [ { - token : "comment.block.lsl", - regex : ".*?\\*\\/", + token : "comment.block.end.lsl", + regex : "\\*\\/", next : "start" }, { token : "comment.block.lsl", regex : ".+" } + ], + "string" : [ + { + token : "constant.character.escape.lsl", + regex : /\\[tn"\\]/ + }, + { + token : "invalid.illegal.constant.character.escape.lsl", + regex : /\\./ + }, + { + token : "string.quoted.double.end.lsl", + regex : /"/, + next : "start" + }, + { + token : "string.quoted.double.lsl", + regex : ".+" + } ] }; this.normalizeRules();