Mercurial > vim
annotate runtime/syntax/expect.vim @ 10048:43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 30 23:26:57 2016 +0200
Updated runtime files. Remove version checks for Vim older than 6.0.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 30 Aug 2016 23:30:09 +0200 |
parents | 9cb3a75a20b9 |
children | 46763b01cd9a |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Expect | |
3 " Maintainer: Ralph Jennings <knowbudy@oro.net> | |
3557 | 4 " Last Change: 2012 Jun 01 |
5 " (Dominique Pelle added @Spell) | |
7 | 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 | 9 finish |
10 endif | |
11 | |
12 " Reserved Expect variable prefixes. | |
13 syn match expectVariables "\$exp[a-zA-Z0-9_]*\|\$inter[a-zA-Z0-9_]*" | |
14 syn match expectVariables "\$spawn[a-zA-Z0-9_]*\|\$timeout[a-zA-Z0-9_]*" | |
15 | |
16 " Normal Expect variables. | |
17 syn match expectVariables "\$env([^)]*)" | |
18 syn match expectVariables "\$any_spawn_id\|\$argc\|\$argv\d*" | |
19 syn match expectVariables "\$user_spawn_id\|\$spawn_id\|\$timeout" | |
20 | |
21 " Expect variable arrays. | |
22 syn match expectVariables "\$\(expect\|interact\)_out([^)]*)" contains=expectOutVar | |
23 | |
24 " User defined variables. | |
25 syn match expectVariables "\$[a-zA-Z_][a-zA-Z0-9_]*" | |
26 | |
27 " Reserved Expect command prefixes. | |
28 syn match expectCommand "exp_[a-zA-Z0-9_]*" | |
29 | |
30 " Normal Expect commands. | |
31 syn keyword expectStatement close debug disconnect | |
32 syn keyword expectStatement exit exp_continue exp_internal exp_open | |
33 syn keyword expectStatement exp_pid exp_version | |
34 syn keyword expectStatement fork inter_return interpreter | |
35 syn keyword expectStatement log_file log_user match_max overlay | |
36 syn keyword expectStatement parity remove_nulls return | |
37 syn keyword expectStatement send send_error send_log send_user | |
38 syn keyword expectStatement sleep spawn strace stty system | |
39 syn keyword expectStatement timestamp trace trap wait | |
40 | |
41 " Tcl commands recognized and used by Expect. | |
42 syn keyword expectCommand proc | |
43 syn keyword expectConditional if else | |
44 syn keyword expectRepeat while for foreach | |
45 | |
46 " Expect commands with special arguments. | |
47 syn keyword expectStatement expect expect_after expect_background nextgroup=expectExpectOpts | |
48 syn keyword expectStatement expect_before expect_user interact nextgroup=expectExpectOpts | |
49 | |
50 syn match expectSpecial contained "\\." | |
51 | |
52 " Options for "expect", "expect_after", "expect_background", | |
53 " "expect_before", "expect_user", and "interact". | |
54 syn keyword expectExpectOpts default eof full_buffer null return timeout | |
55 | |
56 syn keyword expectOutVar contained spawn_id seconds seconds_total | |
57 syn keyword expectOutVar contained string start end buffer | |
58 | |
59 " Numbers (Tcl style). | |
60 syn case ignore | |
61 syn match expectNumber "\<\d\+\(u\=l\=\|lu\|f\)\>" | |
62 "floating point number, with dot, optional exponent | |
63 syn match expectNumber "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>" | |
64 "floating point number, starting with a dot, optional exponent | |
65 syn match expectNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" | |
66 "floating point number, without dot, with exponent | |
67 syn match expectNumber "\<\d\+e[-+]\=\d\+[fl]\=\>" | |
68 "hex number | |
69 syn match expectNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>" | |
70 "syn match expectIdentifier "\<[a-z_][a-z0-9_]*\>" | |
71 syn case match | |
72 | |
3557 | 73 syn region expectString start=+"+ end=+"+ contains=@Spell,expectVariables,expectSpecial |
7 | 74 |
75 " Are these really comments in Expect? (I never use it, so I'm just guessing). | |
76 syn keyword expectTodo contained TODO | |
3557 | 77 syn match expectComment "#.*$" contains=@Spell,expectTodo |
78 syn match expectSharpBang "\%^#!.*" | |
7 | 79 |
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 |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
82 command -nargs=+ HiLink hi def link <args> |
7 | 83 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
84 HiLink expectSharpBang PreProc |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
85 HiLink expectVariables Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
86 HiLink expectCommand Function |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
87 HiLink expectStatement Statement |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
88 HiLink expectConditional Conditional |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
89 HiLink expectRepeat Repeat |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
90 HiLink expectExpectOpts Keyword |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
91 HiLink expectOutVar Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
92 HiLink expectSpecial Special |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
93 HiLink expectNumber Number |
7 | 94 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
95 HiLink expectString String |
7 | 96 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
97 HiLink expectComment Comment |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
98 HiLink expectTodo Todo |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
99 "HiLink expectIdentifier Identifier |
7 | 100 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
101 delcommand HiLink |
7 | 102 |
103 let b:current_syntax = "expect" | |
104 | |
105 " vim: ts=8 |