mirror of
https://github.com/cheat/cheat.git
synced 2024-12-18 18:55:06 +01:00
1790aec85d
Bump `alecthomas/chroma` to `v2`: https://github.com/cheat/cheat/issues/735
100 lines
3.5 KiB
XML
100 lines
3.5 KiB
XML
<lexer>
|
|
<config>
|
|
<name>Puppet</name>
|
|
<alias>puppet</alias>
|
|
<filename>*.pp</filename>
|
|
</config>
|
|
<rules>
|
|
<state name="strings">
|
|
<rule pattern=""([^"])*"">
|
|
<token type="LiteralString"/>
|
|
</rule>
|
|
<rule pattern="'(\\'|[^'])*'">
|
|
<token type="LiteralString"/>
|
|
</rule>
|
|
</state>
|
|
<state name="root">
|
|
<rule>
|
|
<include state="comments"/>
|
|
</rule>
|
|
<rule>
|
|
<include state="keywords"/>
|
|
</rule>
|
|
<rule>
|
|
<include state="names"/>
|
|
</rule>
|
|
<rule>
|
|
<include state="numbers"/>
|
|
</rule>
|
|
<rule>
|
|
<include state="operators"/>
|
|
</rule>
|
|
<rule>
|
|
<include state="strings"/>
|
|
</rule>
|
|
<rule pattern="[]{}:(),;[]">
|
|
<token type="Punctuation"/>
|
|
</rule>
|
|
<rule pattern="[^\S\n]+">
|
|
<token type="Text"/>
|
|
</rule>
|
|
</state>
|
|
<state name="comments">
|
|
<rule pattern="\s*#.*$">
|
|
<token type="Comment"/>
|
|
</rule>
|
|
<rule pattern="/(\\\n)?[*](.|\n)*?[*](\\\n)?/">
|
|
<token type="CommentMultiline"/>
|
|
</rule>
|
|
</state>
|
|
<state name="operators">
|
|
<rule pattern="(=>|\?|<|>|=|\+|-|/|\*|~|!|\|)">
|
|
<token type="Operator"/>
|
|
</rule>
|
|
<rule pattern="(in|and|or|not)\b">
|
|
<token type="OperatorWord"/>
|
|
</rule>
|
|
</state>
|
|
<state name="names">
|
|
<rule pattern="[a-zA-Z_]\w*">
|
|
<token type="NameAttribute"/>
|
|
</rule>
|
|
<rule pattern="(\$\S+)(\[)(\S+)(\])">
|
|
<bygroups>
|
|
<token type="NameVariable"/>
|
|
<token type="Punctuation"/>
|
|
<token type="LiteralString"/>
|
|
<token type="Punctuation"/>
|
|
</bygroups>
|
|
</rule>
|
|
<rule pattern="\$\S+">
|
|
<token type="NameVariable"/>
|
|
</rule>
|
|
</state>
|
|
<state name="numbers">
|
|
<rule pattern="(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?">
|
|
<token type="LiteralNumberFloat"/>
|
|
</rule>
|
|
<rule pattern="\d+[eE][+-]?[0-9]+j?">
|
|
<token type="LiteralNumberFloat"/>
|
|
</rule>
|
|
<rule pattern="0[0-7]+j?">
|
|
<token type="LiteralNumberOct"/>
|
|
</rule>
|
|
<rule pattern="0[xX][a-fA-F0-9]+">
|
|
<token type="LiteralNumberHex"/>
|
|
</rule>
|
|
<rule pattern="\d+L">
|
|
<token type="LiteralNumberIntegerLong"/>
|
|
</rule>
|
|
<rule pattern="\d+j?">
|
|
<token type="LiteralNumberInteger"/>
|
|
</rule>
|
|
</state>
|
|
<state name="keywords">
|
|
<rule pattern="(?i)(nagios_servicedependency|nagios_serviceescalation|nagios_hostdependency|nagios_hostescalation|nagios_serviceextinfo|nagios_contactgroup|nagios_servicegroup|ssh_authorized_key|nagios_hostextinfo|nagios_timeperiod|nagios_hostgroup|macauthorization|create_resources|inline_template|scheduled_task|nagios_contact|nagios_command|nagios_service|nagios_host|configured|versioncmp|selboolean|filebucket|shellquote|selmodule|extlookup|unmounted|interface|contained|resources|fqdn_rand|installed|mailalias|directory|subscribe|loglevel|computer|maillist|schedule|generate|template|regsubst|inherits|present|sprintf|service|stopped|running|package|realize|defined|mounted|warning|yumrepo|k5login|include|default|notice|purged|latest|router|search|sshkey|define|notify|absent|before|augeas|import|tagged|split|undef|mount|check|alert|class|audit|debug|alias|stage|elsif|false|zpool|emerg|noop|sha1|vlan|exec|fail|file|else|host|info|cron|role|link|zone|tidy|true|node|case|user|crit|err|mcx|zfs|md5|tag|if)\b">
|
|
<token type="Keyword"/>
|
|
</rule>
|
|
</state>
|
|
</rules>
|
|
</lexer> |