3 " Maintainer: Michael M. Tung <michael.tung@uni-mainz.de>
4 " Last Change: 2001 May 10
6 " First public release based on 'Symbolic Manipulation with FORM'
7 " by J.A.M. Vermaseren, CAN, Netherlands, 1991.
8 " This syntax file is still in development. Please send suggestions
11 " For version 5.x: Clear all syntax items
12 " For version 6.x: Quit when a syntax file was already loaded
15 elseif exists("b:current_syntax")
21 " A bunch of useful FORM keywords
22 syn keyword formType global local
23 syn keyword formHeaderStatement symbol symbols cfunction cfunctions
24 syn keyword formHeaderStatement function functions vector vectors
25 syn keyword formHeaderStatement set sets index indices
26 syn keyword formHeaderStatement dimension dimensions unittrace
27 syn keyword formStatement id identify drop skip
28 syn keyword formStatement write nwrite
29 syn keyword formStatement format print nprint load save
30 syn keyword formStatement bracket brackets
31 syn keyword formStatement multiply count match only discard
32 syn keyword formStatement trace4 traceN contract symmetrize antisymmetrize
33 syn keyword formConditional if else endif while
34 syn keyword formConditional repeat endrepeat label goto
36 " some special functions
37 syn keyword formStatement g_ gi_ g5_ g6_ g7_ 5_ 6_ 7_
38 syn keyword formStatement e_ d_ delta_ theta_ sum_ sump_
40 " pattern matching for keywords
41 syn match formComment "^\ *\*.*$"
42 syn match formComment "\;\ *\*.*$"
43 syn region formString start=+"+ end=+"+
44 syn region formString start=+'+ end=+'+
45 syn match formPreProc "^\=\#[a-zA-z][a-zA-Z0-9]*\>"
46 syn match formNumber "\<\d\+\>"
47 syn match formNumber "\<\d\+\.\d*\>"
48 syn match formNumber "\.\d\+\>"
49 syn match formNumber "-\d" contains=Number
50 syn match formNumber "-\.\d" contains=Number
51 syn match formNumber "i_\+\>"
52 syn match formNumber "fac_\+\>"
53 syn match formDirective "^\=\.[a-zA-z][a-zA-Z0-9]*\>"
56 syn sync ccomment formComment minlines=10
58 " Define the default highlighting.
59 " For version 5.7 and earlier: only when not done already
60 " For version 5.8 and later: only when an item doesn't have highlighting yet
61 if version >= 508 || !exists("did_form_syn_inits")
63 let did_form_syn_inits = 1
64 command -nargs=+ HiLink hi link <args>
66 command -nargs=+ HiLink hi def link <args>
69 HiLink formConditional Conditional
70 HiLink formNumber Number
71 HiLink formStatement Statement
72 HiLink formComment Comment
73 HiLink formPreProc PreProc
74 HiLink formDirective PreProc
76 HiLink formString String
78 if !exists("form_enhanced_color")
79 HiLink formHeaderStatement Statement
82 HiLink formHeaderStatement HeaderStatement
83 " dark and a light background for local types
84 if &background == "dark"
85 hi HeaderStatement term=underline ctermfg=LightGreen guifg=LightGreen gui=bold
87 hi HeaderStatement term=underline ctermfg=DarkGreen guifg=SeaGreen gui=bold
89 " change slightly the default for dark gvim
90 if has("gui_running") && &background == "dark"
91 hi Conditional guifg=LightBlue gui=bold
92 hi Statement guifg=LightYellow
99 let b:current_syntax = "form"