Skip to content

Commit

Permalink
chore: make regex simpler for maintainability
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarm committed Feb 20, 2024
1 parent 1b110a7 commit 2dc1969
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ repository:
- include: "#expressions"

functions:
begin: (\w+|(?:provider::\w+::\w+))(\()
begin: ([:\-\w]+)(\()
name: meta.function-call.hcl
comment: Built-in function calls
beginCaptures:
"1":
patterns:
- match: \b(abs|abspath|alltrue|anytrue|base64decode|base64encode|base64gzip|base64sha256|base64sha512|basename|bcrypt|can|ceil|chomp|chunklist|cidrhost|cidrnetmask|cidrsubnet|cidrsubnets|coalesce|coalescelist|compact|concat|contains|csvdecode|dirname|distinct|element|endswith|file|filebase64|filebase64sha256|filebase64sha512|fileexists|filemd5|fileset|filesha1|filesha256|filesha512|flatten|floor|format|formatdate|formatlist|indent|index|join|jsondecode|jsonencode|keys|length|log|lookup|lower|matchkeys|max|md5|merge|min|nonsensitive|one|parseint|pathexpand|plantimestamp|pow|range|regex|regexall|replace|reverse|rsadecrypt|sensitive|setintersection|setproduct|setsubtract|setunion|sha1|sha256|sha512|signum|slice|sort|split|startswith|strcontains|strrev|substr|sum|templatefile|textdecodebase64|textencodebase64|timeadd|timecmp|timestamp|title|tobool|tolist|tomap|tonumber|toset|tostring|transpose|trim|trimprefix|trimspace|trimsuffix|try|upper|urlencode|uuid|uuidv5|values|yamldecode|yamlencode|zipmap)\b
name: support.function.builtin.terraform
- match: \bprovider::(?!null|false|true)[[:alpha:]][[:alnum:]_-]*::(?!null|false|true)[[:alpha:]][[:alnum:]_-]*\b
- match: \bprovider::(?!false|true)\w*::(?!null|false|true)\w*\b
name: support.function.provider
"2":
name: punctuation.section.parens.begin.hcl
Expand Down

0 comments on commit 2dc1969

Please sign in to comment.