{ "fileTypes": [ "dm", "dme" ], "foldingStartMarker": "(?x)\n/\\*\\*(?!\\*)\n|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))", "foldingStopMarker": "(?|<)(=)?|\\.|:|/(=)?|~|\\+(\\+|=)?|-(-|=)?|\\*(\\*|=)?|%|>>|<<|=(=)?|!(=)?|<>|&|&&|\\^|\\||\\|\\||\\bto\\b|\\bin\\b|\\bstep\\b)", "name": "keyword.operator.dm" }, { "match": "\\b([A-Z_][A-Z_0-9]*)\\b", "name": "constant.language.dm" }, { "match": "\\bnull\\b", "name": "constant.language.dm" }, { "begin": "{\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.dm" } }, "end": "\"}", "endCaptures": { "0": { "name": "punctuation.definition.string.end.dm" } }, "name": "string.quoted.triple.dm", "patterns": [ { "include": "#string_escaped_char" }, { "include": "#string_embedded_expression" } ] }, { "begin": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.dm" } }, "end": "\"", "endCaptures": { "0": { "name": "punctuation.definition.string.end.dm" } }, "name": "string.quoted.double.dm", "patterns": [ { "include": "#string_escaped_char" }, { "include": "#string_embedded_expression" } ] }, { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.dm" } }, "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.dm" } }, "name": "string.quoted.single.dm", "patterns": [ { "include": "#string_escaped_char" } ] }, { "begin": "(?x)\n^\\s* ((\\#)\\s*define) \\s+ # define\n((?[a-zA-Z_][a-zA-Z0-9_]*)) # macro name\n(?:\n\t(\\()\n\t\t(\n\t\t\t\\s* \\g \\s* # first argument\n\t\t\t((,) \\s* \\g \\s*)* # additional arguments\n\t\t\t(?:\\.\\.\\.)? # varargs ellipsis?\n\t\t)\n\t(\\))\n)", "beginCaptures": { "1": { "name": "keyword.control.directive.define.dm" }, "2": { "name": "punctuation.definition.directive.dm" }, "3": { "name": "entity.name.function.preprocessor.dm" }, "5": { "name": "punctuation.definition.parameters.begin.dm" }, "6": { "name": "variable.parameter.preprocessor.dm" }, "8": { "name": "punctuation.separator.parameters.dm" }, "9": { "name": "punctuation.definition.parameters.end.dm" } }, "end": "(?=(?://|/\\*))|(?[a-zA-Z_][a-zA-Z0-9_]*)) # macro name", "beginCaptures": { "1": { "name": "keyword.control.directive.define.dm" }, "2": { "name": "punctuation.definition.directive.dm" }, "3": { "name": "variable.other.preprocessor.dm" } }, "end": "(?=(?://|/\\*))|(?\\\\\\s*\\n)", "name": "punctuation.separator.continuation.dm" } ] }, { "begin": "^\\s*(?:((#)\\s*(?:elif|else|if|ifdef|ifndef))|((#)\\s*(undef|include)))\\b", "beginCaptures": { "1": { "name": "keyword.control.directive.conditional.dm" }, "2": { "name": "punctuation.definition.directive.dm" }, "3": { "name": "keyword.control.directive.$5.dm" }, "4": { "name": "punctuation.definition.directive.dm" } }, "end": "(?=(?://|/\\*))|(?\\\\\\s*\\n)", "name": "punctuation.separator.continuation.dm" } ] }, { "include": "#block" }, { "begin": "(?x)\n\t\t\t\t(?: ^ # begin-of-line\n\t\t\t\t\t|\n\t\t\t\t\t\t (?: (?= \\s ) (?]) # or type modifier before name\n\t\t\t\t\t\t )\n\t\t\t\t)\n\t\t\t\t(\\s*) (?!(while|for|do|if|else|switch|catch|enumerate|return|r?iterate)\\s*\\()\n\t\t\t\t(\n\t\t\t\t\t(?: [A-Za-z_][A-Za-z0-9_]*+ | :: )++ | # actual name\n\t\t\t\t\t(?: (?<=operator) (?: [-*&<>=+!]+ | \\(\\) | \\[\\] ) ) # if it is a C++ operator\n\t\t\t\t)\n\t\t\t\t \\s*(?=\\()", "beginCaptures": { "1": { "name": "punctuation.whitespace.function.leading.dm" }, "3": { "name": "entity.name.function.dm" }, "4": { "name": "punctuation.definition.parameters.dm" } }, "end": "(?<=\\})|(?=#)|(;)?", "name": "meta.function.dm", "patterns": [ { "include": "#comments" }, { "include": "#parens" }, { "match": "\\bconst\\b", "name": "storage.modifier.dm" }, { "include": "#block" } ] } ], "repository": { "access": { "match": "\\.[a-zA-Z_][a-zA-Z_0-9]*\\b(?!\\s*\\()", "name": "variable.other.dot-access.dm" }, "block": { "begin": "\\{", "end": "\\}", "name": "meta.block.dm", "patterns": [ { "include": "#block_innards" } ] }, "block_innards": { "patterns": [ { "include": "#preprocessor-rule-enabled-block" }, { "include": "#preprocessor-rule-disabled-block" }, { "include": "#preprocessor-rule-other-block" }, { "include": "#access" }, { "captures": { "1": { "name": "punctuation.whitespace.function-call.leading.dm" }, "2": { "name": "support.function.any-method.dm" }, "3": { "name": "punctuation.definition.parameters.dm" } }, "match": "(?x) (?: (?= \\s ) (?:(?<=else|new|return) | (?\\\\\\s*\\n)", "name": "punctuation.separator.continuation.dm" } ] } ] }, "disabled": { "begin": "^\\s*#\\s*if(n?def)?\\b.*$", "comment": "eat nested preprocessor if(def)s", "end": "^\\s*#\\s*endif\\b.*$", "patterns": [ { "include": "#disabled" } ] }, "parens": { "begin": "\\(", "end": "\\)", "name": "meta.parens.dm", "patterns": [ { "include": "$base" } ] }, "preprocessor-rule-disabled": { "begin": "^\\s*(#(if)\\s+(0)\\b).*", "captures": { "1": { "name": "meta.preprocessor.dm" }, "2": { "name": "keyword.control.import.if.dm" }, "3": { "name": "constant.numeric.preprocessor.dm" } }, "end": "^\\s*(#\\s*(endif)\\b)", "patterns": [ { "begin": "^\\s*(#\\s*(else)\\b)", "captures": { "1": { "name": "meta.preprocessor.dm" }, "2": { "name": "keyword.control.import.else.dm" } }, "end": "(?=^\\s*#\\s*endif\\b.*$)", "patterns": [ { "include": "$base" } ] }, { "begin": "", "end": "(?=^\\s*#\\s*(else|endif)\\b.*$)", "name": "comment.block.preprocessor.if-branch", "patterns": [ { "include": "#disabled" } ] } ] }, "preprocessor-rule-disabled-block": { "begin": "^\\s*(#(if)\\s+(0)\\b).*", "captures": { "1": { "name": "meta.preprocessor.dm" }, "2": { "name": "keyword.control.import.if.dm" }, "3": { "name": "constant.numeric.preprocessor.dm" } }, "end": "^\\s*(#\\s*(endif)\\b)", "patterns": [ { "begin": "^\\s*(#\\s*(else)\\b)", "captures": { "1": { "name": "meta.preprocessor.dm" }, "2": { "name": "keyword.control.import.else.dm" } }, "end": "(?=^\\s*#\\s*endif\\b.*$)", "patterns": [ { "include": "#block_innards" } ] }, { "begin": "", "end": "(?=^\\s*#\\s*(else|endif)\\b.*$)", "name": "comment.block.preprocessor.if-branch.in-block", "patterns": [ { "include": "#disabled" } ] } ] }, "preprocessor-rule-enabled": { "begin": "^\\s*(#(if)\\s+(0*1)\\b)", "captures": { "1": { "name": "meta.preprocessor.dm" }, "2": { "name": "keyword.control.import.if.dm" }, "3": { "name": "constant.numeric.preprocessor.dm" } }, "end": "^\\s*(#\\s*(endif)\\b)", "patterns": [ { "begin": "^\\s*(#\\s*(else)\\b).*", "captures": { "1": { "name": "meta.preprocessor.dm" }, "2": { "name": "keyword.control.import.else.dm" } }, "contentName": "comment.block.preprocessor.else-branch", "end": "(?=^\\s*#\\s*endif\\b.*$)", "patterns": [ { "include": "#disabled" } ] }, { "begin": "", "end": "(?=^\\s*#\\s*(else|endif)\\b.*$)", "patterns": [ { "include": "$base" } ] } ] }, "preprocessor-rule-enabled-block": { "begin": "^\\s*(#(if)\\s+(0*1)\\b)", "captures": { "1": { "name": "meta.preprocessor.dm" }, "2": { "name": "keyword.control.import.if.dm" }, "3": { "name": "constant.numeric.preprocessor.dm" } }, "end": "^\\s*(#\\s*(endif)\\b)", "patterns": [ { "begin": "^\\s*(#\\s*(else)\\b).*", "captures": { "1": { "name": "meta.preprocessor.dm" }, "2": { "name": "keyword.control.import.else.dm" } }, "contentName": "comment.block.preprocessor.else-branch.in-block", "end": "(?=^\\s*#\\s*endif\\b.*$)", "patterns": [ { "include": "#disabled" } ] }, { "begin": "", "end": "(?=^\\s*#\\s*(else|endif)\\b.*$)", "patterns": [ { "include": "#block_innards" } ] } ] }, "preprocessor-rule-other": { "begin": "^\\s*((#\\s*(if(n?def)?))\\b.*?(?:(?=(?://|/\\*))|$))", "captures": { "1": { "name": "meta.preprocessor.dm" }, "2": { "name": "keyword.control.import.dm" } }, "end": "^\\s*((#\\s*(endif))\\b).*$", "patterns": [ { "include": "$base" } ] }, "preprocessor-rule-other-block": { "begin": "^\\s*(#\\s*(if(n?def)?)\\b.*?(?:(?=(?://|/\\*))|$))", "captures": { "1": { "name": "meta.preprocessor.dm" }, "2": { "name": "keyword.control.import.dm" } }, "end": "^\\s*(#\\s*(endif)\\b).*$", "patterns": [ { "include": "#block_innards" } ] }, "string_embedded_expression": { "patterns": [ { "begin": "(?\"n\\n \\[]\n)", "name": "constant.character.escape.dm" }, { "match": "\\\\.", "name": "invalid.illegal.unknown-escape.dm" } ] } }, "scopeName": "source.dm" }