xref: /vim-8.2.3635/runtime/syntax/phtml.vim (revision ae5bce1c)
1" Vim syntax file
2" Language:	phtml PHP 2.0
3" Maintainer:	Lutz Eymers <[email protected]>
4" URL:		http://www.isp.de/data/phtml.vim
5" Email:	Subject: send syntax_vim.tgz
6" Last change:	2003 May 11
7"
8" Options	phtml_sql_query = 1 for SQL syntax highligthing inside strings
9"		phtml_minlines = x     to sync at least x lines backwards
10
11" For version 5.x: Clear all syntax items
12" For version 6.x: Quit when a syntax file was already loaded
13if version < 600
14  syntax clear
15elseif exists("b:current_syntax")
16  finish
17endif
18
19if !exists("main_syntax")
20  let main_syntax = 'phtml'
21endif
22
23if version < 600
24  so <sfile>:p:h/html.vim
25else
26  runtime! syntax/html.vim
27  unlet b:current_syntax
28endif
29
30syn cluster htmlPreproc add=phtmlRegionInsideHtmlTags
31
32if exists( "phtml_sql_query")
33  if phtml_sql_query == 1
34    syn include @phtmlSql <sfile>:p:h/sql.vim
35    unlet b:current_syntax
36  endif
37endif
38syn cluster phtmlSql remove=sqlString,sqlComment
39
40syn case match
41
42" Env Variables
43syn keyword phtmlEnvVar SERVER_SOFTWARE SERVER_NAME SERVER_URL GATEWAY_INTERFACE   contained
44syn keyword phtmlEnvVar SERVER_PROTOCOL SERVER_PORT REQUEST_METHOD PATH_INFO  contained
45syn keyword phtmlEnvVar PATH_TRANSLATED SCRIPT_NAME QUERY_STRING REMOTE_HOST contained
46syn keyword phtmlEnvVar REMOTE_ADDR AUTH_TYPE REMOTE_USER CONTEN_TYPE  contained
47syn keyword phtmlEnvVar CONTENT_LENGTH HTTPS HTTPS_KEYSIZE HTTPS_SECRETKEYSIZE  contained
48syn keyword phtmlEnvVar HTTP_ACCECT HTTP_USER_AGENT HTTP_IF_MODIFIED_SINCE  contained
49syn keyword phtmlEnvVar HTTP_FROM HTTP_REFERER contained
50syn keyword phtmlEnvVar PHP_SELF contained
51
52syn case ignore
53
54" Internal Variables
55syn keyword phtmlIntVar phperrmsg php_self contained
56
57" Comment
58syn region phtmlComment		start="/\*" end="\*/"  contained contains=phtmlTodo
59
60" Function names
61syn keyword phtmlFunctions  Abs Ada_Close Ada_Connect Ada_Exec Ada_FetchRow contained
62syn keyword phtmlFunctions  Ada_FieldName Ada_FieldNum Ada_FieldType contained
63syn keyword phtmlFunctions  Ada_FreeResult Ada_NumFields Ada_NumRows Ada_Result contained
64syn keyword phtmlFunctions  Ada_ResultAll AddSlashes ASort BinDec Ceil ChDir contained
65syn keyword phtmlFunctions  AdaGrp ChMod ChOwn Chop Chr ClearStack ClearStatCache contained
66syn keyword phtmlFunctions  closeDir CloseLog Cos Count Crypt Date dbList  contained
67syn keyword phtmlFunctions  dbmClose dbmDelete dbmExists dbmFetch dbmFirstKey contained
68syn keyword phtmlFunctions  dbmInsert dbmNextKey dbmOpen dbmReplace DecBin DecHex contained
69syn keyword phtmlFunctions  DecOct doubleval Echo End ereg eregi ereg_replace contained
70syn keyword phtmlFunctions  eregi_replace EscapeShellCmd Eval Exec Exit Exp contained
71syn keyword phtmlFunctions  fclose feof fgets fgetss File fileAtime fileCtime contained
72syn keyword phtmlFunctions  fileGroup fileInode fileMtime fileOwner filePerms contained
73syn keyword phtmlFunctions  fileSize fileType Floor Flush fopen fputs FPassThru contained
74syn keyword phtmlFunctions  fseek fsockopen ftell getAccDir GetEnv getHostByName contained
75syn keyword phtmlFunctions  getHostByAddr GetImageSize getLastAcess contained
76syn keyword phtmlFunctions  getLastbrowser getLastEmail getLastHost getLastMod contained
77syn keyword phtmlFunctions  getLastref getLogDir getMyInode getMyPid getMyUid contained
78syn keyword phtmlFunctions  getRandMax getStartLogging getToday getTotal GetType contained
79syn keyword phtmlFunctions  gmDate Header HexDec HtmlSpecialChars ImageArc contained
80syn keyword phtmlFunctions  ImageChar ImageCharUp IamgeColorAllocate  contained
81syn keyword phtmlFunctions  ImageColorTransparent ImageCopyResized ImageCreate contained
82syn keyword phtmlFunctions  ImageCreateFromGif ImageDestroy ImageFill contained
83syn keyword phtmlFunctions  ImageFilledPolygon ImageFilledRectangle contained
84syn keyword phtmlFunctions  ImageFillToBorder ImageGif ImageInterlace ImageLine contained
85syn keyword phtmlFunctions  ImagePolygon ImageRectangle ImageSetPixel  contained
86syn keyword phtmlFunctions  ImageString ImageStringUp ImageSX ImageSY Include contained
87syn keyword phtmlFunctions  InitSyslog intval IsSet Key Link LinkInfo Log Log10 contained
88syn keyword phtmlFunctions  LosAs Mail Max Md5 mi_Close mi_Connect mi_DBname contained
89syn keyword phtmlFunctions  mi_Exec mi_FieldName mi_FieldNum mi_NumFields contained
90syn keyword phtmlFunctions  mi_NumRows mi_Result Microtime Min MkDir MkTime msql contained
91syn keyword phtmlFunctions  msql_connect msql_CreateDB msql_dbName msql_DropDB contained
92syn keyword phtmlFunctions  msqlFieldFlags msql_FieldLen msql_FieldName contained
93syn keyword phtmlFunctions  msql_FieldType msql_FreeResult msql_ListDBs contained
94syn keyword phtmlFunctions  msql_Listfields msql_ListTables msql_NumFields contained
95syn keyword phtmlFunctions  msql_NumRows msql_RegCase msql_Result msql_TableName contained
96syn keyword phtmlFunctions  mysql mysql_affected_rows mysql_close mysql_connect contained
97syn keyword phtmlFunctions  mysql_CreateDB mysql_dbName mysqlDropDB  contained
98syn keyword phtmlFunctions  mysql_FieldFlags mysql_FieldLen mysql_FieldName contained
99syn keyword phtmlFunctions  mysql_FieldType mysql_FreeResult mysql_insert_id contained
100syn keyword phtmlFunctions  mysql_listDBs mysql_Listfields mysql_ListTables contained
101syn keyword phtmlFunctions  mysql_NumFields mysql_NumRows mysql_Result  contained
102syn keyword phtmlFunctions  mysql_TableName Next OctDec openDir OpenLog  contained
103syn keyword phtmlFunctions  Ora_Bind Ora_Close Ora_Commit Ora_CommitOff contained
104syn keyword phtmlFunctions  Ora_CommitOn Ora_Exec Ora_Fetch Ora_GetColumn contained
105syn keyword phtmlFunctions  Ora_Logoff Ora_Logon Ora_Parse Ora_Rollback Ord  contained
106syn keyword phtmlFunctions  Parse_str PassThru pclose pg_Close pg_Connect contained
107syn keyword phtmlFunctions  pg_DBname pg_ErrorMessage pg_Exec pg_FieldName contained
108syn keyword phtmlFunctions  pg_FieldPrtLen pg_FieldNum pg_FieldSize  contained
109syn keyword phtmlFunctions  pg_FieldType pg_FreeResult pg_GetLastOid pg_Host contained
110syn keyword phtmlFunctions  pg_NumFields pg_NumRows pg_Options pg_Port  contained
111syn keyword phtmlFunctions  pg_Result pg_tty phpInfo phpVersion popen pos pow contained
112syn keyword phtmlFunctions  Prev PutEnv QuoteMeta Rand readDir ReadFile ReadLink contained
113syn keyword phtmlFunctions  reg_Match reg_replace reg_Search Rename Reset return  contained
114syn keyword phtmlFunctions  rewind rewindDir RmDir rSort SetCookie SetErrorReporting contained
115syn keyword phtmlFunctions  SetLogging SetShowInfo SetType shl shr Sin Sleep contained
116syn keyword phtmlFunctions  Solid_Close Solid_Connect Solid_Exec Solid_FetchRow contained
117syn keyword phtmlFunctions  Solid_FieldName Solid_FieldNum Solid_FreeResult  contained
118syn keyword phtmlFunctions  Solid_NumFields Solid_NumRows Solid_Result Sort contained
119syn keyword phtmlFunctions  Spundtex Sprintf Sqrt Srand strchr strtr  contained
120syn keyword phtmlFunctions  StripSlashes strlen strchr strstr strtok strtolower contained
121syn keyword phtmlFunctions  strtoupper strval substr sybSQL_CheckConnect contained
122syn keyword phtmlFunctions  sybSQL_DBUSE sybSQL_Connect sybSQL_Exit contained
123syn keyword phtmlFunctions  sybSQL_Fieldname sybSQL_GetField sybSQL_IsRow  contained
124syn keyword phtmlFunctions  sybSQL_NextRow sybSQL_NumFields sybSQL_NumRows contained
125syn keyword phtmlFunctions  sybSQL_Query sybSQL_Result sybSQL_Result sybSQL_Seek contained
126syn keyword phtmlFunctions  Symlink syslog System Tan TempNam Time Umask UniqId contained
127syn keyword phtmlFunctions  Unlink Unset UrlDecode UrlEncode USleep Virtual contained
128syn keyword phtmlFunctions  SecureVar contained
129
130" Conditional
131syn keyword phtmlConditional  if else elseif endif switch endswitch contained
132
133" Repeat
134syn keyword phtmlRepeat  while endwhile contained
135
136" Repeat
137syn keyword phtmlLabel  case default contained
138
139" Statement
140syn keyword phtmlStatement  break return continue exit contained
141
142" Operator
143syn match phtmlOperator  "[-=+%^&|*!]" contained
144syn match phtmlOperator  "[-+*/%^&|]=" contained
145syn match phtmlOperator  "/[^*]"me=e-1 contained
146syn match phtmlOperator  "\$" contained
147syn match phtmlRelation  "&&" contained
148syn match phtmlRelation  "||" contained
149syn match phtmlRelation  "[!=<>]=" contained
150syn match phtmlRelation  "[<>]" contained
151
152" Identifier
153syn match  phtmlIdentifier "$\h\w*" contained contains=phtmlEnvVar,phtmlIntVar,phtmlOperator
154
155
156" Include
157syn keyword phtmlInclude  include contained
158
159" Definesag
160syn keyword phtmlDefine  Function contained
161
162" String
163syn region phtmlString keepend matchgroup=None start=+"+ skip=+\\\\\|\\"+  end=+"+ contains=phtmlIdentifier,phtmlSpecialChar,@phtmlSql contained
164
165" Number
166syn match phtmlNumber  "-\=\<\d\+\>" contained
167
168" Float
169syn match phtmlFloat  "\(-\=\<\d+\|-\=\)\.\d\+\>" contained
170
171" SpecialChar
172syn match phtmlSpecialChar "\\[abcfnrtyv\\]" contained
173syn match phtmlSpecialChar "\\\d\{3}" contained contains=phtmlOctalError
174syn match phtmlSpecialChar "\\x[0-9a-fA-F]\{2}" contained
175
176syn match phtmlOctalError "[89]" contained
177
178
179syn match phtmlParentError "[)}\]]" contained
180
181" Todo
182syn keyword phtmlTodo TODO Todo todo contained
183
184" Parents
185syn cluster phtmlInside contains=phtmlComment,phtmlFunctions,phtmlIdentifier,phtmlConditional,phtmlRepeat,phtmlLabel,phtmlStatement,phtmlOperator,phtmlRelation,phtmlString,phtmlNumber,phtmlFloat,phtmlSpecialChar,phtmlParent,phtmlParentError,phtmlInclude
186
187syn cluster phtmlTop contains=@phtmlInside,phtmlInclude,phtmlDefine,phtmlParentError,phtmlTodo
188syn region phtmlParent	matchgroup=Delimiter start="(" end=")" contained contains=@phtmlInside
189syn region phtmlParent	matchgroup=Delimiter start="{" end="}" contained contains=@phtmlInside
190syn region phtmlParent	matchgroup=Delimiter start="\[" end="\]" contained contains=@phtmlInside
191
192syn region phtmlRegion keepend matchgroup=Delimiter start="<?" skip=+(.*>.*)\|".\{-}>.\{-}"\|/\*.\{-}>.\{-}\*/+ end=">" contains=@phtmlTop
193syn region phtmlRegionInsideHtmlTags keepend matchgroup=Delimiter start="<?" skip=+(.*>.*)\|/\*.\{-}>.\{-}\*/+ end=">" contains=@phtmlTop contained
194
195" sync
196if exists("phtml_minlines")
197  exec "syn sync minlines=" . phtml_minlines
198else
199  syn sync minlines=100
200endif
201
202" Define the default highlighting.
203" For version 5.7 and earlier: only when not done already
204" For version 5.8 and later: only when an item doesn't have highlighting yet
205if version >= 508 || !exists("did_phtml_syn_inits")
206  if version < 508
207    let did_phtml_syn_inits = 1
208    command -nargs=+ HiLink hi link <args>
209  else
210    command -nargs=+ HiLink hi def link <args>
211  endif
212
213  HiLink phtmlComment		Comment
214  HiLink phtmlString		String
215  HiLink phtmlNumber		Number
216  HiLink phtmlFloat		Float
217  HiLink phtmlIdentifier	Identifier
218  HiLink phtmlIntVar		Identifier
219  HiLink phtmlEnvVar		Identifier
220  HiLink phtmlFunctions		Function
221  HiLink phtmlRepeat		Repeat
222  HiLink phtmlConditional	Conditional
223  HiLink phtmlLabel		Label
224  HiLink phtmlStatement		Statement
225  HiLink phtmlType		Type
226  HiLink phtmlInclude		Include
227  HiLink phtmlDefine		Define
228  HiLink phtmlSpecialChar	SpecialChar
229  HiLink phtmlParentError	Error
230  HiLink phtmlOctalError	Error
231  HiLink phtmlTodo		Todo
232  HiLink phtmlOperator		Operator
233  HiLink phtmlRelation		Operator
234
235  delcommand HiLink
236endif
237
238let b:current_syntax = "phtml"
239
240if main_syntax == 'phtml'
241  unlet main_syntax
242endif
243
244" vim: ts=8
245