blob: 1999749c095633cfeeb662da0432e806a63797b7 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" 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
6if version < 600
7 syntax clear
8elseif exists("b:current_syntax")
9 finish
10endif
11
12" some control statements
13syntax keyword gpStatement break return next
14syntax keyword gpConditional if
15syntax keyword gpRepeat until while for fordiv forprime forstep forvec
16syntax keyword gpScope local global
17
18syntax keyword gpInterfaceKey buffersize colors compatible debug debugmem
19syntax keyword gpInterfaceKey echo format help histsize log logfile output
20syntax keyword gpInterfaceKey parisize path primelimit prompt psfile
21syntax keyword gpInterfaceKey realprecision seriesprecision simplify
22syntax keyword gpInterfaceKey strictmatch timer
23
24syntax match gpInterface "^\s*\\[a-z].*"
25syntax keyword gpInterface default
26syntax keyword gpInput read input
27
28" functions
29syntax match gpFunRegion "^\s*[a-zA-Z][_a-zA-Z0-9]*(.*)\s*=\s*[^ \t=]"me=e-1 contains=gpFunction,gpArgs
30syntax match gpFunRegion "^\s*[a-zA-Z][_a-zA-Z0-9]*(.*)\s*=\s*$" contains=gpFunction,gpArgs
31syntax match gpArgs contained "[a-zA-Z][_a-zA-Z0-9]*"
32syntax 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
36syntax match gpSpecial contained "\\[ent\\]"
37syntax region gpString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gpSpecial
38
39"comments
40syntax region gpComment start="/\*" end="\*/" contains=gpTodo
41syntax match gpComment "\\\\.*" contains=gpTodo
42syntax keyword gpTodo contained TODO
43syntax sync ccomment gpComment minlines=10
44
45"catch errors caused by wrong parenthesis
46syntax region gpParen transparent start='(' end=')' contains=ALLBUT,gpParenError,gpTodo,gpFunction,gpArgs,gpSpecial
47syntax match gpParenError ")"
48syntax match gpInParen contained "[{}]"
49
50if 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
76endif
77
78let b:current_syntax = "gp"
79" vim: ts=8