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