github-linguist 7.6.0 → 7.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +5 -5
  2. data/bin/github-linguist +17 -4
  3. data/grammars/annotation.liquidhaskell.haskell.json +58 -11
  4. data/grammars/etc.json +472 -4
  5. data/grammars/hidden.manref.json +29 -0
  6. data/grammars/hidden.regexp.injection-shell.json +28 -0
  7. data/grammars/hint.haskell.json +58 -11
  8. data/grammars/hint.message.haskell.json +58 -11
  9. data/grammars/hint.type.haskell.json +58 -11
  10. data/grammars/injections.etc.json +601 -1
  11. data/grammars/markdown.plantuml.codeblock.json +26 -0
  12. data/grammars/source.4dm.json +1156 -0
  13. data/grammars/source.abap.json +7 -7
  14. data/grammars/source.abl.json +685 -83
  15. data/grammars/source.abnf.json +23 -1
  16. data/grammars/source.agda.json +33 -203
  17. data/grammars/source.ahk.json +9 -5
  18. data/grammars/source.angelscript.json +1 -1
  19. data/grammars/source.ballerina.json +55 -19
  20. data/grammars/source.c++.json +4 -4
  21. data/grammars/source.c.platform.json +584 -33
  22. data/grammars/source.chapel.json +7 -4
  23. data/grammars/source.csound.json +1 -1
  24. data/grammars/source.css.json +3 -3
  25. data/grammars/source.css.scss.json +164 -15
  26. data/grammars/source.curlrc.json +869 -65
  27. data/grammars/source.d.json +2 -2
  28. data/grammars/source.dart.json +58 -32
  29. data/grammars/source.dircolors.json +137 -0
  30. data/grammars/source.direct-x.json +135 -0
  31. data/grammars/source.ebnf.json +67 -39
  32. data/grammars/source.editorconfig.json +23 -5
  33. data/grammars/source.elixir.json +51 -0
  34. data/grammars/source.elm.json +1 -1
  35. data/grammars/source.emacs.lisp.json +10 -0
  36. data/grammars/source.faust.json +119 -0
  37. data/grammars/source.futhark.json +146 -0
  38. data/grammars/source.gcode.json +166 -8
  39. data/grammars/source.gedcom.json +196 -0
  40. data/grammars/source.generic-db.json +41 -0
  41. data/grammars/source.gfm.blade.json +15 -0
  42. data/grammars/source.gfm.json +1697 -1439
  43. data/grammars/source.gitconfig.json +1 -1
  44. data/grammars/source.hack.json +200 -98
  45. data/grammars/source.haskell.json +58 -11
  46. data/grammars/source.hlsl.json +9 -5
  47. data/grammars/source.hosts.json +40 -0
  48. data/grammars/source.hsig.json +58 -11
  49. data/grammars/source.httpspec.json +1 -1
  50. data/grammars/source.hx.json +9 -5
  51. data/grammars/source.hxml.json +2 -2
  52. data/grammars/source.idris.json +1 -1
  53. data/grammars/source.igor.json +46 -2
  54. data/grammars/source.ini.npmrc.json +311 -0
  55. data/grammars/source.inno.json +133 -0
  56. data/grammars/source.inputrc.json +500 -0
  57. data/grammars/source.isabelle.root.json +1 -1
  58. data/grammars/source.jison.json +3 -0
  59. data/grammars/source.jisonlex.json +3 -0
  60. data/grammars/source.js.json +4 -4
  61. data/grammars/source.julia.json +70 -24
  62. data/grammars/source.kotlin.json +17 -51
  63. data/grammars/source.lcov.json +398 -0
  64. data/grammars/source.lean.json +20 -4
  65. data/grammars/source.lean.markdown.json +2598 -0
  66. data/grammars/source.lex.json +4 -4
  67. data/grammars/source.m2.json +125 -0
  68. data/grammars/source.m4.json +141 -99
  69. data/grammars/source.man-conf.json +47 -35
  70. data/grammars/source.matlab.json +437 -184
  71. data/grammars/source.mcfunction-snapshot.json +21388 -561
  72. data/grammars/source.mcfunction.json +55 -5
  73. data/grammars/source.meson.json +1 -1
  74. data/grammars/source.mlir.json +37 -317
  75. data/grammars/source.modula-3.json +10 -0
  76. data/grammars/source.msl.json +755 -0
  77. data/grammars/source.nasl.json +155 -0
  78. data/grammars/source.neon.json +381 -0
  79. data/grammars/source.nextflow.json +2 -2
  80. data/grammars/source.objc.platform.json +493 -35
  81. data/grammars/source.odin-ehr.json +806 -0
  82. data/grammars/source.odin.json +402 -0
  83. data/grammars/source.openbsd-pkg.contents.json +128 -0
  84. data/grammars/source.opts.json +12 -2
  85. data/grammars/source.perl6fe.json +1 -1
  86. data/grammars/source.postscript.json +358 -103
  87. data/grammars/source.prisma.json +435 -0
  88. data/grammars/source.purescript.json +29 -2
  89. data/grammars/source.python.json +52 -0
  90. data/grammars/source.q.json +150 -63
  91. data/grammars/source.qasm.json +66 -0
  92. data/grammars/source.ql.json +1408 -0
  93. data/grammars/source.r.json +4 -4
  94. data/grammars/source.reason.json +28 -16
  95. data/grammars/source.rego.json +124 -0
  96. data/grammars/source.sass.json +158 -3
  97. data/grammars/source.scala.json +53 -18
  98. data/grammars/source.sieve.json +383 -0
  99. data/grammars/source.solidity.json +1 -1
  100. data/grammars/source.ssh-config.json +1 -14
  101. data/grammars/source.swift.json +162 -2
  102. data/grammars/source.sy.json +2088 -183
  103. data/grammars/source.tags.json +266 -0
  104. data/grammars/source.terraform.json +576 -132
  105. data/grammars/source.tnsaudit.json +256 -0
  106. data/grammars/source.ts.json +246 -70
  107. data/grammars/source.tsx.json +247 -71
  108. data/grammars/source.v.json +587 -761
  109. data/grammars/source.vim-snippet.json +645 -0
  110. data/grammars/source.viml.json +6 -6
  111. data/grammars/source.webassembly.json +10 -0
  112. data/grammars/source.webidl.json +8 -0
  113. data/grammars/source.wgetrc.json +1640 -0
  114. data/grammars/source.wsd.json +781 -0
  115. data/grammars/source.x86.json +7 -3
  116. data/grammars/source.zig.json +231 -360
  117. data/grammars/text.dfy.dafny.json +188 -0
  118. data/grammars/text.html.php.blade.json +535 -528
  119. data/grammars/text.html.riot.json +788 -0
  120. data/grammars/text.muse.json +1471 -0
  121. data/grammars/text.openbsd-pkg.desc.json +78 -0
  122. data/grammars/text.roff.json +49 -1
  123. data/grammars/text.sfd.json +21 -0
  124. data/grammars/text.tex.latex.haskell.json +58 -11
  125. data/grammars/text.vim-help.json +383 -0
  126. data/grammars/text.xml.svg.json +8 -2
  127. data/grammars/version +1 -1
  128. data/lib/linguist/VERSION +1 -1
  129. data/lib/linguist/blob_helper.rb +4 -2
  130. data/lib/linguist/file_blob.rb +1 -1
  131. data/lib/linguist/generated.rb +96 -28
  132. data/lib/linguist/heuristics.yml +64 -4
  133. data/lib/linguist/languages.json +1 -1
  134. data/lib/linguist/languages.yml +408 -49
  135. data/lib/linguist/lazy_blob.rb +10 -10
  136. data/lib/linguist/linguist.bundle +0 -0
  137. data/lib/linguist/samples.json +48129 -31562
  138. data/lib/linguist/shebang.rb +5 -3
  139. data/lib/linguist/vendor.yml +71 -60
  140. metadata +48 -17
  141. data/grammars/source.LS.json +0 -85
  142. data/grammars/source.MCPOST.json +0 -54
  143. data/grammars/source.MOD.json +0 -55
  144. data/grammars/source.apt.json +0 -18
  145. data/grammars/source.jlex.json +0 -322
  146. data/grammars/source.yaml-ext.json +0 -324
  147. data/grammars/text.html.abl.json +0 -70
