spyce.vim 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. " Vim syntax file
  2. " Language: SPYCE
  3. " Maintainer: Rimon Barr <rimon AT acm DOT org>
  4. " URL: http://spyce.sourceforge.net
  5. " Last Change: 2009 Nov 11
  6. " quit when a syntax file was already loaded
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. " we define it here so that included files can test for it
  11. if !exists("main_syntax")
  12. let main_syntax='spyce'
  13. endif
  14. " Read the HTML syntax to start with
  15. let b:did_indent = 1 " don't perform HTML indentation!
  16. let html_no_rendering = 1 " do not render <b>,<i>, etc...
  17. runtime! syntax/html.vim
  18. unlet b:current_syntax
  19. syntax spell default " added by Bram
  20. " include python
  21. syn include @Python <sfile>:p:h/python.vim
  22. syn include @Html <sfile>:p:h/html.vim
  23. " spyce definitions
  24. syn keyword spyceDirectiveKeyword include compact module import contained
  25. syn keyword spyceDirectiveArg name names file contained
  26. syn region spyceDirectiveString start=+"+ end=+"+ contained
  27. syn match spyceDirectiveValue "=[\t ]*[^'", \t>][^, \t>]*"hs=s+1 contained
  28. syn match spyceBeginErrorS ,\[\[,
  29. syn match spyceBeginErrorA ,<%,
  30. syn cluster spyceBeginError contains=spyceBeginErrorS,spyceBeginErrorA
  31. syn match spyceEndErrorS ,\]\],
  32. syn match spyceEndErrorA ,%>,
  33. syn cluster spyceEndError contains=spyceEndErrorS,spyceEndErrorA
  34. syn match spyceEscBeginS ,\\\[\[,
  35. syn match spyceEscBeginA ,\\<%,
  36. syn cluster spyceEscBegin contains=spyceEscBeginS,spyceEscBeginA
  37. syn match spyceEscEndS ,\\\]\],
  38. syn match spyceEscEndA ,\\%>,
  39. syn cluster spyceEscEnd contains=spyceEscEndS,spyceEscEndA
  40. syn match spyceEscEndCommentS ,--\\\]\],
  41. syn match spyceEscEndCommentA ,--\\%>,
  42. syn cluster spyceEscEndComment contains=spyceEscEndCommentS,spyceEscEndCommentA
  43. syn region spyceStmtS matchgroup=spyceStmtDelim start=,\[\[, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
  44. syn region spyceStmtA matchgroup=spyceStmtDelim start=,<%, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
  45. syn region spyceChunkS matchgroup=spyceChunkDelim start=,\[\[\\, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
  46. syn region spyceChunkA matchgroup=spyceChunkDelim start=,<%\\, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
  47. syn region spyceEvalS matchgroup=spyceEvalDelim start=,\[\[=, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
  48. syn region spyceEvalA matchgroup=spyceEvalDelim start=,<%=, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
  49. syn region spyceDirectiveS matchgroup=spyceDelim start=,\[\[\., end=,\]\], contains=spyceBeginError,spyceDirectiveKeyword,spyceDirectiveArg,spyceDirectiveValue,spyceDirectiveString keepend
  50. syn region spyceDirectiveA matchgroup=spyceDelim start=,<%@, end=,%>, contains=spyceBeginError,spyceDirectiveKeyword,spyceDirectiveArg,spyceDirectiveValue,spyceDirectiveString keepend
  51. syn region spyceCommentS matchgroup=spyceCommentDelim start=,\[\[--, end=,--\]\],
  52. syn region spyceCommentA matchgroup=spyceCommentDelim start=,<%--, end=,--%>,
  53. syn region spyceLambdaS matchgroup=spyceLambdaDelim start=,\[\[spy!\?, end=,\]\], contains=@Html,@spyce extend
  54. syn region spyceLambdaA matchgroup=spyceLambdaDelim start=,<%spy!\?, end=,%>, contains=@Html,@spyce extend
  55. syn cluster spyce contains=spyceStmtS,spyceStmtA,spyceChunkS,spyceChunkA,spyceEvalS,spyceEvalA,spyceCommentS,spyceCommentA,spyceDirectiveS,spyceDirectiveA
  56. syn cluster htmlPreproc contains=@spyce
  57. hi link spyceDirectiveKeyword Special
  58. hi link spyceDirectiveArg Type
  59. hi link spyceDirectiveString String
  60. hi link spyceDirectiveValue String
  61. hi link spyceDelim Special
  62. hi link spyceStmtDelim spyceDelim
  63. hi link spyceChunkDelim spyceDelim
  64. hi link spyceEvalDelim spyceDelim
  65. hi link spyceLambdaDelim spyceDelim
  66. hi link spyceCommentDelim Comment
  67. hi link spyceBeginErrorS Error
  68. hi link spyceBeginErrorA Error
  69. hi link spyceEndErrorS Error
  70. hi link spyceEndErrorA Error
  71. hi link spyceStmtS spyce
  72. hi link spyceStmtA spyce
  73. hi link spyceChunkS spyce
  74. hi link spyceChunkA spyce
  75. hi link spyceEvalS spyce
  76. hi link spyceEvalA spyce
  77. hi link spyceDirectiveS spyce
  78. hi link spyceDirectiveA spyce
  79. hi link spyceCommentS Comment
  80. hi link spyceCommentA Comment
  81. hi link spyceLambdaS Normal
  82. hi link spyceLambdaA Normal
  83. hi link spyce Statement
  84. let b:current_syntax = "spyce"
  85. if main_syntax == 'spyce'
  86. unlet main_syntax
  87. endif