" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" we define it here so that included files can test for it
if !exists("main_syntax")
let main_syntax='spyce'
endif
" Read the HTML syntax to start with
let b:did_indent = 1 " don't perform HTML indentation!
let html_no_rendering = 1 " do not render <b>,<i>, etc...
if version < 600
so <sfile>:p:h/html.vim
else
runtime! syntax/html.vim
unlet b:current_syntax
syntax spell default " added by Bram
endif
" include python
syn include @Python <sfile>:p:h/python.vim
syn include @Html <sfile>:p:h/html.vim
" spyce definitions
syn keyword spyceDirectiveKeyword include compact module import contained
syn keyword spyceDirectiveArg name names file contained
syn region spyceDirectiveString start=+"+ end=+"+ contained
syn match spyceDirectiveValue "=[\t ]*[^'", \t>][^, \t>]*"hs=s+1 contained
syn match spyceBeginErrorS ,\[\[,
syn match spyceBeginErrorA ,<%,
syn cluster spyceBeginError contains=spyceBeginErrorS,spyceBeginErrorA
syn match spyceEndErrorS ,\]\],
syn match spyceEndErrorA ,%>,
syn cluster spyceEndError contains=spyceEndErrorS,spyceEndErrorA
syn match spyceEscBeginS ,\\\[\[,
syn match spyceEscBeginA ,\\<%,
syn cluster spyceEscBegin contains=spyceEscBeginS,spyceEscBeginA
syn match spyceEscEndS ,\\\]\],
syn match spyceEscEndA ,\\%>,
syn cluster spyceEscEnd contains=spyceEscEndS,spyceEscEndA
syn match spyceEscEndCommentS ,--\\\]\],
syn match spyceEscEndCommentA ,--\\%>,
syn cluster spyceEscEndComment contains=spyceEscEndCommentS,spyceEscEndCommentA
syn region spyceStmtS matchgroup=spyceStmtDelim start=,\[\[, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
syn region spyceStmtA matchgroup=spyceStmtDelim start=,<%, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
syn region spyceChunkS matchgroup=spyceChunkDelim start=,\[\[\\, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
syn region spyceChunkA matchgroup=spyceChunkDelim start=,<%\\, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
syn region spyceEvalS matchgroup=spyceEvalDelim start=,\[\[=, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
syn region spyceEvalA matchgroup=spyceEvalDelim start=,<%=, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
syn region spyceDirectiveS matchgroup=spyceDelim start=,\[\[\., end=,\]\], contains=spyceBeginError,spyceDirectiveKeyword,spyceDirectiveArg,spyceDirectiveValue,spyceDirectiveString keepend
syn region spyceDirectiveA matchgroup=spyceDelim start=,<%@, end=,%>, contains=spyceBeginError,spyceDirectiveKeyword,spyceDirectiveArg,spyceDirectiveValue,spyceDirectiveString keepend
syn region spyceCommentS matchgroup=spyceCommentDelim start=,\[\[--, end=,--\]\],
syn region spyceCommentA matchgroup=spyceCommentDelim start=,<%--, end=,--%>,
syn region spyceLambdaS matchgroup=spyceLambdaDelim start=,\[\[spy!\?, end=,\]\], contains=@Html,@spyce extend
syn region spyceLambdaA matchgroup=spyceLambdaDelim start=,<%spy!\?, end=,%>, contains=@Html,@spyce extend
syn cluster spyce contains=spyceStmtS,spyceStmtA,spyceChunkS,spyceChunkA,spyceEvalS,spyceEvalA,spyceCommentS,spyceCommentA,spyceDirectiveS,spyceDirectiveA