Skip to content

Commit

Permalink
add support for characters in CodeMirror mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Jan 29, 2024
1 parent 82a201e commit 5293345
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/js/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -165,7 +165,11 @@ CodeMirror.defineMode("lips", function () {
state.mode = "symbol";
returnType = SYMBOL;
} else if (ch == '#') {
if (stream.eat("|")) { // Multi-line comment
if (stream.eat(/\\/)) {
if (stream.match(/[0-9a-f]+/) || stream.match(/./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)
Expand Down

0 comments on commit 5293345

Please sign in to comment.