annotate runtime/syntax/ampl.vim @ 303:6a21eb563c34

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