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