grammars/hint.haskell.json in github-linguist-5.3.3 vs grammars/hint.haskell.json in github-linguist-6.0.0

- old
+ new

@@ -1,98 +1,149 @@ { - "fileTypes": [ - - ], "scopeName": "hint.haskell", - "macros": { - "identStartCharClass": "[\\p{Ll}_\\p{Lu}\\p{Lt}]", - "identContCharClass": "[\\p{Ll}_\\p{Lu}\\p{Lt}']", - "identCharClass": "[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']", - "functionNameOne": "[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", - "classNameOne": "[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", - "functionName": "(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", - "className": "[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*", - "operatorChar": "(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))", - "operator": "(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))+", - "operatorFun": "(?:\\((?!--+\\))(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))+\\))", - "basicChar": "[\\ -\\[\\]-~]", - "escapeChar": "\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&])", - "octalChar": "(?:\\\\o[0-7]+)", - "hexChar": "(?:\\\\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\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)))(?:\\s+(?:(?!(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))where(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])))(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)))*)", - "indentChar": "[ \\t]", - "indentBlockStart": "^([ \\t]*)", - "indentBlockEnd": "^(?!\\1[ \\t]|[ \\t]*$)", - "maybeBirdTrack": "^", - "lb": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))", - "rb": "(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "b": "(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))|(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])))" - }, "patterns": [ { "include": "#function_type_declaration" }, { "include": "#ctor_type_declaration" } ], "repository": { + "assignment_op": { + "patterns": [ + { + "match": "=", + "captures": { + "0": { + "name": "keyword.operator.assignment.haskell" + } + } + } + ] + }, + "attribute_name": { + "patterns": [ + { + "name": "entity.other.attribute-name.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + } + ] + }, "block_comment": { "patterns": [ { "name": "comment.block.haddock.haskell", "begin": "\\{-\\s*[|^]", "end": "-\\}", - "applyEndPatternLast": 1, + "patterns": [ + { + "include": "#block_comment" + } + ], "beginCaptures": { "0": { "name": "punctuation.definition.comment.haddock.haskell" } }, "endCaptures": { "0": { "name": "punctuation.definition.comment.haddock.haskell" } }, - "patterns": [ - { - "include": "#block_comment" - } - ] + "applyEndPatternLast": true }, { "name": "comment.block.haskell", "begin": "\\{-", "end": "-\\}", - "applyEndPatternLast": 1, + "patterns": [ + { + "include": "#block_comment" + } + ], "beginCaptures": { "0": { "name": "punctuation.definition.comment.block.start.haskell" } }, "endCaptures": { "0": { "name": "punctuation.definition.comment.block.end.haskell" } }, + "applyEndPatternLast": true + } + ] + }, + "c_preprocessor": { + "patterns": [ + { + "name": "meta.preprocessor.c.haskell", + "begin": "^(?=#)", + "end": "(?\u003c!\\\\)(?=$)", "patterns": [ { - "include": "#block_comment" + "name": "keyword.control.c.haskell", + "match": "^#\\S+" } ] } ] }, + "characters": { + "patterns": [ + { + "name": "constant.character.escape.haskell", + "match": "\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\\u0026])" + }, + { + "name": "constant.character.escape.octal.haskell", + "match": "(?:\\\\o[0-7]+)" + }, + { + "name": "constant.character.escape.hexadecimal.haskell", + "match": "(?:\\\\x[0-9A-Fa-f]+)" + }, + { + "name": "constant.character.escape.control.haskell", + "match": "(?:\\\\\\^[A-Z@\\[\\]\\\\^_])" + } + ] + }, + "class_decl": { + "patterns": [ + { + "name": "meta.declaration.class.haskell", + "begin": "^([ \\t]*)(class)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(where)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))|^(?!\\1[ \\t]|[ \\t]*$)", + "patterns": [ + { + "include": "#type_signature" + } + ], + "beginCaptures": { + "2": { + "name": "keyword.other.class.haskell" + } + }, + "endCaptures": { + "1": { + "name": "keyword.other.haskell" + } + } + } + ] + }, + "comma": { + "patterns": [ + { + "name": "punctuation.separator.comma.haskell", + "match": "," + } + ] + }, "comments": { "patterns": [ { "begin": "(^[ \\t]+)?(?=--+\\s+[|^])", "end": "(?!\\G)", @@ -111,11 +162,11 @@ } } ] }, { - "begin": "(^[ \\t]+)?(?=--+(?!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))))", + "begin": "(^[ \\t]+)?(?=--+(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))", "end": "(?!\\G)", "patterns": [ { "name": "comment.line.double-dash.haskell", "begin": "--", @@ -131,362 +182,523 @@ { "include": "#block_comment" } ] }, - "characters": { + "common_toplevel": { "patterns": [ { - "match": "\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&])", - "name": "constant.character.escape.haskell" + "include": "#class_decl" }, { - "match": "(?:\\\\o[0-7]+)", - "name": "constant.character.escape.octal.haskell" + "include": "#instance_decl" }, { - "match": "(?:\\\\x[0-9A-Fa-f]+)", - "name": "constant.character.escape.hexadecimal.haskell" + "include": "#deriving_instance_decl" }, { - "match": "(?:\\\\\\^[A-Z@\\[\\]\\\\^_])", - "name": "constant.character.escape.control.haskell" + "include": "#foreign_import" + }, + { + "include": "#regular_import" + }, + { + "include": "#data_decl" + }, + { + "include": "#type_alias" + }, + { + "include": "#c_preprocessor" } ] }, - "infix_op": { + "ctor_type_declaration": { "patterns": [ { - "name": "entity.name.function.infix.haskell", - "match": "(?:\\((?!--+\\))(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))+\\))" + "name": "meta.ctor.type-declaration.haskell", + "contentName": "meta.type-signature.haskell", + "begin": "^([ \\t]*)(?:(?:((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:\\((?!--+\\))(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+\\)))(?:(?:\\s*,\\s*)(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:\\((?!--+\\))(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+\\))))*))(?:\\s*((?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))))", + "end": "^(?!\\1[ \\t]|[ \\t]*$)", + "patterns": [ + { + "include": "#type_signature" + } + ], + "beginCaptures": { + "2": { + "patterns": [ + { + "include": "#type_ctor" + }, + { + "include": "#infix_op" + } + ] + }, + "3": { + "name": "keyword.other.double-colon.haskell" + } + } } ] }, - "module_exports": { + "data_decl": { "patterns": [ { - "name": "meta.declaration.exports.haskell", - "begin": "\\(", - "end": "\\)", - "applyEndPatternLast": 1, + "name": "meta.declaration.type.data.haskell", + "begin": "^([ \\t]*)(data|newtype)\\s+((?:(?!=|where).)*)", + "end": "^(?!\\1[ \\t]|[ \\t]*$)", "patterns": [ { "include": "#comments" }, { - "include": "#function_name" + "include": "#where" }, { - "include": "#type_name" + "include": "#deriving" }, { - "include": "#comma" + "include": "#assignment_op" }, { - "name": "meta.other.constructor-list.haskell", - "begin": "(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))\\s*\\(", - "end": "\\)", + "match": "(?:(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)\\s*)(?:((?:(?!deriving)(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:(?!deriving)(?:[\\w()'→⇒\\[\\],]|-\u003e|=\u003e)+\\s*)+))(?:(?:\\s+)(?:(?!deriving)(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:(?!deriving)(?:[\\w()'→⇒\\[\\],]|-\u003e|=\u003e)+\\s*)+)))*)?))", + "captures": { + "1": { + "patterns": [ + { + "include": "#type_ctor" + } + ] + }, + "2": { + "name": "meta.type-signature.haskell", + "patterns": [ + { + "include": "#type_signature" + } + ] + } + } + }, + { + "match": "\\|", + "captures": { + "0": { + "name": "punctuation.separator.pipe.haskell" + } + } + }, + { + "name": "meta.declaration.type.data.record.block.haskell", + "begin": "\\{", + "end": "\\}", "patterns": [ { - "include": "#type_ctor" + "include": "#comments" }, { - "include": "#attribute_name" - }, - { "include": "#comma" }, { - "match": "\\.\\.", - "name": "keyword.operator.wildcard.haskell" + "include": "#record_field_declaration" } - ] + ], + "beginCaptures": { + "0": { + "name": "keyword.operator.record.begin.haskell" + } + }, + "endCaptures": { + "0": { + "name": "keyword.operator.record.end.haskell" + } + } }, { - "include": "#infix_op" + "include": "#ctor_type_declaration" } - ] + ], + "beginCaptures": { + "2": { + "name": "keyword.other.data.haskell" + }, + "3": { + "name": "meta.type-signature.haskell", + "patterns": [ + { + "include": "#family_and_instance" + }, + { + "include": "#type_signature" + } + ] + } + } } ] }, - "module_name": { + "deriving": { "patterns": [ { - "name": "support.other.module.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + "include": "#deriving_list" + }, + { + "include": "#deriving_simple" + }, + { + "include": "#deriving_keyword" } ] }, - "module_name_prefix": { + "deriving_instance_decl": { "patterns": [ { - "name": "support.other.module.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\." + "name": "meta.declaration.instance.deriving.haskell", + "contentName": "meta.type-signature.haskell", + "begin": "^([ \\t]*)(deriving\\s+instance)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "end": "^(?!\\1[ \\t]|[ \\t]*$)", + "patterns": [ + { + "include": "#pragma" + }, + { + "include": "#type_signature" + } + ], + "beginCaptures": { + "2": { + "name": "keyword.other.haskell" + } + } } ] }, - "pragma": { + "deriving_keyword": { "patterns": [ { - "name": "meta.preprocessor.haskell", - "begin": "\\{-#", - "end": "#-\\}", - "patterns": [ - { - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))((?i:NOTINLINE CONSTRUCTORLIKE|NOINLINE CONSTRUCTORLIKE|INLINE CONSTRUCTORLIKE|SPECIALISE NOTINLINE|SPECIALIZE NOTINLINE|SPECIALISE NOINLINE|SPECIALIZE NOINLINE|NOTINLINE CONLIKE|SPECIALISE INLINE|SPECIALIZE INLINE|NOINLINE CONLIKE|VECTORISE SCALAR|VECTORIZE SCALAR|OPTIONS_HADDOCK|INLINE CONLIKE|OPTIONS_DERIVE|OPTIONS_CATCH|OPTIONS_NHC98|OPTIONS_HUGS|OVERLAPPABLE|NOVECTORISE|NOVECTORIZE|OPTIONS_GHC|OPTIONS_JHC|OPTIONS_YHC|OVERLAPPING|DEPRECATED|INCOHERENT|INLINEABLE|SPECIALISE|SPECIALIZE|GENERATED|INLINABLE|NOTINLINE|VECTORISE|VECTORIZE|CONTRACT|LANGUAGE|NOINLINE|NOUNPACK|OVERLAPS|INCLUDE|MINIMAL|OPTIONS|WARNING|CFILES|INLINE|SOURCE|UNPACK|CTYPE|RULES|CORE|LINE|ANN|SCC))(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "name": "keyword.other.preprocessor.haskell" + "name": "meta.deriving.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(deriving)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "captures": { + "1": { + "name": "keyword.other.haskell" } - ] + } } ] }, - "function_type_declaration": { + "deriving_list": { "patterns": [ { - "name": "meta.function.type-declaration.haskell", - "begin": "^([ \\t]*)(?:(?:((?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))+\\)))(?:(?:\\s*,\\s*)(?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))+\\))))*)\\s*((?<!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))))))", - "end": "^(?!\\1[ \\t]|[ \\t]*$)", - "contentName": "meta.type-signature.haskell", - "beginCaptures": { - "2": { - "patterns": [ - { - "include": "#function_name" - }, - { - "include": "#infix_op" - } - ] - }, - "3": { - "name": "keyword.other.double-colon.haskell" - } - }, + "name": "meta.deriving.haskell", + "begin": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(deriving)\\s*\\(", + "end": "\\)", "patterns": [ { - "include": "#type_signature" + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "captures": { + "1": { + "name": "entity.other.inherited-class.haskell" + } + } } - ] + ], + "beginCaptures": { + "1": { + "name": "keyword.other.haskell" + } + } } ] }, - "lazy_function_type_signature": { + "deriving_simple": { "patterns": [ { - "name": "meta.function.type-declaration.haskell", - "begin": "^([ \\t]*)(((?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))+\\)))(?:(?:\\s*,\\s*)(?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))+\\))))*))\\s*$", - "end": "^(?!\\1[ \\t]|[ \\t]*$)", - "contentName": "meta.type-signature.haskell", - "beginCaptures": { + "name": "meta.deriving.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(deriving)\\s*([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "captures": { + "1": { + "name": "keyword.other.haskell" + }, "2": { - "patterns": [ - { - "include": "#function_name" - }, - { - "include": "#infix_op" - } - ] + "name": "entity.other.inherited-class.haskell" } - }, - "patterns": [ - { - "include": "#double_colon_operator" - }, - { - "include": "#type_signature" - } - ] + } } ] }, "double_colon_operator": { "patterns": [ { "name": "keyword.other.double-colon.haskell", - "match": "(?<!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))" + "match": "(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))" } ] }, - "ctor_type_declaration": { + "empty_list": { "patterns": [ { - "name": "meta.ctor.type-declaration.haskell", - "begin": "^([ \\t]*)(?:(?:((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:\\((?!--+\\))(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))+\\)))(?:(?:\\s*,\\s*)(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:\\((?!--+\\))(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))+\\))))*))(?:\\s*((?<!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))))))", + "name": "constant.language.empty-list.haskell", + "match": "\\[\\]" + } + ] + }, + "family_and_instance": { + "patterns": [ + { + "name": "keyword.other.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(family|instance)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + } + ] + }, + "foreign_import": { + "patterns": [ + { + "name": "meta.foreign.haskell", + "begin": "^([ \\t]*)(foreign)\\s+(import|export)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", "end": "^(?!\\1[ \\t]|[ \\t]*$)", - "contentName": "meta.type-signature.haskell", + "patterns": [ + { + "match": "(?:un)?safe", + "captures": { + "0": { + "name": "keyword.other.haskell" + } + } + }, + { + "include": "#function_type_declaration" + }, + { + "include": "#haskell_expr" + }, + { + "include": "#comments" + } + ], "beginCaptures": { "2": { - "patterns": [ - { - "include": "#type_ctor" - }, - { - "include": "#infix_op" - } - ] + "name": "keyword.other.haskell" }, "3": { - "name": "keyword.other.double-colon.haskell" + "name": "keyword.other.haskell" } - }, - "patterns": [ - { - "include": "#type_signature" - } - ] + } } ] }, - "record_field_declaration": { + "function_name": { "patterns": [ { - "name": "meta.record-field.type-declaration.haskell", - "begin": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:(?:((?:(?:[\\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;\\[\\]`{}_\"']))+\\))))*)\\s*((?<!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))))))|})", + "name": "entity.name.function.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + } + ] + }, + "function_type_declaration": { + "patterns": [ + { + "name": "meta.function.type-declaration.haskell", "contentName": "meta.type-signature.haskell", + "begin": "^([ \\t]*)(?:(?:((?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+\\)))(?:(?:\\s*,\\s*)(?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+\\))))*)\\s*((?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))))", + "end": "^(?!\\1[ \\t]|[ \\t]*$)|(?=(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(\u003c-|=)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))", + "patterns": [ + { + "include": "#type_signature" + } + ], "beginCaptures": { - "1": { + "2": { "patterns": [ { - "include": "#attribute_name" + "include": "#function_name" }, { "include": "#infix_op" } ] }, - "2": { + "3": { "name": "keyword.other.double-colon.haskell" } - }, - "patterns": [ - { - "include": "#type_signature" - } - ] + } } ] }, - "type_signature": { + "function_type_declaration_with_scoped_type": { "patterns": [ { - "include": "#pragma" + "include": "#scoped_type_override" }, { - "include": "#comments" + "include": "#function_type_declaration" }, { - "name": "keyword.other.forall.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))forall(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + "include": "#multiline_type_declaration" + } + ] + }, + "haskell_expr": { + "patterns": [ + { + "include": "#infix_function" }, { "include": "#unit" }, { "include": "#empty_list" }, { + "include": "#quasi_quotes" + }, + { + "include": "#keywords" + }, + { + "include": "#pragma" + }, + { "include": "#string" }, { - "name": "keyword.other.arrow.haskell", - "match": "(?<!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))(->|→)(?!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))" + "include": "#newline_escape" }, { - "name": "keyword.other.big-arrow.haskell", - "match": "(?<!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))(=>|⇒)(?!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))" + "include": "#quoted_character" }, { + "include": "#comments" + }, + { + "include": "#infix_op" + }, + { + "include": "#comma" + }, + { + "include": "#lit_num" + }, + { + "include": "#scoped_type" + }, + { "include": "#operator" }, { - "name": "variable.other.generic-type.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + "include": "#identifier" }, { - "include": "#type_name" + "include": "#type_ctor" } ] }, - "unit": { + "haskell_source": { "patterns": [ { - "name": "constant.language.unit.haskell", - "match": "\\(\\)" - } - ] - }, - "empty_list": { - "patterns": [ + "include": "#shebang" + }, { - "name": "constant.language.empty-list.haskell", - "match": "\\[\\]" + "include": "#module_decl" + }, + { + "include": "#haskell_toplevel" } ] }, - "deriving": { + "haskell_toplevel": { "patterns": [ { - "include": "#deriving_list" + "include": "#liquidhaskell_annotation" }, { - "include": "#deriving_simple" + "include": "#common_toplevel" }, { - "include": "#deriving_keyword" + "include": "#function_type_declaration_with_scoped_type" + }, + { + "include": "#haskell_expr" } ] }, - "deriving_keyword": { + "hsig_decl": { "patterns": [ { - "name": "meta.deriving.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(deriving)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "captures": { + "name": "meta.declaration.module.haskell", + "begin": "^([ \\t]*)(signature)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(where)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))|^(?!\\1[ \\t]|[ \\t]*$)", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#module_name" + }, + { + "include": "#module_exports" + }, + { + "include": "#invalid" + } + ], + "beginCaptures": { + "2": { + "name": "keyword.other.haskell" + } + }, + "endCaptures": { "1": { "name": "keyword.other.haskell" } } } ] }, - "deriving_list": { + "hsig_source": { "patterns": [ { - "name": "meta.deriving.haskell", - "begin": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(deriving)\\s*\\(", - "end": "\\)", - "beginCaptures": { - "1": { - "name": "keyword.other.haskell" - } - }, - "patterns": [ - { - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "captures": { - "1": { - "name": "entity.other.inherited-class.haskell" - } - } - } - ] + "include": "#hsig_decl" + }, + { + "include": "#hsig_toplevel" } ] }, - "deriving_simple": { + "hsig_toplevel": { "patterns": [ { - "name": "meta.deriving.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(deriving)\\s*([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "include": "#common_toplevel" + }, + { + "include": "#function_type_declaration" + }, + { + "include": "#lazy_function_type_signature" + }, + { + "include": "#comments" + } + ] + }, + "identifier": { + "patterns": [ + { + "name": "identifier.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", "captures": { - "1": { - "name": "keyword.other.haskell" - }, - "2": { - "name": "entity.other.inherited-class.haskell" + "0": { + "patterns": [ + { + "include": "#module_name_prefix" + }, + { + "name": "support.function.prelude.$1.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(abs|acos|acosh|all|and|any|appendFile|asTypeOf|asin|asinh|atan|atan2|atanh|break|ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|errorWithoutStackTrace|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldMap|foldl|foldl1|foldr|foldr1|fromEnum|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|head|id|init|interact|ioError|isDenormalized|isIEEE|isInfinite|isNaN|isNegativeZero|iterate|last|lcm|length|lex|lines|log|logBase|lookup|map|mapM|mapM_|mappend|max|maxBound|maximum|maybe|mconcat|mempty|min|minBound|minimum|mod|negate|not|notElem|null|odd|or|otherwise|pi|pred|print|product|properFraction|pure|putChar|putStr|putStrLn|quot|quotRem|read|readFile|readIO|readList|readLn|readParen|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequenceA|sequence_|show|showChar|showList|showParen|showString|shows|showsPrec|significand|signum|sin|sinh|snd|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|toEnum|toInteger|toRational|traverse|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + } + ] } } } ] }, @@ -504,465 +716,376 @@ } } } ] }, - "quasi_quotes": { + "infix_op": { "patterns": [ { - "begin": "(\\[)((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)(\\|)", - "end": "(\\|)(\\])", - "beginCaptures": { - "1": { - "name": "punctuation.definition.quasiquotes.begin.haskell" - }, - "2": { - "name": "entity.name.tag.haskell", + "name": "entity.name.function.operator.haskell", + "match": "(?:\\((?!--+\\))(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+\\))", + "captures": { + "0": { "patterns": [ { "include": "#module_name_prefix" + }, + { + "name": "support.operator.prelude.haskell", + "match": "^\\((\\!\\!|\\$\\!|\\$|\\\u0026\\\u0026|\\*|\\*\\*|\\*\\\u003e|\\+|\\+\\+|\\-|\\.|\\/|\\/\\=|\\\u003c\\$|\\\u003c\\$\\\u003e|\\\u003c|\\\u003c\\*|\\\u003c\\*\\\u003e|\\\u003c\\=|\\=\\\u003c\\\u003c|\\=\\=|\\\u003e|\\\u003e\\=|\\\u003e\\\u003e|\\\u003e\\\u003e\\=|\\^|\\^\\^|\\|\\|)\\)$" } ] } - }, - "endCaptures": { - "2": { - "name": "punctuation.definition.quasiquotes.end.haskell" - } - }, - "contentName": "string.quoted.quasiquotes.haskell" + } } ] }, - "module_decl": { + "instance_decl": { "patterns": [ { - "name": "meta.declaration.module.haskell", - "begin": "^([ \\t]*)(module)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(where)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))|^(?!\\1[ \\t]|[ \\t]*$)", - "beginCaptures": { - "2": { - "name": "keyword.other.haskell" - } - }, - "endCaptures": { - "1": { - "name": "keyword.other.haskell" - } - }, + "name": "meta.declaration.instance.haskell", + "contentName": "meta.type-signature.haskell", + "begin": "^([ \\t]*)(instance)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(where)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))|^(?!\\1[ \\t]|[ \\t]*$)", "patterns": [ { - "include": "#comments" + "include": "#pragma" }, { - "include": "#module_name" - }, - { - "include": "#module_exports" - }, - { - "include": "#invalid" + "include": "#type_signature" } - ] - } - ] - }, - "hsig_decl": { - "patterns": [ - { - "name": "meta.declaration.module.haskell", - "begin": "^([ \\t]*)(signature)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(where)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))|^(?!\\1[ \\t]|[ \\t]*$)", + ], "beginCaptures": { "2": { "name": "keyword.other.haskell" } }, "endCaptures": { "1": { "name": "keyword.other.haskell" } - }, - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#module_name" - }, - { - "include": "#module_exports" - }, - { - "include": "#invalid" - } - ] + } } ] }, - "class_decl": { + "invalid": { "patterns": [ { - "name": "meta.declaration.class.haskell", - "begin": "^([ \\t]*)(class)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(where)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))|^(?!\\1[ \\t]|[ \\t]*$)", - "beginCaptures": { - "2": { - "name": "keyword.other.class.haskell" - } - }, - "endCaptures": { - "1": { - "name": "keyword.other.haskell" - } - }, - "patterns": [ - { - "include": "#type_signature" - } - ] + "name": "invalid.illegal.character-not-allowed-here.haskell", + "match": "\\S+" } ] }, - "instance_decl": { + "keywords": { "patterns": [ { - "name": "meta.declaration.instance.haskell", - "begin": "^([ \\t]*)(instance)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(where)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))|^(?!\\1[ \\t]|[ \\t]*$)", + "name": "keyword.other.$1.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(deriving|where|data|type|newtype)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + }, + { + "name": "keyword.operator.$1.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(infix[lr]?)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + }, + { + "name": "keyword.control.$1.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(do|if|then|else|case|of|let|in|default|mdo|rec|proc)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + } + ] + }, + "lazy_function_type_signature": { + "patterns": [ + { + "name": "meta.function.type-declaration.haskell", "contentName": "meta.type-signature.haskell", - "beginCaptures": { - "2": { - "name": "keyword.other.haskell" - } - }, - "endCaptures": { - "1": { - "name": "keyword.other.haskell" - } - }, + "begin": "^([ \\t]*)(((?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+\\)))(?:(?:\\s*,\\s*)(?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+\\))))*))\\s*$", + "end": "^(?!\\1[ \\t]|[ \\t]*$)", "patterns": [ { - "include": "#pragma" + "include": "#double_colon_operator" }, { "include": "#type_signature" } - ] + ], + "beginCaptures": { + "2": { + "patterns": [ + { + "include": "#function_name" + }, + { + "include": "#infix_op" + } + ] + } + } } ] }, - "deriving_instance_decl": { + "liquidhaskell_annotation": { "patterns": [ { - "name": "meta.declaration.instance.deriving.haskell", - "begin": "^([ \\t]*)(deriving\\s+instance)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "end": "^(?!\\1[ \\t]|[ \\t]*$)", - "contentName": "meta.type-signature.haskell", - "beginCaptures": { - "2": { - "name": "keyword.other.haskell" - } - }, + "name": "block.liquidhaskell.haskell", + "contentName": "block.liquidhaskell.annotation.haskell", + "begin": "\\{-@(?!#)", + "end": "@-\\}", "patterns": [ { - "include": "#pragma" - }, - { - "include": "#type_signature" + "include": "annotation.liquidhaskell.haskell" } ] } ] }, - "foreign_import": { + "lit_num": { "patterns": [ { - "name": "meta.foreign.haskell", - "begin": "^([ \\t]*)(foreign)\\s+(import|export)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "end": "^(?!\\1[ \\t]|[ \\t]*$)", - "beginCaptures": { - "2": { - "name": "keyword.other.haskell" - }, - "3": { - "name": "keyword.other.haskell" - } - }, + "name": "constant.numeric.hexfloat.haskell", + "match": "0[xX][0-9a-fA-F_]*(?:\\.[0-9a-fA-F_]+(?:[pP][+-]?[0-9_]+)?|[pP][+-]?[0-9_]+)" + }, + { + "name": "constant.numeric.hexadecimal.haskell", + "match": "0[xX][_0-9a-fA-F]+" + }, + { + "name": "constant.numeric.octal.haskell", + "match": "0[oO][_0-7]+" + }, + { + "name": "constant.numeric.binary.haskell", + "match": "0[bB][_01]+" + }, + { + "name": "constant.numeric.float.haskell", + "match": "[0-9][0-9_]*(?:\\.[0-9_]+(?:[eE][+-]?[0-9_]+)?|[eE][+-]?[0-9_]+)" + }, + { + "name": "constant.numeric.decimal.haskell", + "match": "[0-9][_0-9]*" + } + ] + }, + "module_decl": { + "patterns": [ + { + "name": "meta.declaration.module.haskell", + "begin": "^([ \\t]*)(module)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(where)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))|^(?!\\1[ \\t]|[ \\t]*$)", "patterns": [ { - "match": "(?:un)?safe", - "captures": { - "0": { - "name": "keyword.other.haskell" - } - } + "include": "#comments" }, { - "include": "#function_type_declaration" + "include": "#module_name" }, { - "include": "#haskell_expr" + "include": "#module_exports" }, { - "include": "#comments" + "include": "#invalid" } - ] - } - ] - }, - "regular_import": { - "patterns": [ - { - "name": "meta.import.haskell", - "begin": "^([ \\t]*)(import)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "end": "^(?!\\1[ \\t]|[ \\t]*$)", + ], "beginCaptures": { "2": { "name": "keyword.other.haskell" } }, - "patterns": [ - { - "include": "#module_name" - }, - { - "include": "#module_exports" - }, - { - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(qualified|as|hiding)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "captures": { - "1": { - "name": "keyword.other.haskell" - } - } - }, - { - "include": "#comments" + "endCaptures": { + "1": { + "name": "keyword.other.haskell" } - ] + } } ] }, - "data_decl": { + "module_exports": { "patterns": [ { - "name": "meta.declaration.type.data.haskell", - "begin": "^([ \\t]*)(data|newtype)\\s+((?:(?!=|where).)*)", - "end": "^(?!\\1[ \\t]|[ \\t]*$)", - "beginCaptures": { - "2": { - "name": "keyword.other.data.haskell" - }, - "3": { - "name": "meta.type-signature.haskell", - "patterns": [ - { - "include": "#family_and_instance" - }, - { - "include": "#type_signature" - } - ] - } - }, + "name": "meta.declaration.exports.haskell", + "begin": "\\(", + "end": "\\)", "patterns": [ { "include": "#comments" }, { - "include": "#where" + "include": "#c_preprocessor" }, { - "include": "#deriving" + "begin": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(module)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "patterns": [ + { + "include": "#invalid" + } + ], + "beginCaptures": { + "1": { + "name": "keyword.other.haskell" + } + }, + "endCaptures": { + "1": { + "name": "support.other.module.haskell" + } + } }, { - "include": "#assignment_op" + "include": "#function_name" }, { - "match": "(?:(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)\\s*)(?:((?:(?!deriving)(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:(?!deriving)(?:[\\w()'→⇒\\[\\],]|->|=>)+\\s*)+))(?:(?:\\s+)(?:(?!deriving)(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:(?!deriving)(?:[\\w()'→⇒\\[\\],]|->|=>)+\\s*)+)))*)?))", - "captures": { - "1": { - "patterns": [ - { - "include": "#type_ctor" - } - ] - }, - "2": { - "name": "meta.type-signature.haskell", - "patterns": [ - { - "include": "#type_signature" - } - ] - } - } + "include": "#type_name" }, { - "match": "\\|", - "captures": { - "0": { - "name": "punctuation.separator.pipe.haskell" - } - } + "include": "#comma" }, { - "name": "meta.declaration.type.data.record.block.haskell", - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "keyword.operator.record.begin.haskell" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "keyword.operator.record.end.haskell" - } - }, + "name": "meta.other.constructor-list.haskell", + "begin": "(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))\\s*\\(", + "end": "\\)", "patterns": [ { "include": "#comments" }, { + "include": "#c_preprocessor" + }, + { + "include": "#type_ctor" + }, + { + "include": "#attribute_name" + }, + { "include": "#comma" }, { - "include": "#record_field_declaration" + "name": "keyword.operator.wildcard.haskell", + "match": "\\.\\." } ] }, { - "include": "#ctor_type_declaration" + "include": "#infix_op" } - ] + ], + "applyEndPatternLast": true } ] }, - "type_alias": { + "module_name": { "patterns": [ { - "name": "meta.declaration.type.type.haskell", - "begin": "^([ \\t]*)(type)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "end": "^(?!\\1[ \\t]|[ \\t]*$)", + "name": "support.other.module.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + } + ] + }, + "module_name_prefix": { + "patterns": [ + { + "name": "support.other.module.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\." + } + ] + }, + "multiline_type_declaration": { + "patterns": [ + { + "name": "meta.multiline.type-declaration.haskell", "contentName": "meta.type-signature.haskell", - "beginCaptures": { - "2": { - "name": "keyword.other.type.haskell" - } - }, + "begin": "^([ \\t]*)((?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))", + "end": "^(?!\\1|[ \\t]*$)|(?=(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(\u003c-|=)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))", "patterns": [ { - "include": "#comments" - }, - { - "include": "#family_and_instance" - }, - { - "include": "#where" - }, - { - "include": "#assignment_op" - }, - { "include": "#type_signature" } - ] + ], + "beginCaptures": { + "2": { + "name": "keyword.other.double-colon.haskell" + } + } } ] }, - "keywords": { + "newline_escape": { "patterns": [ { - "name": "keyword.other.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(deriving|where|data|type|newtype)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" - }, + "name": "markup.other.escape.newline.haskell", + "match": "\\\\$" + } + ] + }, + "operator": { + "patterns": [ { - "name": "keyword.other.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(data|type|newtype)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" - }, - { "name": "keyword.operator.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))infix[lr]?(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" - }, - { - "name": "keyword.control.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(do|if|then|else|case|of|let|in|default|mdo|rec|proc)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + "match": "(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+", + "captures": { + "0": { + "patterns": [ + { + "include": "#module_name_prefix" + }, + { + "name": "support.operator.prelude.haskell", + "match": "^(\\!\\!|\\$\\!|\\$|\\\u0026\\\u0026|\\*|\\*\\*|\\*\\\u003e|\\+|\\+\\+|\\-|\\.|\\/|\\/\\=|\\\u003c\\$|\\\u003c\\$\\\u003e|\\\u003c|\\\u003c\\*|\\\u003c\\*\\\u003e|\\\u003c\\=|\\=\\\u003c\\\u003c|\\=\\=|\\\u003e|\\\u003e\\=|\\\u003e\\\u003e|\\\u003e\\\u003e\\=|\\^|\\^\\^|\\|\\|)$" + } + ] + } + } } ] }, - "c_preprocessor": { + "pragma": { "patterns": [ { - "name": "meta.preprocessor.c.haskell", - "begin": "^(?=#)", - "end": "(?<!\\\\)(?=$)", + "name": "meta.preprocessor.haskell", + "begin": "\\{-#", + "end": "#-\\}", "patterns": [ { - "include": "source.c" + "name": "keyword.other.preprocessor.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))((?i:NOTINLINE CONSTRUCTORLIKE|NOINLINE CONSTRUCTORLIKE|INLINE CONSTRUCTORLIKE|SPECIALISE NOTINLINE|SPECIALIZE NOTINLINE|SPECIALISE NOINLINE|SPECIALIZE NOINLINE|NOTINLINE CONLIKE|SPECIALISE INLINE|SPECIALIZE INLINE|NOINLINE CONLIKE|VECTORISE SCALAR|VECTORIZE SCALAR|OPTIONS_HADDOCK|INLINE CONLIKE|OPTIONS_DERIVE|OPTIONS_CATCH|OPTIONS_NHC98|OPTIONS_HUGS|OVERLAPPABLE|NOVECTORISE|NOVECTORIZE|OPTIONS_GHC|OPTIONS_JHC|OPTIONS_YHC|OVERLAPPING|DEPRECATED|INCOHERENT|INLINEABLE|SPECIALISE|SPECIALIZE|GENERATED|INLINABLE|NOTINLINE|VECTORISE|VECTORIZE|CONTRACT|LANGUAGE|NOINLINE|NOUNPACK|OVERLAPS|INCLUDE|MINIMAL|OPTIONS|WARNING|CFILES|INLINE|SOURCE|UNPACK|CTYPE|RULES|CORE|LINE|ANN|SCC))(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" } ] } ] }, - "string": { + "quasi_quotes": { "patterns": [ { - "name": "string.quoted.double.haskell", - "begin": "\"", - "end": "\"", + "contentName": "string.quoted.quasiquotes.haskell", + "begin": "(\\[)((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)(\\|)", + "end": "(\\|)(\\])", "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.haskell" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.haskell" - } - }, - "patterns": [ - { - "include": "#characters" + "1": { + "name": "punctuation.definition.quasiquotes.begin.haskell" }, - { - "begin": "\\\\\\s", - "end": "\\\\", - "beginCaptures": { - "0": { - "name": "markup.other.escape.newline.begin.haskell" - } - }, - "endCaptures": { - "0": { - "name": "markup.other.escape.newline.end.haskell" - } - }, + "2": { + "name": "entity.name.tag.haskell", "patterns": [ { - "include": "#invalid" + "include": "#module_name_prefix" } ] } - ] + }, + "endCaptures": { + "2": { + "name": "punctuation.definition.quasiquotes.end.haskell" + } + } } ] }, - "newline_escape": { - "patterns": [ - { - "name": "markup.other.escape.newline.haskell", - "match": "\\\\$" - } - ] - }, "quoted_character": { "patterns": [ { "name": "string.quoted.single.haskell", - "match": "(')((?:[\\ -\\[\\]-~]|\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&])|(?:\\\\o[0-7]+)|(?:\\\\x[0-9A-Fa-f]+)|(?:\\\\\\^[A-Z@\\[\\]\\\\^_])|(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))))(')", + "match": "(')((?:[\\ -\\[\\]-~]|\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\\u0026])|(?:\\\\o[0-7]+)|(?:\\\\x[0-9A-Fa-f]+)|(?:\\\\\\^[A-Z@\\[\\]\\\\^_])|(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))(')", "captures": { "1": { "name": "punctuation.definition.string.begin.haskell" }, "2": { @@ -977,14 +1100,77 @@ } } } ] }, + "record_field_declaration": { + "patterns": [ + { + "name": "meta.record-field.type-declaration.haskell", + "contentName": "meta.type-signature.haskell", + "begin": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:(?:((?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][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p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+\\)))(?:(?:\\s*,\\s*)(?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+\\))))*)\\s*((?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))))|})", + "patterns": [ + { + "include": "#type_signature" + } + ], + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#attribute_name" + }, + { + "include": "#infix_op" + } + ] + }, + "2": { + "name": "keyword.other.double-colon.haskell" + } + } + } + ] + }, + "regular_import": { + "patterns": [ + { + "name": "meta.import.haskell", + "begin": "^([ \\t]*)(import)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "end": "^(?!\\1[ \\t]|[ \\t]*$)", + "patterns": [ + { + "include": "#module_name" + }, + { + "include": "#module_exports" + }, + { + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(qualified|as|hiding)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "captures": { + "1": { + "name": "keyword.other.haskell" + } + } + }, + { + "include": "#comments" + } + ], + "beginCaptures": { + "2": { + "name": "keyword.other.haskell" + } + } + } + ] + }, "scoped_type": { "patterns": [ { - "match": "\\(((?<paren>(?:[^\\(\\)]|\\(\\g<paren>\\))*)(?<!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))(?<paren2>(?:[^\\(\\)]|\\(\\g<paren2>\\))*))\\)", + "match": "\\(((?\u003cparen\u003e(?:[^\\(\\)]|\\(\\g\u003cparen\u003e\\))*)(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?\u003cparen2\u003e(?:[^\\(\\)]|\\(\\g\u003cparen2\u003e\\))*))\\)", "captures": { "1": { "patterns": [ { "include": "#haskell_expr" @@ -992,11 +1178,11 @@ ] } } }, { - "match": "((?<!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))))(.*?)(?=(?<!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))(<-|=)(?!(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"'])))|$)", + "match": "((?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))(.*?)(?=(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(\u003c-|=)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))|$)", "captures": { "1": { "name": "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lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+\\)))(?:(?:\\s*,\\s*)(?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+\\))))*)\\s*((?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(?:::|∷)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))))))(.*)(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(\u003c-|=)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))", "captures": { "2": { "patterns": [ { "include": "#identifier" @@ -1046,60 +1232,107 @@ } } } ] }, - "comma": { + "shebang": { "patterns": [ { - "name": "punctuation.separator.comma.haskell", - "match": "," + "name": "comment.line.shebang.haskell", + "match": "^\\#\\!.*\\brunhaskell\\b.*$" } ] }, - "lit_num": { + "string": { "patterns": [ { - "name": "constant.numeric.hexadecimal.haskell", - "match": "0[xX][0-9a-fA-F]+" - }, - { - "name": "constant.numeric.octal.haskell", - "match": "0[oO][0-7]+" - }, - { - "name": "constant.numeric.float.haskell", - "match": "[0-9]+(\\.[0-9]+[eE][+-]?|\\.|[eE][+-]?)[0-9]+" - }, - { - "name": "constant.numeric.decimal.haskell", - "match": "[0-9]+" + "name": "string.quoted.double.haskell", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "include": "#characters" + }, + { + "begin": "\\\\\\s", + "end": "\\\\", + "patterns": [ + { + "include": "#invalid" + } + ], + "beginCaptures": { + "0": { + "name": "markup.other.escape.newline.begin.haskell" + } + }, + "endCaptures": { + "0": { + "name": "markup.other.escape.newline.end.haskell" + } + } + } + ], + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.haskell" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.haskell" + } + } } ] }, - "operator": { + "type_alias": { "patterns": [ { - "name": "keyword.operator.haskell", - "match": "(?:[\\p{S}\\p{P}](?<![(),;\\[\\]`{}_\"']))+" + "name": "meta.declaration.type.type.haskell", + "contentName": "meta.type-signature.haskell", + "begin": "^([ \\t]*)(type)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "end": "^(?!\\1[ \\t]|[ \\t]*$)", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#family_and_instance" + }, + { + "include": "#where" + }, + { + "include": "#assignment_op" + }, + { + "include": "#type_signature" + } + ], + "beginCaptures": { + "2": { + "name": "keyword.other.type.haskell" + } + } } ] }, - "identifier": { + "type_ctor": { "patterns": [ { - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "name": "identifier.haskell", + "name": "entity.name.tag.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", "captures": { "0": { "patterns": [ { "include": "#module_name_prefix" }, { - "name": "support.function.prelude.$1.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(abs|acos|acosh|all|and|any|appendFile|asTypeOf|asin|asinh|atan|atan2|atanh|break|ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldMap|foldl|foldl1|foldr|foldr1|fromEnum|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|head|id|init|interact|ioError|isDenormalized|isIEEE|isInfinite|isNaN|isNegativeZero|iterate|last|lcm|length|lex|lines|log|logBase|lookup|map|mapM|mapM_|mappend|max|maxBound|maximum|maybe|mconcat|mempty|min|minBound|minimum|mod|negate|not|notElem|null|odd|or|otherwise|pi|pred|print|product|properFraction|pure|putChar|putStr|putStrLn|quot|quotRem|read|readFile|readIO|readList|readLn|readParen|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequenceA|sequence_|show|showChar|showList|showParen|showString|shows|showsPrec|significand|signum|sin|sinh|snd|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|toEnum|toInteger|toRational|traverse|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + "name": "support.tag.prelude.$1.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(EQ|GT|LT|Left|Right|True|False)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" } ] } } } @@ -1107,272 +1340,140 @@ }, "type_name": { "patterns": [ { "name": "entity.name.type.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", "captures": { "0": { "patterns": [ { "include": "#module_name_prefix" }, { "name": "entity.other.inherited-class.prelude.$1.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(Applicative|Bounded|Enum|Eq|Floating|Foldable|Fractional|Functor|Integral|Monad|Monoid|Num|Ord|Read|Real|RealFloat|RealFrac|Show|Traversable)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(Applicative|Bounded|Enum|Eq|Floating|Foldable|Fractional|Functor|Integral|Monad|Monoid|Num|Ord|Read|Real|RealFloat|RealFrac|Show|Traversable)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" }, { "name": "support.class.prelude.$1.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(Either|FilePath|IO|IOError|Integer|Maybe|Ordering|Rational|ReadS|ShowS|String|Bool|Char|Double|Float|Int|Word)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(Either|FilePath|IO|IOError|Integer|Ordering|Rational|ReadS|ShowS|String|Bool|Char|Double|Float|Int|Just|Maybe|Nothing|Word)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" } ] } } } ] }, - "type_ctor": { + "type_signature": { "patterns": [ { - "name": "entity.name.tag.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "include": "#pragma" + }, + { + "include": "#comments" + }, + { + "name": "keyword.other.forall.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))forall(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + }, + { + "name": "constant.language.unit.promoted.haskell", + "match": "'(\\(\\))", "captures": { - "0": { + "1": { "patterns": [ { - "include": "#module_name_prefix" - }, - { - "name": "support.tag.prelude.$1.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(EQ|GT|Just|LT|Left|Nothing|Right|True|False)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" + "include": "#unit" } ] } } - } - ] - }, - "where": { - "patterns": [ + }, { - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))where(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "name": "keyword.other.haskell" - } - ] - }, - "family_and_instance": { - "patterns": [ + "include": "#unit" + }, { - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(family|instance)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", - "name": "keyword.other.haskell" - } - ] - }, - "invalid": { - "patterns": [ - { - "match": "\\S+", - "name": "invalid.illegal.character-not-allowed-here.haskell" - } - ] - }, - "function_name": { - "patterns": [ - { - "name": "entity.name.function.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" - } - ] - }, - "assignment_op": { - "patterns": [ - { - "match": "=", + "name": "constant.language.empty-list.promoted.haskell", + "match": "'(\\[\\])", "captures": { - "0": { - "name": "keyword.operator.assignment.haskell" + "1": { + "patterns": [ + { + "include": "#empty_list" + } + ] } } - } - ] - }, - "attribute_name": { - "patterns": [ - { - "name": "entity.other.attribute-name.haskell", - "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" - } - ] - }, - "liquidhaskell_annotation": { - "patterns": [ - { - "name": "block.liquidhaskell.haskell", - "contentName": "block.liquidhaskell.annotation.haskell", - "begin": "\\{-@(?!#)", - "end": "@-\\}", - "patterns": [ - { - "include": "annotation.liquidhaskell.haskell" - } - ] - } - ] - }, - "shebang": { - "patterns": [ - { - "name": "comment.line.shebang.haskell", - "match": "^\\#\\!.*\\brunhaskell\\b.*$" - } - ] - }, - "haskell_expr": { - "patterns": [ - { - "include": "#infix_function" }, { - "include": "#unit" - }, - { "include": "#empty_list" }, { - "include": "#quasi_quotes" - }, - { - "include": "#keywords" - }, - { - "include": "#pragma" - }, - { "include": "#string" }, { - "include": "#newline_escape" + "name": "keyword.other.arrow.haskell", + "match": "(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(-\u003e|→)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))" }, { - "include": "#quoted_character" + "name": "keyword.other.big-arrow.haskell", + "match": "(?\u003c!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))(=\u003e|⇒)(?!(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"'])))" }, { - "include": "#comments" + "name": "keyword.operator.promoted.haskell", + "match": "'((?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?(?:[\\p{S}\\p{P}](?\u003c![(),;\\[\\]`{}_\"']))+)", + "captures": { + "1": { + "patterns": [ + { + "include": "#operator" + } + ] + } + } }, { - "include": "#infix_op" - }, - { - "include": "#comma" - }, - { - "include": "#lit_num" - }, - { - "include": "#scoped_type" - }, - { "include": "#operator" }, { - "include": "#identifier" + "name": "variable.other.generic-type.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" }, { - "include": "#type_ctor" - } - ] - }, - "common_toplevel": { - "patterns": [ - { - "include": "#class_decl" + "name": "entity.name.type.promoted.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}'])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))'([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*)(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", + "captures": { + "1": { + "patterns": [ + { + "include": "#type_name" + } + ] + } + } }, { - "include": "#instance_decl" + "include": "#type_name" }, { - "include": "#deriving_instance_decl" - }, - { - "include": "#foreign_import" - }, - { - "include": "#regular_import" - }, - { - "include": "#data_decl" - }, - { - "include": "#type_alias" - }, - { - "include": "#c_preprocessor" + "include": "#lit_num" } ] }, - "function_type_declaration_with_scoped_type": { + "unit": { "patterns": [ { - "include": "#scoped_type_override" - }, - { - "include": "#function_type_declaration" + "name": "constant.language.unit.haskell", + "match": "\\(\\)" } ] }, - "haskell_toplevel": { + "where": { "patterns": [ { - "include": "#liquidhaskell_annotation" - }, - { - "include": "#common_toplevel" - }, - { - "include": "#function_type_declaration_with_scoped_type" - }, - { - "include": "#haskell_expr" + "name": "keyword.other.haskell", + "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?\u003c![\\p{Ll}_\\p{Lu}\\p{Lt}']))where(?:(?\u003c=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))" } ] - }, - "hsig_toplevel": { - "patterns": [ - { - "include": "#common_toplevel" - }, - { - "include": "#function_type_declaration" - }, - { - "include": "#lazy_function_type_signature" - }, - { - "include": "#comments" - } - ] - }, - "haskell_source": { - "patterns": [ - { - "include": "#shebang" - }, - { - "include": "#module_decl" - }, - { - "include": "#haskell_toplevel" - } - ] - }, - "hsig_source": { - "patterns": [ - { - "include": "#hsig_decl" - }, - { - "include": "#hsig_toplevel" - } - ] } } -} \ No newline at end of file +}