@@ -31,6 +31,24 @@ exports.setThemeImpl = function(monacoInstance) {
34+exports.registerLanguageImpl = function(monacoInstance) {
35+ return function(languageId) {
37+ monacoInstance.languages.register({ id: languageId})
42+exports.setMonarchTokensProviderImpl = function(monacoInstance) {
43+ return function(name) {
44+ return function(monarchLanguage) {
46+ return monacoInstance.languages.setMonarchTokensProvider(name, monarchLanguage);
34exports.nightOwlTheme = {
52exports.nightOwlTheme = {
35 "base": "vs-dark",
53 "base": "vs-dark",
36 "inherit": true,
54 "inherit": true,
@@ -708,3 +726,167 @@ exports.nightOwlTheme = {
729+exports.purescriptSyntax = {
730+ "displayName": "Purescript",
731+ "name": "purescrript",
732+ "mimeTypes": ["text/purescript"],
733+ "fileExtensions": ["purs"],
735+ "editorOptions": { "tabSize": 2, "insertSpaces": true },
737+ "lineComment": "--",
738+ "blockCommentStart": "{-",
739+ "blockCommentEnd": "-}",
742+ "case", "class", "data", "derive", "do", "else",
743+ "if", "import", "in", "infix", "infixl", "infixr", "instance",
744+ "let", "module", "newtype", "of", "then", "type", "where",
745+ "->", "|", "=>", "::", "\\", "=", "|", "foreign", "forall", "∷"
759+ "class","instance","type", "derive"
763+ "escapes" : "\\\\(?:[nrt\\\\\"'\\?]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{6})",
764+ "symbols0": "[\\$%&\\*\\+@!\\/\\\\\\^~=\\.:\\-\\?]",
765+ "symbols" : "(?:@symbols0|[\\|<>])+",
766+ "idchars" : "(?:[\\w'])*",
771+ ["((?:[A-Z]@idchars\\.)+)([a-z]@idchars)", ["identifier.namespace","identifier"]],
772+ ["((?:[A-Z]@idchars\\.)+)([A-Z]@idchars)", ["identifier.namespace","constructor"]],
774+ ["[a-z]@idchars(?!\\.)",
775+ { "cases":{ "@dataStart": { "token": "keyword", "next" : "@type_data" },
776+ "@typeStart": { "token": "keyword", "next" : "@type_type" },
777+ "@keywords": "keyword",
778+ "@extraKeywords": "keyword",
779+ "@default" : "identifier" }
783+ ["[A-Z]@idchars", "type.identifier" ],
785+ ["_@idchars", "identifier.wildcard"],
788+ ["([a-z]@idchars\\.)+", "identifier.namespace" ],
791+ { "include": "@whitespace" },
793+ ["[{}()\\[\\]]", "@brackets"],
794+ ["[,`]", "delimiter"],
797+ ["::(?!@symbols0)", "type.operator", "@type_line"],
798+ ["@symbols", { "cases": { "@keywords": "keyword.operator",
799+ "@extraKeywords": "keyword.operator",
800+ "@default": "operator" }}
804+ ["[0-9]+\\.[0-9]+([eE][\\-+]?[0-9]+)?", "number.float"],
805+ ["0[xX][0-9a-fA-F]+", "number.hex"],
806+ ["[0-9]+", "number"],
809+ ["\"([^\"\\\\]|\\\\.)*$", "string.invalid" ],
810+ ["\"", { "token": "string.quote", "bracket": "@open", "next": "@string" } ],
813+ ["'[^\\\\']'", "string"],
814+ ["(')(@escapes)(')", ["string","string.escape","string"]],
815+ ["'", "string.invalid"],
818+ ["^[ ]*#.*", "namespace"]
823+ ["{-", "comment", "@comment" ],
824+ ["--.*$", "comment"]
828+ ["[^\\{\\-]+", "comment" ],
829+ ["{-", "comment", "@push" ],
830+ ["-}", "comment", "@pop" ],
831+ ["[\\{\\-]", "comment"]
835+ ["[^\\\\\"]+", "string"],
836+ ["@escapes", "string.escape"],
837+ ["\\\\.", "string.escape.invalid"],
838+ ["\"", { "token": "string.quote", "bracket": "@close", "next": "@pop" } ]
842+ [ "\\=", "keyword"],
843+ ["^\\s*(?!\\-\\-|\\{\\-)[^\\s]", { "token": "@rematch", "next": "@pop" } ],
844+ { "include": "@type" }
848+ [ "([=|])(\\s*)([A-Z]@idchars)", ["keyword.operator","","constructor"]],
849+ ["^\\s*$", { "token": "", "next": "@pop" } ],
850+ { "include": "@type" }
854+ ["^\\s*(?!\\-\\-|\\{\\-)[_a-z]", { "token": "@rematch", "next": "@pop" } ],
855+ ["[^=]*=", { "token": "@rematch", "next": "@pop" } ],
856+ { "include": "@type" }
860+ [ "[(\\[]", { "token": "@brackets.type" }, "@type_nested"],
861+ { "include": "@type_content" }
865+ ["[)\\]]", { "token": "@brackets.type" }, "@pop" ],
866+ ["[(\\[]", { "token": "@brackets.type" }, "@push"],
867+ [",", "delimiter.type"],
868+ { "include": "@type_content" }
872+ { "include": "@whitespace" },
875+ ["[a-z]\\d*\\b", "type.identifier.typevar"],
876+ ["_@idchars", "type.identifier.typevar"],
878+ ["((?:[A-Z]@idchars\\.)*)([A-Z]@idchars)",
879+ ["type.identifier.namespace","type.identifier"]
881+ ["((?:[A-Z]@idchars\\.)*)([a-z]@idchars)",
882+ { "cases": { "@typeKeywords": ["type.identifier.namespace","type.keyword"],
883+ "@keywords": { "token": "@rematch", "next": "@pop" },
884+ "@default": ["type.identifier.namespace","type.identifier"]
888+ ["::|->|[\\.:|]", "type.operator"],
889+ ["[\\s\\S]","@rematch","@pop"]