From 302daada9b1093789d80202a7a8e893383df7906 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Mon, 29 Jan 2024 19:27:17 +0100 Subject: [PATCH] add support for characters in CodeMirror mode --- lib/js/codemirror.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/js/codemirror.js b/lib/js/codemirror.js index c98948037..53528e564 100644 --- a/lib/js/codemirror.js +++ b/lib/js/codemirror.js @@ -67,7 +67,7 @@ CodeMirror.defineMode("lips", function () { function isHexNumber (stream) { return stream.match(hexMatcher); } - + function processEscapedSequence(stream, options) { var next, escaped = false; while ((next = stream.next()) != null) { @@ -165,7 +165,9 @@ CodeMirror.defineMode("lips", function () { state.mode = "symbol"; returnType = SYMBOL; } else if (ch == '#') { - if (stream.eat("|")) { // Multi-line comment + if (stream.eat(/\\x([0-9a-f]+)/) || stream.eat(/\\./u)) { + returnType = STRING; + } else if (stream.eat("|")) { // Multi-line comment state.mode = "comment"; // toggle to comment mode returnType = COMMENT; } else if (stream.eat(/[tf]/i)) { // #t/#f (atom)