grammars/source.puppet.json in github-linguist-4.8.9 vs grammars/source.puppet.json in github-linguist-4.8.10

- old
+ new

@@ -1,440 +1,473 @@ { - "fileTypes": [ + "name": "Puppet", + "file_extensions": [ "pp" ], - "foldingStartMarker": "(^\\s*/\\*|(\\{|\\[|\\()\\s*$)", - "foldingStopMarker": "(\\*/|^\\s*(\\}|\\]|\\)))", - "keyEquivalent": "^~P", - "name": "Puppet", - "patterns": [ - { - "include": "#line_comment" - }, - { - "begin": "^\\s*/\\*", - "end": "\\*/", - "name": "comment.block.puppet" - }, - { - "begin": "(?x)^\\s*\n\t\t\t\t\t(node|class)\\s+\n\t\t\t\t\t((?:[-_A-Za-z0-9\".]+::)*[-_A-Za-z0-9\".]+)\\s* # identifier", - "captures": { - "1": { - "name": "storage.type.puppet" - }, - "2": { - "name": "entity.name.type.class.puppet" - } + "scope": "source.puppet", + "contexts": { + "main": [ + { + "include": "line_comment" }, - "end": "(?={)", - "name": "meta.definition.class.puppet", - "patterns": [ - { - "include": "#variables" - }, - { - "include": "#constants" - }, - { - "include": "#strings" - }, - { - "include": "#numbers" - }, - { - "begin": "\\b(inherits)\\b\\s+", - "captures": { - "1": { - "name": "storage.modifier.puppet" - } + { + "match": "^\\s*/\\*", + "push": [ + { + "meta_scope": "comment.block.puppet" }, - "end": "(?={)", - "name": "meta.definition.class.inherits.puppet", - "patterns": [ - { - "match": "\\b((?:[-_A-Za-z0-9\".]+::)*[-_A-Za-z0-9\".]+)\\b", - "name": "support.type.puppet" - } - ] - } - ] - }, - { - "begin": "^\\s*(define)\\s+([a-zA-Z0-9_:]+)\\s*(\\()", - "beginCaptures": { - "1": { - "name": "storage.type.function.puppet" - }, - "2": { - "name": "entity.name.function.puppet" - }, - "3": { - "name": "punctuation.definition.parameters.begin.puppet" - } + { + "match": "\\*/", + "pop": true + } + ] }, - "contentName": "meta.function.arguments.puppet", - "end": "\\)", - "endCaptures": { - "1": { - "name": "punctuation.definition.parameters.end.puppet" - } - }, - "name": "meta.function.puppet", - "patterns": [ - { - "captures": { - "1": { - "name": "variable.other.puppet" + { + "match": "(?x)^\\s*\n(node|class)\\s+\n((?:[-_A-Za-z0-9\".]+::)*[-_A-Za-z0-9\".]+)\\s* # identifier", + "captures": { + "1": "storage.type.puppet", + "2": "entity.name.type.class.puppet" + }, + "push": [ + { + "meta_scope": "meta.definition.class.puppet" + }, + { + "match": "(?={)", + "captures": { + "1": "storage.type.puppet", + "2": "entity.name.type.class.puppet" }, - "2": { - "name": "punctuation.definition.variable.puppet" - } + "pop": true }, - "match": "((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\\s*(?=,|\\))", - "name": "meta.function.argument.no-default.puppet" + { + "include": "constants" + }, + { + "include": "strings" + }, + { + "match": "\\b(inherits)\\b\\s+", + "captures": { + "1": "storage.modifier.puppet" + }, + "push": [ + { + "meta_scope": "meta.definition.class.inherits.puppet" + }, + { + "match": "(?={)", + "captures": { + "1": "storage.modifier.puppet" + }, + "pop": true + }, + { + "match": "\\b((?:[-_A-Za-z0-9\".]+::)*[-_A-Za-z0-9\".]+)\\b", + "scope": "support.type.puppet" + } + ] + } + ] + }, + { + "match": "^\\s*(define)\\s+([a-zA-Z0-9_:]+)\\s*(\\()", + "captures": { + "1": "storage.type.function.puppet", + "2": "entity.name.function.puppet", + "3": "punctuation.definition.parameters.begin.puppet" }, - { - "begin": "((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)(?:\\s*(=)\\s*)\\s*", - "captures": { - "1": { - "name": "variable.other.puppet" + "push": [ + { + "meta_scope": "meta.function.puppet" + }, + { + "meta_content_scope": "meta.function.arguments.puppet" + }, + { + "match": "\\)", + "captures": { + "1": "punctuation.definition.parameters.end.puppet" }, - "2": { - "name": "punctuation.definition.variable.puppet" - }, - "3": { - "name": "keyword.operator.assignment.puppet" - } + "pop": true }, - "end": "(?=,|\\))", - "name": "meta.function.argument.default.puppet", - "patterns": [ - { - "include": "#parameter-default-types" + { + "match": "((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\\s*(?=,|\\))", + "scope": "meta.function.argument.no-default.puppet", + "captures": { + "1": "variable.other.puppet", + "2": "punctuation.definition.variable.puppet" } - ] - } - ] - }, - { - "captures": { - "1": { - "name": "storage.type.puppet" - }, - "2": { - "name": "entity.name.section.puppet" - } + }, + { + "match": "((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)(?:\\s*(=)\\s*)\\s*", + "captures": { + "1": "variable.other.puppet", + "2": "punctuation.definition.variable.puppet", + "3": "keyword.operator.assignment.puppet" + }, + "push": [ + { + "meta_scope": "meta.function.argument.default.puppet" + }, + { + "match": "(?=,|\\))", + "captures": { + "1": "variable.other.puppet", + "2": "punctuation.definition.variable.puppet", + "3": "keyword.operator.assignment.puppet" + }, + "pop": true + }, + { + "include": "parameter-default-types" + } + ] + } + ] }, - "match": "^\\s*(\\w+)\\s*{\\s*(['\"].+['\"]):", - "name": "meta.definition.resource.puppet" - }, - { - "match": "\\b(case|if|unless|else|elsif)(?!::)", - "name": "keyword.control.puppet" - }, - { - "match": "((\\$?)\"?[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*\"?):(?=\\s+|$)", - "name": "entity.name.section.puppet" - }, - { - "include": "#strings" - }, - { - "include": "#variable" - }, - { - "include": "#constants" - }, - { - "begin": "(?i)\\b(import|include)\\b\\s*", - "beginCaptures": { - "1": { - "name": "keyword.control.import.include.puppet" + { + "match": "^\\s*(\\w+)\\s*{\\s*(\\$[a-zA-Z_]+)\\s*:", + "scope": "meta.definition.resource.puppet", + "captures": { + "1": "storage.type.puppet", + "2": "entity.name.section.puppet" } }, - "end": "(?=\\s|$)", - "name": "meta.include.puppet" - }, - { - "match": "\\b\\w+\\s*(?==>)\\s*", - "name": "constant.other.key.puppet" - }, - { - "match": "(?<={)\\s*\\w+\\s*(?=})", - "name": "constant.other.bareword.puppet" - }, - { - "match": "\\b(escape|gsub|alert|crit|debug|notice|defined|emerg|err|failed|file|generate|include|info|realize|search|tag|tagged|template|warning)\\b", - "name": "support.function.puppet" - } - ], - "repository": { - "constants": { - "patterns": [ - { - "match": "(?i)\\b(false|true|running|undef|present|absent|file|directory)\\b", - "name": "constant.language.puppet" + { + "match": "^\\s*(\\w+)\\s*{\\s*(['\"].+['\"])\\s*:", + "scope": "meta.definition.resource.puppet", + "captures": { + "1": "storage.type.puppet", + "2": "entity.name.section.puppet" } - ] - }, - "double-quoted-string": { - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.puppet" - } }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.puppet" - } + { + "match": "\\b(case|if|unless|else|elsif)\\s+(?!::)", + "scope": "keyword.control.puppet" }, - "name": "string.quoted.double.puppet", - "patterns": [ - { - "include": "#escaped_char" - }, - { - "include": "#variable" - } - ] - }, - "escaped_char": { - "match": "\\\\.", - "name": "constant.character.escape.puppet" - }, - "line_comment": { - "patterns": [ - { - "captures": { - "1": { - "name": "comment.line.number-sign.puppet" - }, - "2": { - "name": "punctuation.definition.comment.puppet" - } - }, - "match": "^((#).*$\\n?)", - "name": "meta.comment.full-line.puppet" - }, - { - "captures": { - "1": { - "name": "punctuation.definition.comment.puppet" - } - }, - "match": "(#).*$\\n?", - "name": "comment.line.number-sign.puppet" - } - ] - }, - "nested_braces": { - "begin": "\\{", - "captures": { - "1": { - "name": "punctuation.section.scope.puppet" - } + { + "match": "((\\$?)\"?[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*\"?):(?=\\s+|$)", + "scope": "entity.name.section.puppet" }, - "end": "\\}", - "patterns": [ - { - "include": "#escaped_char" - }, - { - "include": "#nested_braces" - } - ] - }, - "nested_braces_interpolated": { - "begin": "\\{", - "captures": { - "1": { - "name": "punctuation.section.scope.puppet" - } + { + "include": "strings" }, - "end": "\\}", - "patterns": [ - { - "include": "#escaped_char" - }, - { - "include": "#variable" - }, - { - "include": "#nested_braces_interpolated" - } - ] - }, - "nested_brackets": { - "begin": "\\[", - "captures": { - "1": { - "name": "punctuation.section.scope.puppet" - } + { + "include": "variable" }, - "end": "\\]", - "patterns": [ - { - "include": "#escaped_char" - }, - { - "include": "#nested_brackets" - } - ] - }, - "nested_brackets_interpolated": { - "begin": "\\[", - "captures": { - "1": { - "name": "punctuation.section.scope.puppet" - } + { + "include": "constants" }, - "end": "\\]", - "patterns": [ - { - "include": "#escaped_char" + { + "match": "(?i)\\b(import|include|require)\\s+([::[a-z]]*)\\b\\s*", + "captures": { + "1": "keyword.control.import.include.puppet" }, - { - "include": "#variable" - }, - { - "include": "#nested_brackets_interpolated" - } - ] - }, - "nested_parens": { - "begin": "\\(", - "captures": { - "1": { - "name": "punctuation.section.scope.puppet" - } + "push": [ + { + "meta_scope": "meta.include.puppet" + }, + { + "match": "(?=\\s|$)", + "pop": true + } + ] }, - "end": "\\)", - "patterns": [ - { - "include": "#escaped_char" + { + "match": "\\b\\w+\\s*(?==>)\\s*", + "scope": "constant.other.key.puppet" + }, + { + "match": "(?<={)\\s*\\w+\\s*(?=})", + "scope": "constant.other.bareword.puppet" + }, + { + "match": "\\b(escape|gsub|alert|crit|debug|notice|defined|emerg|err|failed|file|generate|info|realize|search|tag|tagged|template|warning)\\b", + "scope": "support.function.puppet" + } + ], + "constants": [ + { + "match": "(?i)\\b(false|true|running|undef|present|absent|file|directory|installed|running|stopped)\\b", + "scope": "constant.language.puppet" + } + ], + "double-quoted-string": [ + { + "match": "\"", + "captures": { + "0": "punctuation.definition.string.begin.puppet" }, - { - "include": "#nested_parens" + "push": [ + { + "meta_scope": "string.quoted.double.puppet" + }, + { + "match": "\"", + "captures": { + "0": "punctuation.definition.string.end.puppet" + }, + "pop": true + }, + { + "include": "escaped_char" + }, + { + "include": "variable" + } + ] + } + ], + "escaped_char": [ + { + "match": "\\\\.", + "scope": "constant.character.escape.puppet" + } + ], + "line_comment": [ + { + "match": "^((#).*$\\n?)", + "scope": "meta.comment.full-line.puppet", + "captures": { + "1": "comment.line.number-sign.puppet", + "2": "punctuation.definition.comment.puppet" } - ] - }, - "nested_parens_interpolated": { - "begin": "\\(", - "captures": { - "1": { - "name": "punctuation.section.scope.puppet" - } }, - "end": "\\)", - "patterns": [ - { - "include": "#escaped_char" - }, - { - "include": "#variable" - }, - { - "include": "#nested_parens_interpolated" + { + "match": "(#).*$\\n?", + "scope": "comment.line.number-sign.puppet", + "captures": { + "1": "punctuation.definition.comment.puppet" } - ] - }, - "parameter-default-types": { - "patterns": [ - { - "include": "#strings" + } + ], + "nested_braces": [ + { + "match": "\\{", + "captures": { + "1": "punctuation.section.scope.puppet" }, - { - "include": "#numbers" + "push": [ + { + "match": "\\}", + "captures": { + "1": "punctuation.section.scope.puppet" + }, + "pop": true + }, + { + "include": "escaped_char" + }, + { + "include": "nested_braces" + } + ] + } + ], + "nested_braces_interpolated": [ + { + "match": "\\{", + "captures": { + "1": "punctuation.section.scope.puppet" }, - { - "include": "#variables" + "push": [ + { + "match": "\\}", + "captures": { + "1": "punctuation.section.scope.puppet" + }, + "pop": true + }, + { + "include": "escaped_char" + }, + { + "include": "variable" + }, + { + "include": "nested_braces_interpolated" + } + ] + } + ], + "nested_brackets": [ + { + "match": "\\[", + "captures": { + "1": "punctuation.section.scope.puppet" }, - { - "match": "=", - "name": "keyword.operator.assignment.php" + "push": [ + { + "match": "\\]", + "captures": { + "1": "punctuation.section.scope.puppet" + }, + "pop": true + }, + { + "include": "escaped_char" + }, + { + "include": "nested_brackets" + } + ] + } + ], + "nested_brackets_interpolated": [ + { + "match": "\\[", + "captures": { + "1": "punctuation.section.scope.puppet" }, - { - "begin": "(\\[)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.array.begin.puppet" - } + "push": [ + { + "match": "\\]", + "captures": { + "1": "punctuation.section.scope.puppet" + }, + "pop": true }, - "end": "\\]", - "endCaptures": { - "0": { - "name": "punctuation.definition.array.end.puppet" - } + { + "include": "escaped_char" }, - "name": "meta.array.php", - "patterns": [ - { - "include": "#parameter-default-types" - } - ] + { + "include": "variable" + }, + { + "include": "nested_brackets_interpolated" + } + ] + } + ], + "nested_parens": [ + { + "match": "\\(", + "captures": { + "1": "punctuation.section.scope.puppet" }, - { - "include": "#constants" - } - ] - }, - "single-quoted-string": { - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.puppet" - } + "push": [ + { + "match": "\\)", + "captures": { + "1": "punctuation.section.scope.puppet" + }, + "pop": true + }, + { + "include": "escaped_char" + }, + { + "include": "nested_parens" + } + ] + } + ], + "nested_parens_interpolated": [ + { + "match": "\\(", + "captures": { + "1": "punctuation.section.scope.puppet" + }, + "push": [ + { + "match": "\\)", + "captures": { + "1": "punctuation.section.scope.puppet" + }, + "pop": true + }, + { + "include": "escaped_char" + }, + { + "include": "variable" + }, + { + "include": "nested_parens_interpolated" + } + ] + } + ], + "parameter-default-types": [ + { + "include": "strings" }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.puppet" - } + { + "match": "=", + "scope": "keyword.operator.assignment.php" }, - "name": "string.quoted.single.puppet", - "patterns": [ - { - "include": "#escaped_char" - } - ] - }, - "strings": { - "patterns": [ - { - "include": "#double-quoted-string" + { + "match": "(\\[)", + "captures": { + "1": "punctuation.definition.array.begin.puppet" }, - { - "include": "#single-quoted-string" - } - ] - }, - "variable": { - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.definition.variable.puppet" - } + "push": [ + { + "meta_scope": "meta.array.php" }, - "match": "(\\$)([a-zA-Zx7f-xff\\$]|::)([a-zA-Z0-9_x7f-xff\\$]|::)*\\b", - "name": "variable.other.readwrite.global.puppet" + { + "match": "\\]", + "captures": { + "0": "punctuation.definition.array.end.puppet" + }, + "pop": true + }, + { + "include": "parameter-default-types" + } + ] + }, + { + "include": "constants" + } + ], + "single-quoted-string": [ + { + "match": "'", + "captures": { + "0": "punctuation.definition.string.begin.puppet" }, - { - "captures": { - "1": { - "name": "punctuation.definition.variable.puppet" + "push": [ + { + "meta_scope": "string.quoted.single.puppet" + }, + { + "match": "'", + "captures": { + "0": "punctuation.definition.string.end.puppet" }, - "2": { - "name": "punctuation.definition.variable.puppet" - } + "pop": true }, - "match": "(\\$\\{)(?:[a-zA-Zx7f-xff\\$]|::)(?:[a-zA-Z0-9_x7f-xff\\$]|::)*(\\})", - "name": "variable.other.readwrite.global.puppet" + { + "include": "escaped_char" + } + ] + } + ], + "strings": [ + { + "include": "double-quoted-string" + }, + { + "include": "single-quoted-string" + } + ], + "variable": [ + { + "match": "(\\$)([a-zA-Zx7f-xff\\$]|::)([a-zA-Z0-9_x7f-xff\\$]|::)*\\b", + "scope": "variable.other.readwrite.global.puppet", + "captures": { + "1": "punctuation.definition.variable.puppet" } - ] - } - }, - "scopeName": "source.puppet", - "uuid": "AAF4E089-E3C9-4FB9-B099-FD2CCBD4E786" + }, + { + "match": "(\\$\\{)(?:[a-zA-Zx7f-xff\\$]|::)(?:[a-zA-Z0-9_x7f-xff\\$]|::)*(\\})", + "scope": "variable.other.readwrite.global.puppet", + "captures": { + "1": "punctuation.definition.variable.puppet", + "2": "punctuation.definition.variable.puppet" + } + } + ] + } } \ No newline at end of file