gp.vim 2.9 KB

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