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