tsalt.vim 8.1 KB

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