Skip to content

Commit cc9fb7e

Browse files
committed
Escape dashes, should fix #22
1 parent bf59106 commit cc9fb7e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Terraform.YAML-tmLanguage

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ patterns:
3232
match: \b(0x[0-9A-Fa-f]+)([kKmMgG]b?)?\b
3333

3434
- name: meta.resource.terraform
35-
match: (resource|data)\s+(")?(\w+)(")?\s+(")?([\w-]+)(")?\s+({)
35+
match: (resource|data)\s+(")?(\w+)(")?\s+(")?([\w\-]+)(")?\s+({)
3636
foldingStartMarker: '\{\s*$'
3737
foldingStopMarker: '^\s*\}'
3838
captures:
@@ -45,7 +45,7 @@ patterns:
4545
'7': {name: string.terraform punctuation.definition.string.end.terraform}
4646
'8': {name: punctuation.definition.tag.terraform}
4747

48-
- match: (provider|provisioner|variable|output|module|atlas)\s+(")?([\w-]+)(")?\s+({)
48+
- match: (provider|provisioner|variable|output|module|atlas)\s+(")?([\w\-]+)(")?\s+({)
4949
foldingStartMarker: '\{\s*$'
5050
foldingStopMarker: '^\s*\}'
5151
captures:
@@ -99,12 +99,12 @@ repository:
9999
'0': {name: string.terraform punctuation.definition.string.end.terraform}
100100
patterns:
101101
- include: '#string_interpolation'
102-
- match: ([\w-\/\._\\%]+)
102+
- match: ([\w\-\/\._\\%]+)
103103
name: "string.quoted.double.terraform"
104104

105105
string_interpolation_functions:
106106
comment: Builtin functions
107-
begin: (replace|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)(\()
107+
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)(\()
108108
beginCaptures:
109109
'1': {name: keyword.other.function.inline.terraform}
110110
'2': {name: keyword.other.section.begin.terraform}

Terraform.tmLanguage

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<key>foldingStopMarker</key>
122122
<string>^\s*\}</string>
123123
<key>match</key>
124-
<string>(resource|data)\s+(")?(\w+)(")?\s+(")?([\w-]+)(")?\s+({)</string>
124+
<string>(resource|data)\s+(")?(\w+)(")?\s+(")?([\w\-]+)(")?\s+({)</string>
125125
<key>name</key>
126126
<string>meta.resource.terraform</string>
127127
</dict>
@@ -159,7 +159,7 @@
159159
<key>foldingStopMarker</key>
160160
<string>^\s*\}</string>
161161
<key>match</key>
162-
<string>(provider|provisioner|variable|output|module|atlas)\s+(")?([\w-]+)(")?\s+({)</string>
162+
<string>(provider|provisioner|variable|output|module|atlas)\s+(")?([\w\-]+)(")?\s+({)</string>
163163
</dict>
164164
<dict>
165165
<key>captures</key>
@@ -328,7 +328,7 @@
328328
<key>string_interpolation_functions</key>
329329
<dict>
330330
<key>begin</key>
331-
<string>(replace|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)(\()</string>
331+
<string>(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)(\()</string>
332332
<key>beginCaptures</key>
333333
<dict>
334334
<key>1</key>
@@ -411,7 +411,7 @@
411411
</dict>
412412
<dict>
413413
<key>match</key>
414-
<string>([\w-\/\._\\%]+)</string>
414+
<string>([\w\-\/\._\\%]+)</string>
415415
<key>name</key>
416416
<string>string.quoted.double.terraform</string>
417417
</dict>

0 commit comments

Comments
 (0)