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