home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim55rt.sit / runtime / syntax / expect.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  3.5 KB  |  99 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:    Expect
  3. " Maintainer:    Ralph Jennings <knowbudy@oro.net>
  4. " Last change:    1999 Jun 16
  5.  
  6. " Remove any old syntax stuff hanging around
  7. syn clear
  8.  
  9. " Reserved Expect variable prefixes.
  10. syn match   expectVariables "\$exp[a-zA-Z0-9_]*\|\$inter[a-zA-Z0-9_]*"
  11. syn match   expectVariables "\$spawn[a-zA-Z0-9_]*\|\$timeout[a-zA-Z0-9_]*"
  12.  
  13. " Normal Expect variables.
  14. syn match   expectVariables "\$env([^)]*)"
  15. syn match   expectVariables "\$any_spawn_id\|\$argc\|\$argv\d*"
  16. syn match   expectVariables "\$user_spawn_id\|\$spawn_id\|\$timeout"
  17.  
  18. " Expect variable arrays.
  19. syn match   expectVariables "\$\(expect\|interact\)_out([^)]*)"            contains=expectOutVar
  20.  
  21. " User defined variables.
  22. syn match   expectVariables "\$[a-zA-Z_][a-zA-Z0-9_]*"
  23.  
  24. " Reserved Expect command prefixes.
  25. syn match   expectCommand    "exp_[a-zA-Z0-9_]*"
  26.  
  27. " Normal Expect commands.
  28. syn keyword expectStatement    close debug disconnect
  29. syn keyword expectStatement    exit exp_continue exp_internal exp_open
  30. syn keyword expectStatement    exp_pid exp_version
  31. syn keyword expectStatement    fork inter_return interpreter
  32. syn keyword expectStatement    log_file log_user match_max overlay
  33. syn keyword expectStatement    parity remove_nulls return
  34. syn keyword expectStatement    send send_error send_log send_user
  35. syn keyword expectStatement    sleep spawn strace stty system
  36. syn keyword expectStatement    timestamp trace trap wait
  37.  
  38. " Tcl commands recognized and used by Expect.
  39. syn keyword expectCommand        proc
  40. syn keyword expectConditional    if else
  41. syn keyword expectRepeat        while for foreach
  42.  
  43. " Expect commands with special arguments.
  44. syn keyword expectStatement    expect expect_after expect_background            nextgroup=expectExpectOpts
  45. syn keyword expectStatement    expect_before expect_user interact            nextgroup=expectExpectOpts
  46.  
  47. syn match   expectSpecial contained  "\\."
  48.  
  49. " Options for "expect", "expect_after", "expect_background",
  50. " "expect_before", "expect_user", and "interact".
  51. syn keyword expectExpectOpts    default eof full_buffer null return timeout
  52.  
  53. syn keyword expectOutVar  contained  spawn_id seconds seconds_total
  54. syn keyword expectOutVar  contained  string start end buffer
  55.  
  56. " Numbers (Tcl style).
  57. syn case ignore
  58.   syn match  expectNumber    "\<\d\+\(u\=l\=\|lu\|f\)\>"
  59.   "floating point number, with dot, optional exponent
  60.   syn match  expectNumber    "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
  61.   "floating point number, starting with a dot, optional exponent
  62.   syn match  expectNumber    "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
  63.   "floating point number, without dot, with exponent
  64.   syn match  expectNumber    "\<\d\+e[-+]\=\d\+[fl]\=\>"
  65.   "hex number
  66.   syn match  expectNumber    "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
  67.   "syn match  expectIdentifier    "\<[a-z_][a-z0-9_]*\>"
  68. syn case match
  69.  
  70. syn region  expectString    start=+"+  end=+"+  contains=expectVariables,expectSpecial
  71.  
  72. " Are these really comments in Expect? (I never use it, so I'm just guessing).
  73. syn keyword expectTodo        contained TODO
  74. syn match   expectComment        "#.*$" contains=expectTodo
  75.  
  76. if !exists("did_expect_syntax_inits")
  77.   let did_expect_syntax_inits = 1
  78.   " The default methods for highlighting.  Can be overridden later
  79.   hi link expectVariables    Special
  80.   hi link expectCommand        Function
  81.   hi link expectStatement    Statement
  82.   hi link expectConditional    Conditional
  83.   hi link expectRepeat        Repeat
  84.   hi link expectExpectOpts    Keyword
  85.   hi link expectOutVar        Special
  86.   hi link expectSpecial        Special
  87.   hi link expectNumber        Number
  88.  
  89.   hi link expectString        String
  90.  
  91.   hi link expectComment        Comment
  92.   hi link expectTodo        Todo
  93.   "hi link expectIdentifier    Identifier
  94. endif
  95.  
  96. let b:current_syntax = "expect"
  97.  
  98. " vim: ts=8
  99.