diff --git a/demo/kitchen-sink/docs/ruby.rb b/demo/kitchen-sink/docs/ruby.rb index c4d73d19..386fbb86 100644 --- a/demo/kitchen-sink/docs/ruby.rb +++ b/demo/kitchen-sink/docs/ruby.rb @@ -20,7 +20,7 @@ class Range end end -{:id => 34, :key => "value"} +{:id => ?", :key => "value"} herDocs = [<<'FOO', < 34, :key => "value"} +{:id => ?", :key => "value", anotherKey: [x, y?]} =begin =end diff --git a/lib/ace/mode/_test/tokens_ruby.json b/lib/ace/mode/_test/tokens_ruby.json index 1809f5ee..f9991e9c 100644 --- a/lib/ace/mode/_test/tokens_ruby.json +++ b/lib/ace/mode/_test/tokens_ruby.json @@ -139,7 +139,7 @@ ["text"," "], ["punctuation.separator.key-value","=>"], ["text"," "], - ["constant.numeric","34"], + ["string.character","?\""], ["text",", "], ["constant.other.symbol.ruby",":key"], ["text"," "], @@ -148,7 +148,15 @@ ["string.start","\""], ["string","value"], ["string.end","\""], - ["paren.rparen","}"] + ["text",", "], + ["identifier","anotherKey"], + ["text",": "], + ["paren.lparen","["], + ["identifier","x"], + ["text",", "], + ["identifier","y"], + ["text","?"], + ["paren.rparen","]}"] ],[ "start" ],[ diff --git a/lib/ace/mode/ruby_highlight_rules.js b/lib/ace/mode/ruby_highlight_rules.js index a1cb12f9..b78597db 100644 --- a/lib/ace/mode/ruby_highlight_rules.js +++ b/lib/ace/mode/ruby_highlight_rules.js @@ -288,6 +288,9 @@ var RubyHighlightRules = function() { return stack[0]; return currentState; } + }, { + token : "string.character", + regex : "\\B\\?." }, { token : "keyword.operator", regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"