forked from whitequark/Sublime-Coq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Coq Toplevel.sublime-syntax
73 lines (71 loc) · 2.1 KB
/
Coq Toplevel.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
%YAML 1.2
---
name: Coq Toplevel
scope: source.coqtop
hidden: true
variables:
ident: '(?:[a-zA-Z_][a-zA-Z0-9_'']*)'
contexts:
main:
# Informational messages
- match: '^Welcome to Coq .*'
scope: message.info
- match: '^({{ident}}) is recursively defined \(decreasing on \w+ argument\)$'
scope: message.info
- match: '^({{ident}}) is (declared|defined)$'
scope: markup.inserted
captures:
# This capture is used by Sublime-Coq when it undoes steps.
1: meta.defined.coq
- match: '^\d+( focused)? subgoals?$'
scope: message.info
- match: '^\(unfocused: [\d-]+\)$'
scope: message.info
# Error messages
- match: '^(Error:|Syntax [Ee]rror:).*'
scope: message.error
# set:
# - match: '.+'
# scope: message.error
- match: '^(Warning:).*'
scope: message.warning
- match: '"'
embed: 'scope:source.coq#term'
escape: '"'
- match: '^> *(\^+)$'
captures:
1: message.error
- match: '^(> )'
embed: 'scope:source.coq#term'
escape: '(?=^\1|^Error:|Syntax [Ee]rror:)'
# Goals and environment in proof mode
- match: '^( *)?({{ident}})(, ({{ident}}))* (?=:=?)'
embed: 'scope:source.coq#term'
escape: '^(?=\1{{ident}}(, {{ident}})* :=?|\1=+)'
captures:
2: entity.name.coq
4: entity.name.coq
- match: '^ (=+)$'
embed: 'scope:source.coq#term'
escape: '(^$)'
scope: meta.goal.coq
captures:
1: punctuation.separator.coq
- match: '^\d+ subgoals?, subgoal \d+$'
scope: message.info
- match: '^\(unfocused: [\d-]+\), subgoal \d+$'
scope: message.info
- match: '^(subgoal \d+ is:)'
scope: message.info
embed: 'scope:source.coq#term'
escape: '^(?=subgoal)'
# Output of Qed, Defined, Compute, Print, etc.
- match: '^Proof(?=\.$)'
scope: keyword.coq
push: 'scope:source.coq#proof'
- match: '\A({{ident}})?\s*([=:]) '
captures:
1: variable.other.coq
2: punctuation.separator.coq
embed: 'scope:source.coq#term'
escape: '^$'