grammars/source.puppet.json in github-linguist-4.8.11 vs grammars/source.puppet.json in github-linguist-4.8.12

- old
+ new

@@ -1,473 +1,440 @@ { - "name": "Puppet", - "file_extensions": [ + "fileTypes": [ "pp" ], - "scope": "source.puppet", - "contexts": { - "main": [ - { - "include": "line_comment" + "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" + } }, - { - "match": "^\\s*/\\*", - "push": [ - { - "meta_scope": "comment.block.puppet" - }, - { - "match": "\\*/", - "pop": true - } - ] - }, - { - "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" + "end": "(?={)", + "name": "meta.definition.class.puppet", + "patterns": [ + { + "include": "#variables" }, - "push": [ - { - "meta_scope": "meta.definition.class.puppet" + { + "include": "#constants" + }, + { + "include": "#strings" + }, + { + "include": "#numbers" + }, + { + "begin": "\\b(inherits)\\b\\s+", + "captures": { + "1": { + "name": "storage.modifier.puppet" + } }, - { - "match": "(?={)", - "captures": { - "1": "storage.type.puppet", - "2": "entity.name.type.class.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" + } + }, + "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" }, - "pop": true + "2": { + "name": "punctuation.definition.variable.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" + "match": "((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\\s*(?=,|\\))", + "name": "meta.function.argument.no-default.puppet" }, - "push": [ - { - "meta_scope": "meta.function.puppet" - }, - { - "meta_content_scope": "meta.function.arguments.puppet" - }, - { - "match": "\\)", - "captures": { - "1": "punctuation.definition.parameters.end.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" }, - "pop": true - }, - { - "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" + "2": { + "name": "punctuation.definition.variable.puppet" + }, + "3": { + "name": "keyword.operator.assignment.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" - } - ] - } - ] + "end": "(?=,|\\))", + "name": "meta.function.argument.default.puppet", + "patterns": [ + { + "include": "#parameter-default-types" + } + ] + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.puppet" + }, + "2": { + "name": "entity.name.section.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" + "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*(['\"].+['\"])\\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" } + ] + }, + "double-quoted-string": { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.puppet" + } }, - { - "match": "\\b(case|if|unless|else|elsif)\\s+(?!::)", - "scope": "keyword.control.puppet" + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.puppet" + } }, - { - "match": "((\\$?)\"?[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*\"?):(?=\\s+|$)", - "scope": "entity.name.section.puppet" - }, - { - "include": "strings" - }, - { - "include": "variable" - }, - { - "include": "constants" - }, - { - "match": "(?i)\\b(import|include|require)\\s+([::[a-z]]*)\\b\\s*", - "captures": { - "1": "keyword.control.import.include.puppet" + "name": "string.quoted.double.puppet", + "patterns": [ + { + "include": "#escaped_char" }, - "push": [ - { - "meta_scope": "meta.include.puppet" + { + "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": "(?=\\s|$)", - "pop": true - } - ] + "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": "\\b\\w+\\s*(?==>)\\s*", - "scope": "constant.other.key.puppet" + "end": "\\}", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#nested_braces" + } + ] + }, + "nested_braces_interpolated": { + "begin": "\\{", + "captures": { + "1": { + "name": "punctuation.section.scope.puppet" + } }, - { - "match": "(?<={)\\s*\\w+\\s*(?=})", - "scope": "constant.other.bareword.puppet" + "end": "\\}", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#variable" + }, + { + "include": "#nested_braces_interpolated" + } + ] + }, + "nested_brackets": { + "begin": "\\[", + "captures": { + "1": { + "name": "punctuation.section.scope.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" + "end": "\\]", + "patterns": [ + { + "include": "#escaped_char" }, - "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" + { + "include": "#nested_brackets" } + ] + }, + "nested_brackets_interpolated": { + "begin": "\\[", + "captures": { + "1": { + "name": "punctuation.section.scope.puppet" + } }, - { - "match": "(#).*$\\n?", - "scope": "comment.line.number-sign.puppet", - "captures": { - "1": "punctuation.definition.comment.puppet" + "end": "\\]", + "patterns": [ + { + "include": "#escaped_char" + }, + { + "include": "#variable" + }, + { + "include": "#nested_brackets_interpolated" } - } - ], - "nested_braces": [ - { - "match": "\\{", - "captures": { - "1": "punctuation.section.scope.puppet" + ] + }, + "nested_parens": { + "begin": "\\(", + "captures": { + "1": { + "name": "punctuation.section.scope.puppet" + } + }, + "end": "\\)", + "patterns": [ + { + "include": "#escaped_char" }, - "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": "#nested_parens" + } + ] + }, + "nested_parens_interpolated": { + "begin": "\\(", + "captures": { + "1": { + "name": "punctuation.section.scope.puppet" + } + }, + "end": "\\)", + "patterns": [ + { + "include": "#escaped_char" }, - "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" + { + "include": "#variable" }, - "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" + { + "include": "#nested_parens_interpolated" + } + ] + }, + "parameter-default-types": { + "patterns": [ + { + "include": "#strings" }, - "push": [ - { - "match": "\\]", - "captures": { - "1": "punctuation.section.scope.puppet" - }, - "pop": true - }, - { - "include": "escaped_char" - }, - { - "include": "variable" - }, - { - "include": "nested_brackets_interpolated" - } - ] - } - ], - "nested_parens": [ - { - "match": "\\(", - "captures": { - "1": "punctuation.section.scope.puppet" + { + "include": "#numbers" }, - "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" + { + "include": "#variables" }, - "push": [ - { - "match": "\\)", - "captures": { - "1": "punctuation.section.scope.puppet" - }, - "pop": true + { + "match": "=", + "name": "keyword.operator.assignment.php" + }, + { + "begin": "(\\[)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.array.begin.puppet" + } }, - { - "include": "escaped_char" + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.array.end.puppet" + } }, - { - "include": "variable" - }, - { - "include": "nested_parens_interpolated" - } - ] - } - ], - "parameter-default-types": [ - { - "include": "strings" + "name": "meta.array.php", + "patterns": [ + { + "include": "#parameter-default-types" + } + ] + }, + { + "include": "#constants" + } + ] + }, + "single-quoted-string": { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.puppet" + } }, - { - "match": "=", - "scope": "keyword.operator.assignment.php" + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.puppet" + } }, - { - "match": "(\\[)", - "captures": { - "1": "punctuation.definition.array.begin.puppet" + "name": "string.quoted.single.puppet", + "patterns": [ + { + "include": "#escaped_char" + } + ] + }, + "strings": { + "patterns": [ + { + "include": "#double-quoted-string" }, - "push": [ - { - "meta_scope": "meta.array.php" + { + "include": "#single-quoted-string" + } + ] + }, + "variable": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.variable.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" + "match": "(\\$)([a-zA-Zx7f-xff\\$]|::)([a-zA-Z0-9_x7f-xff\\$]|::)*\\b", + "name": "variable.other.readwrite.global.puppet" }, - "push": [ - { - "meta_scope": "string.quoted.single.puppet" - }, - { - "match": "'", - "captures": { - "0": "punctuation.definition.string.end.puppet" + { + "captures": { + "1": { + "name": "punctuation.definition.variable.puppet" }, - "pop": true + "2": { + "name": "punctuation.definition.variable.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" + "match": "(\\$\\{)(?:[a-zA-Zx7f-xff\\$]|::)(?:[a-zA-Z0-9_x7f-xff\\$]|::)*(\\})", + "name": "variable.other.readwrite.global.puppet" } - }, - { - "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" - } - } - ] - } + ] + } + }, + "scopeName": "source.puppet", + "uuid": "AAF4E089-E3C9-4FB9-B099-FD2CCBD4E786" } \ No newline at end of file