-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMaple.sublime-syntax
89 lines (77 loc) · 2.57 KB
/
Maple.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
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
file_extensions:
- maple
scope: source.maple
contexts:
main:
- include: comments
# Strings begin and end with quotes, and use backslashes as an escape
# character
- match: '"'
scope: punctuation.definition.string.begin.maple
push: double_quoted_string
# Names begin and end with quotes, and use backslashes as an escape
# character
- match: '`'
scope: punctuation.definition.name.begin.maple
push: double_quoted_name
# 36 Language Keywords
- match: '\b(assuming|break|by|catch|description|do|done|elif|else|end|error|export|fi|finally|for|from|global|if|in|local|module|next|od|option|options|proc|quit|read|return|save|stop|then|to|try|use|uses|while)\b'
scope: keyword.control.maple
# 11 operator keywords
- match: '\b(and|or|xor|not|implies|union|intersect|subset|minus|mod|assuming)\b'
scope: keyword.operator.maple
# operation symbols
- match: ('|,|&|\*|\+|-|/|\^|@|@@|:=|:-|~|;|:|::|\|\||\.|\.\.|\$|->|%)
scope: keyword.operator.arithmetic.maple
- match: (=|<>|>|<|>=|<=)
scope: keyword.operator.comparison.maple
# Numbers
- match: '\b(-)?[0-9.]+\b'
scope: constant.numeric.maple
# Symbolic Constants
- match: '\b(Catalan|FAIL|false|gamma|I|infinity|NULL|Pi|true|undefined)\b'
scape: constant.keyword.maple
double_quoted_string:
- meta_scope: string.quoted.double.maple
- match: '\\.'
scope: constant.character.escape.maple
- match: '"'
scope: punctuation.definition.string.end.maple
pop: true
double_quoted_name:
- meta_scope: name.quoted.double.maple
- match: '\\.'
scope: constant.name_character.escape.maple
- match: '`'
scope: punctuation.definition.name.end.maple
pop: true
# single and multi-line comments
comments:
- match: (#).*$\n?
scope: comment.line.pound.maple
captures:
1: punctuation.definition.comment.maple
- match: \(\*
captures:
0: punctuation.definition.comment.maple
push:
- meta_scope: comment.block.maple
- match: \*\)
captures:
0: punctuation.definition.comment.maple
pop: true
- include: comments.nested
comments.nested:
- match: \(\*
captures:
0: punctuation.definition.comment.maple
push:
- meta_scope: comment.block.maple
- match: \*\)
captures:
0: punctuation.definition.comment.maple
pop: true
- include: comments.nested