1718a963e6
This is for the core HCL syntax, so it doesn't include any application-specific keyword highlighting, etc. The structural, expression, and template languages are separated into different grammar definitions so that they can be used independently, but they embed each other as needed to complete the language. This is just a first pass, really. There are probably some bugs here, and also some missing features.
336 lines
8.7 KiB
Plaintext
Executable File
336 lines
8.7 KiB
Plaintext
Executable File
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>fileTypes</key>
|
|
<array>
|
|
</array>
|
|
<key>name</key>
|
|
<string>HCL Expression</string>
|
|
<key>patterns</key>
|
|
<array>
|
|
<dict>
|
|
<key>begin</key>
|
|
<string>#|//</string>
|
|
<key>captures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>punctuation.definition.comment.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>comment</key>
|
|
<string>Comments</string>
|
|
<key>end</key>
|
|
<string>$\n?</string>
|
|
<key>name</key>
|
|
<string>comment.line.hcl</string>
|
|
</dict>
|
|
<dict>
|
|
<key>begin</key>
|
|
<string>/\*</string>
|
|
<key>captures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>punctuation.definition.comment.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>comment</key>
|
|
<string>Block comments</string>
|
|
<key>end</key>
|
|
<string>\*/</string>
|
|
<key>name</key>
|
|
<string>comment.block.hcl</string>
|
|
</dict>
|
|
<dict>
|
|
<key>comment</key>
|
|
<string>Language constants (true, false, null)</string>
|
|
<key>match</key>
|
|
<string>\b(true|false|null)\b</string>
|
|
<key>name</key>
|
|
<string>constant.language.hcl</string>
|
|
</dict>
|
|
<dict>
|
|
<key>comment</key>
|
|
<string>Numbers</string>
|
|
<key>match</key>
|
|
<string>\b([0-9]+)(.[0-9]+)?([eE][0-9]+)?\b</string>
|
|
<key>name</key>
|
|
<string>constant.numeric.hcl</string>
|
|
</dict>
|
|
<dict>
|
|
<key>begin</key>
|
|
<string>([-\w]+)(\()</string>
|
|
<key>beginCaptures</key>
|
|
<dict>
|
|
<key>1</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>keyword.other.function.inline.hcl</string>
|
|
</dict>
|
|
<key>2</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>keyword.other.section.begin.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>comment</key>
|
|
<string>Function Calls</string>
|
|
<key>end</key>
|
|
<string>(\))</string>
|
|
<key>endCaptures</key>
|
|
<dict>
|
|
<key>1</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>keyword.other.section.end.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>patterns</key>
|
|
<array>
|
|
<dict>
|
|
<key>include</key>
|
|
<string>$self</string>
|
|
</dict>
|
|
</array>
|
|
</dict>
|
|
<dict>
|
|
<key>captures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>variable.other.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>comment</key>
|
|
<string>Variables and Attribute Names</string>
|
|
<key>match</key>
|
|
<string>[-\w]+</string>
|
|
</dict>
|
|
<dict>
|
|
<key>begin</key>
|
|
<string>(?>\s*<<(\w+))</string>
|
|
<key>beginCaptures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>punctuation.definition.string.begin.hcl</string>
|
|
</dict>
|
|
<key>1</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>keyword.operator.heredoc.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>comment</key>
|
|
<string>Heredoc Templates</string>
|
|
<key>end</key>
|
|
<string>^\s*\1$</string>
|
|
<key>endCaptures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>punctuation.definition.string.end.hcl keyword.operator.heredoc.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>patterns</key>
|
|
<array>
|
|
<dict>
|
|
<key>include</key>
|
|
<string>source.hcltemplate</string>
|
|
</dict>
|
|
</array>
|
|
</dict>
|
|
<dict>
|
|
<key>begin</key>
|
|
<string>\"</string>
|
|
<key>beginCaptures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>string.hcl punctuation.definition.string.begin.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>comment</key>
|
|
<string>String Templates</string>
|
|
<key>end</key>
|
|
<string>\"</string>
|
|
<key>endCaptures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>string.hcl punctuation.definition.string.end.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>patterns</key>
|
|
<array>
|
|
<dict>
|
|
<key>include</key>
|
|
<string>source.hcltemplate</string>
|
|
</dict>
|
|
<dict>
|
|
<key>match</key>
|
|
<string>(^"|$\{|%\{)+</string>
|
|
<key>name</key>
|
|
<string>string.quoted.double.hcl</string>
|
|
</dict>
|
|
</array>
|
|
</dict>
|
|
<dict>
|
|
<key>captures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>keyword.operator.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>comment</key>
|
|
<string>Operators</string>
|
|
<key>match</key>
|
|
<string>(!=|==|>=|<=|&&|\|\||[-+*/%<>!?:])</string>
|
|
</dict>
|
|
<dict>
|
|
<key>begin</key>
|
|
<string>\(</string>
|
|
<key>beginCaptures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>meta.brace.round.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>comment</key>
|
|
<string>Parentheses</string>
|
|
<key>end</key>
|
|
<string>\)</string>
|
|
<key>endCaptures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>meta.brace.round.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>patterns</key>
|
|
<array>
|
|
<dict>
|
|
<key>include</key>
|
|
<string>$self</string>
|
|
</dict>
|
|
</array>
|
|
</dict>
|
|
<dict>
|
|
<key>begin</key>
|
|
<string>\[</string>
|
|
<key>beginCaptures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>meta.brace.square.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>comment</key>
|
|
<string>Tuple Constructor</string>
|
|
<key>end</key>
|
|
<string>\]</string>
|
|
<key>endCaptures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>meta.brace.square.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>patterns</key>
|
|
<array>
|
|
<dict>
|
|
<key>captures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>keyword.control.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>match</key>
|
|
<string>(for|in)</string>
|
|
</dict>
|
|
<dict>
|
|
<key>include</key>
|
|
<string>$self</string>
|
|
</dict>
|
|
</array>
|
|
</dict>
|
|
<dict>
|
|
<key>begin</key>
|
|
<string>\{</string>
|
|
<key>beginCaptures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>meta.brace.curly.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>comment</key>
|
|
<string>Object Constructor</string>
|
|
<key>end</key>
|
|
<string>\}</string>
|
|
<key>endCaptures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>meta.brace.curly.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>patterns</key>
|
|
<array>
|
|
<dict>
|
|
<key>captures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>keyword.control.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>match</key>
|
|
<string>(for|in)</string>
|
|
</dict>
|
|
<dict>
|
|
<key>captures</key>
|
|
<dict>
|
|
<key>0</key>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>keyword.operator.hcl</string>
|
|
</dict>
|
|
</dict>
|
|
<key>match</key>
|
|
<string>(=>|\.\.\.)</string>
|
|
</dict>
|
|
<dict>
|
|
<key>include</key>
|
|
<string>$self</string>
|
|
</dict>
|
|
</array>
|
|
</dict>
|
|
</array>
|
|
<key>scopeName</key>
|
|
<string>source.hclexpr</string>
|
|
<key>uuid</key>
|
|
<string>6c358551-0381-4128-9ea3-277b21943b5c</string>
|
|
</dict>
|
|
</plist> |