summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthewsot@outlook.com>2017-07-30 00:35:28 -0700
committerMatthew Sotoudeh <matthewsot@outlook.com>2017-07-30 00:35:28 -0700
commit59d92d38a3a575c59d9b001a7b9a05cf72a1a088 (patch)
tree57e932b3378cd57bd9eef2a9d09e717915a7b312
parent2240954b45e203a18507d9c50f179e63fd35db78 (diff)
syntax highlighting for comments
-rw-r--r--editor/content/scripts/mode.js11
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());
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback