home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / tsalt.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  8.0 KB  |  201 lines

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