xref: /vim-8.2.3635/runtime/syntax/gp.vim (revision 36e294c0)
1" Vim syntax file
2" Language:	gp (version 2.5)
3" Maintainer:	Karim Belabas <[email protected]>
4" Last change:	2012 Jan 08
5" URL:		http://pari.math.u-bordeaux.fr
6
7if version < 600
8  syntax clear
9elseif exists("b:current_syntax")
10  finish
11endif
12
13let s:cpo_save = &cpo
14set cpo&vim
15
16" control statements
17syntax keyword gpStatement	break return next
18syntax keyword gpConditional	if
19syntax keyword gpRepeat		until while for fordiv forell forprime
20syntax keyword gpRepeat		forsubgroup forstep forvec
21" storage class
22syntax keyword gpScope		my local global
23" defaults
24syntax keyword gpInterfaceKey	breakloop colors compatible
25syntax keyword gpInterfaceKey	datadir debug debugfiles debugmem
26syntax keyword gpInterfaceKey	echo factor_add_primes factor_proven format
27syntax keyword gpInterfaceKey	graphcolormap graphcolors
28syntax keyword gpInterfaceKey	help histfile histsize
29syntax keyword gpInterfaceKey	lines linewrap log logfile new_galois_format
30syntax keyword gpInterfaceKey	output parisize path prettyprinter primelimit
31syntax keyword gpInterfaceKey	prompt prompt_cont psfile
32syntax keyword gpInterfaceKey	readline realprecision recover
33syntax keyword gpInterfaceKey	secure seriesprecision simplify strictmatch
34syntax keyword gpInterfaceKey	TeXstyle timer
35
36syntax match gpInterface	"^\s*\\[a-z].*"
37syntax keyword gpInterface	default
38syntax keyword gpInput		read input
39
40" functions
41syntax match gpFunRegion "^\s*[a-zA-Z][_a-zA-Z0-9]*(.*)\s*=\s*[^ \t=]"me=e-1 contains=gpFunction,gpArgs
42syntax match gpFunRegion "^\s*[a-zA-Z][_a-zA-Z0-9]*(.*)\s*=\s*$" contains=gpFunction,gpArgs
43syntax match gpArgs contained "[a-zA-Z][_a-zA-Z0-9]*"
44syntax 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
48syntax match  gpSpecial contained "\\[ent\\]"
49syntax region gpString  start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gpSpecial
50
51"comments
52syntax region gpComment	start="/\*"  end="\*/" contains=gpTodo
53syntax match  gpComment "\\\\.*" contains=gpTodo
54syntax keyword gpTodo contained	TODO
55syntax sync ccomment gpComment minlines=10
56
57"catch errors caused by wrong parenthesis
58syntax region gpParen		transparent start='(' end=')' contains=ALLBUT,gpParenError,gpTodo,gpFunction,gpArgs,gpSpecial
59syntax match gpParenError	")"
60syntax match gpInParen contained "[{}]"
61
62if 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
88endif
89
90let b:current_syntax = "gp"
91let &cpo = s:cpo_save
92unlet s:cpo_save
93" vim: ts=8
94