home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim55rt.sit / runtime / syntax / phtml.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  11.0 KB  |  220 lines  |  [TEXT/VIM!]

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