3 " Maintainer: Rimon Barr <rimon AT acm DOT org>
4 " URL: http://spyce.sourceforge.net
5 " Last Change: 2003 May 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
31 syn include @Python <sfile>:p:h/python.vim
32 syn include @Html <sfile>:p:h/html.vim
35 syn keyword spyceDirectiveKeyword include compact module import contained
36 syn keyword spyceDirectiveArg name names file contained
37 syn region spyceDirectiveString start=+"+ end=+"+ contained
38 syn match spyceDirectiveValue "=[\t ]*[^'", \t>][^, \t>]*"hs=s+1 contained
40 syn match spyceBeginErrorS ,\[\[,
41 syn match spyceBeginErrorA ,<%,
42 syn cluster spyceBeginError contains=spyceBeginErrorS,spyceBeginErrorA
43 syn match spyceEndErrorS ,\]\],
44 syn match spyceEndErrorA ,%>,
45 syn cluster spyceEndError contains=spyceEndErrorS,spyceEndErrorA
47 syn match spyceEscBeginS ,\\\[\[,
48 syn match spyceEscBeginA ,\\<%,
49 syn cluster spyceEscBegin contains=spyceEscBeginS,spyceEscBeginA
50 syn match spyceEscEndS ,\\\]\],
51 syn match spyceEscEndA ,\\%>,
52 syn cluster spyceEscEnd contains=spyceEscEndS,spyceEscEndA
53 syn match spyceEscEndCommentS ,--\\\]\],
54 syn match spyceEscEndCommentA ,--\\%>,
55 syn cluster spyceEscEndComment contains=spyceEscEndCommentS,spyceEscEndCommentA
57 syn region spyceStmtS matchgroup=spyceStmtDelim start=,\[\[, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
58 syn region spyceStmtA matchgroup=spyceStmtDelim start=,<%, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
59 syn region spyceChunkS matchgroup=spyceChunkDelim start=,\[\[\\, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
60 syn region spyceChunkA matchgroup=spyceChunkDelim start=,<%\\, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
61 syn region spyceEvalS matchgroup=spyceEvalDelim start=,\[\[=, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
62 syn region spyceEvalA matchgroup=spyceEvalDelim start=,<%=, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
63 syn region spyceDirectiveS matchgroup=spyceDelim start=,\[\[\., end=,\]\], contains=spyceBeginError,spyceDirectiveKeyword,spyceDirectiveArg,spyceDirectiveValue,spyceDirectiveString keepend
64 syn region spyceDirectiveA matchgroup=spyceDelim start=,<%@, end=,%>, contains=spyceBeginError,spyceDirectiveKeyword,spyceDirectiveArg,spyceDirectiveValue,spyceDirectiveString keepend
65 syn region spyceCommentS matchgroup=spyceCommentDelim start=,\[\[--, end=,--\]\],
66 syn region spyceCommentA matchgroup=spyceCommentDelim start=,<%--, end=,--%>,
67 syn region spyceLambdaS matchgroup=spyceLambdaDelim start=,\[\[spy!\?, end=,\]\], contains=@Html,@spyce extend
68 syn region spyceLambdaA matchgroup=spyceLambdaDelim start=,<%spy!\?, end=,%>, contains=@Html,@spyce extend
70 syn cluster spyce contains=spyceStmtS,spyceStmtA,spyceChunkS,spyceChunkA,spyceEvalS,spyceEvalA,spyceCommentS,spyceCommentA,spyceDirectiveS,spyceDirectiveA
72 syn cluster htmlPreproc contains=@spyce
74 hi link spyceDirectiveKeyword Special
75 hi link spyceDirectiveArg Type
76 hi link spyceDirectiveString String
77 hi link spyceDirectiveValue String
79 hi link spyceDelim Special
80 hi link spyceStmtDelim spyceDelim
81 hi link spyceChunkDelim spyceDelim
82 hi link spyceEvalDelim spyceDelim
83 hi link spyceLambdaDelim spyceDelim
84 hi link spyceCommentDelim Comment
86 hi link spyceBeginErrorS Error
87 hi link spyceBeginErrorA Error
88 hi link spyceEndErrorS Error
89 hi link spyceEndErrorA Error
91 hi link spyceStmtS spyce
92 hi link spyceStmtA spyce
93 hi link spyceChunkS spyce
94 hi link spyceChunkA spyce
95 hi link spyceEvalS spyce
96 hi link spyceEvalA spyce
97 hi link spyceDirectiveS spyce
98 hi link spyceDirectiveA spyce
99 hi link spyceCommentS Comment
100 hi link spyceCommentA Comment
101 hi link spyceLambdaS Normal
102 hi link spyceLambdaA Normal
104 hi link spyce Statement
106 let b:current_syntax = "spyce"
107 if main_syntax == 'spyce'