7
|
1 " Vim syntax file
|
|
2 " Language: gp (version 2.1)
|
|
3 " Maintainer: Karim Belabas <Karim.Belabas@math.u-psud.fr>
|
|
4 " Last change: 2001 Sep 02
|
|
5
|
|
6 if version < 600
|
|
7 syntax clear
|
|
8 elseif exists("b:current_syntax")
|
|
9 finish
|
|
10 endif
|
|
11
|
|
12 " some control statements
|
|
13 syntax keyword gpStatement break return next
|
|
14 syntax keyword gpConditional if
|
|
15 syntax keyword gpRepeat until while for fordiv forprime forstep forvec
|
|
16 syntax keyword gpScope local global
|
|
17
|
|
18 syntax keyword gpInterfaceKey buffersize colors compatible debug debugmem
|
|
19 syntax keyword gpInterfaceKey echo format help histsize log logfile output
|
|
20 syntax keyword gpInterfaceKey parisize path primelimit prompt psfile
|
|
21 syntax keyword gpInterfaceKey realprecision seriesprecision simplify
|
|
22 syntax keyword gpInterfaceKey strictmatch timer
|
|
23
|
|
24 syntax match gpInterface "^\s*\\[a-z].*"
|
|
25 syntax keyword gpInterface default
|
|
26 syntax keyword gpInput read input
|
|
27
|
|
28 " functions
|
|
29 syntax match gpFunRegion "^\s*[a-zA-Z][_a-zA-Z0-9]*(.*)\s*=\s*[^ \t=]"me=e-1 contains=gpFunction,gpArgs
|
|
30 syntax match gpFunRegion "^\s*[a-zA-Z][_a-zA-Z0-9]*(.*)\s*=\s*$" contains=gpFunction,gpArgs
|
|
31 syntax match gpArgs contained "[a-zA-Z][_a-zA-Z0-9]*"
|
|
32 syntax match gpFunction contained "^\s*[a-zA-Z][_a-zA-Z0-9]*("me=e-1
|
|
33
|
|
34 " String and Character constants
|
|
35 " Highlight special (backslash'ed) characters differently
|
|
36 syntax match gpSpecial contained "\\[ent\\]"
|
|
37 syntax region gpString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gpSpecial
|
|
38
|
|
39 "comments
|
|
40 syntax region gpComment start="/\*" end="\*/" contains=gpTodo
|
|
41 syntax match gpComment "\\\\.*" contains=gpTodo
|
|
42 syntax keyword gpTodo contained TODO
|
|
43 syntax sync ccomment gpComment minlines=10
|
|
44
|
|
45 "catch errors caused by wrong parenthesis
|
|
46 syntax region gpParen transparent start='(' end=')' contains=ALLBUT,gpParenError,gpTodo,gpFunction,gpArgs,gpSpecial
|
|
47 syntax match gpParenError ")"
|
|
48 syntax match gpInParen contained "[{}]"
|
|
49
|
|
50 if version >= 508 || !exists("did_gp_syn_inits")
|
|
51 if version < 508
|
|
52 let did_gp_syn_inits = 1
|
|
53 command -nargs=+ HiLink hi link <args>
|
|
54 else
|
|
55 command -nargs=+ HiLink hi def link <args>
|
|
56 endif
|
|
57
|
|
58 HiLink gpConditional Conditional
|
|
59 HiLink gpRepeat Repeat
|
|
60 HiLink gpError Error
|
|
61 HiLink gpParenError gpError
|
|
62 HiLink gpInParen gpError
|
|
63 HiLink gpStatement Statement
|
|
64 HiLink gpString String
|
|
65 HiLink gpComment Comment
|
|
66 HiLink gpInterface Type
|
|
67 HiLink gpInput Type
|
|
68 HiLink gpInterfaceKey Statement
|
|
69 HiLink gpFunction Function
|
|
70 HiLink gpScope Type
|
|
71 " contained ones
|
|
72 HiLink gpSpecial Special
|
|
73 HiLink gpTodo Todo
|
|
74 HiLink gpArgs Type
|
|
75 delcommand HiLink
|
|
76 endif
|
|
77
|
|
78 let b:current_syntax = "gp"
|
|
79 " vim: ts=8
|