From 0e04fff0ea80fa5cbe96b8354db38bd334aea83a Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 16 Jul 2012 16:04:05 -0700 Subject: upgrade to codemirror 2.3 Signed-off-by: Ananya Sen Conflicts: js/code-editor/codemirror-ninja/theme/lesser-dark-ninja.css Signed-off-by: Ananya Sen --- imports/codemirror/mode/ruby/ruby.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'imports/codemirror/mode/ruby') diff --git a/imports/codemirror/mode/ruby/ruby.js b/imports/codemirror/mode/ruby/ruby.js index b647efd0..74ed7b96 100644 --- a/imports/codemirror/mode/ruby/ruby.js +++ b/imports/codemirror/mode/ruby/ruby.js @@ -30,7 +30,7 @@ CodeMirror.defineMode("ruby", function(config, parserConfig) { return "comment"; } if (stream.eatSpace()) return null; - var ch = stream.next(); + var ch = stream.next(), m; if (ch == "`" || ch == "'" || ch == '"' || (ch == "/" && !stream.eol() && stream.peek() != " ")) { return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state); @@ -46,13 +46,8 @@ CodeMirror.defineMode("ruby", function(config, parserConfig) { } else if (ch == "#") { stream.skipToEnd(); return "comment"; - } else if (ch == "<" && stream.eat("<")) { - stream.eat("-"); - stream.eat(/[\'\"\`]/); - var match = stream.match(/^\w+/); - stream.eat(/[\'\"\`]/); - if (match) return chain(readHereDoc(match[0]), stream, state); - return null; + } else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) { + return chain(readHereDoc(m[1]), stream, state); } else if (ch == "0") { if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/); else if (stream.eat("b")) stream.eatWhile(/[01]/); -- cgit v1.2.3