|
5 | 5 | \RequirePackage{xcolor} |
6 | 6 | \RequirePackage{xparse} |
7 | 7 |
|
8 | | -% EasyCrypt % |
9 | | -% Language |
| 8 | +% EasyCrypt % Language |
10 | 9 | \lstdefinelanguage{easycrypt}{% |
11 | 10 | sensitive=true, % Case sensitive keywords |
12 | | - % Keywords: Meta/Specification language |
| 11 | + % Keywords: Global and programming language |
13 | 12 | morekeywords=[1]% |
14 | 13 | { |
15 | | - abbrev, abstract, as, assert, async, axiom, axiomatized, class, clone, |
16 | | - const, debug, declare, eager, ehoare, elif, else, end, equiv, exists, exit, |
17 | | - export, fail, for, forall, from, fun, glob, global, goal, hint, hoare, if, |
18 | | - import, in, include, inductive, instance, islossless, lemma, let, local, locate, |
19 | | - match, module, nosmt, notation, of, op, phoare, pragma, Pr, pred, print, proc, |
20 | | - proof, prover, qed, quantum, realize, remove, rename, require, res, return, |
21 | | - search, section, Self, subtype, then, theory, time, timeout, Top, type, |
22 | | - undo, var, while, why3, with |
| 14 | + Pr, Self, Top, abbrev, abort, abstract, as, axiom, axiomatized, clone, const, |
| 15 | + declare, dump, end, exception, exit, export, from, global, goal, hint, import, |
| 16 | + include, inductive, instance, lemma, local, locate, module, notation, of, op, |
| 17 | + pred, print, proof, prover, qed, realize, remove, rename, require, search, |
| 18 | + section, subtype, theory, timeout, type, why3, with, |
| 19 | + async, ehoare, elif, else, equiv, exists, for, forall, fun, glob, hoare, if, |
| 20 | + in, is, islossless, let, match, phoare, proc, raise, res, return, then, var, |
| 21 | + while |
23 | 22 | }, |
24 | 23 | % Keywords: Regular (i.e., non-closing) tactics |
25 | 24 | morekeywords=[2]% |
26 | 25 | { |
27 | | - algebra, alias, apply, async, auto, beta, |
28 | | - byequiv, byphoare, bypr, call, case, cbv, cfold, |
29 | | - change, clear, congr, conseq, cut, delta, dump, |
30 | | - ecall, elim, eta, exfalso, exlim, fel, field, fieldeq, fission, |
31 | | - fusion, gen, have, hoare, idtac, inline, interleave, iota, kill, left, logic, |
32 | | - modpath, move, outline, pose, pr_bounded, progress, rcondf, |
33 | | - rcondt, replace, rewrite, right, ring, ringeq, rnd, rndsem, rwnormal, |
34 | | - seq, sim, simplify, skip, sp, split, splitwhile, subst, |
35 | | - suff, swap, symmetry, transitivity, trivial, unroll, weakmem, wlog, |
36 | | - wp, zeta |
| 26 | + algebra, alias, apply, auto, beta, byehoare, byequiv, byphoare, bypr, byupto, |
| 27 | + call, case, cbv, cfold, change, clear, congr, conseq, delta, eager, ecall, |
| 28 | + elim, eta, exfalso, exlim, fel, field, fieldeq, fission, fusion, gen, have, |
| 29 | + idassign, idtac, inline, interleave, iota, kill, left, logic, modpath, move, |
| 30 | + outline, pose, pr_bounded, progress, rcondf, rcondt, replace, rewrite, right, |
| 31 | + ring, ringeq, rnd, rndsem, rwnormal, seq, sim, simplify, skip, sp, split, |
| 32 | + splitwhile, subst, suff, swap, symmetry, transitivity, trivial, unroll, |
| 33 | + weakmem, wlog, wp, zeta |
37 | 34 | }, |
38 | | - % Keywords: Closing tactics/tacticals |
| 35 | + % Keywords: Closing/byclose tactics and dangerous commands |
39 | 36 | morekeywords=[3]% |
40 | 37 | { |
41 | | - abort, admit, admitted, assumption, by, check, done, |
42 | | - edit, exact, fix, reflexivity, smt, solve |
| 38 | + admit, admitted, |
| 39 | + assumption, by, check, coq, done, edit, exact, fix, reflexivity, smt, solve |
43 | 40 | }, |
44 | | - % Keywords: Tacticals |
| 41 | + % Keywords: Tacticals and internal |
45 | 42 | morekeywords=[4]% |
46 | 43 | { |
47 | | - do, expect, first, last, strict, try |
| 44 | + do, expect, first, last, try, |
| 45 | + debug, fail, pragma, time, undo |
48 | 46 | }, |
49 | 47 | comment=[n]{(*}{*)}, % Multi-line, nested comments delimited by (* and *) |
50 | 48 | string=[d]{"}, % Strings delimited by " and ", non-escapable |
|
74 | 72 | } |
75 | 73 |
|
76 | 74 | % Define default colors based on availability of colorblind colors |
77 | | -\makeatletter |
78 | 75 | \@ifpackageloaded{colorblind}{ |
79 | 76 | \lstdefinestyle{easycrypt-default}{% |
80 | 77 | style=easycrypt-base, |
|
104 | 101 | numberstyle={\small\color{gray}}, |
105 | 102 | } |
106 | 103 | } |
107 | | -\makeatother |
108 | 104 |
|
109 | 105 | % Style for drafting/debugging (explicit spaces/tabs) |
110 | 106 | \lstdefinestyle{easycrypt-draft}{% |
|
119 | 115 | style=easycrypt-default, |
120 | 116 | frame=none, |
121 | 117 | framesep=0pt, |
| 118 | + basicstyle={\small\ttfamily}, |
| 119 | + aboveskip=0.3\baselineskip, |
| 120 | + belowskip=0.3\baselineskip, |
| 121 | + columns=fullflexible |
122 | 122 | } |
123 | 123 |
|
124 | | -% Environments |
125 | | -%% Default, non-floating environment |
126 | | -%% Meant to be used inside other (potentially floating) environment |
127 | | -%% that takes care of the caption and surrounding spacing |
| 124 | +% Environments % Default, non-floating environment % Meant to be used inside |
| 125 | +%other (potentially floating) environment % that takes care of the caption and |
| 126 | +%surrounding spacing |
128 | 127 | \lstnewenvironment{eclst}[1][]{% |
129 | 128 | \lstset{% |
130 | 129 | language=easycrypt,% |
|
0 commit comments