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

first working version.
author kono
date Mon, 27 Oct 2008 18:28:11 +0900
parents 76efa0be13f1
children
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: lite
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
3 " Maintainer: Lutz Eymers <ixtab@polzin.com>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
4 " URL: http://www.isp.de/data/lite.vim
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
5 " Email: Subject: send syntax_vim.tgz
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
6 " Last Change: 2001 Mai 01
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
7 "
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
8 " Options lite_sql_query = 1 for SQL syntax highligthing inside strings
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
9 " lite_minlines = x to sync at least x lines backwards
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
10
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
11 " For version 5.x: Clear all syntax items
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
12 " For version 6.x: Quit when a syntax file was already loaded
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
13 if version < 600
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
14 syntax clear
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
15 elseif exists("b:current_syntax")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
16 finish
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
17 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
18
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
19 if !exists("main_syntax")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
20 let main_syntax = 'lite'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
21 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
22
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
23 if main_syntax == 'lite'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
24 if exists("lite_sql_query")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
25 if lite_sql_query == 1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
26 syn include @liteSql <sfile>:p:h/sql.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 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
30 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
31
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
32 if main_syntax == 'msql'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
33 if exists("msql_sql_query")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
34 if msql_sql_query == 1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
35 syn include @liteSql <sfile>:p:h/sql.vim
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
36 unlet b:current_syntax
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
37 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
38 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
39 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
40
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
41 syn cluster liteSql remove=sqlString,sqlComment
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
42
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
43 syn case match
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
44
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
45 " Internal Variables
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
46 syn keyword liteIntVar ERRMSG contained
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
47
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
48 " Comment
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
49 syn region liteComment start="/\*" end="\*/" contains=liteTodo
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
50
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
51 " Function names
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
52 syn keyword liteFunctions echo printf fprintf open close read
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
53 syn keyword liteFunctions readln readtok
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
54 syn keyword liteFunctions split strseg chop tr sub substr
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
55 syn keyword liteFunctions test unlink umask chmod mkdir chdir rmdir
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
56 syn keyword liteFunctions rename truncate link symlink stat
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
57 syn keyword liteFunctions sleep system getpid getppid kill
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
58 syn keyword liteFunctions time ctime time2unixtime unixtime2year
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
59 syn keyword liteFunctions unixtime2year unixtime2month unixtime2day
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
60 syn keyword liteFunctions unixtime2hour unixtime2min unixtime2sec
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
61 syn keyword liteFunctions strftime
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
62 syn keyword liteFunctions getpwnam getpwuid
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
63 syn keyword liteFunctions gethostbyname gethostbyaddress
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
64 syn keyword liteFunctions urlEncode setContentType includeFile
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
65 syn keyword liteFunctions msqlConnect msqlClose msqlSelectDB
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
66 syn keyword liteFunctions msqlQuery msqlStoreResult msqlFreeResult
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
67 syn keyword liteFunctions msqlFetchRow msqlDataSeek msqlListDBs
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
68 syn keyword liteFunctions msqlListTables msqlInitFieldList msqlListField
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
69 syn keyword liteFunctions msqlFieldSeek msqlNumRows msqlEncode
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
70 syn keyword liteFunctions exit fatal typeof
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
71 syn keyword liteFunctions crypt addHttpHeader
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
72
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
73 " Conditional
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
74 syn keyword liteConditional if else
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
75
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
76 " Repeat
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
77 syn keyword liteRepeat while
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
78
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
79 " Operator
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
80 syn keyword liteStatement break return continue
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
81
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
82 " Operator
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
83 syn match liteOperator "[-+=#*]"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
84 syn match liteOperator "/[^*]"me=e-1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
85 syn match liteOperator "\$"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
86 syn match liteRelation "&&"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
87 syn match liteRelation "||"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
88 syn match liteRelation "[!=<>]="
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
89 syn match liteRelation "[<>]"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
90
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
91 " Identifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
92 syn match liteIdentifier "$\h\w*" contains=liteIntVar,liteOperator
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
93 syn match liteGlobalIdentifier "@\h\w*" contains=liteIntVar
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
94
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
95 " Include
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
96 syn keyword liteInclude load
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
97
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
98 " Define
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
99 syn keyword liteDefine funct
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
100
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
101 " Type
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
102 syn keyword liteType int uint char real
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
103
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
104 " String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
105 syn region liteString keepend matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=liteIdentifier,liteSpecialChar,@liteSql
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
106
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
107 " Number
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
108 syn match liteNumber "-\=\<\d\+\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
109
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
110 " Float
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
111 syn match liteFloat "\(-\=\<\d+\|-\=\)\.\d\+\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
112
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
113 " SpecialChar
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
114 syn match liteSpecialChar "\\[abcfnrtv\\]" contained
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
115
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
116 syn match liteParentError "[)}\]]"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
117
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
118 " Todo
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
119 syn keyword liteTodo TODO Todo todo contained
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
120
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
121 " dont syn #!...
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
122 syn match liteExec "^#!.*$"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
123
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
124 " Parents
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
125 syn cluster liteInside contains=liteComment,liteFunctions,liteIdentifier,liteGlobalIdentifier,liteConditional,liteRepeat,liteStatement,liteOperator,liteRelation,liteType,liteString,liteNumber,liteFloat,liteParent
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
126
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
127 syn region liteParent matchgroup=Delimiter start="(" end=")" contains=@liteInside
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
128 syn region liteParent matchgroup=Delimiter start="{" end="}" contains=@liteInside
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
129 syn region liteParent matchgroup=Delimiter start="\[" end="\]" contains=@liteInside
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
130
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
131 " sync
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
132 if main_syntax == 'lite'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
133 if exists("lite_minlines")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
134 exec "syn sync minlines=" . lite_minlines
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
135 else
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
136 syn sync minlines=100
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
137 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
138 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
139
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
140 " Define the default highlighting.
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
141 " For version 5.7 and earlier: only when not done already
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
142 " For version 5.8 and later: only when an item doesn't have highlighting yet
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
143 if version >= 508 || !exists("did_lite_syn_inits")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
144 if version < 508
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
145 let did_lite_syn_inits = 1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
146 command -nargs=+ HiLink hi link <args>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
147 else
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
148 command -nargs=+ HiLink hi def link <args>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
149 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
150
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
151 HiLink liteComment Comment
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
152 HiLink liteString String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
153 HiLink liteNumber Number
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
154 HiLink liteFloat Float
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
155 HiLink liteIdentifier Identifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
156 HiLink liteGlobalIdentifier Identifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
157 HiLink liteIntVar Identifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
158 HiLink liteFunctions Function
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
159 HiLink liteRepeat Repeat
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
160 HiLink liteConditional Conditional
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
161 HiLink liteStatement Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
162 HiLink liteType Type
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
163 HiLink liteInclude Include
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
164 HiLink liteDefine Define
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
165 HiLink liteSpecialChar SpecialChar
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
166 HiLink liteParentError liteError
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
167 HiLink liteError Error
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
168 HiLink liteTodo Todo
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
169 HiLink liteOperator Operator
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
170 HiLink liteRelation Operator
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
171
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
172 delcommand HiLink
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
173 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
174
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
175 let b:current_syntax = "lite"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
176
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
177 if main_syntax == 'lite'
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
178 unlet main_syntax
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
179 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
180
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
181 " vim: ts=8