scilab.vim 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. "
  2. " Vim syntax file
  3. " Language : Scilab
  4. " Maintainer : Benoit Hamelin
  5. " File type : *.sci (see :help filetype)
  6. " History
  7. " 28jan2002 benoith 0.1 Creation. Adapted from matlab.vim.
  8. " 04feb2002 benoith 0.5 Fixed bugs with constant highlighting.
  9. "
  10. " quit when a syntax file was already loaded
  11. if exists("b:current_syntax")
  12. finish
  13. endif
  14. " Reserved words.
  15. syn keyword scilabStatement abort clear clearglobal end exit global mode predef quit resume
  16. syn keyword scilabStatement return
  17. syn keyword scilabFunction function endfunction funptr
  18. syn keyword scilabPredicate null iserror isglobal
  19. syn keyword scilabKeyword typename
  20. syn keyword scilabDebug debug pause what where whereami whereis who whos
  21. syn keyword scilabRepeat for while break
  22. syn keyword scilabConditional if then else elseif
  23. syn keyword scilabMultiplex select case
  24. " Reserved constants.
  25. syn match scilabConstant "\(%\)[0-9A-Za-z?!#$]\+"
  26. syn match scilabBoolean "\(%\)[FTft]\>"
  27. " Delimiters and operators.
  28. syn match scilabDelimiter "[][;,()]"
  29. syn match scilabComparison "[=~]="
  30. syn match scilabComparison "[<>]=\="
  31. syn match scilabComparison "<>"
  32. syn match scilabLogical "[&|~]"
  33. syn match scilabAssignment "="
  34. syn match scilabArithmetic "[+-]"
  35. syn match scilabArithmetic "\.\=[*/\\]\.\="
  36. syn match scilabArithmetic "\.\=^"
  37. syn match scilabRange ":"
  38. syn match scilabMlistAccess "\."
  39. syn match scilabLineContinuation "\.\{2,}"
  40. syn match scilabTransposition "[])a-zA-Z0-9?!_#$.]'"lc=1
  41. " Comments and tools.
  42. syn keyword scilabTodo TODO todo FIXME fixme TBD tbd contained
  43. syn match scilabComment "//.*$" contains=scilabTodo
  44. " Constants.
  45. syn match scilabNumber "[0-9]\+\(\.[0-9]*\)\=\([DEde][+-]\=[0-9]\+\)\="
  46. syn match scilabNumber "\.[0-9]\+\([DEde][+-]\=[0-9]\+\)\="
  47. syn region scilabString start=+'+ skip=+''+ end=+'+ oneline
  48. syn region scilabString start=+"+ end=+"+ oneline
  49. " Identifiers.
  50. syn match scilabIdentifier "\<[A-Za-z?!_#$][A-Za-z0-9?!_#$]*\>"
  51. syn match scilabOverload "%[A-Za-z0-9?!_#$]\+_[A-Za-z0-9?!_#$]\+"
  52. " Define the default highlighting.
  53. " Only when an item doesn't have highlighting yet
  54. hi def link scilabStatement Statement
  55. hi def link scilabFunction Keyword
  56. hi def link scilabPredicate Keyword
  57. hi def link scilabKeyword Keyword
  58. hi def link scilabDebug Debug
  59. hi def link scilabRepeat Repeat
  60. hi def link scilabConditional Conditional
  61. hi def link scilabMultiplex Conditional
  62. hi def link scilabConstant Constant
  63. hi def link scilabBoolean Boolean
  64. hi def link scilabDelimiter Delimiter
  65. hi def link scilabMlistAccess Delimiter
  66. hi def link scilabComparison Operator
  67. hi def link scilabLogical Operator
  68. hi def link scilabAssignment Operator
  69. hi def link scilabArithmetic Operator
  70. hi def link scilabRange Operator
  71. hi def link scilabLineContinuation Underlined
  72. hi def link scilabTransposition Operator
  73. hi def link scilabTodo Todo
  74. hi def link scilabComment Comment
  75. hi def link scilabNumber Number
  76. hi def link scilabString String
  77. hi def link scilabIdentifier Identifier
  78. hi def link scilabOverload Special
  79. let b:current_syntax = "scilab"
  80. "EOF vim: ts=4 noet tw=100 sw=4 sts=0