annotate runtime/syntax/spyce.vim @ 27:a01d8d9b2a58 first-working-version

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