-
Notifications
You must be signed in to change notification settings - Fork 2
/
ECLiPSe Prolog.sublime-syntax
98 lines (98 loc) · 3.03 KB
/
ECLiPSe Prolog.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: ECLiPSe Prolog
comment: This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
file_extensions:
- ecl
scope: source.prolog.eclipse
contexts:
main:
- include: comments
- match: (?<=:-)\s*
push:
- meta_scope: meta.clause.body.prolog
- match: '(\.)[^(\.\.)]'
captures:
1: keyword.control.clause.bodyend.prolog
pop: true
- include: comments
- include: builtin
- include: controlandkeywords
- include: atom
- include: variable
- include: constants
- match: .
scope: meta.clause.body.prolog
- match: (?<=-->)\s*
push:
- meta_scope: meta.dcg.body.prolog
- match: '(\.)[^(\.\.)]'
captures:
1: keyword.control.dcg.bodyend.prolog
pop: true
- include: comments
- include: controlandkeywords
- include: atom
- include: variable
- include: constants
- match: .
scope: meta.dcg.body.prolog
- include: scope:source.prolog
atom:
- match: '(?<![a-zA-Z0-9_])[a-z][a-zA-Z0-9_]*(?!\s*\(|[a-zA-Z0-9_])'
scope: constant.other.atom.simple.prolog
- match: "'.*?'"
scope: constant.other.atom.quoted.prolog
- match: '\[\]'
scope: constant.other.atom.emptylist.prolog
builtin:
- match: \b(op|findall|write|nl|writeln|fail|lib)\b
scope: keyword.other.prolog
- match: \b(for(each(elem)?)?|fromto|do|param|dim)\b
scope: keyword.other.prolog.eclipse
comments:
- match: "%.*"
scope: comment.line.percent-sign.prolog
- match: /\*
captures:
0: punctuation.definition.comment.prolog
push:
- meta_scope: comment.block.prolog
- match: \*/
captures:
0: punctuation.definition.comment.prolog
pop: true
constants:
- match: '(?<![a-zA-Z]|/)(\d+|(\d+\.\d+))'
scope: constant.numeric.integer.prolog
- match: '".*?"'
scope: string.quoted.double.prolog
controlandkeywords:
- match: (->)
captures:
1: keyword.control.if.prolog
push:
- meta_scope: meta.if.prolog
- match: (;)
captures:
1: keyword.control.else.prolog
pop: true
- include: main
- include: builtin
- include: comments
- include: atom
- include: variable
- match: .
scope: meta.if.body.prolog
- match: "!"
scope: keyword.control.cut.prolog
- match: (\s(is)\s)|=:=|=?\\?=|\\\+|@?>|@?=?<|\+|\*|\-
scope: keyword.operator.prolog
- match: (#|&|\$)(<|>|=)|(#|&|\$)?(::)|\.\.|or|and|(#|&|\$)\\=
scope: keyword.operator.prolog.eclipse
variable:
- match: "(?<![a-zA-Z0-9_])[A-Z][a-zA-Z0-9_]*"
scope: variable.parameter.uppercase.prolog
- match: (?<!\w)_
scope: variable.language.anonymous.prolog