grammars/source.terraform.json in github-linguist-5.2.0 vs grammars/source.terraform.json in github-linguist-5.3.0
- old
+ new
@@ -1,51 +1,57 @@
{
+ "name": "Terraform",
+ "scopeName": "source.terraform",
"fileTypes": [
"tf",
"tfvars",
"hcl"
],
- "name": "Terraform",
+ "uuid": "9060ca81-906d-4f19-a91a-159f4eb119d6",
"patterns": [
{
+ "comment": "Comments",
+ "name": "comment.line.number-sign.terraform",
"begin": "#|//",
+ "end": "$\\n?",
"captures": {
"0": {
"name": "punctuation.definition.comment.terraform"
}
- },
- "comment": "Comments",
- "end": "$\\n?",
- "name": "comment.line.number-sign.terraform"
+ }
},
{
+ "comment": "Block comments",
+ "name": "comment.block.terraform",
"begin": "/\\*",
+ "end": "\\*/",
"captures": {
"0": {
"name": "punctuation.definition.comment.terraform"
}
- },
- "comment": "Block comments",
- "end": "\\*/",
- "name": "comment.block.terraform"
+ }
},
{
"comment": "Language constants (true, false, yes, no, on, off)",
- "match": "\\b(true|false|yes|no|on|off)\\b",
- "name": "constant.language.terraform"
+ "name": "constant.language.terraform",
+ "match": "\\b(true|false|yes|no|on|off)\\b"
},
{
"comment": "Numbers",
- "match": "\\b([0-9]+)([kKmMgG]b?)?\\b",
- "name": "constant.numeric.terraform"
+ "name": "constant.numeric.terraform",
+ "match": "\\b([0-9]+)([kKmMgG]b?)?\\b"
},
{
"comment": "Hex numbers",
- "match": "\\b(0x[0-9A-Fa-f]+)([kKmMgG]b?)?\\b",
- "name": "constant.numeric.terraform"
+ "name": "constant.numeric.terraform",
+ "match": "\\b(0x[0-9A-Fa-f]+)([kKmMgG]b?)?\\b"
},
{
+ "name": "meta.resource.terraform",
+ "match": "(resource|data)\\s+(\")?(\\w+)(\")?\\s+(\")?([\\w\\-]+)(\")?\\s+({)",
+ "foldingStartMarker": "\\{\\s*$",
+ "foldingStopMarker": "^\\s*\\}",
"captures": {
"1": {
"name": "storage.type.function.terraform"
},
"2": {
@@ -67,17 +73,16 @@
"name": "string.terraform punctuation.definition.string.end.terraform"
},
"8": {
"name": "punctuation.definition.tag.terraform"
}
- },
- "foldingStartMarker": "\\{\\s*$",
- "foldingStopMarker": "^\\s*\\}",
- "match": "(resource|data)\\s+(\")?(\\w+)(\")?\\s+(\")?([\\w\\-]+)(\")?\\s+({)",
- "name": "meta.resource.terraform"
+ }
},
{
+ "match": "(provider|provisioner|variable|output|module|atlas)\\s+(\")?([\\w\\-]+)(\")?\\s+({)",
+ "foldingStartMarker": "\\{\\s*$",
+ "foldingStopMarker": "^\\s*\\}",
"captures": {
"1": {
"name": "storage.type.function.terraform"
},
"2": {
@@ -90,28 +95,27 @@
"name": "string.terraform punctuation.definition.string.end.terraform"
},
"5": {
"name": "punctuation.definition.tag.terraform"
}
- },
- "foldingStartMarker": "\\{\\s*$",
- "foldingStopMarker": "^\\s*\\}",
- "match": "(provider|provisioner|variable|output|module|atlas)\\s+(\")?([\\w\\-]+)(\")?\\s+({)"
+ }
},
{
+ "comment": "Value assignments (left hand side not in double quotes)",
+ "match": "([\\w_-]+)\\s*(=)\\s*",
"captures": {
"1": {
"name": "variable.other.assignment.terraform"
},
"2": {
"name": "keyword.operator.terraform"
}
- },
- "comment": "Value assignments (left hand side not in double quotes)",
- "match": "([\\w_-]+)\\s*(=)\\s*"
+ }
},
{
+ "comment": "Value assignments (left hand side in double quotes)",
+ "match": "(\")([\\w_-]+)(\")\\s*(=)\\s*",
"captures": {
"1": {
"name": "punctuation.quote.double.terraform"
},
"2": {
@@ -121,30 +125,29 @@
"name": "punctuation.quote.double.terraform"
},
"4": {
"name": "keyword.operator.terraform"
}
- },
- "comment": "Value assignments (left hand side in double quotes)",
- "match": "(\")([\\w_-]+)(\")\\s*(=)\\s*"
+ }
},
{
+ "comment": "Maps",
+ "match": "([\\w\\-_]+)\\s+({)",
"captures": {
"1": {
"name": "entity.name.section.terraform"
},
"2": {
"name": "punctuation.definition.tag.terraform"
}
- },
- "comment": "Maps",
- "match": "([\\w\\-_]+)\\s+({)"
+ }
},
{
"include": "#strings"
},
{
+ "name": "string.unquoted.heredoc.terraform",
"begin": "(?>\\s*<<(\\w+))",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.terraform"
},
@@ -155,113 +158,110 @@
"end": "^\\s*\\1$",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.terraform keyword.operator.heredoc.terraform"
}
- },
- "name": "string.unquoted.heredoc.terraform"
+ }
}
],
"repository": {
- "string_interpolation": {
+ "strings": {
+ "comment": "Strings",
+ "begin": "\\\"",
+ "beginCaptures": {
+ "0": {
+ "name": "string.terraform punctuation.definition.string.begin.terraform"
+ }
+ },
+ "end": "\\\"",
+ "endCaptures": {
+ "0": {
+ "name": "string.terraform punctuation.definition.string.end.terraform"
+ }
+ },
"patterns": [
{
- "begin": "\\$\\{",
- "beginCaptures": {
- "0": {
- "name": "entity.tag.embedded.start.terraform"
- }
- },
- "end": "\\}",
- "endCaptures": {
- "0": {
- "name": "entity.tag.embedded.end.terraform"
- }
- },
- "name": "source.terraform.embedded.source",
- "patterns": [
- {
- "include": "$self"
- },
- {
- "include": "#string_interpolation_functions"
- },
- {
- "include": "#string_interpolation_keywords"
- },
- {
- "captures": {
- "0": {
- "name": "keyword.control.period.terraform"
- }
- },
- "match": "(\\.)"
- },
- {
- "include": "#strings"
- }
- ]
+ "include": "#string_interpolation"
+ },
+ {
+ "match": "([\\w\\-\\/\\._\\\\%]+)",
+ "name": "string.quoted.double.terraform"
}
]
},
"string_interpolation_functions": {
- "begin": "(base64decode|base64encode|base64sha256|ceil|cidrnetmask|compact|distinct|file|floor|keys|length|lower|md5|pathexpand|replace|sha1|sha256|signum|sort|timestamp|title|trimspace|upper|uuid|values|cidrhost|cidrsubnet|coalesce|concat|element|format|formatlist|from|index|join|jsonencode|length|list|lookup|map|max|merge|min|slice|split|substr|zipmap)(\\()",
+ "comment": "Builtin functions",
+ "begin": "(base64decode|base64encode|base64gzip|base64sha256|base64sha512|basename|bcrypt|ceil|chomp|cidrhost|cidrnetmask|cidrsubnet|coalesce|coalescelist|compact|concat|contains|dirname|distinct|element|file|flatten|floor|format|formatlist|index|join|jsonencode|keys|length|list|log|lookup|lower|map|matchkeys|max|md5|merge|min|pathexpand|pow|replace|sha1|sha256|sha512|signum|slice|sort|split|substr|timestamp|title|trimspace|upper|urlencode|uuid|values|zipmap)(\\()",
"beginCaptures": {
"1": {
"name": "keyword.other.function.inline.terraform"
},
"2": {
"name": "keyword.other.section.begin.terraform"
}
},
- "comment": "Builtin functions",
"end": "(\\))",
"endCaptures": {
"1": {
"name": "keyword.other.section.end.terraform"
}
},
"patterns": [
{
- "include": "$self"
+ "include": "#string_interpolation_functions"
},
{
"include": "#string_interpolation_keywords"
}
]
},
"string_interpolation_keywords": {
+ "match": "(terraform|var|self|count|module|path|data)(\\.[\\w\\*]+)+",
"captures": {
"0": {
"name": "entity.other.attribute-name.terraform"
}
- },
- "match": "(terraform|var|self|count|module|path|data)(\\.[\\w\\*]+)+"
+ }
},
- "strings": {
- "begin": "\\\"",
- "beginCaptures": {
- "0": {
- "name": "string.terraform punctuation.definition.string.begin.terraform"
- }
- },
- "comment": "Strings",
- "end": "\\\"",
- "endCaptures": {
- "0": {
- "name": "string.terraform punctuation.definition.string.end.terraform"
- }
- },
+ "string_interpolation": {
"patterns": [
{
- "include": "#string_interpolation"
- },
- {
- "match": "([\\w\\-\\/\\._\\\\%]+)",
- "name": "string.quoted.double.terraform"
+ "name": "source.terraform.embedded.source",
+ "begin": "\\$\\{",
+ "beginCaptures": {
+ "0": {
+ "name": "entity.tag.embedded.start.terraform"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name": "entity.tag.embedded.end.terraform"
+ }
+ },
+ "patterns": [
+ {
+ "include": "$self"
+ },
+ {
+ "include": "#string_interpolation_functions"
+ },
+ {
+ "include": "#string_interpolation_keywords"
+ },
+ {
+ "match": "(\\.)",
+ "captures": {
+ "0": {
+ "name": "keyword.control.period.terraform"
+ }
+ }
+ },
+ {
+ "include": "#strings"
+ }
+ ]
}
]
}
- },
- "scopeName": "source.terraform",
- "uuid": "9060ca81-906d-4f19-a91a-159f4eb119d6"
+ }
}
\ No newline at end of file