From f4613206be4f88213b1173bb2b982b4376fc3162 Mon Sep 17 00:00:00 2001 From: Builders Brewery Date: Wed, 19 Mar 2014 16:39:00 +0100 Subject: [PATCH] revert to old string regex --- lib/ace/mode/_test/tokens_lsl.json | 16 +++++++------- lib/ace/mode/lsl_highlight_rules.js | 34 ++++++++++------------------- 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/lib/ace/mode/_test/tokens_lsl.json b/lib/ace/mode/_test/tokens_lsl.json index 9ac15701..93575a2c 100644 --- a/lib/ace/mode/_test/tokens_lsl.json +++ b/lib/ace/mode/_test/tokens_lsl.json @@ -308,9 +308,9 @@ ["constant.language.integer.lsl","PUBLIC_CHANNEL"], ["punctuation.operator.lsl",","], ["text.lsl"," "], - ["string.quoted.double.begin.lsl","\""], + ["string.quoted.double.lsl.start","\""], ["string.quoted.double.lsl","Hello, Avatar!"], - ["string.quoted.double.end.lsl","\""], + ["string.quoted.double.lsl.end","\""], ["paren.rparen.lsl",")"], ["punctuation.operator.lsl",";"] ],[ @@ -403,9 +403,9 @@ ["text.lsl"," "], ["reserved.godmode.lsl","llSetInventoryPermMask"], ["paren.lparen.lsl","("], - ["string.quoted.double.begin.lsl","\""], + ["string.quoted.double.lsl.start","\""], ["string.quoted.double.lsl","some item"], - ["string.quoted.double.end.lsl","\""], + ["string.quoted.double.lsl.end","\""], ["punctuation.operator.lsl",","], ["text.lsl"," "], ["constant.language.integer.lsl","MASK_NEXT"], @@ -426,13 +426,13 @@ ["constant.language.integer.lsl","PUBLIC_CHANNEL"], ["punctuation.operator.lsl",","], ["text.lsl"," "], - ["string.quoted.double.begin.lsl","\""], + ["string.quoted.double.lsl.start","\""], ["string.quoted.double.lsl","Leaving "], ["constant.character.escape.lsl","\\\""], ["string.quoted.double.lsl","default"], ["constant.character.escape.lsl","\\\""], ["string.quoted.double.lsl"," now..."], - ["string.quoted.double.end.lsl","\""], + ["string.quoted.double.lsl.end","\""], ["paren.rparen.lsl",")"], ["punctuation.operator.lsl",";"] ],[ @@ -473,7 +473,7 @@ ["constant.language.integer.lsl","PUBLIC_CHANNEL"], ["punctuation.operator.lsl",","], ["text.lsl"," "], - ["string.quoted.double.begin.lsl","\""], + ["string.quoted.double.lsl.start","\""], ["string.quoted.double.lsl","Entered "], ["constant.character.escape.lsl","\\\""], ["string.quoted.double.lsl","state other"], @@ -483,7 +483,7 @@ ["string.quoted.double.lsl","default"], ["constant.character.escape.lsl","\\\""], ["string.quoted.double.lsl"," again..."], - ["string.quoted.double.end.lsl","\""], + ["string.quoted.double.lsl.end","\""], ["paren.rparen.lsl",")"], ["punctuation.operator.lsl",";"] ],[ diff --git a/lib/ace/mode/lsl_highlight_rules.js b/lib/ace/mode/lsl_highlight_rules.js index 16938b3c..45ac1696 100644 --- a/lib/ace/mode/lsl_highlight_rules.js +++ b/lib/ace/mode/lsl_highlight_rules.js @@ -66,9 +66,18 @@ function LSLHighlightRules() { regex : "\\/\\*", next : "comment" }, { - token : "string.quoted.double.begin.lsl", - regex : '"', - next : "string" + token : "string.quoted.double.lsl", + start : '"', + end : '"', + next : [ + { + token : "constant.language.escape.lsl", + regex : /\\[tn"\\]/ + }, { + token : "invalid.illegal.constant.character.escape.lsl", + regex : "\\." + } + ] }, { token : "constant.numeric.lsl", regex : "(0[xX][0-9a-fA-F]+|[+-]?[0-9]+(?:(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?)?)\\b" @@ -110,25 +119,6 @@ function LSLHighlightRules() { 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();