forked from JackDunnNZ/sublime-ampl
-
Notifications
You must be signed in to change notification settings - Fork 2
/
AMPL.json-tmLanguage
122 lines (122 loc) · 3.97 KB
/
AMPL.json-tmLanguage
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{ "name": "AMPL",
"scopeName": "source.ampl",
"fileTypes": ["mod", "dat", "run"],
"repository": {
"general": {
"patterns": [
{
"include": "#linecomment"
},
{
"include": "#blockcomment"
},
{
"include": "#singlequotestring"
},
{
"include": "#doublequotestring"
},
{
"include": "#number"
},
{
"include": "#keyword"
},
{
"include": "#suffix"
},
{
"include": "#math"
},
{
"include": "#operator"
}
]
},
"linecomment": {
"name": "comment.line.sharp.ampl",
"match": "(#.*)(?!\\[\\[).*$\\n?",
"captures": { "1": { "name": "punctuation.definition.comment.gms" } }
},
"blockcomment": {
"name": "comment.slashstar.ampl",
"begin": "/\\*",
"end": "\\*/",
"contentName": "comment.block.documentation.ampl"
},
"singlequotestring": {
"name": "string.quoted.single.ampl",
"begin": "'",
"beginCaptures": { "0": { "name": "punctuation.definition.string.begin.ampl" } },
"end": "'",
"endCaptures": { "0": { "name": "punctuation.definition.string.end.ampl" } },
"patterns": [ { "match": "%(\\w+%|\\d+)", "name": "entity.name.class.ampl" } ]
},
"doublequotestring": {
"name": "string.quoted.double.ampl",
"begin": "\"",
"beginCaptures": { "0": { "name": "punctuation.definition.string.begin.ampl" } },
"end": "\"",
"endCaptures": { "0": { "name": "punctuation.definition.string.end.ampl" } },
"patterns": [ { "match": "%(\\w+%|\\d+)", "name": "entity.name.class.ampl" } ]
},
"number": {
"name": "constant.numeric.ampl",
"match": "(?<![\\d.])\\b\\d+(\\.\\d+)?([eE]-?\\d+)?|\\.\\d+([eE]-?\\d+)?|(?i)([+-]?infinity)"
},
"keyword": {
"name": "keyword.control.ampl",
"match": "(?i)\\b(minimize|maximize|objective|coeff|coef|cover|obj|default|from|to|to_come|net_in|net_out|dimen|dimension|integer|binary|set|param|var|node|ordered|circular|reversed|symbolic|arc|check|close|display|drop|include|print|printf|quit|reset|restore|solve|update|write|shell|model|data|option|let|solution|fix|unfix|end|function|pipe|format|if|then|else|and|or|exists|forall|in|not|within|while|repeat|for|subject to|subj to|s\\.t\\.|card|next|nextw|prev|prevw|first|last|member|ord|ord0)\\b"
},
"suffix": {
"name": "keyword.ampl",
"match": "\\b\\w*.(lb|ub|lb0|lb1|lb2|lrc|ub0|ub1|ub2|urc|val|lbs|ubs|init|body|dinit|dual|init0|ldual|slack|udual|lslack|uslack|dinit0)|(<<|>>)"
},
"math": {
"name": "keyword.operator.ampl",
"match": "(?i)\\b(union|diff|difference|symdiff|sum|inter|intersect|intersection|cross|setof|by|less|mod|div|product|abs|acos|acosh|alias|asin|asinh|atan|atan2|atanh|ceil|cos|exp|floor|log|log10|max|min|precision|round|sin|sinh|sqrt|tan|tanh|trunc|Beta|Cauchy|Exponential|Gamma|Irand224|Normal|Poisson|Uniform|Uniform01)\\b"
},
"operator": {
"name": "keyword.operator.ampl",
"match": "(\\+|-|\\*|\\/|\\*\\*|=|<=?|>=?|==|\\||\\^|<|>|!|\\.\\.|:=|&|!=|:|/)"
},
"argumentcurly": {
"begin": "\\{",
"patterns": [
{
"include": "#general"
},
{
"name": "meta.function-call.arguments.ampl",
"match": "."
}
],
"end": "\\}"
},
"argumentbracket": {
"begin": "\\[",
"patterns": [
{
"include": "#general"
},
{
"name": "meta.function-call.arguments.ampl",
"match": "\\w"
}
],
"end": "\\]"
}
},
"patterns": [
{
"include": "#general"
},
{
"include": "#argumentcurly"
},
{
"include": "#argumentbracket"
}
],
"uuid": "7224acbd-b663-4ec3-8a02-3e6cf1680446"
}