diff --git a/newt-vscode/syntaxes/newt.tmLanguage.json b/newt-vscode/syntaxes/newt.tmLanguage.json index b431f60..9d8d389 100644 --- a/newt-vscode/syntaxes/newt.tmLanguage.json +++ b/newt-vscode/syntaxes/newt.tmLanguage.json @@ -16,7 +16,7 @@ }, { "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", diff --git a/playground/src/monarch.ts b/playground/src/monarch.ts index 8b7f48b..ab72fd6 100644 --- a/playground/src/monarch.ts +++ b/playground/src/monarch.ts @@ -93,8 +93,10 @@ export let newtTokens: monaco.languages.IMonarchLanguage = { specialOps: ["=>", "->", ":", "=", ":=", "<-"], tokenizer: { 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" } }, ], [/[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"], // strings