Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

tiger.vim 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. ""
  2. "" tiger.vim for vim-syntax in /u/a1/sigour_b/.vim/syntax
  3. ""
  4. "" Made by SIGOURE Benoit
  5. "" Login <sigour_b@epita.fr>
  6. ""
  7. "" Started on Sat Jan 7 20:11:05 2006 SIGOURE Benoit
  8. "" Last update Wed Mar 8 14:23:09 2006 SIGOURE Benoit
  9. ""
  10. " Vim syntax file based on the C syntax file by Bram Moolenaar <Bram@vim.org>
  11. " INSTALL instructions:
  12. " install tiger-ftdetect.vim
  13. " $ mkdir -p ~/.vim/syntax
  14. " $ cp tiger.vim ~/.vim/syntax
  15. " For version 5.x: Clear all syntax items
  16. " For version 6.x: Quit when a syntax file was already loaded
  17. if version < 600
  18. syntax clear
  19. elseif exists("b:current_syntax")
  20. finish
  21. endif
  22. " A bunch of useful Tiger keywords
  23. syn keyword tigerStatement break let in end of
  24. syn keyword tigerConditional if then else
  25. syn keyword tigerRepeat while for to do
  26. syn keyword tigerTodo contained TODO FIXME XXX NOTE[S]
  27. " tigerCommentGroup allows adding matches for special things in comments
  28. syn cluster tigerCommentGroup contains=tigerTodo
  29. " String constants (Note: there is no character constants in Tiger)
  30. " Highlight special characters (those which have a backslash) differently
  31. syn match tigerSpecial display contained "\\\(x\x\{2}\|\o\{3}\|a\|b\|f\|n\|r\|t\|v\|\\\|\"\)"
  32. " Highlight invalid escapes
  33. syn match tigerSpecialError display contained "\\[^0-9abfnrtvx\\\"]"
  34. syn match tigerSpecialError display contained "\\x[^0-9a-fA-F]"
  35. syn match tigerSpecialError display contained "\\x\x[^0-9a-fA-F]"
  36. syn region tigerString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=tigerSpecial,tigerSpecialError,Spell
  37. syn match tigerSpaceError display excludenl "\s\+$"
  38. syn match tigerSpaceError display " \+\t"me=e-1
  39. "catch errors caused by wrong parenthesis and brackets
  40. syn cluster tigerParenGroup contains=tigerParenError,tigerSpecial,tigerSpecialError,tigerCommentGroup,tigerNumber,tigerNumbersCom
  41. syn region tigerParen transparent start='(' end=')' contains=ALLBUT,@tigerParenGroup,tigerErrInBracket,Spell
  42. syn match tigerParenError display "[\])]"
  43. syn match tigerErrInParen display contained "[\]]"
  44. syn region tigerBracket transparent start='\[' end=']' contains=ALLBUT,@tigerParenGroup,tigerErrInParen,Spell
  45. syn match tigerErrInBracket display contained "[);{}]"
  46. " integer number (Note: octal or hexadecimal literals don't exist in Tiger.)
  47. " (Numbers starting with a 0 are not considered in a special way)
  48. syn case ignore
  49. syn match tigerNumbers display transparent "\<\d\|\.\d" contains=tigerNumber
  50. " Same, but without octal error (for comments)
  51. syn match tigerNumbersCom display contained transparent "\<\d\|\.\d" contains=tigerNumber
  52. syn match tigerNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
  53. syn case match
  54. syn region tigerComment matchgroup=tigerCommentStart start="/\*" end="\*/" contains=@tigerCommentGroup,tigerComment,@Spell
  55. syn keyword tigerType int string
  56. syn keyword tigerStructure type array
  57. syn keyword tigerStorageClass var
  58. syn keyword tigerDecl function primitive
  59. syn keyword tigerImport import
  60. syn keyword tigerNil nil
  61. syn keyword tigerBuiltin chr concat exit flush getchar not ord print print_err print_int size strcmp streq substring
  62. " Define the default highlighting.
  63. " For version 5.7 and earlier: only when not done already
  64. " For version 5.8 and later: only when an item doesn't have highlighting yet
  65. if version >= 508 || !exists("did_tiger_syn_inits")
  66. if version < 508
  67. let did_tiger_syn_inits = 1
  68. command -nargs=+ HiLink hi link <args>
  69. else
  70. command -nargs=+ HiLink hi def link <args>
  71. endif
  72. HiLink tigerCommentL tigerComment
  73. HiLink tigerCommentStart tigerComment
  74. HiLink tigerConditional Conditional
  75. HiLink tigerRepeat Repeat
  76. HiLink tigerNumber Number
  77. HiLink tigerParenError tigerError
  78. HiLink tigerErrInParen tigerError
  79. HiLink tigerErrInBracket tigerError
  80. HiLink tigerSpaceError tigerError
  81. HiLink tigerSpecialError tigerError
  82. HiLink tigerStructure Structure
  83. HiLink tigerStorageClass StorageClass
  84. HiLink tigerDefine Macro
  85. HiLink tigerError Error
  86. HiLink tigerStatement Statement
  87. HiLink tigerType Type
  88. HiLink tigerConstant Constant
  89. HiLink tigerString String
  90. HiLink tigerComment Comment
  91. HiLink tigerSpecial SpecialChar
  92. HiLink tigerTodo Todo
  93. HiLink tigerDecl Type
  94. HiLink tigerImport Include
  95. HiLink tigerNil Constant
  96. HiLink tigerBuiltin Define
  97. delcommand HiLink
  98. endif
  99. let b:current_syntax = "tiger"
  100. " vim: ts=8