Skip to content

Commit

Permalink
Escape dashes, should fix #22
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlouden committed Apr 1, 2017
1 parent bf59106 commit cc9fb7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Terraform.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ patterns:
match: \b(0x[0-9A-Fa-f]+)([kKmMgG]b?)?\b

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

- match: (provider|provisioner|variable|output|module|atlas)\s+(")?([\w-]+)(")?\s+({)
- match: (provider|provisioner|variable|output|module|atlas)\s+(")?([\w\-]+)(")?\s+({)
foldingStartMarker: '\{\s*$'
foldingStopMarker: '^\s*\}'
captures:
Expand Down Expand Up @@ -99,12 +99,12 @@ repository:
'0': {name: string.terraform punctuation.definition.string.end.terraform}
patterns:
- include: '#string_interpolation'
- match: ([\w-\/\._\\%]+)
- match: ([\w\-\/\._\\%]+)
name: "string.quoted.double.terraform"

string_interpolation_functions:
comment: Builtin functions
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)(\()
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)(\()
beginCaptures:
'1': {name: keyword.other.function.inline.terraform}
'2': {name: keyword.other.section.begin.terraform}
Expand Down
8 changes: 4 additions & 4 deletions Terraform.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<key>foldingStopMarker</key>
<string>^\s*\}</string>
<key>match</key>
<string>(resource|data)\s+(")?(\w+)(")?\s+(")?([\w-]+)(")?\s+({)</string>
<string>(resource|data)\s+(")?(\w+)(")?\s+(")?([\w\-]+)(")?\s+({)</string>
<key>name</key>
<string>meta.resource.terraform</string>
</dict>
Expand Down Expand Up @@ -159,7 +159,7 @@
<key>foldingStopMarker</key>
<string>^\s*\}</string>
<key>match</key>
<string>(provider|provisioner|variable|output|module|atlas)\s+(")?([\w-]+)(")?\s+({)</string>
<string>(provider|provisioner|variable|output|module|atlas)\s+(")?([\w\-]+)(")?\s+({)</string>
</dict>
<dict>
<key>captures</key>
Expand Down Expand Up @@ -328,7 +328,7 @@
<key>string_interpolation_functions</key>
<dict>
<key>begin</key>
<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>
<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>
<key>beginCaptures</key>
<dict>
<key>1</key>
Expand Down Expand Up @@ -411,7 +411,7 @@
</dict>
<dict>
<key>match</key>
<string>([\w-\/\._\\%]+)</string>
<string>([\w\-\/\._\\%]+)</string>
<key>name</key>
<string>string.quoted.double.terraform</string>
</dict>
Expand Down

0 comments on commit cc9fb7e

Please sign in to comment.