| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<language id="coq" _name="Coq" version="2.0" _section="Scientific"> |
| 3 |
<metadata> |
| 4 |
<property name="globs">*.v</property> |
| 5 |
<property name="block-comment-start">\(\*</property> |
| 6 |
<property name="block-comment-stop">\*\)</property> |
| 7 |
</metadata> |
| 8 |
|
| 9 |
<styles> |
| 10 |
<style id="comment" _name="Comment" map-to="def:comment"/> |
| 11 |
<style id="coqdoc" _name="Coqdoc text" map-to="def:note"/> |
| 12 |
<style id="vernac-keyword" _name="Vernacular keyword" map-to="def:keyword"/> |
| 13 |
<style id="gallina-keyword" _name="Gallina keyword" map-to="def:keyword"/> |
| 14 |
<style id="identifier" _name="Identifier" map-to="def:identifier"/> |
| 15 |
<style id="constr-keyword" _name="Cic keyword" map-to="def:keyword"/> |
| 16 |
<style id="constr-sort" _name="Cic sort" map-to="def:builtin"/> |
| 17 |
<style id="string" _name="String" map-to="def:string"/> |
| 18 |
<style id="escape" _name="Escaped Character" map-to="def:special-char"/> |
| 19 |
<style id="error" _name="Error" map-to="def:error"/> |
| 20 |
<style id="safe" _name="Checked Part"/> |
| 21 |
<style id="sentence" _name="Sentence terminator"/> |
| 22 |
</styles> |
| 23 |
|
| 24 |
<definitions> |
| 25 |
<define-regex id="space">\s+</define-regex> |
| 26 |
<define-regex id="first_ident_char">[_\p{L}]</define-regex> |
| 27 |
<define-regex id="ident_char">[_\p{L}'\pN]</define-regex> |
| 28 |
<define-regex id="ident">\%{first_ident_char}\%{ident_char}*</define-regex> |
| 29 |
<define-regex id="qualit">(\%{ident}\.)*\%{ident}</define-regex> |
| 30 |
<define-regex id="dot_sep">\.(\s|\z)</define-regex> |
| 31 |
<define-regex id="bullet">([-+*]+|{)(\s|\z)|}(\s*})*</define-regex> |
| 32 |
<define-regex id="single_decl">Definition|Let|Example|SubClass|(Co)?Fixpoint|Function|Conjecture|(Co)?Inductive|Variant|Record|Structure|Ltac|Instance|Class|Existing\%{space}Instance|Canonical\%{space}Structure|Coercion|Universe</define-regex> |
| 33 |
<define-regex id="mult_decl">Hypothes[ie]s|Axiom(s)?|Variable(s)?|Parameter(s)?|Context|Implicit\%{space}Type(s)?</define-regex> |
| 34 |
<define-regex id="locality">((Local|Global)\%{space})?</define-regex> |
| 35 |
<define-regex id="begin_proof">Theorem|Lemma|Fact|Remark|Corollary|Proposition|Property</define-regex> |
| 36 |
<define-regex id="end_proof">Qed|Defined|Admitted|Abort|Save</define-regex> |
| 37 |
<define-regex id="decl_head">((?'gal'\%{locality}(Program\%{space})?(\%{single_decl}|\%{begin_proof}))\%{space}(?'id'\%{ident}))|((?'gal4list'\%{mult_decl})(?'id_list'(\%{space}\%{ident})*))|(?'gal2'Goal)</define-regex> |
| 38 |
|
| 39 |
<!-- Strings, with '""' an escape sequence --> |
| 40 |
<context id="string" style-ref="string" class="string"> |
| 41 |
<start>"</start> |
| 42 |
<end>"</end> |
| 43 |
<include> |
| 44 |
<context id="string-escape" style-ref="escape"> |
| 45 |
<match>""</match> |
| 46 |
</context> |
| 47 |
</include> |
| 48 |
</context> |
| 49 |
|
| 50 |
<!-- Coqdoc comments --> |
| 51 |
<context id="coqdoc" style-ref="coqdoc" class="comment" class-disabled="no-spell-check"> |
| 52 |
<start>\(\*\*(\s|\z)</start> |
| 53 |
<end>\*\)</end> |
| 54 |
<include> |
| 55 |
<context ref="comment"/> |
| 56 |
<context ref="string"/> |
| 57 |
<context ref="def:in-comment"/> |
| 58 |
</include> |
| 59 |
</context> |
| 60 |
|
| 61 |
<!-- Regular comments, possibly nested --> |
| 62 |
<context id="comment" style-ref="comment" class="comment" class-disabled="no-spell-check"> |
| 63 |
<start>\(\*</start> |
| 64 |
<end>\*\)</end> |
| 65 |
<include> |
| 66 |
<context ref="comment"/> |
| 67 |
<context ref="string"/> |
| 68 |
<context ref="def:in-comment"/> |
| 69 |
</include> |
| 70 |
</context> |
| 71 |
|
| 72 |
<!-- Keywords for constr --> |
| 73 |
<context id="constr-keyword" style-ref="constr-keyword"> |
| 74 |
<keyword>forall</keyword> |
| 75 |
<keyword>fun</keyword> |
| 76 |
<keyword>match</keyword> |
| 77 |
<keyword>fix</keyword> |
| 78 |
<keyword>cofix</keyword> |
| 79 |
<keyword>with</keyword> |
| 80 |
<keyword>for</keyword> |
| 81 |
<keyword>end</keyword> |
| 82 |
<keyword>as</keyword> |
| 83 |
<keyword>let</keyword> |
| 84 |
<keyword>in</keyword> |
| 85 |
<keyword>if</keyword> |
| 86 |
<keyword>then</keyword> |
| 87 |
<keyword>else</keyword> |
| 88 |
<keyword>return</keyword> |
| 89 |
</context> |
| 90 |
|
| 91 |
<!-- Sort keywords --> |
| 92 |
<context id="constr-sort" style-ref="constr-sort"> |
| 93 |
<keyword>Prop</keyword> |
| 94 |
<keyword>Set</keyword> |
| 95 |
<keyword>Type</keyword> |
| 96 |
</context> |
| 97 |
|
| 98 |
<!-- Terms --> |
| 99 |
<context id="constr"> |
| 100 |
<include> |
| 101 |
<context ref="string"/> |
| 102 |
<context ref="coqdoc"/> |
| 103 |
<context ref="comment"/> |
| 104 |
<context ref="constr-sort"/> |
| 105 |
<context ref="constr-keyword"/> |
| 106 |
<context id="dot-nosep"> |
| 107 |
<match>\.\.</match> |
| 108 |
</context> |
| 109 |
</include> |
| 110 |
</context> |
| 111 |
|
| 112 |
<context id="coq" class="no-spell-check"> |
| 113 |
<include> |
| 114 |
<context ref="coqdoc"/> |
| 115 |
<context ref="comment"/> |
| 116 |
|
| 117 |
<context id="declaration"> |
| 118 |
<start>\%{decl_head}</start> |
| 119 |
<end>\%{dot_sep}</end> |
| 120 |
<include> |
| 121 |
<context sub-pattern="id" where="start" style-ref="identifier"/> |
| 122 |
<context sub-pattern="gal" where="start" style-ref="gallina-keyword"/> |
| 123 |
<context sub-pattern="gal2" where="start" style-ref="gallina-keyword"/> |
| 124 |
<context sub-pattern="id_list" where="start" style-ref="identifier"/> |
| 125 |
<context sub-pattern="gal4list" where="start" style-ref="gallina-keyword"/> |
| 126 |
<context ref="constr"/> |
| 127 |
</include> |
| 128 |
</context> |
| 129 |
|
| 130 |
<context id="proof"> |
| 131 |
<start>(Proof(\%{dot_sep}|\%{space}using|\%{space}with))|Next Obligation</start> |
| 132 |
<end>\%{end_proof}\%{dot_sep}</end> |
| 133 |
<include> |
| 134 |
<context sub-pattern="0" where="start" style-ref="vernac-keyword"/> |
| 135 |
<context sub-pattern="0" where="end" style-ref="vernac-keyword"/> |
| 136 |
<context ref="coqdoc"/> |
| 137 |
<context ref="comment"/> |
| 138 |
<context id="bullet" style-ref="vernac-keyword" extend-parent="false"> |
| 139 |
<match>\%{bullet}</match> |
| 140 |
</context> |
| 141 |
<context extend-parent="false"> |
| 142 |
<start>\%[</start> |
| 143 |
<end>\%{dot_sep}</end> |
| 144 |
<include> |
| 145 |
<context ref="command-in-proof"/> |
| 146 |
<context ref="constr"/> |
| 147 |
</include> |
| 148 |
</context> |
| 149 |
</include> |
| 150 |
</context> |
| 151 |
|
| 152 |
<context id="exact-proof"> |
| 153 |
<start>Proof</start> |
| 154 |
<end>\%{dot_sep}</end> |
| 155 |
<include> |
| 156 |
<context sub-pattern="0" where="start" style-ref="vernac-keyword"/> |
| 157 |
<context ref="constr"/> |
| 158 |
</include> |
| 159 |
</context> |
| 160 |
|
| 161 |
<context ref="command"/> |
| 162 |
</include> |
| 163 |
</context> |
| 164 |
|
| 165 |
<!-- Toplevel commands --> |
| 166 |
<context id="command" extend-parent="false"> |
| 167 |
<start>\%[</start> |
| 168 |
<end>\%{dot_sep}</end> |
| 169 |
<include> |
| 170 |
<context id="command-in-proof" style-ref="vernac-keyword"> |
| 171 |
<keyword>About</keyword> |
| 172 |
<keyword>Check</keyword> |
| 173 |
<keyword>Print</keyword> |
| 174 |
<keyword>Eval</keyword> |
| 175 |
<keyword>Undo</keyword> |
| 176 |
<keyword>Restart</keyword> |
| 177 |
<keyword>Opaque</keyword> |
| 178 |
<keyword>Transparent</keyword> |
| 179 |
</context> |
| 180 |
|
| 181 |
<context id="toplevel-command" style-ref="vernac-keyword"> |
| 182 |
<keyword>Add</keyword> |
| 183 |
<keyword>Load</keyword> |
| 184 |
<keyword>(Print|Reset)\%{space}+Extraction\%{space}+(Inline|Blacklist|Callback)</keyword> |
| 185 |
<keyword>Print\%{space}+Extraction\%{space}+Foreign</keyword> |
| 186 |
<keyword>Comments</keyword> |
| 187 |
<keyword>Solve\%{space}Obligation</keyword> |
| 188 |
<keyword>(Uns|S)et(\%{space}\%{ident})+</keyword> |
| 189 |
<keyword>(\%{locality}|(Reserved|Tactic)\%{space})?Notation</keyword> |
| 190 |
<keyword>\%{locality}Infix</keyword> |
| 191 |
<keyword>Declare\%{space}ML\%{space}Module</keyword> |
| 192 |
<keyword>Extraction\%{space}Language\%{space}(OCaml|Haskell|Scheme|JSON)</keyword> |
| 193 |
</context> |
| 194 |
|
| 195 |
<context id="hint-command" style-ref="vernac-keyword"> |
| 196 |
<prefix>\%{locality}Hint\%{space}</prefix> |
| 197 |
<keyword>Resolve</keyword> |
| 198 |
<keyword>Immediate</keyword> |
| 199 |
<keyword>Constructors</keyword> |
| 200 |
<keyword>Unfold</keyword> |
| 201 |
<keyword>Extern</keyword> |
| 202 |
<keyword>Rewrite</keyword> |
| 203 |
</context> |
| 204 |
|
| 205 |
<context id="scope-command" style-ref="vernac-keyword"> |
| 206 |
<suffix>\%{space}Scope</suffix> |
| 207 |
<keyword>\%{locality}Open</keyword> |
| 208 |
<keyword>\%{locality}Close</keyword> |
| 209 |
<keyword>Bind</keyword> |
| 210 |
<keyword>Delimit</keyword> |
| 211 |
</context> |
| 212 |
|
| 213 |
<context id="command-for-qualit"> |
| 214 |
<suffix>\%{space}(?'qua'\%{qualit})</suffix> |
| 215 |
<keyword>Chapter</keyword> |
| 216 |
<keyword>Combined\%{space}Scheme</keyword> |
| 217 |
<keyword>Scheme\%{space}(Induction|Minimality|Elimination|Case|Equality)\%{space}for</keyword> |
| 218 |
<keyword>End</keyword> |
| 219 |
<keyword>Section</keyword> |
| 220 |
<keyword>Module(\%{space}Type)?</keyword> |
| 221 |
<keyword>Declare\%{space}Module(\%{space}(Import|Export))?</keyword> |
| 222 |
<keyword>Arguments</keyword> |
| 223 |
<keyword>Implicit\%{space}Arguments</keyword> |
| 224 |
<keyword>Include</keyword> |
| 225 |
<keyword>Extract\%{space}((Inlined\%{space})?Constant|Inductive)</keyword> |
| 226 |
<keyword>Extract\%{space}Foreign\%{space}Constant</keyword> |
| 227 |
<include> |
| 228 |
<context sub-pattern="1" style-ref="vernac-keyword"/> |
| 229 |
<context sub-pattern="qua" style-ref="identifier"/> |
| 230 |
</include> |
| 231 |
</context> |
| 232 |
|
| 233 |
<context id="command-for-qualit-list"> |
| 234 |
<suffix>(?'qua_list'(\%{space}\%{qualit})+)</suffix> |
| 235 |
<keyword>Typeclasses (Transparent|Opaque)</keyword> |
| 236 |
<keyword>Require(\%{space}(Import|Export))?</keyword> |
| 237 |
<keyword>Import</keyword> |
| 238 |
<keyword>Export</keyword> |
| 239 |
<keyword>((Recursive|Separate)\%{space})?Extraction(\%{space}(Library|(No)?Inline|Blacklist))?</keyword> |
| 240 |
<keyword>Extract\%{space}Callback</keyword> |
| 241 |
<include> |
| 242 |
<context sub-pattern="1" style-ref="vernac-keyword"/> |
| 243 |
<context sub-pattern="qua_list" style-ref="identifier"/> |
| 244 |
</include> |
| 245 |
</context> |
| 246 |
|
| 247 |
<context ref="constr"/> |
| 248 |
</include> |
| 249 |
</context> |
| 250 |
|
| 251 |
</definitions> |
| 252 |
</language> |