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