fix highlighting of ?" in ruby mode

This commit is contained in:
nightwing 2015-01-07 01:15:36 +04:00
commit 55bf8e56d3
4 changed files with 15 additions and 4 deletions

View file

@ -20,7 +20,7 @@ class Range
end end
end end
{:id => 34, :key => "value"} {:id => ?", :key => "value"}
herDocs = [<<'FOO', <<BAR, <<-BAZ, <<-`EXEC`] #comment herDocs = [<<'FOO', <<BAR, <<-BAZ, <<-`EXEC`] #comment

View file

@ -13,7 +13,7 @@
[1, +1, -1, 12_345, 0.000_1, [1, +1, -1, 12_345, 0.000_1,
_, 3_1, 1_2, 1_.0, 0._1]; _, 3_1, 1_2, 1_.0, 0._1];
{:id => 34, :key => "value"} {:id => ?", :key => "value", anotherKey: [x, y?]}
=begin =begin
=end =end

View file

@ -139,7 +139,7 @@
["text"," "], ["text"," "],
["punctuation.separator.key-value","=>"], ["punctuation.separator.key-value","=>"],
["text"," "], ["text"," "],
["constant.numeric","34"], ["string.character","?\""],
["text",", "], ["text",", "],
["constant.other.symbol.ruby",":key"], ["constant.other.symbol.ruby",":key"],
["text"," "], ["text"," "],
@ -148,7 +148,15 @@
["string.start","\""], ["string.start","\""],
["string","value"], ["string","value"],
["string.end","\""], ["string.end","\""],
["paren.rparen","}"] ["text",", "],
["identifier","anotherKey"],
["text",": "],
["paren.lparen","["],
["identifier","x"],
["text",", "],
["identifier","y"],
["text","?"],
["paren.rparen","]}"]
],[ ],[
"start" "start"
],[ ],[

View file

@ -288,6 +288,9 @@ var RubyHighlightRules = function() {
return stack[0]; return stack[0];
return currentState; return currentState;
} }
}, {
token : "string.character",
regex : "\\B\\?."
}, { }, {
token : "keyword.operator", token : "keyword.operator",
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"