2023-09-14 22:37:22 +00:00
|
|
|
<lexer>
|
|
|
|
<config>
|
|
|
|
<name>Bicep</name>
|
|
|
|
<alias>bicep</alias>
|
|
|
|
<filename>*.bicep</filename>
|
|
|
|
</config>
|
|
|
|
<rules>
|
2023-10-30 02:49:49 +00:00
|
|
|
<state name="interp">
|
|
|
|
<rule pattern="'">
|
|
|
|
<token type="LiteralString"/>
|
|
|
|
<pop depth="1"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="\\.">
|
|
|
|
<token type="LiteralString"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="\$\{">
|
|
|
|
<token type="LiteralStringInterpol"/>
|
|
|
|
<push state="interp-inside"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="\$">
|
|
|
|
<token type="LiteralString"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="[^'\\$]+">
|
|
|
|
<token type="LiteralString"/>
|
|
|
|
</rule>
|
|
|
|
</state>
|
|
|
|
<state name="interp-inside">
|
|
|
|
<rule pattern="\}">
|
|
|
|
<token type="LiteralStringInterpol"/>
|
|
|
|
<pop depth="1"/>
|
|
|
|
</rule>
|
|
|
|
<rule>
|
|
|
|
<include state="root"/>
|
|
|
|
</rule>
|
|
|
|
</state>
|
|
|
|
<state name="commentsandwhitespace">
|
2023-09-14 22:37:22 +00:00
|
|
|
<rule pattern="//[^\n\r]+">
|
|
|
|
<token type="CommentSingle"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="/\*.*?\*/">
|
|
|
|
<token type="CommentMultiline"/>
|
|
|
|
</rule>
|
2023-10-30 02:49:49 +00:00
|
|
|
<rule pattern="\s+">
|
|
|
|
<token type="TextWhitespace"/>
|
2023-09-14 22:37:22 +00:00
|
|
|
</rule>
|
2023-10-30 02:49:49 +00:00
|
|
|
</state>
|
|
|
|
<state name="root">
|
|
|
|
<rule>
|
|
|
|
<include state="commentsandwhitespace"/>
|
2023-09-14 22:37:22 +00:00
|
|
|
</rule>
|
2023-10-30 02:49:49 +00:00
|
|
|
<rule pattern="'''.*?'''">
|
2023-09-14 22:37:22 +00:00
|
|
|
<token type="LiteralString"/>
|
|
|
|
</rule>
|
2023-10-30 02:49:49 +00:00
|
|
|
<rule pattern="'">
|
|
|
|
<token type="LiteralString"/>
|
|
|
|
<push state="interp"/>
|
2023-09-14 22:37:22 +00:00
|
|
|
</rule>
|
2023-10-30 02:49:49 +00:00
|
|
|
<rule pattern="#[\w-]+\b">
|
|
|
|
<token type="CommentPreproc"/>
|
2023-09-14 22:37:22 +00:00
|
|
|
</rule>
|
2023-10-30 02:49:49 +00:00
|
|
|
<rule pattern="[\w_]+(?=\()">
|
2023-09-14 22:37:22 +00:00
|
|
|
<token type="NameFunction"/>
|
|
|
|
</rule>
|
2023-10-30 02:49:49 +00:00
|
|
|
<rule pattern="\b(metadata|targetScope|resource|module|param|var|output|for|in|if|existing|import|as|type|with|using|func|assert)\b">
|
2023-09-14 22:37:22 +00:00
|
|
|
<token type="KeywordDeclaration"/>
|
|
|
|
</rule>
|
2023-10-30 02:49:49 +00:00
|
|
|
<rule pattern="\b(true|false|null)\b">
|
|
|
|
<token type="KeywordConstant"/>
|
2023-09-14 22:37:22 +00:00
|
|
|
</rule>
|
|
|
|
<rule pattern="(>=|>|<=|<|==|!=|=~|!~|::|&&|\?\?|!|-|%|\*|\/|\+)">
|
|
|
|
<token type="Operator"/>
|
|
|
|
</rule>
|
2023-10-30 02:49:49 +00:00
|
|
|
<rule pattern="(\(|\)|\[|\]|\.|:|\?|{|}|@|,|\||=>|=)">
|
2023-09-14 22:37:22 +00:00
|
|
|
<token type="Punctuation"/>
|
|
|
|
</rule>
|
2023-10-30 02:49:49 +00:00
|
|
|
<rule pattern="[\w_]+">
|
|
|
|
<token type="NameVariable"/>
|
2023-09-14 22:37:22 +00:00
|
|
|
</rule>
|
2023-10-30 02:49:49 +00:00
|
|
|
<rule pattern="[0-9]+">
|
|
|
|
<token type="LiteralNumberInteger"/>
|
2023-09-14 22:37:22 +00:00
|
|
|
</rule>
|
|
|
|
</state>
|
|
|
|
</rules>
|
|
|
|
</lexer>
|