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