annotate runtime/syntax/expect.vim @ 17537:64f95305a008

Added tag v8.1.1766 for changeset e00d12c085a512fa48543da47f7a74848490aed4
author Bram Moolenaar <Bram@vim.org>
date Sun, 28 Jul 2019 14:30:08 +0200
parents 46763b01cd9a
children
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
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3557
diff changeset
7 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3557
diff changeset
8 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " Reserved Expect variable prefixes.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 syn match expectVariables "\$exp[a-zA-Z0-9_]*\|\$inter[a-zA-Z0-9_]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 syn match expectVariables "\$spawn[a-zA-Z0-9_]*\|\$timeout[a-zA-Z0-9_]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " Normal Expect variables.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn match expectVariables "\$env([^)]*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn match expectVariables "\$any_spawn_id\|\$argc\|\$argv\d*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn match expectVariables "\$user_spawn_id\|\$spawn_id\|\$timeout"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Expect variable arrays.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match expectVariables "\$\(expect\|interact\)_out([^)]*)" contains=expectOutVar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " User defined variables.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match expectVariables "\$[a-zA-Z_][a-zA-Z0-9_]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " Reserved Expect command prefixes.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match expectCommand "exp_[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 " Normal Expect commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword expectStatement close debug disconnect
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword expectStatement exit exp_continue exp_internal exp_open
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword expectStatement exp_pid exp_version
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword expectStatement fork inter_return interpreter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword expectStatement log_file log_user match_max overlay
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword expectStatement parity remove_nulls return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword expectStatement send send_error send_log send_user
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword expectStatement sleep spawn strace stty system
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword expectStatement timestamp trace trap wait
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " Tcl commands recognized and used by Expect.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn keyword expectCommand proc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn keyword expectConditional if else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn keyword expectRepeat while for foreach
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " Expect commands with special arguments.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn keyword expectStatement expect expect_after expect_background nextgroup=expectExpectOpts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn keyword expectStatement expect_before expect_user interact nextgroup=expectExpectOpts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match expectSpecial contained "\\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " Options for "expect", "expect_after", "expect_background",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " "expect_before", "expect_user", and "interact".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn keyword expectExpectOpts default eof full_buffer null return timeout
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn keyword expectOutVar contained spawn_id seconds seconds_total
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword expectOutVar contained string start end buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 " Numbers (Tcl style).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn match expectNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 "floating point number, with dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn match expectNumber "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 "floating point number, starting with a dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn match expectNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 "floating point number, without dot, with exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn match expectNumber "\<\d\+e[-+]\=\d\+[fl]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 "hex number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn match expectNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 "syn match expectIdentifier "\<[a-z_][a-z0-9_]*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3557
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
73 syn region expectString start=+"+ end=+"+ contains=@Spell,expectVariables,expectSpecial
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " 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
76 syn keyword expectTodo contained TODO
3557
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
77 syn match expectComment "#.*$" contains=@Spell,expectTodo
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
78 syn match expectSharpBang "\%^#!.*"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3557
diff changeset
81 " Only when an item doesn't have highlighting yet
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
83 hi def link expectSharpBang PreProc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
84 hi def link expectVariables Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
85 hi def link expectCommand Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
86 hi def link expectStatement Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
87 hi def link expectConditional Conditional
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
88 hi def link expectRepeat Repeat
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
89 hi def link expectExpectOpts Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
90 hi def link expectOutVar Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
91 hi def link expectSpecial Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
92 hi def link expectNumber Number
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
94 hi def link expectString String
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
96 hi def link expectComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
97 hi def link expectTodo Todo
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
98 "hi def link expectIdentifier Identifier
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 let b:current_syntax = "expect"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 " vim: ts=8