Mercurial > vim
annotate runtime/syntax/ampl.vim @ 35784:43ea277664a6
Added tag v9.1.0613 for changeset 9dd6970e4bdf127bee6f35932e8926ac771024a9
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 24 Jul 2024 21:45:04 +0200 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
7 | 1 " Language: ampl (A Mathematical Programming Language) |
2 " Maintainer: Krief David <david.krief@etu.enseeiht.fr> or <david_krief@hotmail.com> | |
3 " Last Change: 2003 May 11 | |
4 | |
5 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
6 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
7 if exists("b:current_syntax") |
7 | 8 finish |
9 endif | |
10 | |
11 | |
12 | |
13 | |
14 "-- | |
15 syn match amplEntityKeyword "\(subject to\)\|\(subj to\)\|\(s\.t\.\)" | |
16 syn keyword amplEntityKeyword minimize maximize objective | |
17 | |
18 syn keyword amplEntityKeyword coeff coef cover obj default | |
19 syn keyword amplEntityKeyword from to to_come net_in net_out | |
20 syn keyword amplEntityKeyword dimen dimension | |
21 | |
22 | |
23 | |
24 "-- | |
25 syn keyword amplType integer binary set param var | |
26 syn keyword amplType node ordered circular reversed symbolic | |
27 syn keyword amplType arc | |
28 | |
29 | |
30 | |
31 "-- | |
32 syn keyword amplStatement check close \display drop include | |
33 syn keyword amplStatement print printf quit reset restore | |
34 syn keyword amplStatement solve update write shell model | |
35 syn keyword amplStatement data option let solution fix | |
36 syn keyword amplStatement unfix end function pipe format | |
37 | |
38 | |
39 | |
40 "-- | |
41 syn keyword amplConditional if then else and or | |
42 syn keyword amplConditional exists forall in not within | |
43 | |
44 | |
45 | |
46 "-- | |
47 syn keyword amplRepeat while repeat for | |
48 | |
49 | |
50 | |
51 "-- | |
52 syn keyword amplOperators union diff difference symdiff sum | |
53 syn keyword amplOperators inter intersect intersection cross setof | |
54 syn keyword amplOperators by less mod div product | |
55 "syn keyword amplOperators min max | |
56 "conflict between functions max, min and operators max, min | |
57 | |
58 syn match amplBasicOperators "||\|<=\|==\|\^\|<\|=\|!\|-\|\.\.\|:=" | |
59 syn match amplBasicOperators "&&\|>=\|!=\|\*\|>\|:\|/\|+\|\*\*" | |
60 | |
61 | |
62 | |
63 | |
64 "-- | |
65 syn match amplComment "\#.*" | |
66 syn region amplComment start=+\/\*+ end=+\*\/+ | |
67 | |
68 syn region amplStrings start=+\'+ skip=+\\'+ end=+\'+ | |
69 syn region amplStrings start=+\"+ skip=+\\"+ end=+\"+ | |
70 | |
71 syn match amplNumerics "[+-]\=\<\d\+\(\.\d\+\)\=\([dDeE][-+]\=\d\+\)\=\>" | |
72 syn match amplNumerics "[+-]\=Infinity" | |
73 | |
74 | |
75 "-- | |
76 syn keyword amplSetFunction card next nextw prev prevw | |
77 syn keyword amplSetFunction first last member ord ord0 | |
78 | |
79 syn keyword amplBuiltInFunction abs acos acosh alias asin | |
80 syn keyword amplBuiltInFunction asinh atan atan2 atanh ceil | |
81 syn keyword amplBuiltInFunction cos exp floor log log10 | |
82 syn keyword amplBuiltInFunction max min precision round sin | |
83 syn keyword amplBuiltInFunction sinh sqrt tan tanh trunc | |
84 | |
85 syn keyword amplRandomGenerator Beta Cauchy Exponential Gamma Irand224 | |
86 syn keyword amplRandomGenerator Normal Poisson Uniform Uniform01 | |
87 | |
88 | |
89 | |
90 "-- to highlight the 'dot-suffixes' | |
91 syn match amplDotSuffix "\h\w*\.\(lb\|ub\)"hs=e-2 | |
92 syn match amplDotSuffix "\h\w*\.\(lb0\|lb1\|lb2\|lrc\|ub0\)"hs=e-3 | |
93 syn match amplDotSuffix "\h\w*\.\(ub1\|ub2\|urc\|val\|lbs\|ubs\)"hs=e-3 | |
94 syn match amplDotSuffix "\h\w*\.\(init\|body\|dinit\|dual\)"hs=e-4 | |
95 syn match amplDotSuffix "\h\w*\.\(init0\|ldual\|slack\|udual\)"hs=e-5 | |
96 syn match amplDotSuffix "\h\w*\.\(lslack\|uslack\|dinit0\)"hs=e-6 | |
97 | |
98 | |
99 | |
100 "-- | |
101 syn match amplPiecewise "<<\|>>" | |
102 | |
103 | |
104 | |
105 "-- Todo. | |
106 syn keyword amplTodo contained TODO FIXME XXX | |
107 | |
108 | |
109 | |
110 | |
111 | |
112 | |
113 | |
114 | |
115 | |
116 | |
117 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
118 " The default methods for highlighting. Can be overridden later. |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
119 hi def link amplEntityKeyword Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
120 hi def link amplType Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
121 hi def link amplStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
122 hi def link amplOperators Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
123 hi def link amplBasicOperators Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
124 hi def link amplConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
125 hi def link amplRepeat Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
126 hi def link amplStrings String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
127 hi def link amplNumerics Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
128 hi def link amplSetFunction Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
129 hi def link amplBuiltInFunction Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
130 hi def link amplRandomGenerator Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
131 hi def link amplComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
132 hi def link amplDotSuffix Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
133 hi def link amplPiecewise Special |
7 | 134 |
135 | |
136 let b:current_syntax = "ampl" | |
137 | |
138 " vim: ts=8 | |
139 | |
140 |