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