{ "displayName": "OCaml", "fileTypes": [ ".ml", ".mli" ], "name": "ocaml", "patterns": [ { "include": "#comment" }, { "include": "#pragma" }, { "include": "#decl" } ], "repository": { "attribute": { "begin": "(\\[)\\s*((?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*)" }, "attributePayload": { "patterns": [ { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^)%)(?![-!#-\\&*+./:<-@^|~])", "end": "((?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*\\s*,|[^%\\s[:lower:]])|(?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*|(?=\\btype\\b)", "endCaptures": { "0": { "name": "entity.name.function strong emphasis" } }, "patterns": [ { "include": "#attributeIdentifier" } ] }, { "begin": "\\[", "captures": { "0": { "name": "punctuation.definition.tag" } }, "end": "]", "patterns": [ { "include": "#type" } ] }, { "include": "#bindTermArgs" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^):)(?![-!#-\\&*+./:<-@^|~])", "end": "(?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*\\s*,|[^%\\s[:lower:]])|(?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*|(?=\\btype\\b)", "endCaptures": { "0": { "name": "entity.name.function strong emphasis" } }, "patterns": [ { "include": "#attributeIdentifier" } ] }, { "begin": "\\[", "captures": { "0": { "name": "punctuation.definition.tag" } }, "end": "]", "patterns": [ { "include": "#type" } ] }, { "include": "#bindTermArgs" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^):)(?![-!#-\\&*+./:<-@^|~])", "end": "(?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*\\s*,|[^%\\s[:lower:]])|\\b(rec)\\b|((?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*)", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, "2": { "name": "entity.name.function strong emphasis" } }, "patterns": [ { "include": "#attributeIdentifier" }, { "include": "#comment" } ] }, { "begin": "(?<=(?:\\P{word}|^)rec)(?!\\p{word})", "end": "((?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*)|(?=[^\\s[:alpha:]])", "endCaptures": { "0": { "name": "entity.name.function strong emphasis" } }, "patterns": [ { "include": "#bindTermArgs" } ] }, { "include": "#bindTermArgs" } ] }, { "begin": "(?<=(?:\\P{word}|^)module)(?!\\p{word})", "end": "(?=;;|[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "patterns": [ { "include": "#declModule" } ] }, { "begin": "(?<=(?:\\P{word}|^)open)(?!\\p{word})", "end": "(?=\\bin\\b)|(?=[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "patterns": [ { "include": "#pathModuleSimple" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^):)(?![-!#-\\&*+./:<-@^|~])", "end": "(?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*|(?<=\\))", "endCaptures": { "0": { "name": "markup.inserted constant.language support.constant.property-value entity.name.filename" } }, "patterns": [ { "include": "#comment" }, { "begin": "\\((?!\\*)", "captures": { "0": { "name": "punctuation.definition.tag" } }, "end": "\\)", "patterns": [ { "begin": "(?<=\\()", "end": "[:=]", "endCaptures": { "0": { "name": "keyword" } }, "patterns": [ { "match": "(?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "name": "markup.inserted constant.language support.constant.property-value entity.name.filename" } ] }, { "begin": "(?<=:)", "end": "=|(?=\\))", "endCaptures": { "0": { "name": "keyword" } }, "patterns": [ { "include": "#type" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^)=)(?![-!#-\\&*+./:<-@^|~])", "end": "(?=\\))", "patterns": [ { "include": "#term" } ] } ] } ] } ] }, { "include": "#pattern" } ] }, "bindType": { "patterns": [ { "begin": "(?<=(?:\\P{word}|^)(?:and|type))(?!\\p{word})", "end": "(?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "name": "entity.name.function strong" }, { "include": "#type" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]\\+|^\\+|[^-!#-\\&*+./:<-@^|~]|^)=)(?![-!#-\\&*+./:<-@^|~])", "end": "\\band\\b|(?=;;|[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "endCaptures": { "0": { "name": "variable.other.class.js message.error variable.interpolation string.regexp markup.underline" } }, "patterns": [ { "include": "#bindConstructor" } ] } ] }, "comment": { "patterns": [ { "include": "#attribute" }, { "include": "#extension" }, { "include": "#commentBlock" }, { "include": "#commentDoc" } ] }, "commentBlock": { "begin": "\\(\\*(?!\\*[^)])", "contentName": "emphasis", "end": "\\*\\)", "name": "comment constant.regexp meta.separator.markdown", "patterns": [ { "include": "#commentBlock" }, { "include": "#commentDoc" } ] }, "commentDoc": { "begin": "\\(\\*\\*", "end": "\\*\\)", "name": "comment constant.regexp meta.separator.markdown", "patterns": [ { "match": "\\*" }, { "include": "#comment" } ] }, "decl": { "patterns": [ { "include": "#declClass" }, { "include": "#declException" }, { "include": "#declInclude" }, { "include": "#declModule" }, { "include": "#declOpen" }, { "include": "#declTerm" }, { "include": "#declType" } ] }, "declClass": { "begin": "\\bclass\\b", "beginCaptures": { "0": { "name": "entity.name.class constant.numeric markup.underline" } }, "end": ";;|(?=[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "endCaptures": { "0": { "name": "punctuation.definition.tag" } }, "patterns": [ { "include": "#comment" }, { "include": "#pragma" }, { "begin": "(?<=(?:\\P{word}|^)class)(?!\\p{word})", "beginCaptures": { "0": { "name": "entity.name.class constant.numeric markup.underline" } }, "end": "\\btype\\b|(?=[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|val)\\b)", "endCaptures": { "0": { "name": "keyword" } }, "patterns": [ { "include": "#bindClassTerm" } ] }, { "begin": "(?<=(?:\\P{word}|^)type)(?!\\p{word})", "end": "(?=;;|[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "patterns": [ { "include": "#bindClassType" } ] } ] }, "declException": { "begin": "\\bexception\\b", "beginCaptures": { "0": { "name": "keyword markup.underline" } }, "end": ";;|(?=[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "endCaptures": { "0": { "name": "punctuation.definition.tag" } }, "patterns": [ { "include": "#attributeIdentifier" }, { "include": "#comment" }, { "include": "#pragma" }, { "include": "#bindConstructor" } ] }, "declInclude": { "begin": "\\binclude\\b", "beginCaptures": { "0": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "end": ";;|(?=[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "endCaptures": { "0": { "name": "punctuation.definition.tag" } }, "patterns": [ { "include": "#attributeIdentifier" }, { "include": "#comment" }, { "include": "#pragma" }, { "include": "#signature" } ] }, "declModule": { "begin": "(?<=(?:\\P{word}|^)module)(?!\\p{word})|\\bmodule\\b", "beginCaptures": { "0": { "name": "markup.inserted constant.language support.constant.property-value entity.name.filename markup.underline" } }, "end": ";;|(?=[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "endCaptures": { "0": { "name": "punctuation.definition.tag" } }, "patterns": [ { "include": "#comment" }, { "include": "#pragma" }, { "begin": "(?<=(?:\\P{word}|^)module)(?!\\p{word})", "end": "\\b(type)\\b|(?=\\p{upper})", "endCaptures": { "0": { "name": "keyword" } }, "patterns": [ { "include": "#attributeIdentifier" }, { "include": "#comment" }, { "match": "\\brec\\b", "name": "variable.other.class.js message.error variable.interpolation string.regexp" } ] }, { "begin": "(?<=(?:\\P{word}|^)type)(?!\\p{word})", "end": "(?=;;|[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "patterns": [ { "include": "#bindSignature" } ] }, { "begin": "(?=\\p{upper})", "end": "(?=;;|[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "patterns": [ { "include": "#bindStructure" } ] } ] }, "declOpen": { "begin": "\\bopen\\b", "beginCaptures": { "0": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "end": ";;|(?=[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "endCaptures": { "0": { "name": "punctuation.definition.tag" } }, "patterns": [ { "include": "#attributeIdentifier" }, { "include": "#comment" }, { "include": "#pragma" }, { "include": "#pathModuleExtended" } ] }, "declTerm": { "begin": "\\b(?:(external|val)|(method)|(let))\\b(!?)", "beginCaptures": { "1": { "name": "support.type markup.underline" }, "2": { "name": "storage.type markup.underline" }, "3": { "name": "keyword.control markup.underline" }, "4": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "end": ";;|(?=[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "endCaptures": { "0": { "name": "punctuation.definition.tag" } }, "patterns": [ { "include": "#comment" }, { "include": "#pragma" }, { "include": "#bindTerm" } ] }, "declType": { "begin": "(?<=(?:\\P{word}|^)type)(?!\\p{word})|\\btype\\b", "beginCaptures": { "0": { "name": "keyword markup.underline" } }, "end": ";;|(?=[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "endCaptures": { "0": { "name": "punctuation.definition.tag" } }, "patterns": [ { "include": "#comment" }, { "include": "#pragma" }, { "include": "#bindType" } ] }, "extension": { "begin": "(\\[)((?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "name": "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis" } ] }, { "begin": "(?<=(?:\\P{word}|^)with)(?!\\p{word})", "end": "(:)|(=)|(;)|(?=})", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp strong" }, "2": { "name": "support.type strong" }, "3": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "patterns": [ { "match": "(?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "name": "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^):)(?![-!#-\\&*+./:<-@^|~])", "end": "(;)|(=)|(?=})", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, "2": { "name": "support.type strong" } }, "patterns": [ { "include": "#type" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^)=)(?![-!#-\\&*+./:<-@^|~])", "end": ";|(?=})", "endCaptures": { "0": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "patterns": [ { "include": "#term" } ] } ] }, "literalString": { "patterns": [ { "begin": "\"", "end": "\"", "name": "string beginning.punctuation.definition.quote.markdown", "patterns": [ { "include": "#literalStringEscape" } ] }, { "begin": "(\\{)([_[:lower:]]*?)(\\|)", "end": "(\\|)(\\2)(})", "name": "string beginning.punctuation.definition.quote.markdown", "patterns": [ { "include": "#literalStringEscape" } ] } ] }, "literalStringEscape": { "match": "\\\\(?:[\"\\\\bnrt]|\\d\\d\\d|x\\h\\h|o[0-3][0-7][0-7])" }, "literalUnit": { "match": "\\(\\)", "name": "constant.language constant.numeric entity.other.attribute-name.id.css strong" }, "pathModuleExtended": { "patterns": [ { "include": "#pathModulePrefixExtended" }, { "match": "\\b(?=\\p{upper})[_[:alpha:]]['[:word:]]*", "name": "entity.name.class constant.numeric" } ] }, "pathModulePrefixExtended": { "begin": "\\b(?=\\p{upper})[_[:alpha:]]['[:word:]]*(?=\\s*\\.|$|\\()", "beginCaptures": { "0": { "name": "entity.name.class constant.numeric" } }, "end": "(?![.\\s]|$|\\()", "patterns": [ { "include": "#comment" }, { "begin": "\\(", "captures": { "0": { "name": "keyword.control" } }, "end": "\\)", "patterns": [ { "match": "\\b((?=\\p{upper})[_[:alpha:]]['[:word:]]*(?=\\s*\\)))", "name": "string.other.link variable.language variable.parameter emphasis" }, { "include": "#structure" } ] }, { "begin": "(?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "end": "(?=[^.\\s])(?!\\(\\*)", "patterns": [ { "include": "#comment" }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^)\\.)(?![-!#-\\&*+./:<-@^|~])|(?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|mutable|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*)|(?<=\\))|(?<=])", "endCaptures": { "1": { "name": "keyword strong" }, "2": { "name": "markup.inserted constant.language support.constant.property-value entity.name.filename" } }, "patterns": [ { "include": "#comment" }, { "include": "#pathModulePrefixSimple" }, { "begin": "\\((?!\\*)", "captures": { "0": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "end": "\\)", "patterns": [ { "include": "#term" } ] }, { "begin": "\\[", "captures": { "0": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "end": "]", "patterns": [ { "include": "#pattern" } ] } ] } ] } ] }, "pattern": { "patterns": [ { "include": "#comment" }, { "include": "#patternArray" }, { "include": "#patternLazy" }, { "include": "#patternList" }, { "include": "#patternMisc" }, { "include": "#patternModule" }, { "include": "#patternRecord" }, { "include": "#literal" }, { "include": "#patternParens" }, { "include": "#patternType" }, { "include": "#variablePattern" }, { "include": "#termOperator" } ] }, "patternArray": { "begin": "\\[\\|", "captures": { "0": { "name": "constant.language constant.numeric entity.other.attribute-name.id.css strong" } }, "end": "\\|]", "patterns": [ { "include": "#pattern" } ] }, "patternLazy": { "match": "lazy", "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, "patternList": { "begin": "\\[", "captures": { "0": { "name": "constant.language constant.numeric entity.other.attribute-name.id.css strong" } }, "end": "]", "patterns": [ { "include": "#pattern" } ] }, "patternMisc": { "captures": { "1": { "name": "string.regexp strong" }, "2": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, "3": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "match": "((?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "name": "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis" } ] }, { "begin": "(?<=(?:\\P{word}|^)with)(?!\\p{word})", "end": "(:)|(=)|(;)|(?=})", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp strong" }, "2": { "name": "support.type strong" }, "3": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "patterns": [ { "match": "(?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "name": "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^):)(?![-!#-\\&*+./:<-@^|~])", "end": "(;)|(=)|(?=})", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, "2": { "name": "support.type strong" } }, "patterns": [ { "include": "#type" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^)=)(?![-!#-\\&*+./:<-@^|~])", "end": ";|(?=})", "endCaptures": { "0": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "patterns": [ { "include": "#pattern" } ] } ] }, "patternType": { "begin": "\\btype\\b", "beginCaptures": { "0": { "name": "keyword" } }, "end": "(?=\\))", "patterns": [ { "include": "#declType" } ] }, "pragma": { "begin": "(?(?![-!#-\\&*+./:<-@^|~]))", "endCaptures": { "1": { "name": "punctuation.definition.tag" }, "2": { "name": "support.type strong" } } }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^)->)(?![-!#-\\&*+./:<-@^|~])", "end": "(?=;;|[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "patterns": [ { "include": "#signature" } ] } ] }, { "match": "(?(?![-!#-\\&*+./:<-@^|~])", "name": "support.type strong" } ] }, "signatureLiteral": { "begin": "\\bsig\\b", "captures": { "0": { "name": "punctuation.definition.tag emphasis" } }, "end": "\\bend\\b", "patterns": [ { "include": "#comment" }, { "include": "#pragma" }, { "include": "#decl" } ] }, "signatureParens": { "begin": "\\((?!\\))", "captures": { "0": { "name": "punctuation.definition.tag" } }, "end": "\\)", "patterns": [ { "include": "#comment" }, { "begin": "(?|^->)(?![-!#-\\&*+./:<-@^|~])|(?<=(?:\\P{word}|^)(?:include|open))(?!\\p{word})", "end": "\\bmodule\\b|(?!$|\\s|\\bmodule\\b)", "endCaptures": { "0": { "name": "markup.inserted constant.language support.constant.property-value entity.name.filename" } } }, { "begin": "(?<=(?:\\P{word}|^)module)(?!\\p{word})", "end": "(?=;;|[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "patterns": [ { "begin": "(?<=(?:\\P{word}|^)module)(?!\\p{word})", "end": "\\btype\\b", "endCaptures": { "0": { "name": "keyword" } } }, { "begin": "(?<=(?:\\P{word}|^)type)(?!\\p{word})", "end": "\\bof\\b", "endCaptures": { "0": { "name": "punctuation.definition.tag" } } }, { "begin": "(?<=(?:\\P{word}|^)of)(?!\\p{word})", "end": "(?=;;|[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "patterns": [ { "include": "#signature" } ] } ] } ] }, "structure": { "patterns": [ { "include": "#comment" }, { "include": "#structureLiteral" }, { "include": "#structureFunctor" }, { "include": "#pathModuleExtended" }, { "include": "#structureParens" } ] }, "structureFunctor": { "patterns": [ { "begin": "\\bfunctor\\b", "beginCaptures": { "0": { "name": "keyword" } }, "end": "(?=;;|[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "patterns": [ { "begin": "(?<=(?:\\P{word}|^)functor)(?!\\p{word})", "end": "(\\(\\))|(\\((?!\\)))", "endCaptures": { "1": { "name": "constant.language constant.numeric entity.other.attribute-name.id.css strong" }, "2": { "name": "punctuation.definition.tag" } } }, { "begin": "(?<=\\()", "end": "(:)|(\\))", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp strong" }, "2": { "name": "punctuation.definition.tag" } }, "patterns": [ { "include": "#variableModule" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^):)(?![-!#-\\&*+./:<-@^|~])", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.tag" } }, "patterns": [ { "include": "#signature" } ] }, { "begin": "(?<=\\))", "end": "(\\()|((?(?![-!#-\\&*+./:<-@^|~]))", "endCaptures": { "1": { "name": "punctuation.definition.tag" }, "2": { "name": "support.type strong" } } }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^)->)(?![-!#-\\&*+./:<-@^|~])", "end": "(?=;;|[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "patterns": [ { "include": "#structure" } ] } ] }, { "match": "(?(?![-!#-\\&*+./:<-@^|~])", "name": "support.type strong" } ] }, "structureLiteral": { "begin": "\\bstruct\\b", "captures": { "0": { "name": "punctuation.definition.tag emphasis" } }, "end": "\\bend\\b", "patterns": [ { "include": "#comment" }, { "include": "#pragma" }, { "include": "#decl" } ] }, "structureParens": { "begin": "\\(", "captures": { "0": { "name": "punctuation.definition.tag" } }, "end": "\\)", "patterns": [ { "include": "#structureUnpack" }, { "include": "#structure" } ] }, "structureUnpack": { "begin": "\\bval\\b", "beginCaptures": { "0": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "end": "(?=\\))" }, "term": { "patterns": [ { "include": "#termLet" }, { "include": "#termAtomic" } ] }, "termAtomic": { "patterns": [ { "include": "#comment" }, { "include": "#termConditional" }, { "include": "#termConstructor" }, { "include": "#termDelim" }, { "include": "#termFor" }, { "include": "#termFunction" }, { "include": "#literal" }, { "include": "#termMatch" }, { "include": "#termMatchRule" }, { "include": "#termPun" }, { "include": "#termOperator" }, { "include": "#termTry" }, { "include": "#termWhile" }, { "include": "#pathRecord" } ] }, "termConditional": { "match": "\\b(?:if|then|else)\\b", "name": "keyword.control" }, "termConstructor": { "patterns": [ { "include": "#pathModulePrefixSimple" }, { "match": "\\b(?=\\p{upper})[_[:alpha:]]['[:word:]]*", "name": "constant.language constant.numeric entity.other.attribute-name.id.css strong" } ] }, "termDelim": { "patterns": [ { "begin": "\\((?!\\))", "captures": { "0": { "name": "punctuation.definition.tag" } }, "end": "\\)", "patterns": [ { "include": "#term" } ] }, { "begin": "\\bbegin\\b", "captures": { "0": { "name": "punctuation.definition.tag" } }, "end": "\\bend\\b", "patterns": [ { "include": "#attributeIdentifier" }, { "include": "#term" } ] } ] }, "termFor": { "patterns": [ { "begin": "\\bfor\\b", "beginCaptures": { "0": { "name": "keyword.control" } }, "end": "\\bdone\\b", "endCaptures": { "0": { "name": "keyword.control" } }, "patterns": [ { "begin": "(?<=(?:\\P{word}|^)for)(?!\\p{word})", "end": "(?|^->)(?![-!#-\\&*+./:<-@^|~])|(?<=[(;]))(?=\\s|\\blet\\b)|(?<=(?:\\P{word}|^)(?:begin|do|else|in|struct|then|try))(?!\\p{word})|(?<=(?:[^-!#-\\&*+./:<-@^|~]|^)@@)(?![-!#-\\&*+./:<-@^|~])\\s+", "end": "\\b(?:(and)|(let))\\b|(?=\\S)(?!\\(\\*)", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp markup.underline" }, "2": { "name": "storage.type markup.underline" } }, "patterns": [ { "include": "#comment" } ] }, { "begin": "(?<=(?:\\P{word}|^)(?:and|let))(?!\\p{word})|(let)", "beginCaptures": { "1": { "name": "storage.type markup.underline" } }, "end": "\\b(?:(and)|(in))\\b|(?=[])}]|\\b(?:end|class|exception|external|include|inherit|initializer|let|method|module|open|type|val)\\b)", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp markup.underline" }, "2": { "name": "storage.type markup.underline" } }, "patterns": [ { "include": "#bindTerm" } ] } ] }, "termMatch": { "begin": "\\bmatch\\b", "captures": { "0": { "name": "keyword.control" } }, "end": "\\bwith\\b", "patterns": [ { "include": "#term" } ] }, "termMatchRule": { "patterns": [ { "begin": "(?<=(?:\\P{word}|^)(?:fun|function|with))(?!\\p{word})", "end": "(?)(?![-!#-\\&*+./:<-@^|~])", "endCaptures": { "1": { "name": "support.type strong" }, "2": { "name": "support.type strong" } }, "patterns": [ { "include": "#comment" }, { "include": "#attributeIdentifier" }, { "include": "#pattern" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@\\[^|~]|^)\\|)(?![-!#-\\&*+./:<-@^|~])|(?)(?![-!#-\\&*+./:<-@^|~])", "endCaptures": { "1": { "name": "support.type strong" }, "2": { "name": "support.type strong" } }, "patterns": [ { "include": "#pattern" }, { "begin": "\\bwhen\\b", "beginCaptures": { "0": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "end": "(?=(?(?![-!#-\\&*+./:<-@^|~]))", "patterns": [ { "include": "#term" } ] } ] } ] }, "termOperator": { "patterns": [ { "begin": "(?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "endCaptures": { "0": { "name": "entity.name.function" } } }, { "captures": { "0": { "name": "keyword.control strong" } }, "match": "<-" }, { "captures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, "2": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "match": "(,|[-!#-\\&*+./:<-@^|~]+)|(;)" }, { "match": "\\b(?:and|assert|asr|land|lazy|lsr|lxor|mod|new|or)\\b", "name": "variable.other.class.js message.error variable.interpolation string.regexp" } ] }, "termPun": { "applyEndPatternLast": true, "begin": "(?]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "endCaptures": { "0": { "name": "markup.inserted constant.language support.constant.property-value entity.name.filename" } } } ] }, "termTry": { "begin": "\\btry\\b", "captures": { "0": { "name": "keyword.control" } }, "end": "\\bwith\\b", "patterns": [ { "include": "#term" } ] }, "termWhile": { "patterns": [ { "begin": "\\bwhile\\b", "beginCaptures": { "0": { "name": "keyword.control" } }, "end": "\\bdone\\b", "endCaptures": { "0": { "name": "keyword.control" } }, "patterns": [ { "begin": "(?<=(?:\\P{word}|^)while)(?!\\p{word})", "end": "\\bdo\\b", "endCaptures": { "0": { "name": "keyword.control" } }, "patterns": [ { "include": "#term" } ] }, { "begin": "(?<=(?:\\P{word}|^)do)(?!\\p{word})", "end": "(?=\\bdone\\b)", "patterns": [ { "include": "#term" } ] } ] } ] }, "type": { "patterns": [ { "include": "#comment" }, { "match": "\\bnonrec\\b", "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, { "include": "#pathModulePrefixExtended" }, { "include": "#typeLabel" }, { "include": "#typeObject" }, { "include": "#typeOperator" }, { "include": "#typeParens" }, { "include": "#typePolymorphicVariant" }, { "include": "#typeRecord" }, { "include": "#typeConstructor" } ] }, "typeConstructor": { "patterns": [ { "begin": "(_)|((?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*)|(')((?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*)|(?<=[^*]\\)|])", "beginCaptures": { "1": { "name": "comment constant.regexp meta.separator.markdown" }, "3": { "name": "string.other.link variable.language variable.parameter emphasis strong emphasis" }, "4": { "name": "keyword.control emphasis" } }, "end": "(?=\\((?!\\*)|[])-.:;=>\\[{|}])|((?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*)[:aceps]*(?!\\(\\*|\\p{word})|(?=;;|[])}]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)", "endCaptures": { "1": { "name": "entity.name.function strong" } }, "patterns": [ { "include": "#comment" }, { "include": "#pathModulePrefixExtended" } ] } ] }, "typeLabel": { "patterns": [ { "begin": "(\\??)((?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*)\\s*((?(?![-!#-\\&*+./:<-@^|~]))", "patterns": [ { "include": "#type" } ] } ] }, "typeModule": { "begin": "\\bmodule\\b", "beginCaptures": { "0": { "name": "markup.inserted constant.language support.constant.property-value entity.name.filename" } }, "end": "(?=\\))", "patterns": [ { "include": "#pathModuleExtended" }, { "include": "#signatureConstraints" } ] }, "typeObject": { "begin": "<", "captures": { "0": { "name": "constant.language constant.numeric entity.other.attribute-name.id.css strong strong" } }, "end": ">", "patterns": [ { "begin": "(?<=[;<])", "end": "(:)|(?=>)", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp strong" }, "3": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, "4": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "patterns": [ { "include": "#comment" }, { "include": "#pathModulePrefixSimple" }, { "match": "(?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "name": "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^):)(?![-!#-\\&*+./:<-@^|~])", "end": "(;)|(?=>)", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, "2": { "name": "support.type strong" } }, "patterns": [ { "include": "#type" } ] } ] }, "typeOperator": { "patterns": [ { "match": "[,;]|[-!#-\\&*+./:<-@^|~]+", "name": "variable.other.class.js message.error variable.interpolation string.regexp strong" } ] }, "typeParens": { "begin": "\\(", "captures": { "0": { "name": "punctuation.definition.tag" } }, "end": "\\)", "patterns": [ { "match": ",", "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, { "include": "#typeModule" }, { "include": "#type" } ] }, "typePolymorphicVariant": { "begin": "\\[", "end": "]", "patterns": [ ] }, "typeRecord": { "begin": "\\{", "captures": { "0": { "name": "constant.language constant.numeric entity.other.attribute-name.id.css strong strong" } }, "end": "}", "patterns": [ { "begin": "(?<=[;{])", "end": "(:)|(=)|(;)|(with)|(?=})", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp strong" }, "2": { "name": "support.type strong" }, "3": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, "4": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "patterns": [ { "include": "#comment" }, { "include": "#pathModulePrefixSimple" }, { "match": "(?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "name": "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis" } ] }, { "begin": "(?<=(?:\\P{word}|^)with)(?!\\p{word})", "end": "(:)|(=)|(;)|(?=})", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp strong" }, "2": { "name": "support.type strong" }, "3": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "patterns": [ { "match": "(?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*", "name": "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^):)(?![-!#-\\&*+./:<-@^|~])", "end": "(;)|(=)|(?=})", "endCaptures": { "1": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" }, "2": { "name": "support.type strong" } }, "patterns": [ { "include": "#type" } ] }, { "begin": "(?<=(?:[^-!#-\\&*+./:<-@^|~]|^)=)(?![-!#-\\&*+./:<-@^|~])", "end": ";|(?=})", "endCaptures": { "0": { "name": "variable.other.class.js message.error variable.interpolation string.regexp" } }, "patterns": [ { "include": "#type" } ] } ] }, "variableModule": { "captures": { "0": { "name": "string.other.link variable.language variable.parameter emphasis" } }, "match": "\\b(?=\\p{upper})[_[:alpha:]]['[:word:]]*" }, "variablePattern": { "captures": { "1": { "name": "comment constant.regexp meta.separator.markdown" }, "2": { "name": "string.other.link variable.language variable.parameter emphasis" } }, "match": "\\b(_)\\b|((?!\\b(?:and|'|asr??|assert|\\*|begin|class|[,:@]|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|[->]|if|in|include|inherit|initializer|land|lazy|[(<\\[{]|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|[%+]|private|[\"?]|rec|[]);\\\\}]|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[_[:lower:]])[_[:alpha:]]['[:word:]]*)" } }, "scopeName": "source.ocaml" }