highlighting improvements

This commit is contained in:
2024-12-28 11:04:42 -08:00
parent 3ec2f90770
commit 95f90c8698
2 changed files with 5 additions and 4 deletions

View File

@@ -16,7 +16,7 @@
}, },
{ {
"name": "keyword.newt", "name": "keyword.newt",
"match": "\\b(λ|=>|<-|->|→|:=|\\$|data|record|where|do|class|uses|instance|case|of|let|if|then|else|forall|∀|in|U|module|import|ptype|pfunc|infix|infixl|infixr)\\b" "match": "\\b(λ|=>|<-|->|→|:=|\\$|data|record|constructor|where|do|class|uses|instance|case|of|let|if|then|else|forall|∀|in|U|module|import|ptype|pfunc|infix|infixl|infixr)\\b"
}, },
{ {
"name": "string.js", "name": "string.js",

View File

@@ -93,8 +93,10 @@ export let newtTokens: monaco.languages.IMonarchLanguage = {
specialOps: ["=>", "->", ":", "=", ":=", "<-"], specialOps: ["=>", "->", ":", "=", ":=", "<-"],
tokenizer: { tokenizer: {
root: [ root: [
// char literal, but I don't think there is a class for that.
[/'\\?.'/, "string"],
[ [
/[a-z_$'][\w$]*/, /[a-z_$][\w$']*/,
{ cases: { "@keywords": "keyword", "@default": "identifier" } }, { cases: { "@keywords": "keyword", "@default": "identifier" } },
], ],
[/[A-Z][\w\$]*/, "type.identifier"], [/[A-Z][\w\$]*/, "type.identifier"],
@@ -110,8 +112,7 @@ export let newtTokens: monaco.languages.IMonarchLanguage = {
}, },
}, },
], ],
// char literal, but I don't think there is a class for that.
[/'\\?.'/, "string"],
[/\d+/, "number"], [/\d+/, "number"],
// strings // strings