summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/mode/dart/dart.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/vendor/codemirror/mode/dart/dart.js')
-rw-r--r--public/vendor/codemirror/mode/dart/dart.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/public/vendor/codemirror/mode/dart/dart.js b/public/vendor/codemirror/mode/dart/dart.js
index d92eb519..8d383a95 100644
--- a/public/vendor/codemirror/mode/dart/dart.js
+++ b/public/vendor/codemirror/mode/dart/dart.js
@@ -72,6 +72,12 @@
return null;
}
return false;
+ },
+
+ "/": function(stream, state) {
+ if (!stream.eat("*")) return false
+ state.tokenize = tokenNestedComment(1)
+ return state.tokenize(stream, state)
}
}
});
@@ -121,6 +127,27 @@
return "variable";
}
+ function tokenNestedComment(depth) {
+ return function (stream, state) {
+ var ch
+ while (ch = stream.next()) {
+ if (ch == "*" && stream.eat("/")) {
+ if (depth == 1) {
+ state.tokenize = null
+ break
+ } else {
+ state.tokenize = tokenNestedComment(depth - 1)
+ return state.tokenize(stream, state)
+ }
+ } else if (ch == "/" && stream.eat("*")) {
+ state.tokenize = tokenNestedComment(depth + 1)
+ return state.tokenize(stream, state)
+ }
+ }
+ return "comment"
+ }
+ }
+
CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins));
// This is needed to make loading through meta.js work.