annotate runtime/syntax/form.vim @ 3149:35f098371af6 v7.3.345

updated for version 7.3.345
author Bram Moolenaar <bram@vim.org>
date Thu, 20 Oct 2011 21:41:09 +0200
parents 7bc41231fbc7
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 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: FORM
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
3 " Version: 2.0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Maintainer: Michael M. Tung <michael.tung@uni-mainz.de>
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
5 " Last Change: <Thu Oct 23 13:11:21 CEST 2008>
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
6 " Past Change: <October 2008 Thomas Reiter thomasr@nikhef.nl>
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
7 " Past Change: <Wed, 2005/05/25 09:24:58 arwagner wptx44>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " First public release based on 'Symbolic Manipulation with FORM'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " by J.A.M. Vermaseren, CAN, Netherlands, 1991.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " This syntax file is still in development. Please send suggestions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " to the maintainer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
24 " a bunch of useful FORM keywords
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn keyword formType global local
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword formHeaderStatement symbol symbols cfunction cfunctions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword formHeaderStatement function functions vector vectors
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
28 syn keyword formHeaderStatement tensor tensors ctensor ctensors
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
29 syn keyword formHeaderStatement set sets index indices table ctable
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn keyword formHeaderStatement dimension dimensions unittrace
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
31 syn keyword formConditional if else elseif endif while
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword formConditional repeat endrepeat label goto
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
33 syn keyword formConditional argument endargument exit
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
34 syn keyword formConditional inexpression inside term
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
35 syn keyword formConditional endinexpression endinside endterm
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
36 syn keyword formStatement abrackets also antibrackets antisymmetrize
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
37 syn keyword formStatement argexplode argimplode apply auto autodeclare
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
38 syn keyword formStatement brackets chainin chainout chisholm cleartable
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
39 syn keyword formStatement collect commuting compress contract
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
40 syn keyword formStatement cyclesymmetrize deallocatetable delete
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
41 syn keyword formStatement dimension discard disorder drop factarg fill
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
42 syn keyword formStatement fillexpression fixindex format funpowers hide
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
43 syn keyword formStatement identify idnew idold ifmatch inparallel
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
44 syn keyword formStatement insidefirst keep load makeinteger many metric
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
45 syn keyword formStatement moduleoption modulus multi multiply ndrop
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
46 syn keyword formStatement nfunctions nhide normalize notinparallel
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
47 syn keyword formStatement nprint nskip ntable ntensors nunhide nwrite
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
48 syn keyword formStatement off on once only polyfun pophide print
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
49 syn keyword formStatement printtable propercount pushhide ratio
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
50 syn keyword formStatement rcyclesymmetrize redefine renumber
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
51 syn keyword formStatement replaceinarg replaceloop save select
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
52 syn keyword formStatement setexitflag skip slavepatchsize sort splitarg
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
53 syn keyword formStatement splitfirstarg splitlastarg sum symmetrize
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
54 syn keyword formStatement tablebase testuse threadbucketsize totensor
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
55 syn keyword formStatement tovector trace4 tracen tryreplace unhide
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
56 syn keyword formStatement unittrace vectors write
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
57 " for compatibility with older FORM versions:
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
58 syn keyword formStatement id bracket count match traceN
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 " some special functions
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
61 syn keyword formStatement abs_ bernoulli_ binom_ conjg_ count_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
62 syn keyword formStatement d_ dd_ delta_ deltap_ denom_ distrib_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
63 syn keyword formStatement dum_ dummy_ dummyten_ e_ exp_ fac_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
64 syn keyword formStatement factorin_ firstbracket_ g5_ g6_ g7_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
65 syn keyword formStatement g_ gcd_ gi_ integer_ invfac_ match_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
66 syn keyword formStatement max_ maxpowerof_ min_ minpowerof_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
67 syn keyword formStatement mod_ nargs_ nterms_ pattern_ poly_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
68 syn keyword formStatement polyadd_ polydiv_ polygcd_ polyintfac_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
69 syn keyword formStatement polymul_ polynorm_ polyrem_ polysub_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
70 syn keyword formStatement replace_ reverse_ root_ setfun_ sig_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
71 syn keyword formStatement sign_ sum_ sump_ table_ tbl_ term_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
72 syn keyword formStatement termsin_ termsinbracket_ theta_ thetap_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
73 syn keyword formStatement 5_ 6_ 7_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
74
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
75 syn keyword formReserved sqrt_ ln_ sin_ cos_ tan_ asin_ acos_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
76 syn keyword formReserved atan_ atan2_ sinh_ cosh_ tanh_ asinh_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
77 syn keyword formReserved acosh_ atanh_ li2_ lin_
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
78
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
79 syn keyword formTodo contained TODO FIXME XXX
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
80
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
81 syn match formSpecial display contained "\\\(n\|t\|b\|\\\|\"\)"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
82 syn match formSpecial display contained "%\(%\|e\|E\|s\|f\|\$\)"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
83 syn match formSpecial "\<N\d\+_[?]"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 " pattern matching for keywords
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
86 syn match formComment "^\ *\*.*$" contains=formTodo
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
87 syn match formComment "\;\ *\*.*$" contains=formTodo
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
88 syn region formString start=+"+ end=+"+ contains=formSpecial
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn region formString start=+'+ end=+'+
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
90 syn region formNestedString start=+`+ end=+'+ contains=formNestedString
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn match formPreProc "^\=\#[a-zA-z][a-zA-Z0-9]*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn match formNumber "\<\d\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn match formNumber "\<\d\+\.\d*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn match formNumber "\.\d\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn match formNumber "-\d" contains=Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match formNumber "-\.\d" contains=Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn match formNumber "i_\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 syn match formNumber "fac_\+\>"
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
99 " pattern matching wildcards
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
100 syn match formNumber "?[A-z0-9]*"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
101 " dollar-variables (new in 3.x)
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
102 syn match formNumber "\\$[A-z0-9]*"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
103 " scalar products
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
104 syn match formNumber "^\=[a-zA-z][a-zA-Z0-9]*\.[a-zA-z][a-zA-Z0-9]*\>"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
105
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 syn match formDirective "^\=\.[a-zA-z][a-zA-Z0-9]*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 " hi User Labels
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 syn sync ccomment formComment minlines=10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 if version >= 508 || !exists("did_form_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 let did_form_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 HiLink formConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 HiLink formNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 HiLink formStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 HiLink formComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 HiLink formPreProc PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 HiLink formDirective PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 HiLink formType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 HiLink formString String
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
130 HiLink formNestedString String
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
131 HiLink formReserved Error
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
132 HiLink formTodo Todo
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
133 HiLink formSpecial SpecialChar
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 if !exists("form_enhanced_color")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 HiLink formHeaderStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 " enhanced color mode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 HiLink formHeaderStatement HeaderStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 " dark and a light background for local types
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 if &background == "dark"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 hi HeaderStatement term=underline ctermfg=LightGreen guifg=LightGreen gui=bold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 hi HeaderStatement term=underline ctermfg=DarkGreen guifg=SeaGreen gui=bold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 " change slightly the default for dark gvim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 if has("gui_running") && &background == "dark"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 hi Conditional guifg=LightBlue gui=bold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 hi Statement guifg=LightYellow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 let b:current_syntax = "form"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 " vim: ts=8