@@ -0,0 +1,266 @@
1
+ {
2
+ "name": "Tags",
3
+ "scopeName": "source.tags",
4
+ "patterns": [
5
+ {
6
+ "begin": "\\A[ \\t]*$",
7
+ "end": "(?=[^ \\t\\r\\n])"
8
+ },
9
+ {
10
+ "name": "meta.file.etags",
11
+ "begin": "(?=\\f)",
12
+ "end": "(?=A)B",
13
+ "patterns": [
14
+ {
15
+ "include": "#etags"
16
+ }
17
+ ]
18
+ },
19
+ {
20
+ "name": "meta.file.ctags",
21
+ "begin": "(?=\\S)",
22
+ "end": "(?=A)B",
23
+ "patterns": [
24
+ {
25
+ "include": "#ctags"
26
+ }
27
+ ]
28
+ }
29
+ ],
30
+ "repository": {
31
+ "ctagDefinition": {
32
+ "name": "meta.tag.definition.ctags",
33
+ "match": "(?x) ^ \\s*\n([^\\t]+) \\t+\n([^\\t]+) \\t+\n( (\\d+)\n| ((/) ((?:[^\\\\/]|\\\\.)*+)(/))\n| ((\\?) ((?:[^\\\\?]|\\\\.)*+)(\\?))\n) \\s*\n((;\")\\s*(.*))?",
34
+ "captures": {
35
+ "1": {
36
+ "name": "entity.name.tag.definition.ctags"
37
+ },
38
+ "10": {
39
+ "name": "punctuation.definition.regexp.begin.ctags"
40
+ },
41
+ "11": {
42
+ "patterns": [
43
+ {
44
+ "include": "source.regexp"
45
+ }
46
+ ]
47
+ },
48
+ "12": {
49
+ "name": "punctuation.definition.regexp.end.ctags"
50
+ },
51
+ "13": {
52
+ "name": "comment.line.tag-fields.ctags"
53
+ },
54
+ "14": {
55
+ "name": "punctuation.definition.comment.ctags"
56
+ },
57
+ "15": {
58
+ "patterns": [
59
+ {
60
+ "include": "#fields"
61
+ }
62
+ ]
63
+ },
64
+ "2": {
65
+ "name": "entity.name.filename.source.ctags"
66
+ },
67
+ "3": {
68
+ "name": "meta.tag-address.ctags"
69
+ },
70
+ "4": {
71
+ "patterns": [
72
+ {
73
+ "include": "etc#int"
74
+ }
75
+ ]
76
+ },
77
+ "5": {
78
+ "name": "string.regexp.search.ctags"
79
+ },
80
+ "6": {
81
+ "name": "punctuation.definition.regexp.begin.ctags"
82
+ },
83
+ "7": {
84
+ "patterns": [
85
+ {
86
+ "include": "source.regexp"
87
+ }
88
+ ]
89
+ },
90
+ "8": {
91
+ "name": "punctuation.definition.regexp.end.ctags"
92
+ },
93
+ "9": {
94
+ "name": "string.regexp.search.ctags"
95
+ }
96
+ }
97
+ },
98
+ "ctagMetadata": {
99
+ "name": "meta.metadata.ctags",
100
+ "contentName": "comment.line.ctags",
101
+ "begin": "^\\s*((!)_TAG_[^\\t\\r\\n]*)(?:\\t+([^\\t\\r\\n]+))?",
102
+ "end": "(?=\\s*$)",
103
+ "beginCaptures": {
104
+ "1": {
105
+ "name": "keyword.operator.tag.metadata.ctags"
106
+ },
107
+ "2": {
108
+ "name": "punctuation.definition.metadata.ctags"
109
+ },
110
+ "3": {
111
+ "patterns": [
112
+ {
113
+ "include": "etc#num"
114
+ },
115
+ {
116
+ "include": "etc#url"
117
+ },
118
+ {
119
+ "name": "constant.other.metadata.ctags",
120
+ "match": ".+"
121
+ }
122
+ ]
123
+ }
124
+ }
125
+ },
126
+ "ctags": {
127
+ "patterns": [
128
+ {
129
+ "include": "#ctagMetadata"
130
+ },
131
+ {
132
+ "include": "#ctagDefinition"
133
+ }
134
+ ]
135
+ },
136
+ "etags": {
137
+ "patterns": [
138
+ {
139
+ "name": "meta.section.etags",
140
+ "begin": "^\\f$",
141
+ "end": "(?!\\G)(?=^\\f$)",
142
+ "patterns": [
143
+ {
144
+ "name": "meta.header.etags",
145
+ "contentName": "markup.heading.filename.source.etags",
146
+ "begin": "(?=\\G)",
147
+ "end": "(,\\d+)?[ \\t]*$",
148
+ "endCaptures": {
149
+ "1": {
150
+ "patterns": [
151
+ {
152
+ "include": "etc#comma"
153
+ },
154
+ {
155
+ "include": "etc#int"
156
+ }
157
+ ]
158
+ }
159
+ }
160
+ },
161
+ {
162
+ "name": "meta.tag.definition.etags",
163
+ "match": "^([^\\x7F\\x01]+)(\\x7F)(?:([^\\x01]+)(\\x01))?(\\d+,\\d+)[ \\t]*$",
164
+ "captures": {
165
+ "1": {
166
+ "name": "variable.tag.definition.etags"
167
+ },
168
+ "2": {
169
+ "name": "punctuation.c0.ctrl-char.delete.etags"
170
+ },
171
+ "3": {
172
+ "name": "entity.name.tag.definition.etags"
173
+ },
174
+ "4": {
175
+ "name": "punctuation.c0.ctrl-char.delete.etags"
176
+ },
177
+ "5": {
178
+ "patterns": [
179
+ {
180
+ "include": "etc#comma"
181
+ },
182
+ {
183
+ "include": "etc#int"
184
+ }
185
+ ]
186
+ }
187
+ }
188
+ }
189
+ ],
190
+ "beginCaptures": {
191
+ "0": {
192
+ "name": "punctuation.whitespace.isolated.unpadded.form-feed.etags"
193
+ }
194
+ }
195
+ }
196
+ ]
197
+ },
198
+ "fieldEscape": {
199
+ "name": "constant.character.escape.backslash.ctags",
200
+ "match": "(\\\\).",
201
+ "captures": {
202
+ "1": {
203
+ "name": "punctuation.definition.escape.backslash.ctags"
204
+ }
205
+ }
206
+ },
207
+ "fields": {
208
+ "patterns": [
209
+ {
210
+ "name": "meta.field.$1.ctags",
211
+ "contentName": "string.unquoted.field-value.ctags",
212
+ "begin": "(?:\\G|(?\u003c=\\s|^))(function)(:)",
213
+ "end": "(?=\\s|$)",
214
+ "patterns": [
215
+ {
216
+ "name": "keyword.operator.separator.function-names.ctags",
217
+ "match": "/"
218
+ },
219
+ {
220
+ "include": "#fieldEscape"
221
+ }
222
+ ],
223
+ "beginCaptures": {
224
+ "1": {
225
+ "name": "variable.assignment.ctags"
226
+ },
227
+ "2": {
228
+ "patterns": [
229
+ {
230
+ "include": "etc#kolon"
231
+ }
232
+ ]
233
+ }
234
+ }
235
+ },
236
+ {
237
+ "name": "meta.field.$1.ctags",
238
+ "contentName": "string.unquoted.field-value.ctags",
239
+ "begin": "(?:\\G|(?\u003c=\\s|^))([^:\\s]+)(:)",
240
+ "end": "(?=\\s|$)",
241
+ "patterns": [
242
+ {
243
+ "include": "#fieldEscape"
244
+ }
245
+ ],
246
+ "beginCaptures": {
247
+ "1": {
248
+ "name": "variable.assignment.ctags"
249
+ },
250
+ "2": {
251
+ "patterns": [
252
+ {
253
+ "include": "etc#kolon"
254
+ }
255
+ ]
256
+ }
257
+ }
258
+ },
259
+ {
260
+ "name": "constant.language.other.kind.ctags",
261
+ "match": "(?\u003c=\\s|^)\\w(?=\\s|$)"
262
+ }
263
+ ]
264
+ }
265
+ }
266
+ }
@@ -3,248 +3,692 @@
3
3
  "scopeName": "source.terraform",
