From 8bf516263c6582771e7576e8484ca8cfaa8cb9cb Mon Sep 17 00:00:00 2001 From: Cheng-Han, Wu Date: Wed, 20 Apr 2016 18:11:40 +0800 Subject: Update CodeMirror to 5.13.5 --- public/vendor/codemirror/mode/dart/dart.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'public/vendor/codemirror/mode/dart') 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. -- cgit v1.2.3