3 " Maintainer: Rimon Barr <rimon AT acm DOT org>
4 " URL: http://spyce.sourceforge.net
5 " Last Change: 2009 Nov 11
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
15 " we define it here so that included files can test for it
16 if !exists("main_syntax")
17 let main_syntax='spyce'
20 " Read the HTML syntax to start with
21 let b:did_indent = 1 " don't perform HTML indentation!
22 let html_no_rendering = 1 " do not render <b>,<i>, etc...
24 so <sfile>:p:h/html.vim
26 runtime! syntax/html.vim
27 unlet b:current_syntax
28 syntax spell default " added by Bram
32 syn include @Python <sfile>:p:h/python.vim
33 syn include @Html <sfile>:p:h/html.vim
36 syn keyword spyceDirectiveKeyword include compact module import contained
37 syn keyword spyceDirectiveArg name names file contained
38 syn region spyceDirectiveString start=+"+ end=+"+ contained
39 syn match spyceDirectiveValue "=[\t ]*[^'", \t>][^, \t>]*"hs=s+1 contained
41 syn match spyceBeginErrorS ,\[\[,
42 syn match spyceBeginErrorA ,<%,
43 syn cluster spyceBeginError contains=spyceBeginErrorS,spyceBeginErrorA
44 syn match spyceEndErrorS ,\]\],
45 syn match spyceEndErrorA ,%>,
46 syn cluster spyceEndError contains=spyceEndErrorS,spyceEndErrorA
48 syn match spyceEscBeginS ,\\\[\[,
49 syn match spyceEscBeginA ,\\<%,
50 syn cluster spyceEscBegin contains=spyceEscBeginS,spyceEscBeginA
51 syn match spyceEscEndS ,\\\]\],
52 syn match spyceEscEndA ,\\%>,
53 syn cluster spyceEscEnd contains=spyceEscEndS,spyceEscEndA
54 syn match spyceEscEndCommentS ,--\\\]\],
55 syn match spyceEscEndCommentA ,--\\%>,
56 syn cluster spyceEscEndComment contains=spyceEscEndCommentS,spyceEscEndCommentA
58 syn region spyceStmtS matchgroup=spyceStmtDelim start=,\[\[, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
59 syn region spyceStmtA matchgroup=spyceStmtDelim start=,<%, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
60 syn region spyceChunkS matchgroup=spyceChunkDelim start=,\[\[\\, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
61 syn region spyceChunkA matchgroup=spyceChunkDelim start=,<%\\, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
62 syn region spyceEvalS matchgroup=spyceEvalDelim start=,\[\[=, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
63 syn region spyceEvalA matchgroup=spyceEvalDelim start=,<%=, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
64 syn region spyceDirectiveS matchgroup=spyceDelim start=,\[\[\., end=,\]\], contains=spyceBeginError,spyceDirectiveKeyword,spyceDirectiveArg,spyceDirectiveValue,spyceDirectiveString keepend
65 syn region spyceDirectiveA matchgroup=spyceDelim start=,<%@, end=,%>, contains=spyceBeginError,spyceDirectiveKeyword,spyceDirectiveArg,spyceDirectiveValue,spyceDirectiveString keepend
66 syn region spyceCommentS matchgroup=spyceCommentDelim start=,\[\[--, end=,--\]\],
67 syn region spyceCommentA matchgroup=spyceCommentDelim start=,<%--, end=,--%>,
68 syn region spyceLambdaS matchgroup=spyceLambdaDelim start=,\[\[spy!\?, end=,\]\], contains=@Html,@spyce extend
69 syn region spyceLambdaA matchgroup=spyceLambdaDelim start=,<%spy!\?, end=,%>, contains=@Html,@spyce extend
71 syn cluster spyce contains=spyceStmtS,spyceStmtA,spyceChunkS,spyceChunkA,spyceEvalS,spyceEvalA,spyceCommentS,spyceCommentA,spyceDirectiveS,spyceDirectiveA
73 syn cluster htmlPreproc contains=@spyce
75 hi link spyceDirectiveKeyword Special
76 hi link spyceDirectiveArg Type
77 hi link spyceDirectiveString String
78 hi link spyceDirectiveValue String
80 hi link spyceDelim Special
81 hi link spyceStmtDelim spyceDelim
82 hi link spyceChunkDelim spyceDelim
83 hi link spyceEvalDelim spyceDelim
84 hi link spyceLambdaDelim spyceDelim
85 hi link spyceCommentDelim Comment
87 hi link spyceBeginErrorS Error
88 hi link spyceBeginErrorA Error
89 hi link spyceEndErrorS Error
90 hi link spyceEndErrorA Error
92 hi link spyceStmtS spyce
93 hi link spyceStmtA spyce
94 hi link spyceChunkS spyce
95 hi link spyceChunkA spyce
96 hi link spyceEvalS spyce
97 hi link spyceEvalA spyce
98 hi link spyceDirectiveS spyce
99 hi link spyceDirectiveA spyce
100 hi link spyceCommentS Comment
101 hi link spyceCommentA Comment
102 hi link spyceLambdaS Normal
103 hi link spyceLambdaA Normal
105 hi link spyce Statement
107 let b:current_syntax = "spyce"
108 if main_syntax == 'spyce'