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