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