{ "fileTypes": [ "lhs" ], "name": "Literate Haskell", "scopeName": "text.tex.latex.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": "(?:\\\\x[0-9A-Fa-f]+)", "controlChar": "(?:\\^[A-Z@\\[\\]\\\\\\^_])", "character": "(?:[\\ -\\[\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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*)+)))*)?))", "typeDeclOne": "(?:(?!(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?(?:(?:(?!(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) ([ \\t]*)", "indentBlockEnd": "^(?!(?:>|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "maybeBirdTrack": "^(?:>|<) ", "lb": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<] )", "end": "^(?![><] )", "name": "meta.embedded.haskell", "patterns": [ { "include": "#haskell_source" }, { "match": "^> ", "name": "punctuation.definition.bird-track.haskell" } ] }, { "match": "(?|<) [ \\t]+)?(?=--+\\s+[|^])", "end": "(?!\\G)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.haskell" } }, "patterns": [ { "name": "comment.line.double-dash.haddock.haskell", "begin": "(--+)\\s+([|^])", "end": "\\n", "beginCaptures": { "1": { "name": "punctuation.definition.comment.haskell" }, "2": { "name": "punctuation.definition.comment.haddock.haskell" } } } ] }, { "begin": "(^(?:>|<) [ \\t]+)?(?=--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]))", "end": "(?!\\G)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.haskell" } }, "patterns": [ { "name": "comment.line.double-dash.haskell", "begin": "--", "end": "\\n", "beginCaptures": { "0": { "name": "punctuation.definition.comment.haskell" } } } ] }, { "include": "#block_comment" } ] }, "characters": { "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" }, { "match": "(?:\\\\o[0-7]+)", "name": "constant.character.escape.octal.haskell" }, { "match": "(?:\\\\x[0-9A-Fa-f]+)", "name": "constant.character.escape.hexadecimal.haskell" }, { "match": "(?:\\^[A-Z@\\[\\]\\\\\\^_])", "name": "constant.character.escape.control.haskell" } ] }, "infix_op": { "patterns": [ { "name": "entity.name.function.infix.haskell", "match": "(?:\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]+\\))" } ] }, "module_exports": { "patterns": [ { "name": "meta.declaration.exports.haskell", "begin": "\\(", "end": "\\)", "patterns": [ { "include": "#comments" }, { "include": "#function_name" }, { "include": "#type_name" }, { "include": "#comma" }, { "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": "\\)", "patterns": [ { "include": "#type_ctor" }, { "include": "#attribute_name" }, { "include": "#comma" }, { "match": "\\.\\.", "name": "keyword.operator.wildcard.haskell" } ] }, { "include": "#infix_op" } ] } ] }, "module_name": { "patterns": [ { "name": "support.other.module.haskell", "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) ([ \\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*((?|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "contentName": "meta.type-signature.haskell", "beginCaptures": { "2": { "patterns": [ { "include": "#function_name" }, { "include": "#infix_op" } ] }, "3": { "name": "keyword.other.double-colon.haskell" } }, "patterns": [ { "include": "#type_signature" } ] } ] }, "ctor_type_declaration": { "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*((?|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "contentName": "meta.type-signature.haskell", "beginCaptures": { "2": { "patterns": [ { "include": "#type_ctor" }, { "include": "#infix_op" } ] }, "3": { "name": "keyword.other.double-colon.haskell" } }, "patterns": [ { "include": "#type_signature" } ] } ] }, "record_field_declaration": { "patterns": [ { "name": "meta.record-field.type-declaration.haskell", "begin": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|→)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]])" }, { "name": "keyword.other.big-arrow.haskell", "match": "(?|⇒)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]])" }, { "include": "#operator" }, { "name": "variable.other.generic-type.haskell", "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) ([ \\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}])(?|<) \\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": { "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}])(?|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "beginCaptures": { "2": { "name": "storage.type.class.haskell" } }, "endCaptures": { "1": { "name": "keyword.other.haskell" } }, "patterns": [ { "include": "#type_signature" } ] } ] }, "instance_decl": { "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}])(?|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "contentName": "meta.type-signature.haskell", "beginCaptures": { "2": { "name": "keyword.other.haskell" } }, "endCaptures": { "1": { "name": "keyword.other.haskell" } }, "patterns": [ { "include": "#pragma" }, { "include": "#type_signature" } ] } ] }, "deriving_instance_decl": { "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" } }, "patterns": [ { "include": "#pragma" }, { "include": "#type_signature" } ] } ] }, "foreign_import": { "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" } }, "patterns": [ { "match": "(?:un)?safe", "captures": { "0": { "name": "keyword.other.haskell" } } }, { "include": "#function_type_declaration" }, { "include": "#haskell_expr" } ] } ] }, "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}])(?|<) ([ \\t]*)(data|newtype)\\s+((?:(?!=|where).)*)", "end": "^(?!(?:>|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "beginCaptures": { "2": { "name": "storage.type.data.haskell" }, "3": { "name": "meta.type-signature.haskell", "patterns": [ { "include": "#family_and_instance" }, { "include": "#type_signature" } ] } }, "patterns": [ { "include": "#comments" }, { "include": "#where" }, { "include": "#deriving" }, { "include": "#assignment_op" }, { "match": "(?:(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|=>)+\\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" } ] } } }, { "match": "\\|", "captures": { "0": { "name": "punctuation.separator.pipe.haskell" } } }, { "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" } }, "patterns": [ { "include": "#comments" }, { "include": "#comma" }, { "include": "#record_field_declaration" } ] }, { "include": "#ctor_type_declaration" } ] } ] }, "type_alias": { "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]*$)|^(?!(?:>|<) )", "contentName": "meta.type-signature.haskell", "beginCaptures": { "2": { "name": "storage.type.data.haskell" } }, "patterns": [ { "include": "#comments" }, { "include": "#family_and_instance" }, { "include": "#where" }, { "include": "#assignment_op" }, { "include": "#type_signature" } ] } ] }, "keywords": { "patterns": [ { "name": "keyword.other.haskell", "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) (?=#)", "end": "(?(?:[^\\(\\)]|\\(\\g\\))*)(?(?:[^\\(\\)]|\\(\\g\\))*))\\)", "captures": { "1": { "patterns": [ { "include": "#haskell_expr" } ] } } }, { "match": "((?|<) ([ \\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*((?