4
4
  "patterns": [
5
5
  {
6
- "name": "comment.line.number-sign.terraform",
7
- "begin": "#|//",
8
- "end": "$\\n?",
9
- "captures": {
6
+ "include": "#comments"
7
+ },
8
+ {
9
+ "include": "#top_level_attribute_definition"
10
+ },
11
+ {
12
+ "include": "#imports"
13
+ },
14
+ {
15
+ "include": "#block"
16
+ },
17
+ {
18
+ "include": "#expressions"
19
+ }
20
+ ],
21
+ "repository": {
22
+ "attribute_access": {
23
+ "begin": "\\.",
24
+ "end": "(\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b)|(\\*)|(\\d+)",
25
+ "beginCaptures": {
10
26
  "0": {
11
- "name": "punctuation.definition.comment.terraform"
27
+ "name": "keyword.operator.accessor.terraform"
28
+ }
29
+ },
30
+ "endCaptures": {
31
+ "1": {
32
+ "name": "variable.other.member.terraform"
33
+ },
34
+ "2": {
35
+ "name": "keyword.operator.splat.terraform"
36
+ },
37
+ "3": {
38
+ "name": "constant.numeric.integer.terraform"
12
39
  }
13
40
  }
14
41
  },
15
- {
42
+ "block": {
43
+ "name": "meta.type.terraform",
44
+ "begin": "(\\b(resource|provider|variable|output|locals|module|data|terraform)\\b|(\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b))(?=[\\s\\\"\\-[:word:]]*(\\{))",
45
+ "end": "(?=\\{)",
46
+ "patterns": [
47
+ {
48
+ "name": "string.quoted.double.terraform",
49
+ "begin": "\\\"",
50
+ "end": "\\\"",
51
+ "beginCaptures": {
52
+ "0": {
53
+ "name": "punctuation.definition.string.begin.terraform"
54
+ }
55
+ },
56
+ "endCaptures": {
57
+ "0": {
58
+ "name": "punctuation.definition.string.end.terraform"
59
+ }
60
+ }
61
+ },
62
+ {
63
+ "name": "entity.name.label.terraform",
64
+ "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b"
65
+ }
66
+ ],
67
+ "beginCaptures": {
68
+ "2": {
69
+ "name": "storage.type.terraform"
70
+ },
71
+ "3": {
72
+ "name": "entity.name.type.terraform"
73
+ }
74
+ }
75
+ },
76
+ "block_comments": {
16
77
  "name": "comment.block.terraform",
17
78
  "begin": "/\\*",
18
79
  "end": "\\*/",
19
- "captures": {
80
+ "beginCaptures": {
81
+ "0": {
82
+ "name": "punctuation.definition.comment.terraform"
83
+ }
84
+ },
85
+ "endCaptures": {
20
86
  "0": {
21
87
  "name": "punctuation.definition.comment.terraform"
22
88
  }
23
89
  }
24
90
  },
25
- {
26
- "name": "constant.language.terraform",
27
- "match": "\\b(true|false|yes|no|on|off)\\b"
28
- },
29
- {
30
- "name": "constant.numeric.terraform",
31
- "match": "\\b([0-9]+)([kKmMgG]b?)?\\b"
91
+ "brackets": {
92
+ "begin": "\\[",
93
+ "end": "(\\*)?\\]",
94
+ "patterns": [
95
+ {
96
+ "include": "#comma"
97
+ },
98
+ {
99
+ "include": "#comments"
100
+ },
101
+ {
102
+ "include": "#expressions"
103
+ },
104
+ {
105
+ "include": "#tuple_for_expression"
106
+ }
107
+ ],
108
+ "beginCaptures": {
109
+ "0": {
110
+ "name": "punctuation.section.brackets.begin.terraform"
111
+ }
112
+ },
113
+ "endCaptures": {
114
+ "0": {
115
+ "name": "punctuation.section.brackets.end.terraform"
116
+ },
117
+ "1": {
118
+ "name": "keyword.operator.splat.terraform"
119
+ }
120
+ }
32
121
  },
33
- {
34
- "name": "constant.numeric.terraform",
35
- "match": "\\b(0x[0-9A-Fa-f]+)([kKmMgG]b?)?\\b"
122
+ "comma": {
123
+ "name": "punctuation.separator.terraform",
124
+ "match": "\\,"
36
125
  },
37
- {
38
- "name": "meta.resource.terraform",
39
- "match": "(resource|data)\\s+(\")?(\\w+)(\")?\\s+(\")?([\\w\\-]+)(\")?\\s+({)",
40
- "captures": {
41
- "1": {
42
- "name": "storage.type.function.terraform"
126
+ "comments": {
127
+ "patterns": [
128
+ {
129
+ "include": "#inline_comments"
43
130
  },
44
- "2": {
45
- "name": "string.terraform punctuation.definition.string.begin.terraform"
131
+ {
132
+ "include": "#block_comments"
133
+ }
134
+ ]
135
+ },
136
+ "expressions": {
137
+ "patterns": [
138
+ {
139
+ "include": "#literal_values"
46
140
  },
47
- "3": {
48
- "name": "string.value.terraform"
141
+ {
142
+ "include": "#operators"
49
143
  },
50
- "4": {
51
- "name": "string.terraform punctuation.definition.string.end.terraform"
144
+ {
145
+ "include": "#brackets"
52
146
  },
53
- "5": {
54
- "name": "string.terraform punctuation.definition.string.begin.terraform"
147
+ {
148
+ "include": "#objects"
55
149
  },
56
- "6": {
57
- "name": "string.value.terraform"
150
+ {
151
+ "include": "#attribute_access"
58
152
  },
59
- "7": {
60
- "name": "string.terraform punctuation.definition.string.end.terraform"
153
+ {
154
+ "include": "#functions"
61
155
  },
62
- "8": {
63
- "name": "punctuation.definition.tag.terraform"
156
+ {
157
+ "include": "#parens"
64
158
  }
65
- }
159
+ ]
66
160
  },
67
- {
68
- "match": "(provider|provisioner|variable|output|module|atlas)\\s+(\")?([\\w\\-]+)(\")?\\s+({)",
69
- "captures": {
70
- "1": {
71
- "name": "storage.type.function.terraform"
161
+ "functions": {
162
+ "name": "meta.function-call.terraform",
163
+ "begin": "((abs|ceil|floor|log|max|min|pow|signum|chomp|format|formatlist|indent|join|lower|regex|regexall|replace|split|strrev|substr|title|trimspace|upper|chunklist|coalesce|coalescelist|compact|concat|contains|distinct|element|flatten|index|keys|length|list|lookup|map|matchkeys|merge|range|reverse|setintersection|setproduct|setunion|slice|sort|transpose|values|zipmap|base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|urlencode|yamldecode|yamlencode|abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile|formatdate|timeadd|timestamp|base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filemd1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5|cidrhost|cidrnetmask|cidrsubnet|tobool|tolist|tomap|tonumber|toset|tostring)|\\b((?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b))(\\()",
164
+ "end": "\\)",
165
+ "patterns": [
166
+ {
167
+ "include": "#comments"
72
168
  },
169
+ {
170
+ "include": "#expressions"
171
+ },
172
+ {
173
+ "include": "#comma"
174
+ }
175
+ ],
176
+ "beginCaptures": {
73
177
  "2": {
74
- "name": "string.terraform punctuation.definition.string.begin.terraform"
178
+ "name": "support.function.builtin.terraform"
75
179
  },
76
180
  "3": {
77
- "name": "string.value.terraform"
181
+ "name": "variable.function.terraform"
78
182
  },
79
183
  "4": {
80
- "name": "string.terraform punctuation.definition.string.end.terraform"
81
- },
82
- "5": {
83
- "name": "punctuation.definition.tag.terraform"
184
+ "name": "punctuation.section.parens.begin.terraform"
185
+ }
186
+ },
187
+ "endCaptures": {
188
+ "0": {
189
+ "name": "punctuation.section.parens.end.terraform"
84
190
  }
85
191
  }
86
192
  },
87
- {
88
- "match": "([\\w_-]+)\\s*(=)\\s*",
89
- "captures": {
193
+ "heredoc": {
194
+ "name": "string.unquoted.heredoc.terraform",
195
+ "begin": "(\\\u003c\\\u003c\\-?)\\s*(\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b)\\s*$",
196
+ "end": "^\\s*\\2\\s*$",
197
+ "patterns": [
198
+ {
199
+ "include": "#string_interpolation"
200
+ }
201
+ ],
202
+ "beginCaptures": {
90
203
  "1": {
91
- "name": "variable.other.assignment.terraform"
204
+ "name": "keyword.operator.heredoc.terraform"
92
205
  },
93
206
  "2": {
94
- "name": "keyword.operator.terraform"
207
+ "name": "keyword.control.heredoc.terraform"
208
+ }
209
+ },
210
+ "endCaptures": {
211
+ "0": {
212
+ "name": "keyword.control.heredoc.terraform"
95
213
  }
96
214
  }
97
215
  },
98
- {
99
- "match": "(\")([\\w_-]+)(\")\\s*(=)\\s*",
100
- "captures": {
101
- "1": {
102
- "name": "punctuation.quote.double.terraform"
216
+ "imports": {
217
+ "begin": "\\s*(terraform)\\s*(import)\\s*",
218
+ "end": "$\\n?",
219
+ "patterns": [
220
+ {
221
+ "include": "#string_literals"
103
222
  },
104
- "2": {
105
- "name": "variable.assignment.terraform"
223
+ {
224
+ "name": "entity.name.label.terraform",
225
+ "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b"
106
226
  },
107
- "3": {
108
- "name": "punctuation.quote.double.terraform"
227
+ {
228
+ "include": "#numeric_literals"
109
229
  },
110
- "4": {
111
- "name": "keyword.operator.terraform"
230
+ {
231
+ "include": "#attribute_access"
112
232
  }
113
- }
114
- },
115
- {
116
- "match": "([\\w\\-_]+)\\s+({)",
117
- "captures": {
233
+ ],
234
+ "beginCaptures": {
118
235
  "1": {
119
- "name": "entity.name.section.terraform"
236
+ "name": "support.constant.terraform"
120
237
  },
121
238
  "2": {
122
- "name": "punctuation.definition.tag.terraform"
239
+ "name": "keyword.control.import.terraform"
123
240
  }
124
241
  }
125
242
  },
126
- {
127
- "include": "#strings"
128
- },
129
- {
130
- "name": "string.unquoted.heredoc.terraform",
131
- "begin": "(?\u003e\\s*\u003c\u003c(\\w+))",
132
- "end": "^\\s*\\1$",
243
+ "inline_comments": {
244
+ "name": "comment.line.terraform",
245
+ "begin": "#|//",
246
+ "end": "$\n?",
133
247
  "beginCaptures": {
134
248
  "0": {
135
- "name": "punctuation.definition.string.begin.terraform"
249
+ "name": "punctuation.definition.comment.terraform"
250
+ }
251
+ }
252
+ },
253
+ "language_constants": {
254
+ "name": "constant.language.terraform",
255
+ "match": "\\b(true|false|null)\\b"
256
+ },
257
+ "literal_values": {
258
+ "patterns": [
259
+ {
260
+ "include": "#numeric_literals"
136
261
  },
137
- "1": {
138
- "name": "keyword.operator.heredoc.terraform"
262
+ {
263
+ "include": "#language_constants"
264
+ },
265
+ {
266
+ "include": "#string_literals"
267
+ },
268
+ {
269
+ "include": "#heredoc"
270
+ },
271
+ {
272
+ "include": "#type_keywords"
273
+ },
274
+ {
275
+ "include": "#named_value_references"
139
276
  }
140
- },
141
- "endCaptures": {
277
+ ]
278
+ },
279
+ "main": {
280
+ "patterns": [
281
+ {
282
+ "include": "#comments"
283
+ },
284
+ {
285
+ "include": "#block"
286
+ },
287
+ {
288
+ "include": "#expressions"
289
+ }
290
+ ]
291
+ },
292
+ "named_value_references": {
293
+ "name": "support.constant.terraform",
294
+ "match": "\\b(var|local|module|data|path|terraform)\\b"
295
+ },
296
+ "numeric_literals": {
297
+ "patterns": [
298
+ {
299
+ "name": "constant.numeric.float.terraform",
300
+ "match": "\\b\\d+(([Ee][+-]?))\\d+\\b",
301
+ "captures": {
302
+ "1": {
303
+ "name": "punctuation.separator.exponent.terraform"
304
+ }
305
+ }
306
+ },
307
+ {
308
+ "name": "constant.numeric.float.terraform",
309
+ "match": "\\b\\d+(\\.)\\d+(?:(([Ee][+-]?))\\d+)?\\b",
310
+ "captures": {
311
+ "1": {
312
+ "name": "punctuation.separator.decimal.terraform"
313
+ },
314
+ "2": {
315
+ "name": "punctuation.separator.exponent.terraform"
316
+ }
317
+ }
318
+ },
319
+ {
320
+ "name": "constant.numeric.integer.terraform",
321
+ "match": "\\b\\d+\\b"
322
+ }
323
+ ]
324
+ },
325
+ "object_for_expression": {
326
+ "begin": "\\bfor\\b",
327
+ "end": "(?=\\})",
328
+ "patterns": [
329
+ {
330
+ "name": "storage.type.function.terraform",
331
+ "match": "\\=\\\u003e"
332
+ },
333
+ {
334
+ "name": "keyword.operator.word.terraform",
335
+ "match": "\\bin\\b"
336
+ },
337
+ {
338
+ "name": "keyword.control.conditional.terraform",
339
+ "match": "\\bif\\b"
340
+ },
341
+ {
342
+ "name": "keyword.operator.terraform",
343
+ "match": "\\:"
344
+ },
345
+ {
346
+ "include": "#expressions"
347
+ },
348
+ {
349
+ "include": "#comments"
350
+ },
351
+ {
352
+ "include": "#comma"
353
+ },
354
+ {
355
+ "name": "variable.other.readwrite.terraform",
356
+ "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b"
357
+ }
358
+ ],
359
+ "beginCaptures": {
142
360
  "0": {
143
- "name": "punctuation.definition.string.end.terraform keyword.operator.heredoc.terraform"
361
+ "name": "keyword.control.terraform"
144
362
  }
145
363
  }
146
- }
147
- ],
148
- "repository": {
149
- "string_interpolation": {
364
+ },
365
+ "object_key_values": {
150
366
  "patterns": [
151
367
  {
152
- "name": "source.terraform.embedded.source",
153
- "begin": "\\$\\{",
154
- "end": "\\}",
368
+ "include": "#comments"
369
+ },
370
+ {
371
+ "include": "#expressions"
372
+ }
373
+ ]
374
+ },
375
+ "objects": {
376
+ "name": "meta.braces.terraform",
377
+ "begin": "\\{",
378
+ "end": "\\}",
379
+ "patterns": [
380
+ {
381
+ "include": "#object_for_expression"
382
+ },
383
+ {
384
+ "include": "#comments"
385
+ },
386
+ {
387
+ "begin": "\\s*(\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b)\\s*(\\=)\\s*",
388
+ "end": "((\\,)|($\\n?)|(?=\\}))",
155
389
  "patterns": [
156
390
  {
157
- "include": "$self"
391
+ "include": "#object_key_values"
392
+ }
393
+ ],
394
+ "beginCaptures": {
395
+ "1": {
396
+ "name": "meta.mapping.key.terraform string.unquoted.terraform"
158
397
  },
159
- {
160
- "include": "#string_interpolation_functions"
398
+ "2": {
399
+ "name": "keyword.operator.terraform"
400
+ }
401
+ },
402
+ "endCaptures": {
403
+ "1": {
404
+ "name": "punctuation.separator.terraform"
161
405
  },
406
+ "3": {
407
+ "name": "punctuation.section.braces.end.terraform"
408
+ }
409
+ }
410
+ },
411
+ {
412
+ "begin": "((\\\").*(\\\"))\\s*(\\=)\\s*",
413
+ "end": "((\\,)|($\\n?)|(?=\\}))",
414
+ "patterns": [
162
415
  {
163
- "include": "#string_interpolation_keywords"
416
+ "include": "#object_key_values"
417
+ }
418
+ ],
419
+ "beginCaptures": {
420
+ "1": {
421
+ "name": "meta.mapping.key.terraform string.quoted.double.terraform"
164
422
  },
165
- {
166
- "match": "(\\.)",
167
- "captures": {
168
- "0": {
169
- "name": "keyword.control.period.terraform"
170
- }
171
- }
423
+ "2": {
424
+ "name": "punctuation.definition.string.begin.terraform"
425
+ },
426
+ "3": {
427
+ "name": "punctuation.definition.string.end.terraform"
428
+ },
429
+ "4": {
430
+ "name": "keyword.operator.terraform"
431
+ }
432
+ },
433
+ "endCaptures": {
434
+ "1": {
435
+ "name": "punctuation.separator.terraform"
172
436
  },
437
+ "3": {
438
+ "name": "punctuation.section.braces.end.terraform"
439
+ }
440
+ }
441
+ },
442
+ {
443
+ "name": "meta.mapping.key.terraform",
444
+ "begin": "\\(",
445
+ "end": "(\\))\\s*(\\=)\\s*",
446
+ "patterns": [
173
447
  {
174
- "include": "#strings"
448
+ "include": "#expressions"
175
449
  }
176
450
  ],
177
451
  "beginCaptures": {
178
452
  "0": {
179
- "name": "entity.tag.embedded.start.terraform"
453
+ "name": "punctuation.section.parens.begin.terraform"
180
454
  }
181
455
  },
182
456
  "endCaptures": {
183
- "0": {
184
- "name": "entity.tag.embedded.end.terraform"
457
+ "1": {
458
+ "name": "punctuation.section.parens.end.terraform"
459
+ },
460
+ "2": {
461
+ "name": "keyword.operator.terraform"
185
462
  }
186
463
  }
464
+ },
465
+ {
466
+ "patterns": [
467
+ {
468
+ "include": "#main"
469
+ }
470
+ ]
187
471
  }
188
- ]
472
+ ],
473
+ "beginCaptures": {
474
+ "0": {
475
+ "name": "punctuation.section.braces.begin.terraform"
476
+ }
477
+ },
478
+ "endCaptures": {
479
+ "0": {
480
+ "name": "punctuation.section.braces.end.terraform"
481
+ }
482
+ }
189
483
  },
190
- "string_interpolation_functions": {
191
- "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)(\\()",
192
- "end": "(\\))",
484
+ "operators": {
193
485
  "patterns": [
194
486
  {
195
- "include": "#string_interpolation_functions"
487
+ "name": "keyword.operator.terraform",
488
+ "match": "\\\u003e\\="
196
489
  },
197
490
  {
198
- "include": "#string_interpolation_keywords"
491
+ "name": "keyword.operator.terraform",
492
+ "match": "\\\u003c\\="
199
493
  },
200
494
  {
201
- "include": "#strings"
495
+ "name": "keyword.operator.terraform",
496
+ "match": "\\=\\="
497
+ },
498
+ {
499
+ "name": "keyword.operator.terraform",
500
+ "match": "\\!\\="
501
+ },
502
+ {
503
+ "name": "keyword.operator.arithmetic.terraform",
504
+ "match": "\\+"
505
+ },
506
+ {
507
+ "name": "keyword.operator.arithmetic.terraform",
508
+ "match": "\\-"
509
+ },
510
+ {
511
+ "name": "keyword.operator.arithmetic.terraform",
512
+ "match": "\\*"
513
+ },
514
+ {
515
+ "name": "keyword.operator.arithmetic.terraform",
516
+ "match": "\\/"
517
+ },
518
+ {
519
+ "name": "keyword.operator.arithmetic.terraform",
520
+ "match": "\\%"
521
+ },
522
+ {
523
+ "name": "keyword.operator.logical.terraform",
524
+ "match": "\\\u0026\\\u0026"
525
+ },
526
+ {
527
+ "name": "keyword.operator.logical.terraform",
528
+ "match": "\\|\\|"
529
+ },
530
+ {
531
+ "name": "keyword.operator.logical.terraform",
532
+ "match": "\\!"
533
+ },
534
+ {
535
+ "name": "keyword.operator.terraform",
536
+ "match": "\\\u003e"
537
+ },
538
+ {
539
+ "name": "keyword.operator.terraform",
540
+ "match": "\\\u003c"
541
+ },
542
+ {
543
+ "name": "keyword.operator.terraform",
544
+ "match": "\\?"
545
+ },
546
+ {
547
+ "name": "keyword.operator.terraform",
548
+ "match": "\\.\\.\\."
549
+ },
550
+ {
551
+ "name": "keyword.operator.terraform",
552
+ "match": "\\:"
553
+ }
554
+ ]
555
+ },
556
+ "parens": {
557
+ "begin": "\\(",
558
+ "end": "\\)",
559
+ "patterns": [
560
+ {
561
+ "include": "#expressions"
562
+ },
563
+ {
564
+ "name": "variable.other.readwrite.terraform",
565
+ "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b"
202
566
  }
203
567
  ],
204
568
  "beginCaptures": {
205
- "1": {
206
- "name": "keyword.other.function.inline.terraform"
207
- },
208
- "2": {
209
- "name": "keyword.other.section.begin.terraform"
569
+ "0": {
570
+ "name": "punctuation.section.parens.begin.terraform"
210
571
  }
211
572
  },
212
573
  "endCaptures": {
213
- "1": {
214
- "name": "keyword.other.section.end.terraform"
574
+ "0": {
575
+ "name": "punctuation.section.parens.end.terraform"
215
576
  }
216
577
  }
217
578
  },
218
- "string_interpolation_keywords": {
219
- "match": "(terraform|var|self|count|module|path|data|local)(\\.[\\w\\*]+)+",
220
- "captures": {
579
+ "string_interpolation": {
580
+ "name": "meta.interpolation.terraform",
581
+ "begin": "(\\$|\\%)\\{",
582
+ "end": "\\}",
583
+ "patterns": [
584
+ {
585
+ "name": "keyword.operator.template.left.trim.terraform",
586
+ "match": "\\~\\s"
587
+ },
588
+ {
589
+ "name": "keyword.operator.template.right.trim.terraform",
590
+ "match": "\\s\\~"
591
+ },
592
+ {
593
+ "name": "keyword.control.terraform",
594
+ "match": "\\b(if|else|endif|for|in|endfor)\\b"
595
+ },
596
+ {
597
+ "include": "#expressions"
598
+ }
599
+ ],
600
+ "beginCaptures": {
601
+ "0": {
602
+ "name": "keyword.other.interpolation.begin.terraform"
603
+ }
604
+ },
605
+ "endCaptures": {
221
606
  "0": {
222
- "name": "entity.other.attribute-name.terraform"
607
+ "name": "keyword.other.interpolation.end.terraform"
223
608
  }
224
609
  }
225
610
  },
226
- "strings": {
227
- "begin": "\\\"",
228
- "end": "\\\"",
611
+ "string_literals": {
612
+ "name": "string.quoted.double.terraform",
613
+ "begin": "\"",
614
+ "end": "\"",
229
615
  "patterns": [
230
616
  {
231
617
  "include": "#string_interpolation"
232
618
  },
233
619
  {
234
- "name": "string.quoted.double.terraform",
235
- "match": "([\\w\\-\\/\\._\\\\%\\(\\)]+)"
620
+ "name": "constant.character.escape.terraform",
621
+ "match": "\\\\[nrt\"\\\\]|\\\\u([[:xdigit:]]{8}|[[:xdigit:]]{4})"
236
622
  }
237
623
  ],
238
624
  "beginCaptures": {
239
625
  "0": {
240
- "name": "string.terraform punctuation.definition.string.begin.terraform"
626
+ "name": "punctuation.definition.string.begin.terraform"
241
627
  }
242
628
  },
243
629
  "endCaptures": {
244
630
  "0": {
245
- "name": "string.terraform punctuation.definition.string.end.terraform"
631
+ "name": "punctuation.definition.string.end.terraform"
632
+ }
633
+ }
634
+ },
635
+ "top_level_attribute_definition": {
636
+ "name": "variable.declaration.terraform",
637
+ "match": "(\\()?(\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b)(\\))?\\s*(\\=[^\\=|\\\u003e])\\s*",
638
+ "captures": {
639
+ "1": {
640
+ "name": "punctuation.section.parens.begin.terraform"
641
+ },
642
+ "2": {
643
+ "name": "variable.other.readwrite.terraform"
644
+ },
645
+ "3": {
646
+ "name": "punctuation.section.parens.end.terraform"
647
+ },
648
+ "4": {
649
+ "name": "keyword.operator.assignment.terraform"
650
+ }
651
+ }
652
+ },
653
+ "tuple_for_expression": {
654
+ "begin": "\\bfor\\b",
655
+ "end": "(?=\\])",
656
+ "patterns": [
657
+ {
658
+ "name": "keyword.operator.word.terraform",
659
+ "match": "\\bin\\b"
660
+ },
661
+ {
662
+ "name": "keyword.control.conditional.terraform",
663
+ "match": "\\bif\\b"
664
+ },
665
+ {
666
+ "name": "keyword.operator.terraform",
667
+ "match": "\\:"
668
+ },
669
+ {
670
+ "include": "#expressions"
671
+ },
672
+ {
673
+ "include": "#comments"
674
+ },
675
+ {
676
+ "include": "#comma"
677
+ },
678
+ {
679
+ "name": "variable.other.readwrite.terraform",
680
+ "match": "\\b(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\\b"
681
+ }
682
+ ],
683
+ "beginCaptures": {
684
+ "0": {
685
+ "name": "keyword.control.terraform"
246
686
  }
247
687
  }
688
+ },
689
+ "type_keywords": {
690
+ "name": "storage.type.terraform",
691
+ "match": "\\b(any|string|number|bool)\\b"
248
692
  }
249
693
  }
250
694
  }