mirror of
https://github.com/cheat/cheat.git
synced 2024-12-23 04:59:45 +01:00
1790aec85d
Bump `alecthomas/chroma` to `v2`: https://github.com/cheat/cheat/issues/735
89 lines
3.5 KiB
XML
89 lines
3.5 KiB
XML
<lexer>
|
|
<config>
|
|
<name>PostScript</name>
|
|
<alias>postscript</alias>
|
|
<alias>postscr</alias>
|
|
<filename>*.ps</filename>
|
|
<filename>*.eps</filename>
|
|
<mime_type>application/postscript</mime_type>
|
|
</config>
|
|
<rules>
|
|
<state name="root">
|
|
<rule pattern="^%!.+\n">
|
|
<token type="CommentPreproc"/>
|
|
</rule>
|
|
<rule pattern="%%.*\n">
|
|
<token type="CommentSpecial"/>
|
|
</rule>
|
|
<rule pattern="(^%.*\n){2,}">
|
|
<token type="CommentMultiline"/>
|
|
</rule>
|
|
<rule pattern="%.*\n">
|
|
<token type="CommentSingle"/>
|
|
</rule>
|
|
<rule pattern="\(">
|
|
<token type="LiteralString"/>
|
|
<push state="stringliteral"/>
|
|
</rule>
|
|
<rule pattern="[{}<>\[\]]">
|
|
<token type="Punctuation"/>
|
|
</rule>
|
|
<rule pattern="<[0-9A-Fa-f]+>(?=[()<>\[\]{}/%\s])">
|
|
<token type="LiteralNumberHex"/>
|
|
</rule>
|
|
<rule pattern="[0-9]+\#(\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)((e|E)[0-9]+)?(?=[()<>\[\]{}/%\s])">
|
|
<token type="LiteralNumberOct"/>
|
|
</rule>
|
|
<rule pattern="(\-|\+)?([0-9]+\.?|[0-9]*\.[0-9]+|[0-9]+\.[0-9]*)((e|E)[0-9]+)?(?=[()<>\[\]{}/%\s])">
|
|
<token type="LiteralNumberFloat"/>
|
|
</rule>
|
|
<rule pattern="(\-|\+)?[0-9]+(?=[()<>\[\]{}/%\s])">
|
|
<token type="LiteralNumberInteger"/>
|
|
</rule>
|
|
<rule pattern="\/[^()<>\[\]{}/%\s]+(?=[()<>\[\]{}/%\s])">
|
|
<token type="NameVariable"/>
|
|
</rule>
|
|
<rule pattern="[^()<>\[\]{}/%\s]+(?=[()<>\[\]{}/%\s])">
|
|
<token type="NameFunction"/>
|
|
</rule>
|
|
<rule pattern="(false|true)(?=[()<>\[\]{}/%\s])">
|
|
<token type="KeywordConstant"/>
|
|
</rule>
|
|
<rule pattern="(eq|ne|g[et]|l[et]|and|or|not|if(?:else)?|for(?:all)?)(?=[()<>\[\]{}/%\s])">
|
|
<token type="KeywordReserved"/>
|
|
</rule>
|
|
<rule pattern="(dictstackoverflow|undefinedfilename|currentlinewidth|undefinedresult|currentmatrix|defaultmatrix|invertmatrix|concatmatrix|currentpoint|setlinewidth|syntaxerror|idtransform|identmatrix|setrgbcolor|stringwidth|setlinejoin|getinterval|itransform|strokepath|pathforall|rangecheck|setlinecap|dtransform|transform|translate|setmatrix|typecheck|undefined|scalefont|closepath|findfont|showpage|rcurveto|grestore|truncate|pathbbox|charpath|rlineto|rmoveto|ceiling|newpath|setdash|setfont|restore|curveto|setgray|stroke|pstack|matrix|length|lineto|repeat|rotate|moveto|shfill|concat|gsave|aload|scale|array|round|stack|index|begin|print|floor|exch|quit|clip|copy|bind|loop|idiv|fill|show|roll|exit|load|dict|save|arcn|sqrt|exec|rand|atan|end|div|abs|run|def|cvs|exp|cvi|sin|cos|get|dup|mod|put|sub|pop|add|neg|mul|arc|log|ln|gt)(?=[()<>\[\]{}/%\s])">
|
|
<token type="NameBuiltin"/>
|
|
</rule>
|
|
<rule pattern="\s+">
|
|
<token type="Text"/>
|
|
</rule>
|
|
</state>
|
|
<state name="stringliteral">
|
|
<rule pattern="[^()\\]+">
|
|
<token type="LiteralString"/>
|
|
</rule>
|
|
<rule pattern="\\">
|
|
<token type="LiteralStringEscape"/>
|
|
<push state="escape"/>
|
|
</rule>
|
|
<rule pattern="\(">
|
|
<token type="LiteralString"/>
|
|
<push/>
|
|
</rule>
|
|
<rule pattern="\)">
|
|
<token type="LiteralString"/>
|
|
<pop depth="1"/>
|
|
</rule>
|
|
</state>
|
|
<state name="escape">
|
|
<rule pattern="[0-8]{3}|n|r|t|b|f|\\|\(|\)">
|
|
<token type="LiteralStringEscape"/>
|
|
<pop depth="1"/>
|
|
</rule>
|
|
<rule>
|
|
<pop depth="1"/>
|
|
</rule>
|
|
</state>
|
|
</rules>
|
|
</lexer> |