Skip to content
Snippets Groups Projects
Commit 9f6449f7 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[ruby mode] Add heuristic to distinguish operator-/ from regexp

This isn't really correct, but covers most cases. Someone with more
knowledge of Ruby's syntax will have to chime in what the real
solution would look like.

Issue #314
parent 45cb94e8
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,8 @@ CodeMirror.defineMode("ruby", function(config, parserConfig) {
}
if (stream.eatSpace()) return null;
var ch = stream.next();
if (ch == "`" || ch == "'" || ch == '"' || ch == "/") {
if (ch == "`" || ch == "'" || ch == '"' ||
(ch == "/" && !stream.eol() && stream.peek() != " ")) {
return chain(readQuoted(ch, "string", ch == '"'), stream, state);
} else if (ch == "%") {
var style, embed = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment