diff options
author | Matthew Sotoudeh <matthewsot@outlook.com> | 2017-07-30 00:35:28 -0700 |
---|---|---|
committer | Matthew Sotoudeh <matthewsot@outlook.com> | 2017-07-30 00:35:28 -0700 |
commit | 59d92d38a3a575c59d9b001a7b9a05cf72a1a088 (patch) | |
tree | 57e932b3378cd57bd9eef2a9d09e717915a7b312 | |
parent | 2240954b45e203a18507d9c50f179e63fd35db78 (diff) |
syntax highlighting for comments
-rw-r--r-- | editor/content/scripts/mode.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/editor/content/scripts/mode.js b/editor/content/scripts/mode.js index adb935e..9035f46 100644 --- a/editor/content/scripts/mode.js +++ b/editor/content/scripts/mode.js @@ -19,6 +19,17 @@ CodeMirror.defineMode("yaepl", function (){ return { startState: function() { return { s_qt: false, d_qt: false} }, token: function(stream, state) { + console.log(stream.current()) + if (stream.peek() == "/") { + stream.next(); + if (stream.next() == "/") { + stream.eatWhile(/./); + return "comment"; + } + else { + stream.backUp(2); + } + } if (stream.peek() == "'" || stream.peek() == "\"") { return handleStr(stream, stream.peek()); } |