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