7
|
1 " Vim syntax file
|
|
2 " Language: Telix (Modem Comm Program) SALT Script
|
|
3 " Maintainer: Sean M. McKee <mckee@misslink.net>
|
3312
|
4 " Last Change: 2012 Feb 03 by Thilo Six
|
7
|
5 " Version Info: @(#)tsalt.vim 1.5 97/12/16 08:11:15
|
|
6
|
|
7 " For version 5.x: Clear all syntax items
|
|
8 " For version 6.x: Quit when a syntax file was already loaded
|
|
9 if version < 600
|
|
10 syntax clear
|
|
11 elseif exists("b:current_syntax")
|
|
12 finish
|
|
13 endif
|
|
14
|
3312
|
15 let s:cpo_save = &cpo
|
|
16 set cpo&vim
|
|
17
|
7
|
18 " turn case matching off
|
|
19 syn case ignore
|
|
20
|
|
21 "FUNCTIONS
|
|
22 " Character Handling Functions
|
|
23 syn keyword tsaltFunction IsAscii IsAlNum IsAlpha IsCntrl IsDigit
|
|
24 syn keyword tsaltFunction IsLower IsUpper ToLower ToUpper
|
|
25
|
|
26 " Connect Device Operations
|
|
27 syn keyword tsaltFunction Carrier cInp_Cnt cGetC cGetCT cPutC cPutN
|
|
28 syn keyword tsaltFunction cPutS cPutS_TR FlushBuf Get_Baud
|
|
29 syn keyword tsaltFunction Get_DataB Get_Port Get_StopB Hangup
|
|
30 syn keyword tsaltFunction KillConnectDevice MakeConnectDevice
|
|
31 syn keyword tsaltFunction Send_Brk Set_ConnectDevice Set_Port
|
|
32
|
|
33 " File Input/Output Operations
|
|
34 syn keyword tsaltFunction fClearErr fClose fDelete fError fEOF fFlush
|
|
35 syn keyword tsaltFunction fGetC fGetS FileAttr FileFind FileSize
|
|
36 syn keyword tsaltFunction FileTime fnStrip fOpen fPutC fPutS fRead
|
|
37 syn keyword tsaltFunction fRename fSeek fTell fWrite
|
|
38
|
|
39 " File Transfers and Logs
|
|
40 syn keyword tsaltFunction Capture Capture_Stat Printer Receive Send
|
|
41 syn keyword tsaltFunction Set_DefProt UsageLog Usage_Stat UStamp
|
|
42
|
|
43 " Input String Matching
|
|
44 syn keyword tsaltFunction Track Track_AddChr Track_Free Track_Hit
|
|
45 syn keyword tsaltFunction WaitFor
|
|
46
|
|
47 " Keyboard Operations
|
|
48 syn keyword tsaltFunction InKey InKeyW KeyGet KeyLoad KeySave KeySet
|
|
49
|
|
50 " Miscellaneous Functions
|
|
51 syn keyword tsaltFunction ChatMode Dos Dial DosFunction ExitTelix
|
|
52 syn keyword tsaltFunction GetEnv GetFon HelpScreen LoadFon NewDir
|
|
53 syn keyword tsaltFunction Randon Redial RedirectDOS Run
|
|
54 syn keyword tsaltFunction Set_Terminal Show_Directory TelixVersion
|
|
55 syn keyword tsaltFunction Terminal TransTab Update_Term
|
|
56
|
|
57 " Script Management
|
|
58 syn keyword tsaltFunction ArgCount Call CallD CompileScript GetRunPath
|
|
59 syn keyword tsaltFunction Is_Loaded Load_Scr ScriptVersion
|
|
60 syn keyword tsaltFunction TelixForWindows Unload_Scr
|
|
61
|
|
62 " Sound Functions
|
|
63 syn keyword tsaltFunction Alarm PlayWave Tone
|
|
64
|
|
65 " String Handling
|
|
66 syn keyword tsaltFunction CopyChrs CopyStr DelChrs GetS GetSXY
|
|
67 syn keyword tsaltFunction InputBox InsChrs ItoS SetChr StoI StrCat
|
|
68 syn keyword tsaltFunction StrChr StrCompI StrLen StrLower StrMaxLen
|
|
69 syn keyword tsaltFunction StrPos StrPosI StrUpper SubChr SubChrs
|
|
70 syn keyword tsaltFunction SubStr
|
|
71
|
|
72 " Time, Date, and Timer Operations
|
|
73 syn keyword tsaltFunction CurTime Date Delay Delay_Scr Get_OnlineTime
|
|
74 syn keyword tsaltFunction tDay tHour tMin tMonth tSec tYear Time
|
|
75 syn keyword tsaltFunction Time_Up Timer_Free Time_Restart
|
|
76 syn keyword tsaltFunction Time_Start Time_Total
|
|
77
|
|
78 " Video Operations
|
|
79 syn keyword tsaltFunction Box CNewLine Cursor_OnOff Clear_Scr
|
|
80 syn keyword tsaltFunction GetTermHeight GetTermWidth GetX GetY
|
|
81 syn keyword tsaltFunction GotoXY MsgBox NewLine PrintC PrintC_Trm
|
|
82 syn keyword tsaltFunction PrintN PrintN_Trm PrintS PrintS_Trm
|
|
83 syn keyword tsaltFunction PrintSC PRintSC_Trm
|
|
84 syn keyword tsaltFunction PStrA PStrAXY Scroll Status_Wind vGetChr
|
|
85 syn keyword tsaltFunction vGetChrs vGetChrsA vPutChr vPutChrs
|
|
86 syn keyword tsaltFunction vPutChrsA vRstrArea vSaveArea
|
|
87
|
|
88 " Dynamic Data Exchange (DDE) Operations
|
|
89 syn keyword tsaltFunction DDEExecute DDEInitate DDEPoke DDERequest
|
|
90 syn keyword tsaltFunction DDETerminate DDETerminateAll
|
|
91 "END FUNCTIONS
|
|
92
|
|
93 "PREDEFINED VARAIABLES
|
|
94 syn keyword tsaltSysVar _add_lf _alarm_on _answerback_str _asc_rcrtrans
|
|
95 syn keyword tsaltSysVar _asc_remabort _asc_rlftrans _asc_scpacing
|
|
96 syn keyword tsaltSysVar _asc_scrtrans _asc_secho _asc_slpacing
|
|
97 syn keyword tsaltSysVar _asc_spacechr _asc_striph _back_color
|
|
98 syn keyword tsaltSysVar _capture_fname _connect_str _dest_bs
|
|
99 syn keyword tsaltSysVar _dial_pause _dial_time _dial_post
|
|
100 syn keyword tsaltSysVar _dial_pref1 _dial_pref2 _dial_pref3
|
|
101 syn keyword tsaltSysVar _dial_pref4 _dir_prog _down_dir
|
|
102 syn keyword tsaltSysVar _entry_bbstype _entry_comment _entry_enum
|
|
103 syn keyword tsaltSysVar _entry_name _entry_num _entry_logonname
|
|
104 syn keyword tsaltSysVar _entry_pass _fore_color _image_file
|
|
105 syn keyword tsaltSysVar _local_echo _mdm_hang_str _mdm_init_str
|
|
106 syn keyword tsaltSysVar _no_connect1 _no_connect2 _no_connect3
|
|
107 syn keyword tsaltSysVar _no_connect4 _no_connect5 _redial_stop
|
|
108 syn keyword tsaltSysVar _scr_chk_key _script_dir _sound_on
|
|
109 syn keyword tsaltSysVar _strip_high _swap_bs _telix_dir _up_dir
|
|
110 syn keyword tsaltSysVar _usage_fname _zmodauto _zmod_rcrash
|
|
111 syn keyword tsaltSysVar _zmod_scrash
|
|
112 "END PREDEFINED VARAIABLES
|
|
113
|
|
114 "TYPE
|
|
115 syn keyword tsaltType str int
|
|
116 "END TYPE
|
|
117
|
|
118 "KEYWORDS
|
|
119 syn keyword tsaltStatement goto break return continue
|
|
120 syn keyword tsaltConditional if then else
|
|
121 syn keyword tsaltRepeat while for do
|
|
122 "END KEYWORDS
|
|
123
|
|
124 syn keyword tsaltTodo contained TODO
|
|
125
|
|
126 " the rest is pretty close to C -----------------------------------------
|
|
127
|
|
128 " String and Character constants
|
|
129 " Highlight special characters (those which have a backslash) differently
|
|
130 syn match tsaltSpecial contained "\^\d\d\d\|\^."
|
|
131 syn region tsaltString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=tsaltSpecial
|
|
132 syn match tsaltCharacter "'[^\\]'"
|
|
133 syn match tsaltSpecialCharacter "'\\.'"
|
|
134
|
|
135 "catch errors caused by wrong parenthesis
|
|
136 syn region tsaltParen transparent start='(' end=')' contains=ALLBUT,tsaltParenError,tsaltIncluded,tsaltSpecial,tsaltTodo
|
|
137 syn match tsaltParenError ")"
|
|
138 syn match tsaltInParen contained "[{}]"
|
|
139
|
|
140 hi link tsaltParenError tsaltError
|
|
141 hi link tsaltInParen tsaltError
|
|
142
|
|
143 "integer number, or floating point number without a dot and with "f".
|
|
144 syn match tsaltNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
|
|
145 "floating point number, with dot, optional exponent
|
|
146 syn match tsaltFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
|
|
147 "floating point number, starting with a dot, optional exponent
|
|
148 syn match tsaltFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
|
|
149 "floating point number, without dot, with exponent
|
|
150 syn match tsaltFloat "\<\d\+e[-+]\=\d\+[fl]\=\>"
|
|
151 "hex number
|
|
152 syn match tsaltNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
|
|
153 "syn match cIdentifier "\<[a-z_][a-z0-9_]*\>"
|
|
154
|
|
155 syn region tsaltComment start="/\*" end="\*/" contains=cTodo
|
|
156 syn match tsaltComment "//.*" contains=cTodo
|
|
157 syn match tsaltCommentError "\*/"
|
|
158
|
|
159 syn region tsaltPreCondit start="^[ \t]*#[ \t]*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=tsaltComment,tsaltString,tsaltCharacter,tsaltNumber,tsaltCommentError
|
|
160 syn region tsaltIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
|
|
161 syn match tsaltIncluded contained "<[^>]*>"
|
|
162 syn match tsaltInclude "^[ \t]*#[ \t]*include\>[ \t]*["<]" contains=tsaltIncluded
|
|
163 "syn match TelixSalyLineSkip "\\$"
|
|
164 syn region tsaltDefine start="^[ \t]*#[ \t]*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,tsaltPreCondit,tsaltIncluded,tsaltInclude,tsaltDefine,tsaltInParen
|
|
165 syn region tsaltPreProc start="^[ \t]*#[ \t]*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,tsaltPreCondit,tsaltIncluded,tsaltInclude,tsaltDefine,tsaltInParen
|
|
166
|
|
167 " Highlight User Labels
|
|
168 syn region tsaltMulti transparent start='?' end=':' contains=ALLBUT,tsaltIncluded,tsaltSpecial,tsaltTodo
|
|
169
|
|
170 syn sync ccomment tsaltComment
|
|
171
|
|
172
|
|
173 " Define the default highlighting.
|
|
174 " For version 5.7 and earlier: only when not done already
|
|
175 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
176 if version >= 508 || !exists("did_tsalt_syntax_inits")
|
|
177 if version < 508
|
|
178 let did_tsalt_syntax_inits = 1
|
|
179 command -nargs=+ HiLink hi link <args>
|
|
180 else
|
|
181 command -nargs=+ HiLink hi def link <args>
|
|
182 endif
|
|
183
|
|
184 HiLink tsaltFunction Statement
|
|
185 HiLink tsaltSysVar Type
|
|
186 "HiLink tsaltLibFunc UserDefFunc
|
|
187 "HiLink tsaltConstants Type
|
|
188 "HiLink tsaltFuncArg Type
|
|
189 "HiLink tsaltOperator Operator
|
|
190 "HiLink tsaltLabel Label
|
|
191 "HiLink tsaltUserLabel Label
|
|
192 HiLink tsaltConditional Conditional
|
|
193 HiLink tsaltRepeat Repeat
|
|
194 HiLink tsaltCharacter SpecialChar
|
|
195 HiLink tsaltSpecialCharacter SpecialChar
|
|
196 HiLink tsaltNumber Number
|
|
197 HiLink tsaltFloat Float
|
|
198 HiLink tsaltCommentError tsaltError
|
|
199 HiLink tsaltInclude Include
|
|
200 HiLink tsaltPreProc PreProc
|
|
201 HiLink tsaltDefine Macro
|
|
202 HiLink tsaltIncluded tsaltString
|
|
203 HiLink tsaltError Error
|
|
204 HiLink tsaltStatement Statement
|
|
205 HiLink tsaltPreCondit PreCondit
|
|
206 HiLink tsaltType Type
|
|
207 HiLink tsaltString String
|
|
208 HiLink tsaltComment Comment
|
|
209 HiLink tsaltSpecial Special
|
|
210 HiLink tsaltTodo Todo
|
|
211
|
|
212 delcommand HiLink
|
|
213 endif
|
|
214
|
|
215 let b:current_syntax = "tsalt"
|
|
216
|
3312
|
217 let &cpo = s:cpo_save
|
|
218 unlet s:cpo_save
|
7
|
219 " vim: ts=8
|