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
136 lines
5.2 KiB
XML
136 lines
5.2 KiB
XML
<lexer>
|
|
<config>
|
|
<name>Coq</name>
|
|
<alias>coq</alias>
|
|
<filename>*.v</filename>
|
|
<mime_type>text/x-coq</mime_type>
|
|
</config>
|
|
<rules>
|
|
<state name="string">
|
|
<rule pattern="[^"]+">
|
|
<token type="LiteralStringDouble"/>
|
|
</rule>
|
|
<rule pattern="""">
|
|
<token type="LiteralStringDouble"/>
|
|
</rule>
|
|
<rule pattern=""">
|
|
<token type="LiteralStringDouble"/>
|
|
<pop depth="1"/>
|
|
</rule>
|
|
</state>
|
|
<state name="dotted">
|
|
<rule pattern="\s+">
|
|
<token type="Text"/>
|
|
</rule>
|
|
<rule pattern="\.">
|
|
<token type="Punctuation"/>
|
|
</rule>
|
|
<rule pattern="[A-Z][\w\']*(?=\s*\.)">
|
|
<token type="NameNamespace"/>
|
|
</rule>
|
|
<rule pattern="[A-Z][\w\']*">
|
|
<token type="NameClass"/>
|
|
<pop depth="1"/>
|
|
</rule>
|
|
<rule pattern="[a-z][a-z0-9_\']*">
|
|
<token type="Name"/>
|
|
<pop depth="1"/>
|
|
</rule>
|
|
<rule>
|
|
<pop depth="1"/>
|
|
</rule>
|
|
</state>
|
|
<state name="root">
|
|
<rule pattern="\s+">
|
|
<token type="Text"/>
|
|
</rule>
|
|
<rule pattern="false|true|\(\)|\[\]">
|
|
<token type="NameBuiltinPseudo"/>
|
|
</rule>
|
|
<rule pattern="\(\*">
|
|
<token type="Comment"/>
|
|
<push state="comment"/>
|
|
</rule>
|
|
<rule pattern="\b(Projections|Monomorphic|Polymorphic|Proposition|CoInductive|Hypothesis|CoFixpoint|Contextual|Definition|Parameters|Hypotheses|Structure|Inductive|Corollary|Implicits|Parameter|Variables|Arguments|Canonical|Printing|Coercion|Reserved|Universe|Notation|Instance|Fixpoint|Variable|Morphism|Relation|Existing|Implicit|Example|Theorem|Delimit|Defined|Rewrite|outside|Require|Resolve|Section|Context|Prenex|Strict|Module|Import|Export|Global|inside|Remark|Tactic|Search|Record|Scope|Unset|Check|Local|Close|Class|Graph|Proof|Lemma|Print|Axiom|Show|Goal|Open|Fact|Hint|Bind|Ltac|Save|View|Let|Set|All|End|Qed)\b">
|
|
<token type="KeywordNamespace"/>
|
|
</rule>
|
|
<rule pattern="\b(exists2|nosimpl|struct|exists|return|forall|match|cofix|then|with|else|for|fix|let|fun|end|is|of|if|in|as)\b">
|
|
<token type="Keyword"/>
|
|
</rule>
|
|
<rule pattern="\b(Type|Prop)\b">
|
|
<token type="KeywordType"/>
|
|
</rule>
|
|
<rule pattern="\b(native_compute|setoid_rewrite|etransitivity|econstructor|transitivity|autorewrite|constructor|cutrewrite|vm_compute|bool_congr|generalize|inversion|induction|injection|nat_congr|intuition|destruct|suffices|erewrite|symmetry|nat_norm|replace|rewrite|compute|pattern|trivial|without|assert|unfold|change|eapply|intros|unlock|revert|rename|refine|eauto|tauto|after|right|congr|split|field|simpl|intro|clear|apply|using|subst|case|left|suff|loss|wlog|have|fold|ring|move|lazy|elim|pose|auto|red|cbv|hnf|cut|set)\b">
|
|
<token type="Keyword"/>
|
|
</rule>
|
|
<rule pattern="\b(contradiction|discriminate|reflexivity|assumption|congruence|romega|omega|exact|solve|tauto|done|by)\b">
|
|
<token type="KeywordPseudo"/>
|
|
</rule>
|
|
<rule pattern="\b(repeat|first|idtac|last|try|do)\b">
|
|
<token type="KeywordReserved"/>
|
|
</rule>
|
|
<rule pattern="\b([A-Z][\w\']*)">
|
|
<token type="Name"/>
|
|
</rule>
|
|
<rule pattern="(λ|Π|\|\}|\{\||\\/|/\\|=>|~|\}|\|]|\||\{<|\{|`|_|]|\[\||\[>|\[<|\[|\?\?|\?|>\}|>]|>|=|<->|<-|<|;;|;|:>|:=|::|:|\.\.|\.|->|-\.|-|,|\+|\*|\)|\(|&&|&|#|!=)">
|
|
<token type="Operator"/>
|
|
</rule>
|
|
<rule pattern="([=<>@^|&+\*/$%-]|[!?~])?[!$%&*+\./:<=>?@^|~-]">
|
|
<token type="Operator"/>
|
|
</rule>
|
|
<rule pattern="\b(unit|nat|bool|string|ascii|list)\b">
|
|
<token type="KeywordType"/>
|
|
</rule>
|
|
<rule pattern="[^\W\d][\w']*">
|
|
<token type="Name"/>
|
|
</rule>
|
|
<rule pattern="\d[\d_]*">
|
|
<token type="LiteralNumberInteger"/>
|
|
</rule>
|
|
<rule pattern="0[xX][\da-fA-F][\da-fA-F_]*">
|
|
<token type="LiteralNumberHex"/>
|
|
</rule>
|
|
<rule pattern="0[oO][0-7][0-7_]*">
|
|
<token type="LiteralNumberOct"/>
|
|
</rule>
|
|
<rule pattern="0[bB][01][01_]*">
|
|
<token type="LiteralNumberBin"/>
|
|
</rule>
|
|
<rule pattern="-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)">
|
|
<token type="LiteralNumberFloat"/>
|
|
</rule>
|
|
<rule pattern="'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'">
|
|
<token type="LiteralStringChar"/>
|
|
</rule>
|
|
<rule pattern="'.'">
|
|
<token type="LiteralStringChar"/>
|
|
</rule>
|
|
<rule pattern="'">
|
|
<token type="Keyword"/>
|
|
</rule>
|
|
<rule pattern=""">
|
|
<token type="LiteralStringDouble"/>
|
|
<push state="string"/>
|
|
</rule>
|
|
<rule pattern="[~?][a-z][\w\']*:">
|
|
<token type="Name"/>
|
|
</rule>
|
|
</state>
|
|
<state name="comment">
|
|
<rule pattern="[^(*)]+">
|
|
<token type="Comment"/>
|
|
</rule>
|
|
<rule pattern="\(\*">
|
|
<token type="Comment"/>
|
|
<push/>
|
|
</rule>
|
|
<rule pattern="\*\)">
|
|
<token type="Comment"/>
|
|
<pop depth="1"/>
|
|
</rule>
|
|
<rule pattern="[(*)]">
|
|
<token type="Comment"/>
|
|
</rule>
|
|
</state>
|
|
</rules>
|
|
</lexer> |