annotate runtime/syntax/expect.vim @ 9766:be9b5f8c3fd9 v7.4.2158

commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 5 20:35:13 2016 +0200 patch 7.4.2158 Problem: Result of getcompletion('', 'cscope') depends on previous completion. (Christian Brabandt) Solution: Call set_context_in_cscope_cmd().
author Christian Brabandt <cb@256bit.org>
date Fri, 05 Aug 2016 20:45:06 +0200
parents 9cb3a75a20b9
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Expect
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Ralph Jennings <knowbudy@oro.net>
3557
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 " Last Change: 2012 Jun 01
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
5 " (Dominique Pelle added @Spell)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " Reserved Expect variable prefixes.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 syn match expectVariables "\$exp[a-zA-Z0-9_]*\|\$inter[a-zA-Z0-9_]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn match expectVariables "\$spawn[a-zA-Z0-9_]*\|\$timeout[a-zA-Z0-9_]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " Normal Expect variables.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn match expectVariables "\$env([^)]*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn match expectVariables "\$any_spawn_id\|\$argc\|\$argv\d*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match expectVariables "\$user_spawn_id\|\$spawn_id\|\$timeout"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " Expect variable arrays.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match expectVariables "\$\(expect\|interact\)_out([^)]*)" contains=expectOutVar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " User defined variables.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match expectVariables "\$[a-zA-Z_][a-zA-Z0-9_]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " Reserved Expect command prefixes.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match expectCommand "exp_[a-zA-Z0-9_]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " Normal Expect commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword expectStatement close debug disconnect
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword expectStatement exit exp_continue exp_internal exp_open
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword expectStatement exp_pid exp_version
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword expectStatement fork inter_return interpreter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword expectStatement log_file log_user match_max overlay
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword expectStatement parity remove_nulls return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn keyword expectStatement send send_error send_log send_user
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn keyword expectStatement sleep spawn strace stty system
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn keyword expectStatement timestamp trace trap wait
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " Tcl commands recognized and used by Expect.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn keyword expectCommand proc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn keyword expectConditional if else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn keyword expectRepeat while for foreach
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 " Expect commands with special arguments.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn keyword expectStatement expect expect_after expect_background nextgroup=expectExpectOpts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword expectStatement expect_before expect_user interact nextgroup=expectExpectOpts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match expectSpecial contained "\\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " Options for "expect", "expect_after", "expect_background",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " "expect_before", "expect_user", and "interact".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword expectExpectOpts default eof full_buffer null return timeout
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn keyword expectOutVar contained spawn_id seconds seconds_total
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn keyword expectOutVar contained string start end buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 " Numbers (Tcl style).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn match expectNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 "floating point number, with dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn match expectNumber "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 "floating point number, starting with a dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn match expectNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 "floating point number, without dot, with exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn match expectNumber "\<\d\+e[-+]\=\d\+[fl]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 "hex number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn match expectNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 "syn match expectIdentifier "\<[a-z_][a-z0-9_]*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
3557
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
76 syn region expectString start=+"+ end=+"+ contains=@Spell,expectVariables,expectSpecial
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 " Are these really comments in Expect? (I never use it, so I'm just guessing).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn keyword expectTodo contained TODO
3557
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
80 syn match expectComment "#.*$" contains=@Spell,expectTodo
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
81 syn match expectSharpBang "\%^#!.*"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 if version >= 508 || !exists("did_expect_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 let did_expect_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
3557
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
94 HiLink expectSharpBang PreProc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 HiLink expectVariables Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 HiLink expectCommand Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 HiLink expectStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 HiLink expectConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 HiLink expectRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 HiLink expectExpectOpts Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 HiLink expectOutVar Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 HiLink expectSpecial Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 HiLink expectNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 HiLink expectString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 HiLink expectComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 HiLink expectTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 "HiLink expectIdentifier Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 let b:current_syntax = "expect"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 " vim: ts=8