Files
dev/code-rs/tui/assets/syntaxes/HCL.sublime-syntax
T

48 lines
1.1 KiB
YAML

%YAML 1.2
---
name: HCL
file_extensions:
- hcl
- tf
- tfvars
scope: source.hcl
contexts:
main:
- include: comments
- include: strings
- include: numbers
- match: '\b(true|false|null)\b'
scope: constant.language.hcl
- match: '\b(resource|variable|output|provider|module|locals|data)\b'
scope: keyword.declaration.hcl
- match: '[A-Za-z_][A-Za-z0-9_]*\s*(?=\{)'
scope: entity.name.section.hcl
- match: '[A-Za-z_][A-Za-z0-9_]*\s*=\s*'
scope: support.type.property-name.hcl
comments:
- match: '#.*$'
scope: comment.line.number-sign.hcl
- match: '//.*$'
scope: comment.line.double-slash.hcl
- match: '/\*'
scope: comment.block.hcl
push:
- match: '\*/'
pop: true
strings:
- match: '"'
scope: punctuation.definition.string.begin.hcl
push:
- meta_scope: string.quoted.double.hcl
- match: '"'
scope: punctuation.definition.string.end.hcl
pop: true
- match: '\\.'
scope: constant.character.escape.hcl
numbers:
- match: '\b-?\d+(?:\.\d+)?\b'
scope: constant.numeric.hcl