@@ -74,8 +74,38 @@ variables:
74
74
75
75
# Built-In Functions
76
76
#
77
- # https://www.terraform.io/docs/language/functions/index.html
78
- predeclared_funcs : 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
77
+ # https://developer.hashicorp.com/terraform/language/functions
78
+ predeclared_funcs : |-
79
+ \b(?x:
80
+ # numbers
81
+ abs|ceil|floor|log|max|min|parseint|pow|signum
82
+ # string
83
+ |chomp|endswith|format|formatlist|indent|join|lower|regex|regexall|replace
84
+ |split|startswith|strcontains|strrev|substr
85
+ |templatestring|title|trim|trimprefix|trimsuffix|trimspace|upper
86
+ # collection
87
+ |alltrue|anytrue|chunklist|coalesce|coalescelist|compact|concat|contains
88
+ |distinct|element|flatten|index|keys|length|list|lookup
89
+ |map|matchkeys|merge|one|range|reverse
90
+ |setintersection|setproduct|setsubtract|setunion|slice|sort|sum
91
+ |transpose|values|zipmap
92
+ # encoding
93
+ |base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|textdecodebase64|textencodebase64|urlencode|yamldecode|yamlencode
94
+ # filesystem
95
+ |abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile
96
+ # date and time
97
+ |formatdate|plantimestamp|timeadd|timecmp|timestamp
98
+ # hash and crypto
99
+ |base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filesha1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5
100
+ # ip network
101
+ |cidrhost|cidrnetmask|cidrsubnet|cidrsubnets
102
+ # type conversion
103
+ |can|issensitive|nonsensitive|sensitive|tobool|tolist|tomap|tonumber|toset|tostring|try|type
104
+ # terraform-specific
105
+ |provider::terraform::(?:encode_tfvars|decode_tfvars|encode_expr)
106
+ # deprecated/old
107
+ |filemd1
108
+ )\b
79
109
80
110
contexts :
81
111
main :
@@ -479,12 +509,12 @@ contexts:
479
509
# https://github.com/hashicorp/hcl2/blob/master/hcl/hclsyntax/spec.md#functions-and-function-calls
480
510
# https://www.terraform.io/docs/language/expressions/function-calls.html
481
511
functions :
482
- - match : (({{predeclared_funcs}})|\b({{identifer}})\b)(\()
512
+ - match : (?: ({{predeclared_funcs}})|\b({{identifer}})\b)(\()
483
513
comment : Built-in function calls
484
514
captures :
485
- 2 : support.function.builtin.terraform
486
- 3 : variable.function.terraform
487
- 4 : punctuation.section.parens.begin.terraform
515
+ 1 : support.function.builtin.terraform
516
+ 2 : variable.function.terraform
517
+ 3 : punctuation.section.parens.begin.terraform
488
518
push :
489
519
- meta_scope : meta.function-call.terraform
490
520
- match : \)
0 commit comments