mirror of
https://github.com/cheat/cheat.git
synced 2024-12-19 03:05:06 +01:00
84 lines
2.3 KiB
XML
84 lines
2.3 KiB
XML
|
<lexer>
|
||
|
<config>
|
||
|
<name>Bicep</name>
|
||
|
<alias>bicep</alias>
|
||
|
<filename>*.bicep</filename>
|
||
|
</config>
|
||
|
<rules>
|
||
|
<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">
|
||
|
<rule pattern="//[^\n\r]+">
|
||
|
<token type="CommentSingle"/>
|
||
|
</rule>
|
||
|
<rule pattern="/\*.*?\*/">
|
||
|
<token type="CommentMultiline"/>
|
||
|
</rule>
|
||
|
<rule pattern="\s+">
|
||
|
<token type="TextWhitespace"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="root">
|
||
|
<rule>
|
||
|
<include state="commentsandwhitespace"/>
|
||
|
</rule>
|
||
|
<rule pattern="'''.*?'''">
|
||
|
<token type="LiteralString"/>
|
||
|
</rule>
|
||
|
<rule pattern="'">
|
||
|
<token type="LiteralString"/>
|
||
|
<push state="interp"/>
|
||
|
</rule>
|
||
|
<rule pattern="#[\w-]+\b">
|
||
|
<token type="CommentPreproc"/>
|
||
|
</rule>
|
||
|
<rule pattern="[\w_]+(?=\()">
|
||
|
<token type="NameFunction"/>
|
||
|
</rule>
|
||
|
<rule pattern="\b(metadata|targetScope|resource|module|param|var|output|for|in|if|existing|import|as|type|with|using|func|assert)\b">
|
||
|
<token type="KeywordDeclaration"/>
|
||
|
</rule>
|
||
|
<rule pattern="\b(true|false|null)\b">
|
||
|
<token type="KeywordConstant"/>
|
||
|
</rule>
|
||
|
<rule pattern="(>=|>|<=|<|==|!=|=~|!~|::|&&|\?\?|!|-|%|\*|\/|\+)">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="(\(|\)|\[|\]|\.|:|\?|{|}|@|,|\||=>|=)">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
<rule pattern="[\w_]+">
|
||
|
<token type="NameVariable"/>
|
||
|
</rule>
|
||
|
<rule pattern="[0-9]+">
|
||
|
<token type="LiteralNumberInteger"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
</rules>
|
||
|
</lexer>
|