annotate src/testdir/test49.vim @ 16344:d24e5d848a09 v8.1.1177

patch 8.1.1177: .ts files are recognized as xml, typescript is more common commit https://github.com/vim/vim/commit/1a4dce7cad4af4de347853aad6d671da2df662ad Author: Bram Moolenaar <Bram@vim.org> Date: Tue Apr 16 22:21:05 2019 +0200 patch 8.1.1177: .ts files are recognized as xml, typescript is more common Problem: .ts files are recognized as xml, while typescript is more common. Solution: Recognize .ts files as typescript. (closes https://github.com/vim/vim/issues/4264)
author Bram Moolenaar <Bram@vim.org>
date Tue, 16 Apr 2019 22:30:06 +0200
parents f01eb1aed348
children b55b4a21f006
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 script language tests
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Author: Servatius Brandt <Servatius.Brandt@fujitsu-siemens.com>
15456
f01eb1aed348 patch 8.1.0736: code for Blob not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
3 " Last Change: 2019 Jan 13
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Test environment {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " Adding new tests easily. {{{2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " Writing new tests is eased considerably with the following functions and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " abbreviations (see "Commands for recording the execution path", "Automatic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " argument generation").
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " To get the abbreviations, execute the command
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " :let test49_set_env = 1 | source test49.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " To get them always (from src/testdir), put a line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " au! BufRead test49.vim let test49_set_env = 1 | source test49.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " into the local .vimrc file in the src/testdir directory.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 if exists("test49_set_env") && test49_set_env
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " Automatic argument generation for the test environment commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 function! Xsum()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 let addend = substitute(getline("."), '^.*"\s*X:\s*\|^.*', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " Evaluate arithmetic expression.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 if addend != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 exec "let g:Xsum = g:Xsum + " . addend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 function! Xcheck()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 let g:Xsum=0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 ?XpathINIT?,.call Xsum()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 exec "norm A "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 return g:Xsum
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 iab Xcheck Xcheck<Space><C-R>=Xcheck()<CR><C-O>x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 function! Xcomment(num)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 let str = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 let tabwidth = &sts ? &sts : &ts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 let tabs = (48+tabwidth - a:num - virtcol(".")) / tabwidth
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 while tabs > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 let str = str . "\t"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 let tabs = tabs - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 let str = str . '" X:'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 return str
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 function! Xloop()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 let back = line(".") . "|norm" . virtcol(".") . "|"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 norm 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 let last = search('X\(loop\|path\)INIT\|Xloop\>', "bW")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 exec back
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 let theline = getline(last)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 if theline =~ 'X\(loop\|path\)INIT'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 let num = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 let num = 2 * substitute(theline, '.*Xloop\s*\(\d\+\).*', '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 ?X\(loop\|path\)INIT?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 \s/\(XloopINIT!\=\s*\d\+\s\+\)\@<=\(\d\+\)/\=2*submatch(2)/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 exec back
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 exec "norm a "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 return num . Xcomment(strlen(num))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 iab Xloop Xloop<Space><C-R>=Xloop()<CR><C-O>x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 function! Xpath(loopinit)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 let back = line(".") . "|norm" . virtcol(".") . "|"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 norm 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 let last = search('XpathINIT\|Xpath\>\|XloopINIT', "bW")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 exec back
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 let theline = getline(last)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 if theline =~ 'XpathINIT'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 let num = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 elseif theline =~ 'Xpath\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 let num = 2 * substitute(theline, '.*Xpath\s*\(\d\+\).*', '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 let pattern = '.*XloopINIT!\=\s*\(\d\+\)\s*\(\d\+\).*'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 let num = substitute(theline, pattern, '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 let factor = substitute(theline, pattern, '\2', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 " The "<C-O>x" from the "Xpath" iab and the character triggering its
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 " expansion are in the input buffer. Save and clear typeahead so
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 " that it is not read away by the call to "input()" below. Restore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 " afterwards.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 call inputsave()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 let loops = input("Number of iterations in previous loop? ")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 call inputrestore()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 while (loops > 0)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 let num = num * factor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 exec "norm a "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 if a:loopinit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 return num . " 1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 return num . Xcomment(strlen(num))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 iab Xpath Xpath<Space><C-R>=Xpath(0)<CR><C-O>x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 iab XloopINIT XloopINIT<Space><C-R>=Xpath(1)<CR><C-O>x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 " Also useful (see ExtraVim below):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 aug ExtraVim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 au!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 au BufEnter <sfile> syn region ExtraVim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 \ start=+^if\s\+ExtraVim(.*)+ end=+^endif+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 \ transparent keepend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 au BufEnter <sfile> syn match ExtraComment /^"/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 \ contained containedin=ExtraVim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 au BufEnter <sfile> hi link ExtraComment vimComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 aug END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 aug Xpath
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 au BufEnter <sfile> syn keyword Xpath
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 \ XpathINIT Xpath XloopINIT Xloop XloopNEXT Xcheck Xout
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 au BufEnter <sfile> hi link Xpath Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 aug END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 do BufEnter <sfile>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 " Do not execute the tests when sourcing this file for getting the functions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 " and abbreviations above, which are intended for easily adding new test
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 " cases; they are not needed for test execution. Unlet the variable
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 " controlling this so that an explicit ":source" command for this file will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 " execute the tests.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 unlet test49_set_env
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 " Commands for recording the execution path. {{{2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 " The Xpath/Xloop commands can be used for computing the eXecution path by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 " adding (different) powers of 2 from those script lines, for which the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 " execution should be checked. Xloop provides different addends for each
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
150 " execution of a loop. Permitted values are 2^0 to 2^30, so that 31 execution
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 " points (multiply counted inside loops) can be tested.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 " Note that the arguments of the following commands can be generated
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 " automatically, see below.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 " Usage: {{{3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 " - Use XpathINIT at the beginning of the test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 " - Use Xpath to check if a line is executed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 " Argument: power of 2 (decimal).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 " - To check multiple execution of loops use Xloop for automatically
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 " computing Xpath values:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 " - Use XloopINIT before the loop.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 " Two arguments:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 " - the first Xpath value (power of 2) to be used (Xnext),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 " - factor for computing a new Xnext value when reexecuting a loop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 " (by a ":continue" or ":endwhile"); this should be 2^n where
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 " n is the number of Xloop commands inside the loop.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 " If XloopINIT! is used, the first execution of XloopNEXT is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 " a no-operation.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 " - Use Xloop inside the loop:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 " One argument:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 " The argument and the Xnext value are multiplied to build the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 " next Xpath value. No new Xnext value is prepared. The argument
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 " should be 2^(n-1) for the nth Xloop command inside the loop.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 " If the loop has only one Xloop command, the argument can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 " ommitted (default: 1).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 " - Use XloopNEXT before ":continue" and ":endwhile". This computes a new
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 " Xnext value for the next execution of the loop by multiplying the old
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 " one with the factor specified in the XloopINIT command. No Argument.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 " Alternatively, when XloopINIT! is used, a single XloopNEXT at the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 " beginning of the loop can be used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 " Nested loops are not supported.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 " - Use Xcheck at end of each test. It prints the test number, the expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 " execution path value, the test result ("OK" or "FAIL"), and, if the tests
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 " fails, the actual execution path.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 " One argument:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 " Expected Xpath/Xloop sum for the correct execution path.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 " In order that this value can be computed automatically, do the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 " following: For each line in the test with an Xpath and Xloop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 " command, add a comment starting with "X:" and specifying an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 " expression that evaluates to the value contributed by this line to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 " the correct execution path. (For copying an Xpath argument of at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 " least two digits into the comment, press <C-P>.) At the end of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 " test, just type "Xcheck" and press <Esc>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 " - In order to add additional information to the test output file, use the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 " Xout command. Argument(s) like ":echo".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 " Automatic argument generation: {{{3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 " The arguments of the Xpath, XloopINIT, Xloop, and Xcheck commands can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 " generated automatically, so that new tests can easily be written without
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 " mental arithmetic. The Xcheck argument is computed from the "X:" comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 " of the preceding Xpath and Xloop commands. See the commands and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 " abbreviations at the beginning of this file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 " Implementation: {{{3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 " XpathINIT, Xpath, XloopINIT, Xloop, XloopNEXT, Xcheck, Xout.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 " The variants for existing g:ExtraVimResult are needed when executing a script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 " in an extra Vim process, see ExtraVim below.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 " EXTRA_VIM_START - do not change or remove this line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 com! XpathINIT let g:Xpath = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 if exists("g:ExtraVimResult")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 com! -count -bar Xpath exec "!echo <count> >>" . g:ExtraVimResult
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 com! -count -bar Xpath let g:Xpath = g:Xpath + <count>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 com! -count -nargs=1 -bang
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 \ XloopINIT let g:Xnext = <count> |
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 \ let g:Xfactor = <args> |
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 \ let g:Xskip = strlen("<bang>")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 if exists("g:ExtraVimResult")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 com! -count=1 -bar Xloop exec "!echo " . (g:Xnext * <count>) . " >>" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 \ g:ExtraVimResult
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 com! -count=1 -bar Xloop let g:Xpath = g:Xpath + g:Xnext * <count>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 com! XloopNEXT let g:Xnext = g:Xnext *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 \ (g:Xskip ? 1 : g:Xfactor) |
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 \ let g:Xskip = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 let @r = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 let Xtest = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 com! -count Xcheck let Xresult = "*** Test " .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 \ (Xtest<10?" ":Xtest<100?" ":"") .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 \ Xtest . ": " . (
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 \ (Xpath==<count>) ? "OK (".Xpath.")" :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 \ "FAIL (".Xpath." instead of <count>)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 \ ) |
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 \ let @R = Xresult . "\n" |
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 \ echo Xresult |
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 \ let Xtest = Xtest + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 if exists("g:ExtraVimResult")
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
260 com! -nargs=+ Xoutq exec "!echo @R:'" .
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
261 \ substitute(substitute(<q-args>,
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
262 \ "'", '&\\&&', "g"), "\n", "@NL@", "g")
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
263 \ . "' >>" . g:ExtraVimResult
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 else
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
265 com! -nargs=+ Xoutq let @R = "--- Test " .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 \ (g:Xtest<10?" ":g:Xtest<100?" ":"") .
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
267 \ g:Xtest . ": " . substitute(<q-args>,
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
268 \ "\n", "&\t ", "g") . "\n"
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
269 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
270 com! -nargs=+ Xout exec 'Xoutq' <args>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 " Switch off storing of lines for undoing changes. Speeds things up a little.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 set undolevels=-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 " EXTRA_VIM_STOP - do not change or remove this line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 " ExtraVim() - Run a script file in an extra Vim process. {{{2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 " This is useful for testing immediate abortion of the script processing due to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 " an error in a command dynamically enclosed by a :try/:tryend region or when an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 " exception is thrown but not caught or when an interrupt occurs. It can also
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 " be used for testing :finish.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 " An interrupt location can be specified by an "INTERRUPT" comment. A number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 " telling how often this location is reached (in a loop or in several function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 " calls) should be specified as argument. When missing, once per script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 " invocation or function call is assumed. INTERRUPT locations are tested by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 " setting a breakpoint in that line and using the ">quit" debug command when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 " the breakpoint is reached. A function for which an INTERRUPT location is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 " specified must be defined before calling it (or executing it as a script by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 " using ExecAsScript below).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 " This function is only called in normal modus ("g:ExtraVimResult" undefined).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 " Tests to be executed as an extra script should be written as follows:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 " column 1 column 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 " | |
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 " v v
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 " XpathINIT XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 " if ExtraVim() if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 " ... " ...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 " ... " ...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 " endif endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 " Xcheck <number> Xcheck <number>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 " Double quotes in column 1 are removed before the script is executed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 " They should be used if the test has unbalanced conditionals (:if/:endif,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 " :while:/endwhile, :try/:endtry) or for a line with a syntax error. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 " extra script may use Xpath, XloopINIT, Xloop, XloopNEXT, and Xout as usual.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 " A file name may be specified as argument. All messages of the extra Vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 " process are then redirected to the file. An existing file is overwritten.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 let ExtraVimCount = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 let ExtraVimBase = expand("<sfile>")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 let ExtraVimTestEnv = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 "
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 10942
diff changeset
321 function ExtraVim(...)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 " Count how often this function is called.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 let g:ExtraVimCount = g:ExtraVimCount + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 " Disable folds to prevent that the ranges in the ":write" commands below
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326 " are extended up to the end of a closed fold. This also speeds things up
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 " considerably.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 set nofoldenable
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 " Open a buffer for this test script and copy the test environment to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 " a temporary file. Take account of parts relevant for the extra script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 " execution only.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 let current_buffnr = bufnr("%")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 execute "view +1" g:ExtraVimBase
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 if g:ExtraVimCount == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 let g:ExtraVimTestEnv = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 execute "/E" . "XTRA_VIM_START/+,/E" . "XTRA_VIM_STOP/-w"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 \ g:ExtraVimTestEnv "|']+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 execute "/E" . "XTRA_VIM_START/+,/E" . "XTRA_VIM_STOP/-w >>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 \ g:ExtraVimTestEnv "|']+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 execute "/E" . "XTRA_VIM_START/+,/E" . "XTRA_VIM_STOP/-w >>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 \ g:ExtraVimTestEnv "|']+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 execute "/E" . "XTRA_VIM_START/+,/E" . "XTRA_VIM_STOP/-w >>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 \ g:ExtraVimTestEnv "|']+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 " Start the extra Vim script with a ":source" command for the test
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 " environment. The source line number where the extra script will be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 " appended, needs to be passed as variable "ExtraVimBegin" to the script.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 let extra_script = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 exec "!echo 'source " . g:ExtraVimTestEnv . "' >" . extra_script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 let extra_begin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 " Starting behind the test environment, skip over the first g:ExtraVimCount
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 " occurrences of "if ExtraVim()" and copy the following lines up to the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 " matching "endif" to the extra Vim script.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 execute "/E" . "ND_OF_TEST_ENVIRONMENT/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 exec 'norm ' . g:ExtraVimCount . '/^\s*if\s\+ExtraVim(.*)/+' . "\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 execute ".,/^endif/-write >>" . extra_script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 " Open a buffer for the extra Vim script, delete all ^", and write the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 " script if was actually modified.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 execute "edit +" . (extra_begin + 1) extra_script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 ,$s/^"//e
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 update
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 " Count the INTERRUPTs and build the breakpoint and quit commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 let breakpoints = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 let debug_quits = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 let in_func = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 exec extra_begin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 while search(
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 \ '"\s*INTERRUPT\h\@!\|^\s*fu\%[nction]\>!\=\s*\%(\u\|s:\)\w*\s*(\|'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 \ . '^\s*\\\|^\s*endf\%[unction]\>\|'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 \ . '\%(^\s*fu\%[nction]!\=\s*\)\@<!\%(\u\|s:\)\w*\s*(\|'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 \ . 'ExecAsScript\s\+\%(\u\|s:\)\w*',
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 \ "W") > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 let theline = getline(".")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 if theline =~ '^\s*fu'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 " Function definition.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 let in_func = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 let func_start = line(".")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 let func_name = substitute(theline,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 \ '^\s*fu\%[nction]!\=\s*\(\%(\u\|s:\)\w*\).*', '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 elseif theline =~ '^\s*endf'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 " End of function definition.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 let in_func = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 let finding = substitute(theline, '.*\(\%' . col(".") . 'c.*\)',
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 \ '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 if finding =~ '^"\s*INTERRUPT\h\@!'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 " Interrupt comment. Compose as many quit commands as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 " specified.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 let cnt = substitute(finding,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 \ '^"\s*INTERRUPT\s*\(\d*\).*$', '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 let quits = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 while cnt > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 " Use "\r" rather than "\n" to separate the quit commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 " "\r" is not interpreted as command separator by the ":!"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 " command below but works to separate commands in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 " external vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 let quits = quits . "q\r"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 let cnt = cnt - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 if in_func
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 " Add the function breakpoint and note the number of quits
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 " to be used, if specified, or one for every call else.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 let breakpoints = breakpoints . " -c 'breakadd func " .
697
f08390485cd3 updated for version 7.0210
vimboss
parents: 341
diff changeset
409 \ (line(".") - func_start) . " " .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 \ func_name . "'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 if quits != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 let debug_quits = debug_quits . quits
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 elseif !exists("quits{func_name}")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 let quits{func_name} = "q\r"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 let quits{func_name} = quits{func_name} . "q\r"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 " Add the file breakpoint and the quits to be used for it.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 let breakpoints = breakpoints . " -c 'breakadd file " .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 \ line(".") . " " . extra_script . "'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 if quits == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 let quits = "q\r"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 let debug_quits = debug_quits . quits
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 " Add the quits to be used for calling the function or executing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 " it as script file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 if finding =~ '^ExecAsScript'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 " Sourcing function as script.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 let finding = substitute(finding,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 \ '^ExecAsScript\s\+\(\%(\u\|s:\)\w*\).*', '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 " Function call.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 let finding = substitute(finding,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 \ '^\(\%(\u\|s:\)\w*\).*', '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 if exists("quits{finding}")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 let debug_quits = debug_quits . quits{finding}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 " Close the buffer for the script and create an (empty) resultfile.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 bwipeout
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 let resultfile = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 exec "!>" . resultfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 " Run the script in an extra vim. Switch to extra modus by passing the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 " resultfile in ExtraVimResult. Redirect messages to the file specified as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 " argument if any. Use ":debuggreedy" so that the commands provided on the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 " pipe are consumed at the debug prompt. Use "-N" to enable command-line
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
455 " continuation ("C" in 'cpo'). Add "nviminfo" to 'viminfo' to avoid
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 " messing up the user's viminfo file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 let redirect = a:0 ?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 \ " -c 'au VimLeave * redir END' -c 'redir\\! >" . a:1 . "'" : ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 exec "!echo '" . debug_quits . "q' | ../vim -u NONE -N -Xes" . redirect .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460 \ " -c 'debuggreedy|set viminfo+=nviminfo'" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 \ " -c 'let ExtraVimBegin = " . extra_begin . "'" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 \ " -c 'let ExtraVimResult = \"" . resultfile . "\"'" . breakpoints .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 \ " -S " . extra_script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 " Build the resulting sum for resultfile and add it to g:Xpath. Add Xout
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 " information provided by the extra Vim process to the test output.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 let sum = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 exec "edit" resultfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 let line = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 while line <= line("$")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 let theline = getline(line)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 if theline =~ '^@R:'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 exec 'Xout "' . substitute(substitute(
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 \ escape(escape(theline, '"'), '\"'),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 \ '^@R:', '', ""), '@NL@', "\n", "g") . '"'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 let sum = sum + getline(line)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 let line = line + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481 bwipeout
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 let g:Xpath = g:Xpath + sum
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484 " Delete the extra script and the resultfile.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 call delete(extra_script)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 call delete(resultfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488 " Switch back to the buffer that was active when this function was entered.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489 exec "buffer" current_buffnr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491 " Return 0. This protects extra scripts from being run in the main Vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 " process.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 return 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497 " ExtraVimThrowpoint() - Relative throwpoint in ExtraVim script {{{2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 "
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
499 " Evaluates v:throwpoint and returns the throwpoint relative to the beginning of
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 " an ExtraVim script as passed by ExtraVim() in ExtraVimBegin.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 " EXTRA_VIM_START - do not change or remove this line.
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 10942
diff changeset
503 function ExtraVimThrowpoint()
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 if !exists("g:ExtraVimBegin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 Xout "ExtraVimThrowpoint() used outside ExtraVim() script."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 return v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509 if v:throwpoint =~ '^function\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 return v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513 return "line " .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 \ (substitute(v:throwpoint, '.*, line ', '', "") - g:ExtraVimBegin) .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 \ " of ExtraVim() script"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 " EXTRA_VIM_STOP - do not change or remove this line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520 " MakeScript() - Make a script file from a function. {{{2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522 " Create a script that consists of the body of the function a:funcname.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 " Replace any ":return" by a ":finish", any argument variable by a global
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524 " variable, and and every ":call" by a ":source" for the next following argument
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 " in the variable argument list. This function is useful if similar tests are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526 " to be made for a ":return" from a function call or a ":finish" in a script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 " file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 " In order to execute a function specifying an INTERRUPT location (see ExtraVim)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530 " as a script file, use ExecAsScript below.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532 " EXTRA_VIM_START - do not change or remove this line.
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 10942
diff changeset
533 function MakeScript(funcname, ...)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534 let script = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535 execute "redir! >" . script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536 execute "function" a:funcname
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537 redir END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538 execute "edit" script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539 " Delete the "function" and the "endfunction" lines. Do not include the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 " word "function" in the pattern since it might be translated if LANG is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541 " set. When MakeScript() is being debugged, this deletes also the debugging
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 " output of its line 3 and 4.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543 exec '1,/.*' . a:funcname . '(.*)/d'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544 /^\d*\s*endfunction\>/,$d
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545 %s/^\d*//e
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546 %s/return/finish/e
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547 %s/\<a:\(\h\w*\)/g:\1/ge
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548 normal gg0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549 let cnt = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550 while search('\<call\s*\%(\u\|s:\)\w*\s*(.*)', 'W') > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551 let cnt = cnt + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552 s/\<call\s*\%(\u\|s:\)\w*\s*(.*)/\='source ' . a:{cnt}/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554 g/^\s*$/d
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555 write
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556 bwipeout
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557 return script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559 " EXTRA_VIM_STOP - do not change or remove this line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
561
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
562 " ExecAsScript - Source a temporary script made from a function. {{{2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
563 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564 " Make a temporary script file from the function a:funcname, ":source" it, and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565 " delete it afterwards.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567 " When inside ":if ExtraVim()", add a file breakpoint for each INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 " location specified in the function.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 " EXTRA_VIM_START - do not change or remove this line.
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 10942
diff changeset
571 function ExecAsScript(funcname)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
572 " Make a script from the function passed as argument.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
573 let script = MakeScript(a:funcname)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
574
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575 " When running in an extra Vim process, add a file breakpoint for each
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576 " function breakpoint set when the extra Vim process was invoked by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577 " ExtraVim().
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578 if exists("g:ExtraVimResult")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579 let bplist = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580 execute "redir! >" . bplist
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581 breaklist
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582 redir END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583 execute "edit" bplist
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584 " Get the line number from the function breakpoint. Works also when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585 " LANG is set.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586 execute 'v/^\s*\d\+\s\+func\s\+' . a:funcname . '\s.*/d'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 %s/^\s*\d\+\s\+func\s\+\%(\u\|s:\)\w*\s\D*\(\d*\).*/\1/e
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588 let cnt = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589 while cnt < line("$")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590 let cnt = cnt + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591 if getline(cnt) != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592 execute "breakadd file" getline(cnt) script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595 bwipeout!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596 call delete(bplist)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
599 " Source and delete the script.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 exec "source" script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601 call delete(script)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 com! -nargs=1 -bar ExecAsScript call ExecAsScript(<f-args>)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605 " EXTRA_VIM_STOP - do not change or remove this line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
606
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
607
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
608 " END_OF_TEST_ENVIRONMENT - do not change or remove this line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610
10942
e05695e59f6d patch 8.0.0360: sometimes VimL is used instead of "Vim script"
Christian Brabandt <cb@256bit.org>
parents: 7977
diff changeset
611 " Tests 1 to 15 were moved to test_vimscript.vim
7454
4ff843da79fd commit https://github.com/vim/vim/commit/a2cce8630756769b2cefdc28c7290ae9262cddb1
Christian Brabandt <cb@256bit.org>
parents: 7391
diff changeset
612 let Xtest = 16
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
614 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615 " Test 16: Double :else or :elseif after :else {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
616 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
617 " Multiple :elses or an :elseif after an :else are forbidden.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
619
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
620 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
622 function! F() abort
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623 if 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
624 Xpath 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
627 else " aborts function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 function! G() abort
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633 if 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
636 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
637 elseif 1 " aborts function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644 function! H() abort
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645 if 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647 elseif 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
651 else " aborts function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656 function! I() abort
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657 if 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
659 elseif 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
662 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
663 elseif 1 " aborts function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
668 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671 call G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
672 call H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673 call I()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
675 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676 delfunction G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
677 delfunction H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
678 delfunction I
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
679
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
680 Xcheck 8722
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
681
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
682
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
684 " Test 17: Nesting of unmatched :if or :endif inside a :while {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
685 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686 " The :while/:endwhile takes precedence in nesting over an unclosed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
687 " :if or an unopened :endif.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
688 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
689
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692 function! MSG(enr, emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
693 let english = v:lang == "C" || v:lang =~ '^[Ee]n'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694 if a:enr == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695 Xout "TODO: Add message number for:" a:emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696 let v:errmsg = ":" . v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
697 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698 let match = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
699 if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700 let match = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701 if v:errmsg == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702 Xout "Message missing."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704 let v:errmsg = escape(v:errmsg, '"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
705 Xout "Unexpected message:" v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
706 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
708 return match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
709 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
710
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
711 let messages = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
712
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713 " While loops inside a function are continued on error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
715 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
716 XloopINIT 1 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
717 let loops = 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
718 while loops > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
719 let loops = loops - 1 " 2: 1: 0:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
720 Xloop 1 " X: 1 + 1*16 + 1*16*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
721 if (loops == 1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
722 Xloop 2 " X: 2*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
723 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
724 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725 elseif (loops == 0)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
726 Xloop 4 " X: 4*16*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728 elseif 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729 Xloop 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731 " endif missing!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732 endwhile " :endwhile after :if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
733 Xpath 4096 " X: 16*16*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734 if MSG('E171', "Missing :endif")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735 let g:messages = g:messages . "A"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739 XloopINIT! 8192 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740 let loops = 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
741 while loops > 0 " 2: 1:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744 Xloop 1 " X: 8192 + 8192*4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
745 if 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 " endif missing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748 endwhile " :endwhile after :if 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749 Xpath 131072 " X: 8192*4*4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
750 if MSG('E171', "Missing :endif")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
751 let g:messages = g:messages . "B"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
753
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
754 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
755 XloopINIT 262144 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
756 let loops = 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
757 while loops > 0 " 2: 1:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
758 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
759 Xloop 1 " X: 262144 + 262144 * 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
760 " if missing!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761 endif " :endif without :if in while
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
762 Xloop 2 " X: 524288 + 524288 * 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
763 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765 Xpath 4194304 " X: 262144*4*4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
766 if MSG('E580', ":endif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
767 let g:messages = g:messages . "C"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
768 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
770
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
771 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
772
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
773 " Error continuation outside a function is at the outermost :endwhile or :endif.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
774 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775 XloopINIT! 8388608 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
776 let loops = 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
777 while loops > 0 " 2: 1:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
778 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
779 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780 Xloop 1 " X: 8388608 + 0 * 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
781 if 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
782 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
783 " endif missing! Following :endwhile fails.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
784 endwhile | Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
785 Xpath 268435456 " X: 2*8388608*4*4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
786 if MSG('E171', "Missing :endif")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
787 let messages = g:messages . "D"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
788 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
789
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
790 if messages != "ABCD"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
791 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
792 Xout "messages is" messages "instead of ABCD"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
793 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
794
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
795 unlet loops messages
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
796 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
797 delfunction MSG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
798
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
799 Xcheck 285127993
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
800
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
801
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
802 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
803 " Test 18: Interrupt (Ctrl-C pressed) {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
804 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
805 " On an interrupt, the script processing is terminated immediately.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
806 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
807
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
808 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
809
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
810 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
811 if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
812 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
813 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
814 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
815 if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
816 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
817 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
818 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
819 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
820 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
821 endif | Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
822 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
823 endwhile | Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
824 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
825 endif | Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
826 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
827 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
828
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
829 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
830 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
831 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
832 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
833 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
834 endtry | Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
835 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
836 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
837
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
838 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
839 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
840 if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
841 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
842 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
843 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
844 if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
845 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
846 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
847 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
848 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
849 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
850 endif | Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
851 Xpath Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
852 endwhile | Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
853 Xpath Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
854 endif | Xpath Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
855 Xpath Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
856 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
857
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
858 call F() | Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
859 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
860 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
861
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
862 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
863 function! G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
864 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
865 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
866 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
867 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
868 endtry | Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
869 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
870 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
871
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
872 call G() | Xpath 1073741824 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
873 " The Xpath command does not accept 2^31 (negative); display explicitly:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
874 exec "!echo 2147483648 >>" . g:ExtraVimResult
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
875 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
876 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
877
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
878 Xcheck 67224583
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
879
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
880
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
881 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
882 " Test 19: Aborting on errors inside :try/:endtry {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
883 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
884 " An error in a command dynamically enclosed in a :try/:endtry region
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
885 " aborts script processing immediately. It does not matter whether
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
886 " the failing command is outside or inside a function and whether a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
887 " function has an "abort" attribute.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
888 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
889
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
890 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
891
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
892 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
893 function! F() abort
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
894 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
895 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
896 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
897 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
898
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
899 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
900 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
901 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
902 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
903 endtry | Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
904 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
905 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
906
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
907 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
908 function! G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
909 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
910 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
911 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
912 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
913
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
914 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
915 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
916 call G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
917 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
918 endtry | Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
919 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
920 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
921
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
922 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
923 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
924 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
925 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
926 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
927 endtry | Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
928 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
929 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
930
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
931 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
932 if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
933 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
934 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
935 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
936 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
937 endtry | Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
938 endif | Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
939 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
940 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
941
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
942 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
943 let p = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
944 while p
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
945 let p = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
946 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
947 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
948 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
949 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
950 endtry | Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
951 endwhile | Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
952 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
953 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
954
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
955 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
956 let p = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
957 while p
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
958 let p = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
959 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
960 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
961 endwhile | Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
962 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
963 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
964
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
965 Xcheck 69275973
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
966 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
967 " Test 20: Aborting on errors after :try/:endtry {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
968 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
969 " When an error occurs after the last active :try/:endtry region has
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
970 " been left, termination behavior is as if no :try/:endtry has been
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
971 " seen.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
972 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
973
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
974 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
975
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
976 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
977 let p = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
978 while p
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
979 let p = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
980 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
981 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
982 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
983 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
984 endwhile | Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
985 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
986 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
987
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
988 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
989 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
990 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
991 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
992 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
993 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
994 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
995 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
996 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
997 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
998 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
999 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1000
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1001 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1002 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1003 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1004 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1005 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1006 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1007 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1008 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1009 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1010 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1011 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1012 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1013 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1014 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1015
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1016 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1017 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1018 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1019 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1020 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1021 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1022 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1023 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1024 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1025 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1026 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1027 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1028 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1029 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1030
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1031 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1032 let p = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1033 while p
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1034 let p = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1035 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1036 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1037 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1038 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1039 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1040 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1041 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1042 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1043 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1044 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1045
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1046 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1047 let p = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1048 while p
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1049 let p = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1050 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1051 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1052 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1053 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1054 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1055 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1056 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1057 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1058 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1059 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1060 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1061 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1062
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1063 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1064 let p = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1065 while p
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1066 let p = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1067 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1068 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1069 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1070 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1071 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1072 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1073 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1074 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1075 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1076 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1077 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1078 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1079
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1080 Xcheck 1874575085
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1081
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1082
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1083 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1084 " Test 21: :finally for :try after :continue/:break/:return/:finish {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1085 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1086 " If a :try conditional stays inactive due to a preceding :continue,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1087 " :break, :return, or :finish, its :finally clause should not be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1088 " executed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1089 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1090
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1091 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1092
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1093 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1094 function F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1095 let loops = 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1096 XloopINIT! 1 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1097 while loops > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1098 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1099 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1100 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1101 if loops == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1102 Xloop 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1103 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1104 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1105 elseif loops == 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1106 Xloop 4 " X: 4*256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1107 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1108 Xloop 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1109 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1110
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1111 try " inactive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1112 Xloop 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1113 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1114 Xloop 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1115 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1116 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1117 Xloop 64 " X: 64 + 64*256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1118 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1119 Xloop 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1120 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1121
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1122 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1123 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1124 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1125 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1126 try " inactive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1127 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1128 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1129 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1130 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1131 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1132 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1133 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1134 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1135 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1137 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1138 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1139 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1140 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1141 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1142 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1143 try " inactive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1144 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1145 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1146 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1147 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1148 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1149 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1150 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1151 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1152 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1153
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1154 Xcheck 147932225
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1155
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1156
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1157 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1158 " Test 22: :finally for a :try after an error/interrupt/:throw {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1159 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1160 " If a :try conditional stays inactive due to a preceding error or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1161 " interrupt or :throw, its :finally clause should not be executed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1162 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1163
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1164 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1165
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1166 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1167 function! Error()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1168 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1169 asdf " aborting error, triggering error exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1170 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1171 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1172
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1173 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1174 call Error()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1175 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1176
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1177 if 1 " not active due to error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1178 try " not active since :if inactive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1179 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1180 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1181 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1182 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1183 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1184
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1185 try " not active due to error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1186 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1187 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1188 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1189 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1190 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1191
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1192 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1193 function! Interrupt()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1194 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1195 "INTERRUPT " triggering interrupt exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1196 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1197 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1198
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1199 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1200 call Interrupt()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1201 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1202
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1203 if 1 " not active due to interrupt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1204 try " not active since :if inactive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1205 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1206 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1207 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1208 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1209 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1210
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1211 try " not active due to interrupt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1212 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1213 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1214 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1215 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1216 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1217
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1218 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1219 function! Throw()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1220 throw "xyz"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1221 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1222
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1223 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1224 call Throw()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1225 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1226
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1227 if 1 " not active due to :throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1228 try " not active since :if inactive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1229 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1230 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1231 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1232 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1233 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1234
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1235 try " not active due to :throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1236 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1237 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1238 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1239 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1240 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1241
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1242 Xcheck 4161
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1243
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1244
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1245 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1246 " Test 23: :catch clauses for a :try after a :throw {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1247 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1248 " If a :try conditional stays inactive due to a preceding :throw,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1249 " none of its :catch clauses should be executed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1250 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1251
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1252 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1253
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1254 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1255 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1256 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1257 throw "xyz"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1258 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1259
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1260 if 1 " not active due to :throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1261 try " not active since :if inactive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1262 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1263 catch /xyz/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1264 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1265 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1266 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1267 catch /xyz/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1268 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1269 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1270
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1271 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1272 throw "abc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1273 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1274
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1275 try " not active due to :throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1276 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1277 catch /abc/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1278 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1279 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1280 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1281
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1282 Xcheck 49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1283
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1284
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1285 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1286 " Test 24: :endtry for a :try after a :throw {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1287 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1288 " If a :try conditional stays inactive due to a preceding :throw,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1289 " its :endtry should not rethrow the exception to the next surrounding
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1290 " active :try conditional.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1291 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1292
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1293 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1294
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1295 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1296 try " try 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1297 try " try 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1298 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1299 throw "xyz" " makes try 2 inactive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1300 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1301
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1302 try " try 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1303 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1304 endtry " no rethrow to try 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1305 catch /xyz/ " should catch although try 2 inactive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1306 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1307 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1308 catch /xyz/ " try 1 active, but exception already caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1309 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1310 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1311 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1312 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1313
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1314 Xcheck 41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1315
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1316
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1317 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1318 " Test 25: Executing :finally clauses on normal control flow {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1319 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1320 " Control flow in a :try conditional should always fall through to its
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1321 " :finally clause. A :finally clause of a :try conditional inside an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1322 " inactive conditional should never be executed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1323 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1324
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1325 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1326
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1327 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1328 let loops = 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1329 XloopINIT 1 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1330 while loops > 0 " 3: 2: 1:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1331 Xloop 1 " X: 1 + 1*256 + 1*256*256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1332 if loops >= 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1333 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1334 Xloop 2 " X: 2 + 2*256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1335 if loops == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1336 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1337 Xloop 4 " X: 4*256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1338 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1339 Xloop 8 " X: 8*256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1340 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1341 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1342 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1343 Xloop 16 " X: 16 + 16*256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1344 if loops == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1345 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1346 Xloop 32 " X: 32*256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1347 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1348 Xloop 64 " X: 64*256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1349 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1350 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1351 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1352 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1353 Xloop 128 " X: 128 + 128*256 + 128*256*256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1354 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1355 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1356 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1357 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1358 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1359
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1360 if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1361 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1362 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1363 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1364 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1365 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1366 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1367 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1368 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1369 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1370 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1371 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1372 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1373 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1374 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1375
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1376 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1377
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1378 Xcheck 260177811
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1379
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1380
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1381 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1382 " Test 26: Executing :finally clauses after :continue or :break {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1383 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1384 " For a :continue or :break dynamically enclosed in a :try/:endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1385 " region inside the next surrounding :while/:endwhile, if the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1386 " :continue/:break is before the :finally, the :finally clause is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1387 " executed first. If the :continue/:break is after the :finally, the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1388 " :finally clause is broken (like an :if/:endif region).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1389 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1390
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1391 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1392
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1393 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1394 let loops = 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1395 XloopINIT! 1 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1396 while loops > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1397 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1398 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1399 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1400 if loops == 2 " 3: 2: 1:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1401 Xloop 1 " X: 1*32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1402 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1403 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1404 elseif loops == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1405 Xloop 2 " X: 2*32*32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1406 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1407 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1408 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1409 Xloop 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1410 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1411 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1412 Xloop 8 " X: 8 + 8*32 + 8*32*32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1413 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1414 Xloop 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1415 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1416 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1417 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1418 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1419 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1420 let loops = 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1421 XloopINIT 131072 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1422 while loops > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1423 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1424 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1425 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1426 if loops == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1427 Xloop 1 " X: 131072*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1428 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1429 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1430 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1431 elseif loops == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1432 Xloop 2 " X: 131072*2*16*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1433 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1434 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1435 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1436 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1437 Xloop 4 " X: 131072*4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1438 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1439 Xloop 8 " X: 131072*8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1440 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1441 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1442 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1443 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1444 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1445 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1446
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1447 unlet loops
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1448
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1449 Xcheck 1681500476
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1450
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1451
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1452 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1453 " Test 27: Executing :finally clauses after :return {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1454 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1455 " For a :return command dynamically enclosed in a :try/:endtry region,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1456 " :finally clauses are executed and the called function is ended.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1457 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1458
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1459 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1460
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1461 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1462 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1463 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1464 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1465 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1466 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1467 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1468 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1469 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1470 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1471 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1472 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1473 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1474 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1475 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1476 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1477
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1478 function! G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1479 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1480 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1481 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1482 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1483 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1484 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1485 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1486 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1487 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1488 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1489 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1490
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1491 function! H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1492 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1493 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1494 call G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1495 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1496 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1497 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1498 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1499 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1500 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1501 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1502 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1503
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1504 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1505 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1506 call H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1507 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1508 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1509 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1510 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1511 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1513 Xcheck 1996459
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1514
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1515 " Leave F, G, and H for execution as scripts in the next test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1516
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1517
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1518 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1519 " Test 28: Executing :finally clauses after :finish {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1520 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1521 " For a :finish command dynamically enclosed in a :try/:endtry region,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1522 " :finally clauses are executed and the sourced file is finished.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1523 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1524 " This test executes the bodies of the functions F, G, and H from the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1525 " previous test as script files (:return replaced by :finish).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1526 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1527
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1528 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1529
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1530 let scriptF = MakeScript("F") " X: 1 + 2 + 8 + 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1531 let scriptG = MakeScript("G", scriptF) " X: 128 + 512 + 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1532 let scriptH = MakeScript("H", scriptG) " X: 4096 + 8192 + 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1533
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1534 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1535 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1536 exec "source" scriptH
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1537 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1538 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1539 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1540 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1541 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1542
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1543 call delete(scriptF)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1544 call delete(scriptG)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1545 call delete(scriptH)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1546 unlet scriptF scriptG scriptH
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1547 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1548 delfunction G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1549 delfunction H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1550
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1551 Xcheck 1996459
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1552
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1553
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1554 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1555 " Test 29: Executing :finally clauses on errors {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1556 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1557 " After an error in a command dynamically enclosed in a :try/:endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1558 " region, :finally clauses are executed and the script processing is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1559 " terminated.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1560 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1561
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1562 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1563
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1564 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1565 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1566 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1567 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1568 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1569 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1570 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1571 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1572 asdf " error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1573 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1574 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1575 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1576 endtry | Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1577 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1578 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1579 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1580 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1581 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1582 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1583 endtry | Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1584 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1585 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1586 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1587 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1588 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1589
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1590 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1591 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1592 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1593 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1594 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1595 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1596 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1597 endwhile | Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1598 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1599 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1600 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1601 endtry | Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1602 endwhile | Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1603 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1604 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1605
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1606 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1607 function! G() abort
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1608 if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1609 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1610 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1611 asdf " error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1612 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1613 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1614 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1615 endtry | Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1616 endif | Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1617 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1618 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1619
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1620 if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1621 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1622 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1623 call G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1624 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1625 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1626 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1627 endtry | Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1628 endif | Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1629 Xpath 1073741824 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1630 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1631
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1632 Xcheck 170428555
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1633
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1634
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1635 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1636 " Test 30: Executing :finally clauses on interrupt {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1637 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1638 " After an interrupt in a command dynamically enclosed in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1639 " a :try/:endtry region, :finally clauses are executed and the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1640 " script processing is terminated.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1641 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1642
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1643 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1644
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1645 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1646 XloopINIT 1 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1647
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1648 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1649 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1650 Xloop 1 " X: 1 + 1*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1651 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1652 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1653 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1654 Xloop 4 " X: 4 + 4*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1655 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1656 Xloop 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1657 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1658
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1659 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1660 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1661 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1662 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1663 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1664 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1665 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1666 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1667 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1668 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1669 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1670 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1671 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1672 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1673 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1674 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1675 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1676 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1677 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1678 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1679 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1680 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1681 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1682 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1683 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1684 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1685 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1686 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1687 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1688 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1689 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1690 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1691 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1692 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1693 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1694 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1695 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1696 ExecAsScript F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1697 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1698 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1699 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1700 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1701 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1702 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1703 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1704 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1705 Xpath 1073741824 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1706 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1707
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1708 Xcheck 190905173
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1709
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1710
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1711 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1712 " Test 31: Executing :finally clauses after :throw {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1713 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1714 " After a :throw dynamically enclosed in a :try/:endtry region,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1715 " :finally clauses are executed and the script processing is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1716 " terminated.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1717 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1718
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1719 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1720
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1721 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1722 XloopINIT 1 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1723
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1724 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1725 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1726 Xloop 1 " X: 1 + 1*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1727 throw "exception"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1728 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1729 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1730 Xloop 4 " X: 4 + 4*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1731 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1732 Xloop 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1733 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1734
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1735 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1736 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1737 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1738 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1739 throw "exception"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1740 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1741 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1742 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1743 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1744 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1745 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1746 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1747 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1748 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1749 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1750 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1751 throw "exception"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1752 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1753 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1754 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1755 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1756 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1757 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1758 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1759 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1760 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1761 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1762 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1763 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1764 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1765 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1766 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1767 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1768 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1769 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1770 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1771 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1772 ExecAsScript F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1773 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1774 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1775 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1776 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1777 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1778 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1779 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1780 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1781 Xpath 1073741824 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1782 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1783
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1784 Xcheck 190905173
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1785
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1786
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1787 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1788 " Test 32: Remembering the :return value on :finally {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1789 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1790 " If a :finally clause is executed due to a :return specifying
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1791 " a value, this is the value visible to the caller if not overwritten
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1792 " by a new :return in the :finally clause. A :return without a value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1793 " in the :finally clause overwrites with value 0.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1794 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1795
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1796 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1797
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1798 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1799 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1800 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1801 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1802 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1803 return "ABCD"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1804 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1805 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1806 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1807 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1808 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1809 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1810 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1811 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1812 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1813 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1814
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1815 function! G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1816 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1817 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1818 return 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1819 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1820 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1821 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1822 return 16 + strlen(F())
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1823 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1824 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1825 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1826 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1827
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1828 function! H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1829 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1830 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1831 return 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1832 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1833 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1834 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1835 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1836 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1837 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1838 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1839 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1840
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1841 function! I()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1842 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1843 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1844 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1845 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1846 return G() + H() + 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1847 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1848 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1849 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1850 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1851
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1852 let retcode = I()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1853 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1854
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1855 if retcode < 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1856 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1857 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1858 if retcode % 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1859 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1860 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1861 if (retcode/4) % 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1862 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1863 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1864 if (retcode/8) % 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1865 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1866 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1867 if (retcode/16) % 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1868 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1869 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1870 if (retcode/32) % 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1871 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1872 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1873 if (retcode/64) % 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1874 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1875 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1876 if retcode/128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1877 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1878 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1879
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1880 unlet retcode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1881 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1882 delfunction G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1883 delfunction H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1884 delfunction I
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1885
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1886 Xcheck 354833067
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1887
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1888
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1889 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1890 " Test 33: :return under :execute or user command and :finally {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1891 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1892 " A :return command may be executed under an ":execute" or from
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1893 " a user command. Executing of :finally clauses and passing through
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1894 " the return code works also then.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1895 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1896 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1897
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1898 command! -nargs=? RETURN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1899 \ try | return <args> | finally | return <args> * 2 | endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1900
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1901 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1902 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1903 RETURN 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1904 Xpath 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1905 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1906 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1907 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1908 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1909 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1910
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1911 function! G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1912 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1913 RETURN 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1914 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1915 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1916 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1917 RETURN 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1918 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1919 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1920 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1921 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1922
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1923 function! H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1924 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1925 execute "try | return 512 | finally | return 1024 | endtry"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1926 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1927 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1928 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1929 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1930 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1931 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1932
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1933 function! I()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1934 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1935 execute "try | return 2048 | finally | return 4096 | endtry"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1936 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1937 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1938 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1939 execute "try | return 8192 | finally | return 16384 | endtry"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1940 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1941 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1942 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1943 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1944
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1945 function! J()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1946 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1947 RETURN 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1948 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1949 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1950 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1951 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1952 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1953 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1954 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1955 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1956
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1957 function! K()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1958 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1959 execute "try | return 131072 | finally | return 262144 | endtry"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1960 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1961 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1962 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1963 execute "try | return 524288 | finally | return | endtry"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1964 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1965 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1966 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1967 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1968
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1969 function! L()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1970 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1971 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1972 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1973 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1974 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1975 RETURN 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1976 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1977 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1978 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1979 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1980
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1981 function! M()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1982 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1983 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1984 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1985 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1986 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1987 execute "try | return 4194304 | finally | return 8388608 | endtry"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1988 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1989 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1990 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1991 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1992
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1993 function! N()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1994 RETURN 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1995 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1996
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1997 function! O()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1998 execute "try | return 67108864 | finally | return 134217728 | endtry"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1999 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2000
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2001 let sum = F() + G() + H() + I() + J() + K() + L() + M()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2002 let expected = 16 + 256 + 1024 + 16384 + 0 + 0 + 2097152 + 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2003 let sum = sum + N() + O()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2004 let expected = expected + 33554432 + 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2005
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2006 if sum == expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2007 Xout "sum = " . sum . " (ok)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2008 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2009 Xout "sum = " . sum . ", expected: " . expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2010 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2011
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2012 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2013
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2014 if sum != expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2015 " The Xpath command does not accept 2^31 (negative); add explicitly:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2016 let Xpath = Xpath + 2147483648 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2017 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2018
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2019 unlet sum expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2020 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2021 delfunction G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2022 delfunction H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2023 delfunction I
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2024 delfunction J
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2025 delfunction K
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2026 delfunction L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2027 delfunction M
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2028 delfunction N
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2029 delfunction O
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2030
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2031 Xcheck 1216907538
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2032
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2033
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2034 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2035 " Test 34: :finally reason discarded by :continue {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2036 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2037 " When a :finally clause is executed due to a :continue, :break,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2038 " :return, :finish, error, interrupt or :throw, the jump reason is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2039 " discarded by a :continue in the finally clause.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2040 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2041
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2042 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2043
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2044 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2045
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2046 XloopINIT! 1 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2047
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2048 function! C(jump)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2049 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2050 let loop = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2051 while loop < 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2052 let loop = loop + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2053 if loop == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2054 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2055 if a:jump == "continue"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2056 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2057 elseif a:jump == "break"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2058 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2059 elseif a:jump == "return" || a:jump == "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2060 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2061 elseif a:jump == "error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2062 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2063 elseif a:jump == "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2064 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2065 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2066 elseif a:jump == "throw"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2067 throw "abc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2068 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2069 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2070 continue " discards jump that caused the :finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2071 Xloop 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2072 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2073 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2074 elseif loop == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2075 Xloop 4 " X: 4*(1+8+64+512+4096+32768+262144)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2076 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2077 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2078 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2079
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2080 call C("continue")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2081 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2082 call C("break")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2083 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2084 call C("return")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2085 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2086 let g:jump = "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2087 ExecAsScript C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2088 unlet g:jump
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2089 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2090 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2091 call C("error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2092 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2093 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2094 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2095 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2096 call C("interrupt")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2097 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2098 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2099 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2100 call C("throw")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2101 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2102 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2103 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2104 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2106 delfunction C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2107
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2108 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2109
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2110 Xcheck 2146584868
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2112
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2113 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2114 " Test 35: :finally reason discarded by :break {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2115 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2116 " When a :finally clause is executed due to a :continue, :break,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2117 " :return, :finish, error, interrupt or :throw, the jump reason is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2118 " discarded by a :break in the finally clause.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2119 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2121 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2123 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2125 XloopINIT! 1 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2127 function! B(jump)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2128 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2129 let loop = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2130 while loop < 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2131 let loop = loop + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2132 if loop == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2133 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2134 if a:jump == "continue"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2135 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2136 elseif a:jump == "break"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2137 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2138 elseif a:jump == "return" || a:jump == "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2139 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2140 elseif a:jump == "error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2141 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2142 elseif a:jump == "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2143 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2144 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2145 elseif a:jump == "throw"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2146 throw "abc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2147 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2148 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2149 break " discards jump that caused the :finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2150 Xloop 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2151 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2152 elseif loop == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2153 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2154 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2155 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2156 Xloop 4 " X: 4*(1+8+64+512+4096+32768+262144)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2157 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2158
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2159 call B("continue")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2160 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2161 call B("break")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2162 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2163 call B("return")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2164 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2165 let g:jump = "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2166 ExecAsScript B
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2167 unlet g:jump
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2168 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2169 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2170 call B("error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2171 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2172 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2173 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2174 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2175 call B("interrupt")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2176 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2177 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2178 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2179 call B("throw")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2180 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2181 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2182 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2183 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2184
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2185 delfunction B
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2186
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2187 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2188
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2189 Xcheck 2146584868
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2190
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2191
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2192 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2193 " Test 36: :finally reason discarded by :return {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2194 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2195 " When a :finally clause is executed due to a :continue, :break,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2196 " :return, :finish, error, interrupt or :throw, the jump reason is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2197 " discarded by a :return in the finally clause.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2198 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2199
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2200 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2201
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2202 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2203
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2204 XloopINIT! 1 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2205
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2206 function! R(jump, retval) abort
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2207 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2208 let loop = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2209 while loop < 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2210 let loop = loop + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2211 if loop == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2212 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2213 if a:jump == "continue"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2214 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2215 elseif a:jump == "break"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2216 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2217 elseif a:jump == "return"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2218 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2219 elseif a:jump == "error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2220 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2221 elseif a:jump == "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2222 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2223 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2224 elseif a:jump == "throw"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2225 throw "abc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2226 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2227 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2228 return a:retval " discards jump that caused the :finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2229 Xloop 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2230 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2231 elseif loop == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2232 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2233 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2234 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2235 Xloop 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2236 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2237
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2238 let sum = -R("continue", -8)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2239 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2240 let sum = sum - R("break", -16)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2241 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2242 let sum = sum - R("return", -32)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2243 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2244 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2245 let sum = sum - R("error", -64)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2246 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2247 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2248 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2249 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2250 let sum = sum - R("interrupt", -128)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2251 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2252 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2253 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2254 let sum = sum - R("throw", -256)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2255 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2256 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2257 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2258 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2259
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2260 let expected = 8 + 16 + 32 + 64 + 128 + 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2261 if sum != expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2262 Xpath 1073741824 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2263 Xout "sum =" . sum . ", expected: " . expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2264 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2265
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2266 unlet sum expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2267 delfunction R
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2268
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2269 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2270
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2271 Xcheck 1071644672
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2272
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2273
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2274 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2275 " Test 37: :finally reason discarded by :finish {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2276 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2277 " When a :finally clause is executed due to a :continue, :break,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2278 " :return, :finish, error, interrupt or :throw, the jump reason is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2279 " discarded by a :finish in the finally clause.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2280 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2281
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2282 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2283
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2284 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2285
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2286 XloopINIT! 1 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2287
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2288 function! F(jump) " not executed as function, transformed to a script
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2289 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2290 let loop = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2291 while loop < 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2292 let loop = loop + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2293 if loop == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2294 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2295 if a:jump == "continue"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2296 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2297 elseif a:jump == "break"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2298 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2299 elseif a:jump == "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2300 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2301 elseif a:jump == "error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2302 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2303 elseif a:jump == "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2304 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2305 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2306 elseif a:jump == "throw"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2307 throw "abc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2308 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2309 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2310 finish " discards jump that caused the :finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2311 Xloop 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2312 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2313 elseif loop == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2314 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2315 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2316 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2317 Xloop 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2318 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2319
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2320 let scriptF = MakeScript("F")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2321 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2322
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2323 let g:jump = "continue"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2324 exec "source" scriptF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2325 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2326 let g:jump = "break"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2327 exec "source" scriptF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2328 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2329 let g:jump = "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2330 exec "source" scriptF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2331 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2332 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2333 let g:jump = "error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2334 exec "source" scriptF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2335 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2336 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2337 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2338 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2339 let g:jump = "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2340 exec "source" scriptF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2341 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2342 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2343 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2344 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2345 let g:jump = "throw"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2346 exec "source" scriptF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2347 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2348 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2349 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2350 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2351 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2352 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2353 unlet g:jump
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2354
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2355 call delete(scriptF)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2356 unlet scriptF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2357
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2358 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2359
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2360 Xcheck 1071644672
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2361
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2362
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2363 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2364 " Test 38: :finally reason discarded by an error {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2365 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2366 " When a :finally clause is executed due to a :continue, :break,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2367 " :return, :finish, error, interrupt or :throw, the jump reason is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2368 " discarded by an error in the finally clause.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2369 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2370
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2371 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2372
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2373 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2374
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2375 XloopINIT! 1 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2376
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2377 function! E(jump)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2378 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2379 let loop = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2380 while loop < 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2381 let loop = loop + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2382 if loop == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2383 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2384 if a:jump == "continue"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2385 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2386 elseif a:jump == "break"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2387 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2388 elseif a:jump == "return" || a:jump == "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2389 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2390 elseif a:jump == "error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2391 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2392 elseif a:jump == "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2393 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2394 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2395 elseif a:jump == "throw"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2396 throw "abc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2397 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2398 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2399 asdf " error; discards jump that caused the :finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2400 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2401 elseif loop == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2402 Xloop 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2403 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2404 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2405 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2406 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2407
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2408 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2409 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2410 call E("continue")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2411 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2412 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2413 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2414 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2415 call E("break")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2416 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2417 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2418 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2419 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2420 call E("return")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2421 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2422 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2423 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2424 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2425 let g:jump = "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2426 ExecAsScript E
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2427 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2428 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2429 unlet g:jump
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2430 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2431 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2432 call E("error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2433 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2434 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2435 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2436 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2437 call E("interrupt")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2438 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2439 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2440 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2441 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2442 call E("throw")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2443 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2444 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2445 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2446 delfunction E
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2447 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2448 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2449 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2450 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2451 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2452 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2453 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2454 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2455
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2456 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2457
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2458 Xcheck 357908480
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2459
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2460
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2461 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2462 " Test 39: :finally reason discarded by an interrupt {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2463 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2464 " When a :finally clause is executed due to a :continue, :break,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2465 " :return, :finish, error, interrupt or :throw, the jump reason is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2466 " discarded by an interrupt in the finally clause.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2467 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2468
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2469 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2470
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2471 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2472
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2473 XloopINIT! 1 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2474
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2475 function! I(jump)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2476 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2477 let loop = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2478 while loop < 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2479 let loop = loop + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2480 if loop == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2481 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2482 if a:jump == "continue"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2483 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2484 elseif a:jump == "break"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2485 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2486 elseif a:jump == "return" || a:jump == "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2487 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2488 elseif a:jump == "error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2489 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2490 elseif a:jump == "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2491 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2492 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2493 elseif a:jump == "throw"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2494 throw "abc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2495 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2496 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2497 "INTERRUPT - discards jump that caused the :finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2498 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2499 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2500 elseif loop == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2501 Xloop 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2502 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2503 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2504 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2505 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2506
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2507 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2508 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2509 call I("continue")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2510 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2511 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2512 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2513 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2514 call I("break")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2515 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2516 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2517 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2518 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2519 call I("return")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2520 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2521 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2522 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2523 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2524 let g:jump = "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2525 ExecAsScript I
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2526 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2527 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2528 unlet g:jump
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2529 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2530 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2531 call I("error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2532 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2533 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2534 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2535 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2536 call I("interrupt")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2537 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2538 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2539 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2540 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2541 call I("throw")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2542 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2543 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2544 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2545 delfunction I
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2546 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2547 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2548 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2549 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2550 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2551 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2552 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2553 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2554
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2555 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2556
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2557 Xcheck 357908480
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2558
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2559
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2560 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2561 " Test 40: :finally reason discarded by :throw {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2562 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2563 " When a :finally clause is executed due to a :continue, :break,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2564 " :return, :finish, error, interrupt or :throw, the jump reason is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2565 " discarded by a :throw in the finally clause.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2566 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2567
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2568 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2569
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2570 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2571
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2572 XloopINIT! 1 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2573
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2574 function! T(jump)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2575 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2576 let loop = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2577 while loop < 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2578 let loop = loop + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2579 if loop == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2580 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2581 if a:jump == "continue"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2582 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2583 elseif a:jump == "break"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2584 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2585 elseif a:jump == "return" || a:jump == "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2586 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2587 elseif a:jump == "error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2588 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2589 elseif a:jump == "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2590 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2591 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2592 elseif a:jump == "throw"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2593 throw "abc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2594 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2595 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2596 throw "xyz" " discards jump that caused the :finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2597 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2598 elseif loop == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2599 Xloop 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2600 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2601 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2602 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2603 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2604
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2605 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2606 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2607 call T("continue")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2608 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2609 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2610 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2611 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2612 call T("break")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2613 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2614 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2615 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2616 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2617 call T("return")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2618 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2619 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2620 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2621 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2622 let g:jump = "finish"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2623 ExecAsScript T
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2624 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2625 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2626 unlet g:jump
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2627 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2628 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2629 call T("error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2630 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2631 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2632 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2633 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2634 call T("interrupt")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2635 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2636 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2637 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2638 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2639 call T("throw")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2640 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2641 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2642 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2643 delfunction T
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2644 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2645 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2646 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2647 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2648 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2649 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2650 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2651 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2652
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2653 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2654
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2655 Xcheck 357908480
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2656
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2657
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2658 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2659 " Test 41: Skipped :throw finding next command {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2660 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2661 " A :throw in an inactive conditional must not hide a following
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2662 " command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2663 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2664
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2665 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2666
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2667 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2668 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2669 if 0 | throw "never" | endif | Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2670 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2671 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2672
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2673 function! G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2674 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2675 while 0 | throw "never" | endwhile | Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2676 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2677 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2678
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2679 function H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2680 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2681 if 0 | try | throw "never" | endtry | endif | Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2682 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2683 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2684
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2685 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2686
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2687 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2688 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2689 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2690 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2691 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2692 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2693 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2694 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2695
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2696 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2697
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2698 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2699 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2700 call G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2701 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2702 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2703 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2704 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2705 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2706
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2707 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2708
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2709 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2710 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2711 call H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2712 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2713 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2714 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2715 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2716 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2717
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2718 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2719
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2720 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2721 delfunction G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2722 delfunction H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2723
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2724 Xcheck 3076095
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2725
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2726
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2727 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2728 " Test 42: Catching number and string exceptions {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2729 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2730 " When a number is thrown, it is converted to a string exception.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2731 " Numbers and strings may be caught by specifying a regular exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2732 " as argument to the :catch command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2733 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2734
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2735 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2736
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2737 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2738
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2739 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2740 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2741 throw 4711
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2742 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2743 catch /4711/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2744 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2745 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2746
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2747 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2748 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2749 throw 4711
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2750 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2751 catch /^4711$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2752 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2753 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2754
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2755 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2756 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2757 throw 4711
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2758 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2759 catch /\d/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2760 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2761 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2762
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2763 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2764 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2765 throw 4711
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2766 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2767 catch /^\d\+$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2768 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2769 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2770
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2771 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2772 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2773 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2774 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2775 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2776 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2777 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2778
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2779 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2780 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2781 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2782 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2783 catch /^arrgh$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2784 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2785 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2786
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2787 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2788 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2789 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2790 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2791 catch /\l/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2792 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2793 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2794
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2795 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2796 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2797 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2798 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2799 catch /^\l\+$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2800 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2801 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2802
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2803 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2804 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2805 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2806 throw "ARRGH"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2807 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2808 catch /^arrgh$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2809 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2810 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2811 catch /^\carrgh$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2812 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2813 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2814
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2815 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2816 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2817 throw ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2818 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2819 catch /^$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2820 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2821 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2822
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2823 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2824 " The Xpath command does not accept 2^31 (negative); add explicitly:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2825 let Xpath = Xpath + 2147483648 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2826 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2827 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2828
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2829 Xcheck 1505155949
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2830
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2831
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2832 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2833 " Test 43: Selecting the correct :catch clause {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2834 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2835 " When an exception is thrown and there are multiple :catch clauses,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2836 " the first matching one is taken.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2837 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2838
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2839 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2840
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2841 XloopINIT 1 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2842 let loops = 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2843 while loops > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2844 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2845 if loops == 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2846 Xloop 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2847 throw "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2848 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2849 elseif loops == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2850 Xloop 4 " X: 4*1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2851 throw "ab"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2852 Xloop 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2853 elseif loops == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2854 Xloop 16 " X: 16*1024*1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2855 throw "abc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2856 Xloop 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2857 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2858 catch /abc/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2859 Xloop 64 " X: 64*1024*1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2860 catch /ab/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2861 Xloop 128 " X: 128*1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2862 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2863 Xloop 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2864 catch /a/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2865 Xloop 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2866 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2867
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2868 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2869 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2870 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2871 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2872
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2873 unlet loops
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2874
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2875 Xcheck 1157763329
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2876
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2877
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2878 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2879 " Test 44: Missing or empty :catch patterns {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2880 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2881 " A missing or empty :catch pattern means the same as /.*/, that is,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2882 " catches everything. To catch only empty exceptions, /^$/ must be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2883 " used. A :catch with missing, empty, or /.*/ argument also works
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2884 " when followed by another command separated by a bar on the same
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2885 " line. :catch patterns cannot be specified between ||. But other
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2886 " pattern separators can be used instead of //.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2887 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2888
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2889 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2890
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2891 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2892 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2893 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2894 throw ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2895 catch /^$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2896 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2897 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2898
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2899 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2900 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2901 throw ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2902 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2903 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2904 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2905
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2906 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2907 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2908 throw ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2909 catch //
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2910 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2911 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2913 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2914 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2915 throw ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2916 catch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2917 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2918 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2919
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2920 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2921 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2922 throw "oops"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2923 catch /^$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2924 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2925 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2926 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2927 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2928
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2929 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2930 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2931 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2932 catch /^$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2933 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2934 catch //
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2935 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2936 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2937
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2938 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2939 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2940 throw "brrr"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2941 catch /^$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2942 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2943 catch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2944 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2945 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2946
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2947 try | Xpath 131072 | throw "x" | catch /.*/ | Xpath 262144 | endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2948 " X: 131072 + 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2949
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2950 try | Xpath 524288 | throw "y" | catch // | Xpath 1048576 | endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2951 " X: 524288 + 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2952
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2953 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2954 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2955 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2956 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2957 " Extra try level: if ":catch" without arguments below raises
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2958 " a syntax error because it misinterprets the "Xpath" as a pattern,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2959 " let it be caught by the ":catch /.*/" below.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2960 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2961 try | Xpath 2097152 | throw "z" | catch | Xpath 4194304 | :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2962 endtry " X: 2097152 + 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2963 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2964 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2965 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2966 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2967 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2968 if $VIMNOERRTHROW && v:errmsg != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2969 Xout v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2970 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2971 if caught || $VIMNOERRTHROW && v:errmsg != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2972 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2973 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2974 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2975 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2976 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2977
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2978 let cologne = 4711
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2979 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2980 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2981 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2982 throw "throw cologne"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2983 " Next lines catches all and throws 4711:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2984 catch |throw cologne|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2985 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2986 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2987 catch /4711/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2988 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2989 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2990
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2991 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2992 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2993 throw "plus"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2994 catch +plus+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2995 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2996 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2997
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2998 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2999 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3000 Xpath 1073741824 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3001 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3002 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3003
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3004 unlet! caught cologne
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3005
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3006 Xcheck 1031761407
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3007
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3008
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3009 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3010 " Test 45: Catching exceptions from nested :try blocks {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3011 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3012 " When :try blocks are nested, an exception is caught by the innermost
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3013 " try conditional that has a matching :catch clause.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3014 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3015
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3016 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3017
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3018 XloopINIT 1 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3019 let loops = 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3020 while loops > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3021 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3022 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3023 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3024 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3025 if loops == 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3026 Xloop 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3027 throw "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3028 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3029 elseif loops == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3030 Xloop 4 " X: 4*1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3031 throw "ab"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3032 Xloop 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3033 elseif loops == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3034 Xloop 16 " X: 16*1024*1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3035 throw "abc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3036 Xloop 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3037 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3038 catch /abc/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3039 Xloop 64 " X: 64*1024*1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3040 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3041 catch /ab/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3042 Xloop 128 " X: 128*1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3043 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3044 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3045 Xloop 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3046 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3047 catch /a/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3048 Xloop 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3049 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3050
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3051 let loops = loops - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3052 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3053 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3054 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3055
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3056 unlet loops
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3057
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3058 Xcheck 1157763329
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3059
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3060
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3061 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3062 " Test 46: Executing :finally after a :throw in nested :try {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3063 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3064 " When an exception is thrown from within nested :try blocks, the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3065 " :finally clauses of the non-catching try conditionals should be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3066 " executed before the matching :catch of the next surrounding :try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3067 " gets the control. If this also has a :finally clause, it is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3068 " executed afterwards.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3069 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3070
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3071 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3073 let sum = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3074
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3075 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3076 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3077 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3078 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3079 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3080 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3081 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3082 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3083 throw "ABC"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3084 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3085 catch /xyz/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3086 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3087 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3088 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3089 if sum != 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3090 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3091 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3092 let sum = sum + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3093 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3094 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3095 catch /123/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3096 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3097 catch /321/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3098 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3099 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3100 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3101 if sum != 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3102 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3103 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3104 let sum = sum + 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3105 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3106 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3107 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3108 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3109 if sum != 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3110 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3111 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3112 let sum = sum + 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3113 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3114 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3115 catch /ABC/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3116 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3117 if sum != 7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3118 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3119 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3120 let sum = sum + 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3121 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3122 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3123 if sum != 15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3124 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3125 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3126 let sum = sum + 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3127 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3128 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3129 if sum != 31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3130 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3131 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3132
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3133 unlet sum
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3135 Xcheck 739407
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3137
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3138 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3139 " Test 47: Throwing exceptions from a :catch clause {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3140 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3141 " When an exception is thrown from a :catch clause, it should not be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3142 " caught by a :catch of the same :try conditional. After executing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3143 " the :finally clause (if present), surrounding try conditionals
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3144 " should be checked for a matching :catch.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3145 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3146
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3147 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3148
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3149 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3150 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3151 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3152 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3153 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3154 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3155 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3156 throw "x1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3157 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3158 catch /x1/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3159 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3160 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3161 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3162 throw "x2"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3163 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3164 catch /x1/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3165 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3166 catch /x2/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3167 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3168 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3169 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3170 throw "x3"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3171 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3172 catch /x1/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3173 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3174 catch /x2/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3175 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3176 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3177 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3178 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3179 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3180 catch /x3/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3181 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3182 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3183 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3184 catch /x1/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3185 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3186 catch /x2/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3187 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3188 catch /x3/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3189 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3190 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3191 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3192 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3193 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3194 catch /x1/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3195 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3196 catch /x2/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3197 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3198 catch /x3/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3199 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3200 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3201 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3202 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3203 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3204 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3205 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3206 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3207
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3208 Xcheck 371213935
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3209
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3210
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3211 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3212 " Test 48: Throwing exceptions from a :finally clause {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3213 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3214 " When an exception is thrown from a :finally clause, it should not be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3215 " caught by a :catch of the same :try conditional. Surrounding try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3216 " conditionals should be checked for a matching :catch. A previously
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3217 " thrown exception is discarded.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3218 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3219
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3220 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3221
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3222 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3223
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3224 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3225 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3226 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3227 catch /x1/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3228 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3229 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3230 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3231 throw "x1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3232 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3233 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3234 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3235 catch /x1/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3236 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3237 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3238 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3239
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3240 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3241 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3242 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3243 throw "x2"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3244 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3245 catch /x2/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3246 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3247 catch /x3/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3248 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3249 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3250 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3251 throw "x3"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3252 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3253 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3254 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3255 catch /x2/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3256 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3257 catch /x3/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3258 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3259 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3260 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3261
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3262 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3263 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3264 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3265 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3266 throw "x4"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3267 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3268 catch /x5/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3269 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3270 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3271 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3272 throw "x5" " discards "x4"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3273 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3274 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3275 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3276 catch /x4/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3277 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3278 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3279 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3280 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3281 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3282 catch /x5/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3283 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3284 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3285 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3286
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3287 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3288 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3289 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3290 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3291 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3292
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3293 Xcheck 756255461
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3294
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3295
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3296 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
3297 " Test 49: Throwing exceptions across functions {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3298 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3299 " When an exception is thrown but not caught inside a function, the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3300 " caller is checked for a matching :catch clause.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3301 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3302
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3303 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3305 function! C()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3306 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3307 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3308 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3309 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3310 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3311 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3312 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3313 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3314 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3315
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3316 XloopINIT! 16 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3317
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3318 function! T1()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3319 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3320 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3321 Xloop 1 " X: 16 + 16*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3322 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3323 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3324 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3325 Xloop 4 " X: 64 + 64*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3326 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3327 Xloop 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3328 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3329
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3330 function! T2()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3331 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3332 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3333 call T1()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3334 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3335 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3336 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3337 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3338 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3339 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3340
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3341 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3342 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3343 call C() " throw and catch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3344 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3345 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3346 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3347 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3348 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3349
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3350 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3351 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3352 call T1() " throw, one level
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3353 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3354 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3355 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3356 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3357 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3358 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3359 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3360
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3361 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3362 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3363 call T2() " throw, two levels
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3364 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3365 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3366 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3367 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3368 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3369 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3370 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3371 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3372
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3373 Xcheck 179000669
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3374
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3375 " Leave C, T1, and T2 for execution as scripts in the next test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3376
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3377
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3378 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
3379 " Test 50: Throwing exceptions across script files {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3380 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3381 " When an exception is thrown but not caught inside a script file,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3382 " the sourcing script or function is checked for a matching :catch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3383 " clause.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3384 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3385 " This test executes the bodies of the functions C, T1, and T2 from
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3386 " the previous test as script files (:return replaced by :finish).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3387 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3388
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3389 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3390
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3391 let scriptC = MakeScript("C") " X: 1 + 4 + 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3392 delfunction C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3393
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3394 XloopINIT! 16 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3395
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3396 let scriptT1 = MakeScript("T1") " X: 16 + 64 + 16*16 + 64*16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3397 delfunction T1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3398
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3399 let scriptT2 = MakeScript("T2", scriptT1) " X: 4096 + 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3400 delfunction T2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3401
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3402 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3403 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3404 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3405 exec "source" g:scriptC
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3406 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3407 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3408 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3409 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3410 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3411
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3412 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3413 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3414 exec "source" g:scriptT1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3415 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3416 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3417 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3418 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3419 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3420 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3421 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3422 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3423
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3424 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3425 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3426 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3427 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3428 exec "source" scriptT2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3429 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3430 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3431 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3432 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3433 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3434 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3435 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3436 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3437
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3438 call delete(scriptC)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3439 call delete(scriptT1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3440 call delete(scriptT2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3441 unlet scriptC scriptT1 scriptT2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3442 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3443
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3444 Xcheck 363550045
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3445
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3446
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3447 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
3448 " Test 51: Throwing exceptions across :execute and user commands {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3449 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3450 " A :throw command may be executed under an ":execute" or from
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3451 " a user command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3452 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3453
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3454 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3455
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3456 command! -nargs=? THROW1 throw <args> | throw 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3457 command! -nargs=? THROW2 try | throw <args> | endtry | throw 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3458 command! -nargs=? THROW3 try | throw 3 | catch /3/ | throw <args> | endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3459 command! -nargs=? THROW4 try | throw 4 | finally | throw <args> | endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3460
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3461 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3462
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3463 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3464 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3465 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3466 THROW1 "A"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3467 catch /A/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3468 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3469 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3470 catch /1/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3471 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3472 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3473
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3474 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3475 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3476 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3477 THROW2 "B"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3478 catch /B/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3479 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3480 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3481 catch /2/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3482 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3483 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3484
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3485 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3486 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3487 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3488 THROW3 "C"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3489 catch /C/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3490 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3491 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3492 catch /3/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3493 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3494 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3495
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3496 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3497 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3498 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3499 THROW4 "D"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3500 catch /D/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3501 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3502 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3503 catch /4/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3504 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3505 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3506
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3507 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3508 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3509 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3510 execute 'throw "E" | throw 5'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3511 catch /E/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3512 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3513 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3514 catch /5/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3515 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3516 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3517
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3518 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3519 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3520 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3521 execute 'try | throw "F" | endtry | throw 6'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3522 catch /F/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3523 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3524 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3525 catch /6/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3526 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3527 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3528
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3529 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3530 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3531 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3532 execute'try | throw 7 | catch /7/ | throw "G" | endtry'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3533 catch /G/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3534 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3535 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3536 catch /7/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3537 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3538 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3539
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3540 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3541 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3542 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3543 execute 'try | throw 8 | finally | throw "H" | endtry'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3544 catch /H/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3545 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3546 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3547 catch /8/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3548 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3549 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3550
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3551 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3552 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3553 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3554 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3555
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3556 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3557
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3558 delcommand THROW1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3559 delcommand THROW2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3560 delcommand THROW3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3561 delcommand THROW4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3562
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3563 Xcheck 40744667
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3564
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3565
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3566 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3567 " Test 52: Uncaught exceptions {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3568 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3569 " When an exception is thrown but not caught, an error message is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3570 " displayed when the script is terminated. In case of an interrupt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3571 " or error exception, the normal interrupt or error message(s) are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3572 " displayed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3573 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3574
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3575 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3577 let msgfile = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3578
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3579 function! MESSAGES(...)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3580 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3581 exec "edit" g:msgfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3582 catch /^Vim(edit):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3583 return 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3584 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3585
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3586 let english = v:lang == "C" || v:lang =~ '^[Ee]n'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3587 let match = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3588 norm gg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3589
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3590 let num = a:0 / 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3591 let cnt = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3592 while cnt <= num
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3593 let enr = a:{2*cnt - 1}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3594 let emsg= a:{2*cnt}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3595 let cnt = cnt + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3596
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3597 if enr == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3598 Xout "TODO: Add message number for:" emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3599 elseif enr == "INT"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3600 let enr = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3601 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3602 if enr == "" && !english
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3603 continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3604 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3605 let pattern = (enr != "") ? enr . ':.*' : ''
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3606 if english
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3607 let pattern = pattern . emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3608 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3609 if !search(pattern, "W")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3610 let match = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3611 Xout "No match for:" pattern
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3612 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3613 norm $
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3614 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3615
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3616 bwipeout!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3617 return match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3618 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3619
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3620 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3621 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3622 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3623 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3624
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3625 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3626 if !MESSAGES('E605', "Exception not caught")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3627 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3628 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3629
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3630 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3631 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3632 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3633 throw "oops"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3634 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3635 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3636 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3637 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3638 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3639
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3640 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3641 if !MESSAGES('E605', "Exception not caught")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3642 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3643 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3644
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3645 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3646 function! T()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3647 throw "brrr"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3648 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3649
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3650 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3651 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3652 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3653 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3654 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3655 call T()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3656 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3657 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3658 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3659
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3660 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3661 if !MESSAGES('E605', "Exception not caught")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3662 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3663 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3664
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3665 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3666 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3667 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3668 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3669 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3670 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3671 throw "brrr"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3672 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3673 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3674 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3675
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3676 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3677 if !MESSAGES('E605', "Exception not caught")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3678 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3679 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3680
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3681 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3682 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3683 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3684 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3685 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3686 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3687 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3688
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3689 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3690 if !MESSAGES('INT', "Interrupted")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3691 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3692 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3693
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3694 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3695 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3696 Xpath 4194304 " X: 4194304
15456
f01eb1aed348 patch 8.1.0736: code for Blob not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
3697 let x = novar " error E121; exception: E121
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3698 catch /E15:/ " should not catch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3699 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3700 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3701 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3702 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3703
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3704 Xpath 33554432 " X: 33554432
15456
f01eb1aed348 patch 8.1.0736: code for Blob not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
3705 if !MESSAGES('E121', "Undefined variable")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3706 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3707 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3708
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3709 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3710 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3711 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3712 " unlet novar # " error E108/E488; exception: E488
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3713 catch /E108:/ " should not catch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3714 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3715 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3716 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3717 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3718
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3719 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3720 if !MESSAGES('E108', "No such variable", 'E488', "Trailing characters")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3721 " The Xpath command does not accept 2^31 (negative); add explicitly:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3722 let Xpath = Xpath + 2147483648 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3723 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3724
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3725 call delete(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3726 unlet msgfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3727
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3728 Xcheck 1247112011
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3729
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3730 " Leave MESSAGES() for the next tests.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3731
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3732
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3733 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3734 " Test 53: Nesting errors: :endif/:else/:elseif {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3735 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3736 " For nesting errors of :if conditionals the correct error messages
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3737 " should be given.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3738 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3739 " This test reuses the function MESSAGES() from the previous test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3740 " This functions checks the messages in g:msgfile.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3741 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3742
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3743 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3744
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3745 let msgfile = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3746
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3747 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3748 " endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3749 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3750 if MESSAGES('E580', ":endif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3751 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3752 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3753
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3754 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3755 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3756 " endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3757 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3758 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3759 if MESSAGES('E580', ":endif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3760 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3761 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3762
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3763 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3764 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3765 " finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3766 " endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3767 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3768 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3769 if MESSAGES('E580', ":endif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3770 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3771 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3772
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3773 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3774 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3775 " endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3776 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3777 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3778 if MESSAGES('E580', ":endif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3779 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3780 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3781
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3782 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3783 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3784 " throw "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3785 " catch /a/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3786 " endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3787 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3788 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3789 if MESSAGES('E580', ":endif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3790 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3791 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3792
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3793 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3794 " else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3795 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3796 if MESSAGES('E581', ":else without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3797 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3798 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3799
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3800 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3801 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3802 " else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3803 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3804 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3805 if MESSAGES('E581', ":else without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3806 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3807 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3808
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3809 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3810 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3811 " finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3812 " else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3813 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3814 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3815 if MESSAGES('E581', ":else without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3816 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3817 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3818
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3819 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3820 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3821 " else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3822 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3823 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3824 if MESSAGES('E581', ":else without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3825 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3826 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3827
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3828 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3829 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3830 " throw "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3831 " catch /a/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3832 " else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3833 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3834 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3835 if MESSAGES('E581', ":else without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3836 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3837 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3838
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3839 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3840 " elseif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3841 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3842 if MESSAGES('E582', ":elseif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3843 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3844 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3845
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3846 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3847 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3848 " elseif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3849 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3850 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3851 if MESSAGES('E582', ":elseif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3852 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3853 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3854
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3855 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3856 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3857 " finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3858 " elseif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3859 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3860 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3861 if MESSAGES('E582', ":elseif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3862 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3863 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3865 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3866 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3867 " elseif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3868 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3869 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3870 if MESSAGES('E582', ":elseif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3871 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3872 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3873
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3874 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3875 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3876 " throw "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3877 " catch /a/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3878 " elseif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3879 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3880 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3881 if MESSAGES('E582', ":elseif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3882 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3883 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3884
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3885 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3886 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3887 " else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3888 " else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3889 " endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3890 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3891 if MESSAGES('E583', "multiple :else")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3892 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3893 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3894
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3895 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3896 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3897 " else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3898 " elseif 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3899 " endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3900 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3901 if MESSAGES('E584', ":elseif after :else")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3902 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3903 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3904
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3905 call delete(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3906 unlet msgfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3907
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3908 Xcheck 131071
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3909
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3910 " Leave MESSAGES() for the next test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3911
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3913 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3914 " Test 54: Nesting errors: :while/:endwhile {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3915 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3916 " For nesting errors of :while conditionals the correct error messages
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3917 " should be given.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3918 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3919 " This test reuses the function MESSAGES() from the previous test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3920 " This functions checks the messages in g:msgfile.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3921 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3922
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3923 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3924
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3925 let msgfile = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3926
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3927 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3928 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3929 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3930 if MESSAGES('E588', ":endwhile without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3931 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3932 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3933
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3934 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3935 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3936 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3937 " endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3938 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3939 if MESSAGES('E588', ":endwhile without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3940 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3941 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3942
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3943 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3944 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3945 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3946 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3947 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3948 if MESSAGES('E171', "Missing :endif")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3949 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3950 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3951
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3952 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3953 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3954 " finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3955 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3956 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3957 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3958 if MESSAGES('E588', ":endwhile without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3959 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3960 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3961
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3962 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3963 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3964 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3965 " finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3966 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3967 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3968 if MESSAGES('E600', "Missing :endtry")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3969 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3970 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3971
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3972 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3973 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3974 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3975 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3976 " finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3977 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3978 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3979 if MESSAGES('E600', "Missing :endtry")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3980 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3981 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3982
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3983 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3984 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3985 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3986 " finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3987 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3988 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3989 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3990 if MESSAGES('E171', "Missing :endif")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3991 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3992 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3993
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3994 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3995 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3996 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3997 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3998 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3999 if MESSAGES('E588', ":endwhile without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4000 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4001 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4002
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4003 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4004 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4005 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4006 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4007 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4008 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4009 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4010 if MESSAGES('E588', ":endwhile without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4011 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4012 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4013
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4014 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4015 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4016 " throw "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4017 " catch /a/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4018 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4019 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4020 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4021 if MESSAGES('E588', ":endwhile without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4022 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4023 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4025 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4026 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4027 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4028 " throw "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4029 " catch /a/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4030 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4031 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4032 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4033 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4034 if MESSAGES('E588', ":endwhile without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4035 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4036 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4037
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4038
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4039 call delete(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4040 unlet msgfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4041
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4042 Xcheck 2047
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4043
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4044 " Leave MESSAGES() for the next test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4045
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4046
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4047 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4048 " Test 55: Nesting errors: :continue/:break {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4049 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4050 " For nesting errors of :continue and :break commands the correct
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4051 " error messages should be given.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4052 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4053 " This test reuses the function MESSAGES() from the previous test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4054 " This functions checks the messages in g:msgfile.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4055 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4056
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4057 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4058
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4059 let msgfile = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4060
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4061 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4062 " continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4063 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4064 if MESSAGES('E586', ":continue without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4065 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4066 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4067
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4068 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4069 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4070 " continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4071 " endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4072 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4073 if MESSAGES('E586', ":continue without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4074 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4075 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4076
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4077 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4078 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4079 " finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4080 " continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4081 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4082 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4083 if MESSAGES('E586', ":continue without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4084 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4085 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4086
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4087 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4088 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4089 " continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4090 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4091 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4092 if MESSAGES('E586', ":continue without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4093 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4094 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4095
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4096 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4097 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4098 " throw "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4099 " catch /a/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4100 " continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4101 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4102 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4103 if MESSAGES('E586', ":continue without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4104 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4105 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4107 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4108 " break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4109 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4110 if MESSAGES('E587', ":break without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4111 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4112 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4114 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4115 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4116 " break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4117 " endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4118 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4119 if MESSAGES('E587', ":break without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4120 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4121 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4123 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4124 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4125 " finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4126 " break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4127 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4128 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4129 if MESSAGES('E587', ":break without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4130 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4131 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4132
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4133 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4134 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4135 " break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4136 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4137 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4138 if MESSAGES('E587', ":break without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4139 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4140 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4141
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4142 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4143 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4144 " throw "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4145 " catch /a/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4146 " break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4147 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4148 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4149 if MESSAGES('E587', ":break without :while")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4150 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4151 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4153 call delete(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4154 unlet msgfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4155
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4156 Xcheck 1023
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4157
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4158 " Leave MESSAGES() for the next test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4160
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4161 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4162 " Test 56: Nesting errors: :endtry {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4163 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4164 " For nesting errors of :try conditionals the correct error messages
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4165 " should be given.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4166 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4167 " This test reuses the function MESSAGES() from the previous test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4168 " This functions checks the messages in g:msgfile.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4169 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4170
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4171 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4172
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4173 let msgfile = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4174
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4175 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4176 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4177 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4178 if MESSAGES('E602', ":endtry without :try")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4179 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4180 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4181
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4182 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4183 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4184 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4185 " endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4186 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4187 if MESSAGES('E602', ":endtry without :try")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4188 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4189 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4190
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4191 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4192 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4193 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4194 " endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4195 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4196 if MESSAGES('E602', ":endtry without :try")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4197 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4198 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4199
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4200 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4201 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4202 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4203 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4204 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4205 if MESSAGES('E171', "Missing :endif")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4206 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4207 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4208
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4209 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4210 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4211 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4212 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4213 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4214 if MESSAGES('E170', "Missing :endwhile")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4215 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4216 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4217
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4218 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4219 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4220 " finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4221 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4222 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4223 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4224 if MESSAGES('E171', "Missing :endif")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4225 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4226 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4227
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4228 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4229 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4230 " finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4231 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4232 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4233 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4234 if MESSAGES('E170', "Missing :endwhile")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4235 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4236 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4237
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4238 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4239 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4240 " throw "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4241 " catch /a/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4242 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4243 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4244 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4245 if MESSAGES('E171', "Missing :endif")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4246 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4247 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4248
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4249 if ExtraVim(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4250 " try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4251 " throw "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4252 " catch /a/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4253 " while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4254 " endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4255 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4256 if MESSAGES('E170', "Missing :endwhile")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4257 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4258 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4259
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4260 call delete(msgfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4261 unlet msgfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4262
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4263 delfunction MESSAGES
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4264
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4265 Xcheck 511
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4266
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4267
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4268 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4269 " Test 57: v:exception and v:throwpoint for user exceptions {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4270 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4271 " v:exception evaluates to the value of the exception that was caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4272 " most recently and is not finished. (A caught exception is finished
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4273 " when the next ":catch", ":finally", or ":endtry" is reached.)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4274 " v:throwpoint evaluates to the script/function name and line number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4275 " where that exception has been thrown.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4276 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4277
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4278 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4279
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4280 function! FuncException()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4281 let g:exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4282 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4283
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4284 function! FuncThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4285 let g:throwpoint = v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4286 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4287
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4288 let scriptException = MakeScript("FuncException")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4289 let scriptThrowPoint = MakeScript("FuncThrowpoint")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4290
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4291 command! CmdException let g:exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4292 command! CmdThrowpoint let g:throwpoint = v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4293
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4294 XloopINIT! 1 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4295
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4296 function! CHECK(n, exception, throwname, throwline)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4297 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4298 let error = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4299 if v:exception != a:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4300 Xout a:n.": v:exception is" v:exception "instead of" a:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4301 let error = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4302 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4303 if v:throwpoint !~ a:throwname
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4304 let name = escape(a:throwname, '\')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4305 Xout a:n.": v:throwpoint (".v:throwpoint.") does not match" name
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4306 let error = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4307 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4308 if v:throwpoint !~ a:throwline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4309 let line = escape(a:throwline, '\')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4310 Xout a:n.": v:throwpoint (".v:throwpoint.") does not match" line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4311 let error = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4312 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4313 if error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4314 Xloop 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4315 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4316 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4317
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4318 function! T(arg, line)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4319 if a:line == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4320 throw a:arg " in line 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4321 elseif a:line == 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4322 throw a:arg " in line 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4323 elseif a:line == 6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4324 throw a:arg " in line 6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4325 elseif a:line == 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4326 throw a:arg " in line 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4327 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4328 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4329
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4330 function! G(arg, line)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4331 call T(a:arg, a:line)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4332 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4333
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4334 function! F(arg, line)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4335 call G(a:arg, a:line)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4336 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4337
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4338 let scriptT = MakeScript("T")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4339 let scriptG = MakeScript("G", scriptT)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4340 let scriptF = MakeScript("F", scriptG)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4341
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4342 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4343 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4344 call F("oops", 2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4345 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4346 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4347 let exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4348 let throwpoint = v:throwpoint
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4349 call CHECK(1, "oops", '\<F\[1]\.\.G\[1]\.\.T\>', '\<2\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4350 exec "let exception = v:exception"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4351 exec "let throwpoint = v:throwpoint"
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4352 call CHECK(2, "oops", '\<F\[1]\.\.G\[1]\.\.T\>', '\<2\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4353 CmdException
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4354 CmdThrowpoint
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4355 call CHECK(3, "oops", '\<F\[1]\.\.G\[1]\.\.T\>', '\<2\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4356 call FuncException()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4357 call FuncThrowpoint()
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4358 call CHECK(4, "oops", '\<F\[1]\.\.G\[1]\.\.T\>', '\<2\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4359 exec "source" scriptException
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4360 exec "source" scriptThrowPoint
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4361 call CHECK(5, "oops", '\<F\[1]\.\.G\[1]\.\.T\>', '\<2\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4362 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4363 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4364 call G("arrgh", 4)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4365 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4366 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4367 let exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4368 let throwpoint = v:throwpoint
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4369 call CHECK(6, "arrgh", '\<G\[1]\.\.T\>', '\<4\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4370 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4371 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4372 let g:arg = "autsch"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4373 let g:line = 6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4374 exec "source" scriptF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4375 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4376 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4377 let exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4378 let throwpoint = v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4379 " Symbolic links in tempname()s are not resolved, whereas resolving
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4380 " is done for v:throwpoint. Resolve the temporary file name for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4381 " scriptT, so that it can be matched against v:throwpoint.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4382 call CHECK(7, "autsch", resolve(scriptT), '\<6\>')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4383 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4384 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4385 let exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4386 let throwpoint = v:throwpoint
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4387 call CHECK(8, "arrgh", '\<G\[1]\.\.T\>', '\<4\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4388 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4389 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4390 let g:arg = "brrrr"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4391 let g:line = 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4392 exec "source" scriptG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4393 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4394 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4395 let exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4396 let throwpoint = v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4397 " Resolve scriptT for matching it against v:throwpoint.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4398 call CHECK(9, "brrrr", resolve(scriptT), '\<8\>')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4399 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4400 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4401 let exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4402 let throwpoint = v:throwpoint
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4403 call CHECK(10, "arrgh", '\<G\[1]\.\.T\>', '\<4\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4404 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4405 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4406 let exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4407 let throwpoint = v:throwpoint
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4408 call CHECK(11, "arrgh", '\<G\[1]\.\.T\>', '\<4\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4409 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4410 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4411 let exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4412 let throwpoint = v:throwpoint
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4413 call CHECK(12, "arrgh", '\<G\[1]\.\.T\>', '\<4\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4414 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4415 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4416 let exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4417 let throwpoint = v:throwpoint
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4418 call CHECK(13, "oops", '\<F\[1]\.\.G\[1]\.\.T\>', '\<2\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4419 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4420 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4421 let exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4422 let throwpoint = v:throwpoint
7139
d1e35ca56c73 commit https://github.com/vim/vim/commit/0a777ab9890ba0e8dd57f082e98fde1adab36aa0
Christian Brabandt <cb@256bit.org>
parents: 4774
diff changeset
4423 call CHECK(14, "oops", '\<F\[1]\.\.G\[1]\.\.T\>', '\<2\>')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4424 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4425 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4426 let exception = v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4427 let throwpoint = v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4428 call CHECK(15, "", '^$', '^$')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4429 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4430
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4431 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4433 unlet exception throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4434 delfunction FuncException
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4435 delfunction FuncThrowpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4436 call delete(scriptException)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4437 call delete(scriptThrowPoint)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4438 unlet scriptException scriptThrowPoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4439 delcommand CmdException
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4440 delcommand CmdThrowpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4441 delfunction T
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4442 delfunction G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4443 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4444 call delete(scriptT)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4445 call delete(scriptG)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4446 call delete(scriptF)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4447 unlet scriptT scriptG scriptF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4448
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4449 Xcheck 2147450880
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4450
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4451
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4452 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4453 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4454 " Test 58: v:exception and v:throwpoint for error/interrupt exceptions {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4455 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4456 " v:exception and v:throwpoint work also for error and interrupt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4457 " exceptions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4458 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4459
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4460 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4461
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4462 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4463
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4464 function! T(line)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4465 if a:line == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4466 delfunction T " error (function in use) in line 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4467 elseif a:line == 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4468 let dummy = 0 " INTERRUPT1 - interrupt in line 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4469 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4470 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4471
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4472 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4473 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4474 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4475 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4476 call T(2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4477 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4478 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4479 if v:exception !~ 'Vim(delfunction):'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4480 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4481 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4482 if v:throwpoint !~ '\<T\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4483 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4484 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4485 if v:throwpoint !~ '\<2\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4486 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4487 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4488 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4489 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4490 if caught || $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4491 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4492 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4493 if v:exception != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4494 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4495 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4496 if v:throwpoint != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4497 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4498 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4499 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4500 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4501 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4502
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4503 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4504 if v:exception != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4505 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4506 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4507 if v:throwpoint != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4508 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4509 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4510
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4511 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4512 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4513 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4514 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4515 call T(4)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4516 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4517 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4518 if v:exception != 'Vim:Interrupt'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4519 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4520 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4521 if v:throwpoint !~ '\<T\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4522 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4523 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4524 if v:throwpoint !~ '\<4\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4525 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4526 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4527 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4528 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4529 if caught || $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4530 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4531 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4532 if v:exception != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4533 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4534 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4535 if v:throwpoint != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4536 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4537 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4538 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4539 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4540 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4541
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4542 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4543 if v:exception != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4544 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4545 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4546 if v:throwpoint != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4547 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4548 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4549
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4550 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4551
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4552 Xcheck 624945
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4553
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4554
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4555 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4556 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4557 " Test 59: v:exception and v:throwpoint when discarding exceptions {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4558 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4559 " When a :catch clause is left by a ":break" etc or an error or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4560 " interrupt exception, v:exception and v:throwpoint are reset. They
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4561 " are not affected by an exception that is discarded before being
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4562 " caught.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4563 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4564
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4565 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4566
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4567 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4568
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4569 XloopINIT! 1 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4570
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4571 let sfile = expand("<sfile>")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4572
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4573 function! LineNumber()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4574 return substitute(substitute(v:throwpoint, g:sfile, '', ""),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4575 \ '\D*\(\d*\).*', '\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4576 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4577
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4578 command! -nargs=1 SetLineNumber
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4579 \ try | throw "line" | catch /.*/ | let <args> = LineNumber() | endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4580
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4581 " Check v:exception/v:throwpoint against second/fourth parameter if
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4582 " specified, check for being empty else.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4583 function! CHECK(n, ...)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4584 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4585 let exception = a:0 != 0 ? a:1 : "" " second parameter (optional)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4586 let emsg = a:0 != 0 ? a:2 : "" " third parameter (optional)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4587 let line = a:0 != 0 ? a:3 : 0 " fourth parameter (optional)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4588 let error = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4589 if emsg != ""
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
4590 " exception is the error number, emsg the English error message text
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4591 if exception !~ '^E\d\+$'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4592 Xout "TODO: Add message number for:" emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4593 elseif v:lang == "C" || v:lang =~ '^[Ee]n'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4594 if exception == "E492" && emsg == "Not an editor command"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4595 let exception = '^Vim:' . exception . ': ' . emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4596 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4597 let exception = '^Vim(\a\+):' . exception . ': ' . emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4598 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4599 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4600 if exception == "E492"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4601 let exception = '^Vim:' . exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4602 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4603 let exception = '^Vim(\a\+):' . exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4604 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4605 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4606 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4607 if exception == "" && v:exception != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4608 Xout a:n.": v:exception is set:" v:exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4609 let error = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4610 elseif exception != "" && v:exception !~ exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4611 Xout a:n.": v:exception (".v:exception.") does not match" exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4612 let error = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4613 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4614 if line == 0 && v:throwpoint != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4615 Xout a:n.": v:throwpoint is set:" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4616 let error = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4617 elseif line != 0 && v:throwpoint !~ '\<' . line . '\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4618 Xout a:n.": v:throwpoint (".v:throwpoint.") does not match" line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4619 let error = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4620 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4621 if !error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4622 Xloop 1 " X: 2097151
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4623 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4624 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4625
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4626 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4627 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4628 throw "x1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4629 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4630 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4631 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4632 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4633 call CHECK(1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4634
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4635 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4636 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4637 throw "x2"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4638 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4639 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4640 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4641 call CHECK(2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4642 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4643 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4644 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4645 call CHECK(3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4646
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4647 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4648 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4649 let errcaught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4650 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4651 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4652 throw "x3"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4653 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4654 SetLineNumber line_before_error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4655 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4656 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4657 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4658 let errcaught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4659 call CHECK(4, 'E492', "Not an editor command",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4660 \ line_before_error + 1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4661 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4662 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4663 if !errcaught && $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4664 call CHECK(4)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4665 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4666 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4667 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4668 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4669 call CHECK(5)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4670
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4671 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4672
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4673 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4674 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4675 let intcaught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4676 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4677 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4678 throw "x4"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4679 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4680 SetLineNumber two_lines_before_interrupt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4681 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4682 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4683 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4684 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4685 let intcaught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4686 call CHECK(6, "Vim:Interrupt", '',
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4687 \ two_lines_before_interrupt + 2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4688 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4689 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4690 if !intcaught && $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4691 call CHECK(6)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4692 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4693 break " discard interrupt for $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4694 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4695 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4696 call CHECK(7)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4697
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4698 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4699
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4700 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4701 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4702 let errcaught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4703 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4704 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4705 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4706 SetLineNumber line_before_throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4707 throw "x5"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4708 " missing endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4709 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4710 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4711 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4712 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4713 let errcaught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4714 call CHECK(8, 'E171', "Missing :endif", line_before_throw + 3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4715 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4716 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4717 if !errcaught && $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4718 call CHECK(8)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4719 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4720 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4721 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4722 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4723 call CHECK(9)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4724
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4725 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4726
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4727 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4728 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4729 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4730 throw "x6"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4731 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4732 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4733 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4734 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4735 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4736 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4737 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4738 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4739 call CHECK(10)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4740
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4741 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4742 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4743 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4744 throw "x7"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4745 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4746 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4747 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4748 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4749 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4750 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4751 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4752 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4753 call CHECK(11)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4754 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4755 call CHECK(12)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4756
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4757 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4758 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4759 let errcaught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4760 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4761 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4762 throw "x8"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4763 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4764 SetLineNumber line_before_error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4765 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4766 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4767 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4768 let errcaught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4769 call CHECK(13, 'E492', "Not an editor command",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4770 \ line_before_error + 1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4771 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4772 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4773 if !errcaught && $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4774 call CHECK(13)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4775 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4776 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4777 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4778 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4779 call CHECK(14)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4780
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4781 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4782
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4783 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4784 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4785 let intcaught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4786 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4787 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4788 throw "x9"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4789 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4790 SetLineNumber two_lines_before_interrupt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4791 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4792 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4793 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4794 let intcaught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4795 call CHECK(15, "Vim:Interrupt", '',
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4796 \ two_lines_before_interrupt + 2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4797 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4798 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4799 if !intcaught && $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4800 call CHECK(15)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4801 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4802 break " discard interrupt for $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4803 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4804 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4805 call CHECK(16)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4806
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4807 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4808
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4809 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4810 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4811 let errcaught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4812 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4813 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4814 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4815 SetLineNumber line_before_throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4816 throw "x10"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4817 " missing endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4818 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4819 call CHECK(17)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4820 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4821 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4822 let errcaught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4823 call CHECK(18, 'E171', "Missing :endif", line_before_throw + 3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4824 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4825 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4826 if !errcaught && $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4827 call CHECK(18)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4828 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4829 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4830 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4831 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4832 call CHECK(19)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4833
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4834 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4835
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4836 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4837 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4838 let errcaught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4839 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4840 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4841 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4842 SetLineNumber line_before_throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4843 throw "x11"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4844 " missing endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4845 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4846 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4847 let errcaught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4848 call CHECK(20, 'E171', "Missing :endif", line_before_throw + 3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4849 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4850 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4851 if !errcaught && $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4852 call CHECK(20)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4853 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4854 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4855 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4856 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4857 call CHECK(21)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4858
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4859 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4860
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4861 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4862
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4863 Xcheck 2038431743
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4865
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4866 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4867 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4868 " Test 60: (Re)throwing v:exception; :echoerr. {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4869 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4870 " A user exception can be rethrown after catching by throwing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4871 " v:exception. An error or interrupt exception cannot be rethrown
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4872 " because Vim exceptions cannot be faked. A Vim exception using the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4873 " value of v:exception can, however, be triggered by the :echoerr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4874 " command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4875 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4876
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4877 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4878
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4879 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4880 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4881 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4882 throw "oops"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4883 catch /oops/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4884 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4885 throw v:exception " rethrow user exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4886 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4887 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4888 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4889 catch /^oops$/ " catches rethrown user exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4890 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4891 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4892 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4893 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4894
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4895 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4896 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4897 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4898 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4899 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4900 write /n/o/n/w/r/i/t/a/b/l/e/_/f/i/l/e
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4901 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4902 Xout "did_emsg was reset before executing " .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4903 \ "BufWritePost autocommands."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4904 catch /^Vim(write):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4905 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4906 throw v:exception " throw error: cannot fake Vim exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4907 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4908 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4909 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4910 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4911 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4912 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4913 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4914 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4915 catch /^Vim(throw):/ " catches throw error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4916 let caught = caught + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4917 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4918 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4919 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4920 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4921 if caught != 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4922 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4923 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4924 elseif caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4925 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4926 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4927 return | " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4928 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4929 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4930 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4931
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4932 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4933 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4934
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4935 function! G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4936 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4937 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4938 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4939 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4940 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4941 catch /^Vim/ " catch error exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4942 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4943 " Trigger Vim error exception with value specified after :echoerr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4944 let value = substitute(v:exception, '^Vim\((.*)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4945 echoerr value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4946 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4947 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4948 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4949 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4950 if !caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4951 if !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4952 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4953 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4954 let value = "Error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4955 echoerr value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4956 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4957 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4958 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4959 catch /^Vim(echoerr):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4960 let caught = caught + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4961 if v:exception !~ value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4962 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4963 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4964 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4965 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4966 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4967 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4968 if caught != 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4969 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4970 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4971 elseif caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4972 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4973 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4974 return | " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4975 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4976 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4977 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4978
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4979 call G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4980 delfunction G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4981
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4982 unlet! value caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4983
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4984 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4985 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4986 let errcaught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4987 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4988 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4989 let intcaught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4990 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4991 catch /^Vim:/ " catch interrupt exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4992 let intcaught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4993 " Trigger Vim error exception with value specified after :echoerr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4994 echoerr substitute(v:exception, '^Vim\((.*)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4995 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4996 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4997 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4998 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4999 if !intcaught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5000 if !$VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5001 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5002 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5003 echoerr "Interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5004 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5005 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5006 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5007 catch /^Vim(echoerr):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5008 let errcaught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5009 if v:exception !~ "Interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5010 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5011 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5012 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5013 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5014 if !errcaught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5015 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5016 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5017 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5018 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5019
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5020 Xcheck 311511339
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5021
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5022
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5023 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5024 " Test 61: Catching interrupt exceptions {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5025 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5026 " When an interrupt occurs inside a :try/:endtry region, an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5027 " interrupt exception is thrown and can be caught. Its value is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5028 " "Vim:Interrupt". If the interrupt occurs after an error or a :throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5029 " but before a matching :catch is reached, all following :catches of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5030 " that try block are ignored, but the interrupt exception can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5031 " caught by the next surrounding try conditional. An interrupt is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5032 " ignored when there is a previous interrupt that has not been caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5033 " or causes a :finally clause to be executed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5034 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5035
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5036 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5037
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5038 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5039
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5040 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5041 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5042 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5043 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5044 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5045 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5046 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5047 catch /^Vim:Interrupt$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5048 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5049 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5050 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5051 if caught || $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5052 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5053 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5054 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5055 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5056 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5057 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5058 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5059 break " discard interrupt for $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5060 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5061 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5062
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5063 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5064 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5065 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5066 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5067 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5068 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5069 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5070 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5071 catch /do_not_catch/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5072 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5073 catch /.*/ "INTERRUPT - throw interrupt if !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5074 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5075 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5076 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5077 finally "INTERRUPT - throw interrupt if $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5078 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5079 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5080 catch /^Vim:Interrupt$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5081 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5082 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5083 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5084 if caught || $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5085 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5086 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5087 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5088 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5089 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5090 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5091 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5092 break " discard interrupt for $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5093 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5094 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5095
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5096 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5097 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5098 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5099 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5100 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5101 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5102 throw "x"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5103 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5104 catch /do_not_catch/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5105 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5106 catch /x/ "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5107 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5108 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5109 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5110 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5111 catch /^Vim:Interrupt$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5112 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5113 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5114 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5115 if caught || $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5116 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5117 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5118 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5119 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5120 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5121 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5122 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5123 break " discard interrupt for $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5124 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5125 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5127 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5128 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5129 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5130 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5131 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5132 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5133 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5134 catch /do_not_catch/ "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5135 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5136 catch /^Vim:Interrupt$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5137 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5138 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5139 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5140 if caught || $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5141 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5142 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5143 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5144 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5145 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5146 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5147 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5148 break " discard interrupt for $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5149 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5150 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5151
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5152 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5153
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5154 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5155
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5156 Xcheck 374889517
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5157
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5158
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5159 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5160 " Test 62: Catching error exceptions {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5161 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5162 " An error inside a :try/:endtry region is converted to an exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5163 " and can be caught. The error exception has a "Vim(cmdname):" prefix
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5164 " where cmdname is the name of the failing command, or a "Vim:" prefix
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5165 " if no command name is known. The "Vim" prefixes cannot be faked.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5166 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5167
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5168 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5169
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5170 function! MSG(enr, emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5171 let english = v:lang == "C" || v:lang =~ '^[Ee]n'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5172 if a:enr == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5173 Xout "TODO: Add message number for:" a:emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5174 let v:errmsg = ":" . v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5175 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5176 let match = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5177 if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5178 let match = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5179 if v:errmsg == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5180 Xout "Message missing."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5181 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5182 let v:errmsg = escape(v:errmsg, '"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5183 Xout "Unexpected message:" v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5184 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5185 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5186 return match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5187 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5188
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5189 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5190 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5191 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5192 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5193 unlet novar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5194 catch /^Vim(unlet):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5195 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5196 let v:errmsg = substitute(v:exception, '^Vim(unlet):', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5197 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5198 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5199 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5200 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5201 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5202 if !MSG('E108', "No such variable")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5203 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5204 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5205 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5206 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5207 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5208 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5209 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5210 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5211 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5212 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5213
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5214 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5215 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5216 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5217 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5218 throw novar " error in :throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5219 catch /^Vim(throw):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5220 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5221 let v:errmsg = substitute(v:exception, '^Vim(throw):', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5222 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5223 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5224 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5225 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5226 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5227 if caught ? !MSG('E121', "Undefined variable")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5228 \ : !MSG('E15', "Invalid expression")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5229 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5230 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5231 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5232 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5233 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5234 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5235 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5236 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5237 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5238 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5239
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5240 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5241 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5242 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5243 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5244 throw "Vim:faked" " error: cannot fake Vim exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5245 catch /^Vim(throw):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5246 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5247 let v:errmsg = substitute(v:exception, '^Vim(throw):', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5248 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5249 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5250 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5251 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5252 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5253 if !MSG('E608', "Cannot :throw exceptions with 'Vim' prefix")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5254 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5255 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5256 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5257 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5258 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5259 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5260 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5261 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5262 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5263 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5264
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5265 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5266 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5267 " Missing :endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5268 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5269
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5270 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5271 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5272 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5273 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5274 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5275 catch /^Vim(endfunction):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5276 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5277 let v:errmsg = substitute(v:exception, '^Vim(endfunction):', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5278 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5279 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5280 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5281 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5282 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5283 if !MSG('E170', "Missing :endwhile")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5284 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5285 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5286 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5287 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5288 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5289 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5290 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5291 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5292 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5293 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5294
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5295 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5296 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5297 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5298 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5299 ExecAsScript F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5300 catch /^Vim:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5301 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5302 let v:errmsg = substitute(v:exception, '^Vim:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5303 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5304 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5305 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5306 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5307 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5308 if !MSG('E170', "Missing :endwhile")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5309 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5310 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5311 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5312 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5313 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5314 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5315 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5316 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5317 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5318 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5319
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5320 function! G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5321 call G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5322 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5323
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5324 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5325 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5326 let mfd_save = &mfd
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5327 set mfd=3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5328 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5329 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5330 call G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5331 catch /^Vim(call):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5332 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5333 let v:errmsg = substitute(v:exception, '^Vim(call):', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5334 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5335 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5336 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5337 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5338 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5339 if !MSG('E132', "Function call depth is higher than 'maxfuncdepth'")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5340 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5341 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5342 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5343 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5344 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5345 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5346 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5347 let &mfd = mfd_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5348 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5349 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5350 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5351
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5352 function! H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5353 return H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5354 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5355
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5356 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5357 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5358 let mfd_save = &mfd
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5359 set mfd=3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5360 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5361 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5362 call H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5363 catch /^Vim(return):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5364 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5365 let v:errmsg = substitute(v:exception, '^Vim(return):', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5366 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5367 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5368 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5369 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5370 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5371 if !MSG('E132', "Function call depth is higher than 'maxfuncdepth'")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5372 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5373 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5374 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5375 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5376 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5377 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5378 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5379 let &mfd = mfd_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5380 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5381 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5382 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5383
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5384 unlet! caught mfd_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5385 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5386 delfunction G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5387 delfunction H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5388 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5389
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5390 Xcheck 286331153
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5391
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5392 " Leave MSG() for the next test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5393
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5394
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5395 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5396 " Test 63: Suppressing error exceptions by :silent!. {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5397 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5398 " A :silent! command inside a :try/:endtry region suppresses the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5399 " conversion of errors to an exception and the immediate abortion on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5400 " error. When the commands executed by the :silent! themselves open
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5401 " a new :try/:endtry region, conversion of errors to exception and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5402 " immediate abortion is switched on again - until the next :silent!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5403 " etc. The :silent! has the effect of setting v:errmsg to the error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5404 " message text (without displaying it) and continuing with the next
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5405 " script line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5406 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5407 " When a command triggering autocommands is executed by :silent!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5408 " inside a :try/:endtry, the autocommand execution is not suppressed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5409 " on error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5410 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5411 " This test reuses the function MSG() from the previous test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5412 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5413
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5414 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5415
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5416 XloopINIT! 1 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5417
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5418 let taken = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5419
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5420 function! S(n) abort
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5421 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5422 let g:taken = g:taken . "E" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5423 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5424 exec "asdf" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5425
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5426 " Check that ":silent!" continues:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5427 Xloop 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5428
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5429 " Check that ":silent!" sets "v:errmsg":
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5430 if MSG('E492', "Not an editor command")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5431 Xloop 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5432 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5433 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5434
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5435 function! Foo()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5436 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5437 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5438 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5439 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5440 " This is not silent:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5441 call S(3) " X: 0 * 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5442 catch /^Vim:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5443 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5444 let errmsg3 = substitute(v:exception, '^Vim:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5445 silent! call S(4) " X: 3 * 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5446 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5447 if !caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5448 let errmsg3 = v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5449 " Do call S(4) here if not executed in :catch.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5450 silent! call S(4)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5451 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5452 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5453 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5454 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5455 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5456 let v:errmsg = errmsg3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5457 if !MSG('E492', "Not an editor command")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5458 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5459 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5460 silent! call S(5) " X: 3 * 256
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5461 " Break out of try conditionals that cover ":silent!". This also
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5462 " discards the aborting error when $VIMNOERRTHROW is non-zero.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5463 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5464 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5465 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5466 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5467 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5468 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5469 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5470 " This is a double ":silent!" (see caller).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5471 silent! call S(6) " X: 3 * 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5472 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5473
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5474 function! Bar()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5475 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5476 silent! call S(2) " X: 3 * 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5477 " X: 3 * 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5478 silent! execute "call Foo() | call S(7)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5479 silent! call S(8) " X: 3 * 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5480 endtry " normal end of try cond that covers ":silent!"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5481 " This has a ":silent!" from the caller:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5482 call S(9) " X: 3 * 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5483 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5484
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5485 silent! call S(1) " X: 3 * 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5486 silent! call Bar()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5487 silent! call S(10) " X: 3 * 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5488
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5489 let expected = "E1E2E3E4E5E6E7E8E9E10"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5490 if taken != expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5491 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5492 Xout "'taken' is" taken "instead of" expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5493 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5494
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5495 augroup TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5496 autocmd BufWritePost * Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5497 augroup END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5498
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5499 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5500 write /i/m/p/o/s/s/i/b/l/e
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5501 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5502
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5503 autocmd! TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5504 unlet! caught errmsg3 taken expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5505 delfunction S
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5506 delfunction Foo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5507 delfunction Bar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5508 delfunction MSG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5509
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5510 Xcheck 236978127
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5511
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5513 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5514 " Test 64: Error exceptions after error, interrupt or :throw {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5515 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5516 " When an error occurs after an interrupt or a :throw but before
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5517 " a matching :catch is reached, all following :catches of that try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5518 " block are ignored, but the error exception can be caught by the next
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5519 " surrounding try conditional. Any previous error exception is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5520 " discarded. An error is ignored when there is a previous error that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5521 " has not been caught.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5522 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5523
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5524 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5525
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5526 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5527
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5528 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5529 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5530 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5531 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5532 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5533 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5534 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5535 " Missing :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5536 endwhile " throw error exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5537 catch /^Vim(/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5538 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5539 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5540 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5541 if caught || $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5542 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5543 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5544 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5545 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5546 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5547 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5548 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5549 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5550 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5551 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5552
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5553 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5554 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5555 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5556 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5557 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5558 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5559 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5560 " Missing :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5561 catch /.*/ " throw error exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5562 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5563 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5564 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5565 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5566 catch /^Vim(/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5567 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5568 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5569 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5570 if caught || $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5571 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5572 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5573 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5574 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5575 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5576 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5577 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5578 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5579 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5580 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5581
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5582 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5583 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5584 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5585 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5586 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5587 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5588 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5589 catch /do_not_catch/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5590 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5591 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5592 " Missing :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5593 catch /.*/ " throw error exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5594 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5595 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5596 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5597 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5598 catch /^Vim(/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5599 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5600 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5601 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5602 if caught || $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5603 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5604 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5605 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5606 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5607 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5608 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5609 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5610 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5611 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5612 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5613
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5614 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5615 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5616 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5617 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5618 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5619 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5620 throw "x"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5621 catch /do_not_catch/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5622 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5623 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5624 " Missing :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5625 catch /x/ " throw error exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5626 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5627 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5628 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5629 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5630 catch /^Vim(/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5631 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5632 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5633 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5634 if caught || $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5635 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5636 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5637 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5638 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5639 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5640 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5641 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5642 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5643 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5644 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5645
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5646 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5647 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5648 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5649 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5650 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5651 " endif " :endif without :if; throw error exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5652 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5653 " Missing :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5654 catch /do_not_catch/ " ignore new error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5655 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5656 catch /^Vim(endif):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5657 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5658 catch /^Vim(/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5659 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5660 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5661 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5662 if caught || $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5663 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5664 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5665 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5666 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5667 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5668 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5669 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5670 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5671 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5672 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5673
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5674 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5675
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5676 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5677
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5678 Xcheck 1499645335
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5679
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5680
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5681 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5682 " Test 65: Errors in the /pattern/ argument of a :catch {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5683 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5684 " On an error in the /pattern/ argument of a :catch, the :catch does
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5685 " not match. Any following :catches of the same :try/:endtry don't
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5686 " match either. Finally clauses are executed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5687 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5688
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5689 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5690
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5691 function! MSG(enr, emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5692 let english = v:lang == "C" || v:lang =~ '^[Ee]n'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5693 if a:enr == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5694 Xout "TODO: Add message number for:" a:emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5695 let v:errmsg = ":" . v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5696 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5697 let match = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5698 if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5699 let match = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5700 if v:errmsg == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5701 Xout "Message missing."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5702 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5703 let v:errmsg = escape(v:errmsg, '"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5704 Xout "Unexpected message:" v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5705 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5706 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5707 return match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5708 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5709
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5710 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5711 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5712 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5713 throw "oops"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5714 catch /^oops$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5715 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5716 catch /\)/ " not checked; exception has already been caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5717 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5718 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5719 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5720 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5721 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5722 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5723 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5724
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5725 function! F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5726 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5727 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5728 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5729 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5730 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5731 throw "ab"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5732 catch /abc/ " does not catch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5733 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5734 catch /\)/ " error; discards exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5735 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5736 catch /.*/ " not checked
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5737 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5738 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5739 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5740 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5741 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5742 catch /^ab$/ " checked, but original exception is discarded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5743 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5744 catch /^Vim(catch):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5745 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5746 let v:errmsg = substitute(v:exception, '^Vim(catch):', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5747 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5748 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5749 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5750 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5751 endif
7977
96fe78b32ad5 commit https://github.com/vim/vim/commit/dc94a26a641914df5f1ba1ab47a5752e1137287e
Christian Brabandt <cb@256bit.org>
parents: 7454
diff changeset
5752 if !MSG('E475', "Invalid argument")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5753 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5754 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5755 if !caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5756 return | " discard error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5757 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5758 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5759 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5760 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5761 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5762 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5763 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5764
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5765 call F()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5766 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5767
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5768 delfunction MSG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5769 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5770 unlet! caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5771
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5772 Xcheck 70187
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5773
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5774
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5775 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5776 " Test 66: Stop range :call on error, interrupt, or :throw {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5777 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5778 " When a function which is multiply called for a range since it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5779 " doesn't handle the range itself has an error in a command
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5780 " dynamically enclosed by :try/:endtry or gets an interrupt or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5781 " executes a :throw, no more calls for the remaining lines in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5782 " range are made. On an error in a command not dynamically enclosed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5783 " by :try/:endtry, the function is executed again for the remaining
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5784 " lines in the range.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5785 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5786
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5787 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5788
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5789 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5790
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5791 let file = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5792 exec "edit" file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5793
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5794 insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5795 line 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5796 line 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5797 line 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5798 .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5799
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5800 XloopINIT! 1 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5801
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5802 let taken = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5803 let expected = "G1EF1E(1)F1E(2)F1E(3)G2EF2E(1)G3IF3I(1)G4TF4T(1)G5AF5A(1)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5804
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5805 function! F(reason, n) abort
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5806 let g:taken = g:taken . "F" . a:n .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5807 \ substitute(a:reason, '\(\l\).*', '\u\1', "") .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5808 \ "(" . line(".") . ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5809
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5810 if a:reason == "error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5811 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5812 elseif a:reason == "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5813 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5814 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5815 elseif a:reason == "throw"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5816 throw "xyz"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5817 elseif a:reason == "aborting error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5818 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5819 if g:taken != g:expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5820 Xloop 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5821 Xout "'taken' is" g:taken "instead of" g:expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5822 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5823 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5824 bwipeout!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5825 call delete(file)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5826 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5827 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5828 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5829 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5830
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5831 function! G(reason, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5832 let g:taken = g:taken . "G" . a:n .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5833 \ substitute(a:reason, '\(\l\).*', '\u\1', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5834 1,3call F(a:reason, a:n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5835 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5836
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5837 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5838 call G("error", 1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5839 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5840 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5841 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5842 call G("error", 2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5843 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5844 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5845 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5846 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5847 call G("interrupt", 3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5848 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5849 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5850 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5851 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5852 call G("throw", 4)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5853 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5854 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5855 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5856 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5857 catch /xyz/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5858 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5859 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5860 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5861 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5862 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5863 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5864 call G("aborting error", 5)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5865 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5866 Xout "'taken' is" taken "instead of" expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5867
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5868 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5869
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5870 Xcheck 5464
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5871
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5872
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5873 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5874 " Test 67: :throw across :call command {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5875 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5876 " On a call command, an exception might be thrown when evaluating the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5877 " function name, during evaluation of the arguments, or when the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5878 " function is being executed. The exception can be caught by the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5879 " caller.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5880 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5881
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5882 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5883
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5884 function! THROW(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5885 if a:n == 1
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5886 Xpath 1 " X: 1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5887 elseif a:n == 2
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5888 Xpath 2 " X: 2
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5889 elseif a:n == 3
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5890 Xpath 4 " X: 4
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5891 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5892 throw a:x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5893 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5894
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5895 function! NAME(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5896 if a:n == 1
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5897 Xpath 8 " X: 0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5898 elseif a:n == 2
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5899 Xpath 16 " X: 16
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5900 elseif a:n == 3
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5901 Xpath 32 " X: 32
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5902 elseif a:n == 4
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5903 Xpath 64 " X: 64
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5904 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5905 return a:x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5906 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5907
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5908 function! ARG(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5909 if a:n == 1
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5910 Xpath 128 " X: 0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5911 elseif a:n == 2
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5912 Xpath 256 " X: 0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5913 elseif a:n == 3
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5914 Xpath 512 " X: 512
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5915 elseif a:n == 4
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5916 Xpath 1024 " X: 1024
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5917 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5918 return a:x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5919 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5920
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5921 function! F(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5922 if a:n == 2
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5923 Xpath 2048 " X: 0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5924 elseif a:n == 4
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5925 Xpath 4096 " X: 4096
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5926 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5927 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5928
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5929 while 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5930 try
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5931 let error = 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5932 let v:errmsg = ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5933
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5934 while 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5935 try
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5936 Xpath 8192 " X: 8192
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5937 call {NAME(THROW("name", 1), 1)}(ARG(4711, 1), 1)
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5938 Xpath 16384 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5939 catch /^name$/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5940 Xpath 32768 " X: 32768
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5941 catch /.*/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5942 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5943 Xout "1:" v:exception "in" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5944 finally
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5945 if !error && $VIMNOERRTHROW && v:errmsg != ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5946 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5947 Xout "1:" v:errmsg
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5948 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5949 if error
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5950 Xpath 65536 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5951 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5952 let error = 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5953 let v:errmsg = ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5954 break " discard error for $VIMNOERRTHROW
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5955 endtry
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5956 endwhile
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5957
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5958 while 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5959 try
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5960 Xpath 131072 " X: 131072
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5961 call {NAME("F", 2)}(ARG(THROW("arg", 2), 2), 2)
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5962 Xpath 262144 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5963 catch /^arg$/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5964 Xpath 524288 " X: 524288
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5965 catch /.*/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5966 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5967 Xout "2:" v:exception "in" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5968 finally
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5969 if !error && $VIMNOERRTHROW && v:errmsg != ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5970 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5971 Xout "2:" v:errmsg
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5972 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5973 if error
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5974 Xpath 1048576 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5975 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5976 let error = 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5977 let v:errmsg = ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5978 break " discard error for $VIMNOERRTHROW
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5979 endtry
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5980 endwhile
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5981
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5982 while 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5983 try
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5984 Xpath 2097152 " X: 2097152
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5985 call {NAME("THROW", 3)}(ARG("call", 3), 3)
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5986 Xpath 4194304 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5987 catch /^call$/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5988 Xpath 8388608 " X: 8388608
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5989 catch /^0$/ " default return value
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5990 Xpath 16777216 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5991 Xout "3:" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5992 catch /.*/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5993 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5994 Xout "3:" v:exception "in" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5995 finally
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5996 if !error && $VIMNOERRTHROW && v:errmsg != ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5997 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5998 Xout "3:" v:errmsg
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
5999 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6000 if error
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6001 Xpath 33554432 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6002 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6003 let error = 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6004 let v:errmsg = ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6005 break " discard error for $VIMNOERRTHROW
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6006 endtry
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6007 endwhile
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6008
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6009 while 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6010 try
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6011 Xpath 67108864 " X: 67108864
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6012 call {NAME("F", 4)}(ARG(4711, 4), 4)
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6013 Xpath 134217728 " X: 134217728
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6014 catch /.*/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6015 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6016 Xout "4:" v:exception "in" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6017 finally
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6018 if !error && $VIMNOERRTHROW && v:errmsg != ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6019 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6020 Xout "4:" v:errmsg
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6021 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6022 if error
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6023 Xpath 268435456 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6024 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6025 let error = 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6026 let v:errmsg = ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6027 break " discard error for $VIMNOERRTHROW
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6028 endtry
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6029 endwhile
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6030
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6031 catch /^0$/ " default return value
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6032 Xpath 536870912 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6033 Xout v:throwpoint
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6034 catch /.*/
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6035 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6036 Xout v:exception "in" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6037 finally
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6038 if !error && $VIMNOERRTHROW && v:errmsg != ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6039 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6040 Xout v:errmsg
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6041 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6042 if error
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6043 Xpath 1073741824 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6044 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6045 break " discard error for $VIMNOERRTHROW
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6046 endtry
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6047 endwhile
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6048
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6049 unlet error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6050 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6051
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6052 Xcheck 212514423
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6053
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6054 " Leave THROW(), NAME(), and ARG() for the next test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6055
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6056
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6057 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6058 " Test 68: :throw across function calls in expressions {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6059 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6060 " On a function call within an expression, an exception might be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6061 " thrown when evaluating the function name, during evaluation of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6062 " arguments, or when the function is being executed. The exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6063 " can be caught by the caller.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6064 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6065 " This test reuses the functions THROW(), NAME(), and ARG() from the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6066 " previous test.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6067 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6068
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6069 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6070
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6071 function! F(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6072 if a:n == 2
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6073 Xpath 2048 " X: 0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6074 elseif a:n == 4
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6075 Xpath 4096 " X: 4096
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6076 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6077 return a:x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6078 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6079
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6080 unlet! var1 var2 var3 var4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6081
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6082 while 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6083 try
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6084 let error = 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6085 let v:errmsg = ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6086
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6087 while 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6088 try
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6089 Xpath 8192 " X: 8192
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6090 let var1 = {NAME(THROW("name", 1), 1)}(ARG(4711, 1), 1)
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6091 Xpath 16384 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6092 catch /^name$/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6093 Xpath 32768 " X: 32768
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6094 catch /.*/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6095 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6096 Xout "1:" v:exception "in" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6097 finally
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6098 if !error && $VIMNOERRTHROW && v:errmsg != ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6099 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6100 Xout "1:" v:errmsg
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6101 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6102 if error
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6103 Xpath 65536 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6104 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6105 let error = 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6106 let v:errmsg = ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6107 break " discard error for $VIMNOERRTHROW
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6108 endtry
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6109 endwhile
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6110
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6111 while 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6112 try
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6113 Xpath 131072 " X: 131072
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6114 let var2 = {NAME("F", 2)}(ARG(THROW("arg", 2), 2), 2)
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6115 Xpath 262144 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6116 catch /^arg$/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6117 Xpath 524288 " X: 524288
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6118 catch /.*/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6119 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6120 Xout "2:" v:exception "in" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6121 finally
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6122 if !error && $VIMNOERRTHROW && v:errmsg != ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6123 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6124 Xout "2:" v:errmsg
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6125 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6126 if error
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6127 Xpath 1048576 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6128 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6129 let error = 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6130 let v:errmsg = ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6131 break " discard error for $VIMNOERRTHROW
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6132 endtry
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6133 endwhile
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6134
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6135 while 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6136 try
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6137 Xpath 2097152 " X: 2097152
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6138 let var3 = {NAME("THROW", 3)}(ARG("call", 3), 3)
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6139 Xpath 4194304 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6140 catch /^call$/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6141 Xpath 8388608 " X: 8388608
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6142 catch /^0$/ " default return value
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6143 Xpath 16777216 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6144 Xout "3:" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6145 catch /.*/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6146 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6147 Xout "3:" v:exception "in" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6148 finally
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6149 if !error && $VIMNOERRTHROW && v:errmsg != ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6150 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6151 Xout "3:" v:errmsg
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6152 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6153 if error
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6154 Xpath 33554432 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6155 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6156 let error = 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6157 let v:errmsg = ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6158 break " discard error for $VIMNOERRTHROW
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6159 endtry
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6160 endwhile
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6161
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6162 while 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6163 try
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6164 Xpath 67108864 " X: 67108864
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6165 let var4 = {NAME("F", 4)}(ARG(4711, 4), 4)
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6166 Xpath 134217728 " X: 134217728
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6167 catch /.*/
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6168 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6169 Xout "4:" v:exception "in" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6170 finally
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6171 if !error && $VIMNOERRTHROW && v:errmsg != ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6172 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6173 Xout "4:" v:errmsg
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6174 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6175 if error
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6176 Xpath 268435456 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6177 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6178 let error = 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6179 let v:errmsg = ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6180 break " discard error for $VIMNOERRTHROW
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6181 endtry
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6182 endwhile
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6183
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6184 catch /^0$/ " default return value
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6185 Xpath 536870912 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6186 Xout v:throwpoint
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6187 catch /.*/
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6188 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6189 Xout v:exception "in" v:throwpoint
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6190 finally
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6191 if !error && $VIMNOERRTHROW && v:errmsg != ""
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6192 let error = 1
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6193 Xout v:errmsg
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6194 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6195 if error
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6196 Xpath 1073741824 " X: 0
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6197 endif
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6198 break " discard error for $VIMNOERRTHROW
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6199 endtry
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6200 endwhile
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6201
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6202 if exists("var1") || exists("var2") || exists("var3") ||
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6203 \ !exists("var4") || var4 != 4711
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6204 " The Xpath command does not accept 2^31 (negative); add explicitly:
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6205 let Xpath = Xpath + 2147483648 " X: 0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6206 if exists("var1")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6207 Xout "var1 =" var1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6208 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6209 if exists("var2")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6210 Xout "var2 =" var2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6211 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6212 if exists("var3")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6213 Xout "var3 =" var3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6214 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6215 if !exists("var4")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6216 Xout "var4 unset"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6217 elseif var4 != 4711
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6218 Xout "var4 =" var4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6219 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6220 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6221
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6222 unlet! error var1 var2 var3 var4
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6223 delfunction THROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6224 delfunction NAME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6225 delfunction ARG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6226 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6227
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6228 Xcheck 212514423
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6229
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6230
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6231 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6232 " Test 69: :throw across :if, :elseif, :while {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6233 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6234 " On an :if, :elseif, or :while command, an exception might be thrown
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6235 " during evaluation of the expression to test. The exception can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6236 " caught by the script.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6237 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6238
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6239 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6240
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6241 XloopINIT! 1 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6242
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6243 function! THROW(x)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6244 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6245 Xloop 1 " X: 1 + 2 + 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6246 throw a:x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6247 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6248
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6249 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6250
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6251 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6252 Xpath 8 " X: 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6253 if 4711 == THROW("if") + 111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6254 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6255 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6256 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6257 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6258 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6259 catch /^if$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6260 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6261 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6262 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6263 Xout "if:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6264 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6265
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6266 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6267 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6268 if 4711 == 4 + 7 + 1 + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6269 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6270 elseif 4711 == THROW("elseif") + 222
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6271 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6272 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6273 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6274 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6275 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6276 catch /^elseif$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6277 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6278 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6279 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6280 Xout "elseif:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6281 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6282
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6283 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6284 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6285 while 4711 == THROW("while") + 4711
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6286 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6287 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6288 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6289 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6290 catch /^while$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6291 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6292 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6293 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6294 Xout "while:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6295 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6296
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6297 catch /^0$/ " default return value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6298 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6299 Xout v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6300 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6301 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6302 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6303 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6305 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6306
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6307 delfunction THROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6308
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6309 Xcheck 8995471
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6310
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6311
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6312 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6313 " Test 70: :throw across :return or :throw {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6314 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6315 " On a :return or :throw command, an exception might be thrown during
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6316 " evaluation of the expression to return or throw, respectively. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6317 " exception can be caught by the script.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6318 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6319
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6320 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6321
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6322 let taken = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6323
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6324 function! THROW(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6325 let g:taken = g:taken . "T" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6326 throw a:x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6327 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6328
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6329 function! F(x, y, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6330 let g:taken = g:taken . "F" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6331 return a:x + THROW(a:y, a:n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6332 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6333
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6334 function! G(x, y, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6335 let g:taken = g:taken . "G" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6336 throw a:x . THROW(a:y, a:n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6337 return a:x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6338 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6339
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6340 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6341 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6342 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6343 call F(4711, "return", 1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6344 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6345 catch /^return$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6346 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6347 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6348 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6349 Xout "return:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6350 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6351
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6352 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6353 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6354 let var = F(4712, "return-var", 2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6355 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6356 catch /^return-var$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6357 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6358 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6359 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6360 Xout "return-var:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6361 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6362 unlet! var
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6363 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6364
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6365 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6366 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6367 throw "except1" . THROW("throw1", 3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6368 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6369 catch /^except1/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6370 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6371 catch /^throw1$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6372 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6373 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6374 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6375 Xout "throw1:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6376 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6377
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6378 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6379 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6380 call G("except2", "throw2", 4)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6381 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6382 catch /^except2/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6383 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6384 catch /^throw2$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6385 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6386 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6387 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6388 Xout "throw2:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6389 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6390
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6391 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6392 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6393 let var = G("except3", "throw3", 5)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6394 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6395 catch /^except3/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6396 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6397 catch /^throw3$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6398 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6399 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6400 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6401 Xout "throw3:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6402 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6403 unlet! var
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6404 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6405
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6406 let expected = "F1T1F2T2T3G4T4G5T5"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6407 if taken != expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6408 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6409 Xout "'taken' is" taken "instead of" expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6410 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6411
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6412 catch /^0$/ " default return value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6413 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6414 Xout v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6415 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6416 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6417 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6418 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6419
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6420 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6421
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6422 unlet taken expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6423 delfunction THROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6424 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6425 delfunction G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6426
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6427 Xcheck 69544277
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6428
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6429
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6430 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6431 " Test 71: :throw across :echo variants and :execute {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6432 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6433 " On an :echo, :echon, :echomsg, :echoerr, or :execute command, an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6434 " exception might be thrown during evaluation of the arguments to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6435 " be displayed or executed as a command, respectively. Any following
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6436 " arguments are not evaluated, then. The exception can be caught by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6437 " the script.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6438 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6439
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6440 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6441
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6442 let taken = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6443
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6444 function! THROW(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6445 let g:taken = g:taken . "T" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6446 throw a:x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6447 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6448
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6449 function! F(n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6450 let g:taken = g:taken . "F" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6451 return "F" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6452 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6453
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6454 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6455 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6456 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6457 echo "echo" . THROW("echo-except", 1) F(1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6458 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6459 catch /^echo-except$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6460 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6461 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6462 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6463 Xout "echo:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6464 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6465
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6466 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6467 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6468 echon "echon" . THROW("echon-except", 2) F(2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6469 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6470 catch /^echon-except$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6471 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6472 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6473 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6474 Xout "echon:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6475 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6476
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6477 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6478 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6479 echomsg "echomsg" . THROW("echomsg-except", 3) F(3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6480 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6481 catch /^echomsg-except$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6482 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6483 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6484 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6485 Xout "echomsg:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6486 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6487
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6488 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6489 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6490 echoerr "echoerr" . THROW("echoerr-except", 4) F(4)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6491 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6492 catch /^echoerr-except$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6493 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6494 catch /Vim/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6495 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6496 catch /echoerr/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6497 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6498 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6499 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6500 Xout "echoerr:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6501 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6502
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6503 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6504 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6505 execute "echo 'execute" . THROW("execute-except", 5) F(5) "'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6506 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6507 catch /^execute-except$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6508 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6509 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6510 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6511 Xout "execute:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6512 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6513
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6514 let expected = "T1T2T3T4T5"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6515 if taken != expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6516 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6517 Xout "'taken' is" taken "instead of" expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6518 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6519
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6520 catch /^0$/ " default return value
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6521 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6522 Xout v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6523 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6524 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6525 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6526 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6527
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6528 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6529
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6530 unlet taken expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6531 delfunction THROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6532 delfunction F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6533
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6534 Xcheck 34886997
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6535
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6537 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6538 " Test 72: :throw across :let or :unlet {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6539 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6540 " On a :let command, an exception might be thrown during evaluation
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6541 " of the expression to assign. On an :let or :unlet command, the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6542 " evaluation of the name of the variable to be assigned or list or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6543 " deleted, respectively, may throw an exception. Any following
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6544 " arguments are not evaluated, then. The exception can be caught by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6545 " the script.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6546 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6547
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6548 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6549
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6550 let throwcount = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6551
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6552 function! THROW(x)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6553 let g:throwcount = g:throwcount + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6554 throw a:x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6555 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6556
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6557 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6558 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6559 let $VAR = "old_value"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6560 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6561 let $VAR = "let(" . THROW("var") . ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6562 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6563 catch /^var$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6564 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6565 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6566 if $VAR != "old_value"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6567 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6568 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6569 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6570
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6571 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6572 let @a = "old_value"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6573 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6574 let @a = "let(" . THROW("reg") . ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6575 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6576 catch /^reg$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6577 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6578 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6579 let @A = "let(" . THROW("REG") . ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6580 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6581 catch /^REG$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6582 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6583 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6584 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6585 if @a != "old_value"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6586 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6587 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6588 if @A != "old_value"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6589 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6590 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6591 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6592
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6593 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6594 let saved_gpath = &g:path
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6595 let saved_lpath = &l:path
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6596 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6597 let &path = "let(" . THROW("opt") . ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6598 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6599 catch /^opt$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6600 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6601 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6602 let &g:path = "let(" . THROW("gopt") . ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6603 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6604 catch /^gopt$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6605 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6606 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6607 let &l:path = "let(" . THROW("lopt") . ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6608 Xpath 65536 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6609 catch /^lopt$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6610 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6611 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6612 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6613 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6614 if &g:path != saved_gpath || &l:path != saved_lpath
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6615 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6616 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6617 let &g:path = saved_gpath
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6618 let &l:path = saved_lpath
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6619 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6620
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6621 unlet! var1 var2 var3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6622
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6623 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6624 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6625 let var1 = "let(" . THROW("var1") . ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6626 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6627 catch /^var1$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6628 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6629 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6630 if exists("var1")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6631 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6632 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6633 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6634
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6635 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6636 let var2 = "old_value"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6637 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6638 let var2 = "let(" . THROW("var2"). ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6639 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6640 catch /^var2$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6641 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6642 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6643 if var2 != "old_value"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6644 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6645 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6646 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6647
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6648 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6649 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6650 let var{THROW("var3")} = 4711
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6651 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6652 catch /^var3$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6653 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6654 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6655
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6656 let addpath = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6657
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6658 function ADDPATH(p)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6659 let g:addpath = g:addpath . a:p
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6660 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6661
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6662 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6663 call ADDPATH("T1")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6664 let var{THROW("var4")} var{ADDPATH("T2")} | call ADDPATH("T3")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6665 call ADDPATH("T4")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6666 catch /^var4$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6667 call ADDPATH("T5")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6668 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6669
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6670 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6671 call ADDPATH("T6")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6672 unlet var{THROW("var5")} var{ADDPATH("T7")} | call ADDPATH("T8")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6673 call ADDPATH("T9")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6674 catch /^var5$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6675 call ADDPATH("T10")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6676 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6677
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6678 if addpath != "T1T5T6T10" || throwcount != 11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6679 throw "addpath: " . addpath . ", throwcount: " . throwcount
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6680 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6681
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6682 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6683
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6684 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6685 " The Xpath command does not accept 2^31 (negative); add explicitly:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6686 let Xpath = Xpath + 2147483648 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6687 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6688 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6689
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6690 unlet! var1 var2 var3 addpath throwcount
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6691 delfunction THROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6692
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6693 Xcheck 1789569365
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6694
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6695
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6696 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6697 " Test 73: :throw across :function, :delfunction {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6698 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6699 " The :function and :delfunction commands may cause an expression
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6700 " specified in braces to be evaluated. During evaluation, an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6701 " exception might be thrown. The exception can be caught by the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6702 " script.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6703 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6704
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6705 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6706
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6707 let taken = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6708
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6709 function! THROW(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6710 let g:taken = g:taken . "T" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6711 throw a:x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6712 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6713
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6714 function! EXPR(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6715 let g:taken = g:taken . "E" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6716 if a:n % 2 == 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6717 call THROW(a:x, a:n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6718 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6719 return 2 - a:n % 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6720 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6721
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6722 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6723 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6724 " Define function.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6725 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6726 function! F0()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6727 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6728 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6729 function! F{EXPR("function-def-ok", 1)}()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6730 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6731 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6732 function! F{EXPR("function-def", 2)}()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6733 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6734 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6735 catch /^function-def-ok$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6736 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6737 catch /^function-def$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6738 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6739 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6740 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6741 Xout "def:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6742 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6743
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6744 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6745 " List function.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6746 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6747 function F0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6748 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6749 function F{EXPR("function-lst-ok", 3)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6750 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6751 function F{EXPR("function-lst", 4)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6752 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6753 catch /^function-lst-ok$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6754 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6755 catch /^function-lst$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6756 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6757 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6758 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6759 Xout "lst:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6760 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6761
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6762 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6763 " Delete function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6764 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6765 delfunction F0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6766 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6767 delfunction F{EXPR("function-del-ok", 5)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6768 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6769 delfunction F{EXPR("function-del", 6)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6770 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6771 catch /^function-del-ok$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6772 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6773 catch /^function-del$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6774 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6775 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6776 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6777 Xout "del:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6778 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6779
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6780 let expected = "E1E2T2E3E4T4E5E6T6"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6781 if taken != expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6782 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6783 Xout "'taken' is" taken "instead of" expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6784 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6785
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6786 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6787 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6788 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6789 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6790
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6791 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6792
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6793 unlet taken expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6794 delfunction THROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6795 delfunction EXPR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6796
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6797 Xcheck 9032615
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6798
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6799
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6800 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
6801 " Test 74: :throw across builtin functions and commands {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6802 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6803 " Some functions like exists(), searchpair() take expression
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6804 " arguments, other functions or commands like substitute() or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6805 " :substitute cause an expression (specified in the regular
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6806 " expression) to be evaluated. During evaluation an exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6807 " might be thrown. The exception can be caught by the script.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6808 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6809
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6810 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6811
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6812 let taken = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6813
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6814 function! THROW(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6815 let g:taken = g:taken . "T" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6816 throw a:x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6817 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6818
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6819 function! EXPR(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6820 let g:taken = g:taken . "E" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6821 call THROW(a:x . a:n, a:n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6822 return "EXPR"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6823 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6825 function! SKIP(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6826 let g:taken = g:taken . "S" . a:n . "(" . line(".")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6827 let theline = getline(".")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6828 if theline =~ "skip"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6829 let g:taken = g:taken . "s)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6830 return 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6831 elseif theline =~ "throw"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6832 let g:taken = g:taken . "t)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6833 call THROW(a:x . a:n, a:n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6834 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6835 let g:taken = g:taken . ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6836 return 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6837 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6838 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6839
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6840 function! SUBST(x, n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6841 let g:taken = g:taken . "U" . a:n . "(" . line(".")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6842 let theline = getline(".")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6843 if theline =~ "not" " SUBST() should not be called for this line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6844 let g:taken = g:taken . "n)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6845 call THROW(a:x . a:n, a:n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6846 elseif theline =~ "throw"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6847 let g:taken = g:taken . "t)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6848 call THROW(a:x . a:n, a:n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6849 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6850 let g:taken = g:taken . ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6851 return "replaced"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6852 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6853 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6854
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6855 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6856 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6857 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6858 let result = exists('*{EXPR("exists", 1)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6859 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6860 catch /^exists1$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6861 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6862 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6863 let result = exists('{EXPR("exists", 2)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6864 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6865 catch /^exists2$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6866 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6867 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6868 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6869 Xout "exists2:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6870 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6871 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6872 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6873 Xout "exists1:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6874 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6875
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6876 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6877 let file = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6878 exec "edit" file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6879 insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6880 begin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6881 xx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6882 middle 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6883 xx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6884 middle 5 skip
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6885 xx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6886 middle 7 throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6887 xx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6888 end
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6889 .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6890 normal! gg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6891 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6892 let result =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6893 \ searchpair("begin", "middle", "end", '', 'SKIP("searchpair", 3)')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6894 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6895 let result =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6896 \ searchpair("begin", "middle", "end", '', 'SKIP("searchpair", 4)')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6897 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6898 let result =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6899 \ searchpair("begin", "middle", "end", '', 'SKIP("searchpair", 5)')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6900 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6901 catch /^searchpair[35]$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6902 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6903 catch /^searchpair4$/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6904 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6905 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6906 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6907 Xout "searchpair:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6908 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6909 bwipeout!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6910 call delete(file)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6911 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6913 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6914 let file = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6915 exec "edit" file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6916 insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6917 subst 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6918 subst 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6919 not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6920 subst 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6921 subst throw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6922 subst 6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6923 .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6924 normal! gg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6925 Xpath 16384 " X: 16384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6926 1,2substitute/subst/\=SUBST("substitute", 6)/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6927 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6928 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6929 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6930 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6931 3substitute/subst/\=SUBST("substitute", 7)/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6932 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6933 if v:errmsg != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6934 " If exceptions are not thrown on errors, fake the error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6935 " exception in order to get the same execution path.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6936 throw "faked Vim(substitute)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6937 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6938 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6939 catch /Vim(substitute)/ " Pattern not found ('e' flag missing)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6940 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6941 3substitute/subst/\=SUBST("substitute", 8)/e
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6942 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6943 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6944 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6945 4,6substitute/subst/\=SUBST("substitute", 9)/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6946 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6947 catch /^substitute[678]/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6948 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6949 catch /^substitute9/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6950 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6951 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6952 bwipeout!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6953 call delete(file)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6954 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6955
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6956 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6957 Xpath 4194304 " X: 4194304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6958 let var = substitute("sub", "sub", '\=THROW("substitute()y", 10)', '')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6959 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6960 catch /substitute()y/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6961 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6962 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6963 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6964 Xout "substitute()y:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6965 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6966
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6967 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6968 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6969 let var = substitute("not", "sub", '\=THROW("substitute()n", 11)', '')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6970 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6971 catch /substitute()n/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6972 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6973 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6974 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6975 Xout "substitute()n:" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6976 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6977
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6978 let expected = "E1T1E2T2S3(3)S4(5s)S4(7t)T4U6(1)U6(2)U9(4)U9(5t)T9T10"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6979 if taken != expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6980 Xpath 1073741824 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6981 Xout "'taken' is" taken "instead of" expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6982 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6983
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6984 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6985 " The Xpath command does not accept 2^31 (negative); add explicitly:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6986 let Xpath = Xpath + 2147483648 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6987 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6988 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6989
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6990 unlet result var taken expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6991 delfunction THROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6992 delfunction EXPR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6993 delfunction SKIP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6994 delfunction SUBST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6995
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6996 Xcheck 224907669
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6997
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6998
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6999 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7000 " Test 75: Errors in builtin functions. {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7001 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7002 " On an error in a builtin function called inside a :try/:endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7003 " region, the evaluation of the expression calling that function and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7004 " the command containing that expression are abandoned. The error can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7005 " be caught as an exception.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7006 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7007 " A simple :call of the builtin function is a trivial case. If the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7008 " builtin function is called in the argument list of another function,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7009 " no further arguments are evaluated, and the other function is not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7010 " executed. If the builtin function is called from the argument of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7011 " a :return command, the :return command is not executed. If the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7012 " builtin function is called from the argument of a :throw command,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7013 " the :throw command is not executed. The evaluation of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7014 " expression calling the builtin function is abandoned.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7015 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7016
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7017 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7018
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7019 function! F1(arg1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7020 Xpath 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7021 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7022
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7023 function! F2(arg1, arg2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7024 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7025 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7026
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7027 function! G()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7028 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7029 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7030
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7031 function! H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7032 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7033 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7034
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7035 function! R()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7036 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7037 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7038 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7039 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7040 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7041 return append(1, "s")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7042 catch /E21/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7043 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7044 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7045 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7046 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7047 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7048 if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7049 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7050 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7051 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7052 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7053 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7054 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7055 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7056
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7057 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7058 set noma " let append() fail with "E21"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7059
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7060 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7061 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7062 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7063 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7064 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7065 call append(1, "s")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7066 catch /E21/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7067 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7068 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7069 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7070 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7071 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7072 if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7073 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7074 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7075 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7076 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7077 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7078
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7079 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7080 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7081 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7082 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7083 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7084 call F1('x' . append(1, "s"))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7085 catch /E21/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7086 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7087 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7088 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7089 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7090 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7091 if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7092 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7093 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7094 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7095 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7096 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7097
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7098 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7099 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7100 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7101 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7102 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7103 call F2('x' . append(1, "s"), G())
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7104 catch /E21/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7105 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7106 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7107 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7108 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7109 Xpath 524288 " X: 524288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7110 if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7111 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7112 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7113 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7114 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7115 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7116
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7117 call R()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7118
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7119 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7120 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7121 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7122 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7123 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7124 throw "T" . append(1, "s")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7125 catch /E21/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7126 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7127 catch /^T.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7128 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7129 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7130 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7131 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7132 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7133 if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7134 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7135 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7136 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7137 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7138 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7139
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7140 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7141 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7142 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7143 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7144 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7145 let x = "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7146 let x = x . "b" . append(1, "s") . H()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7147 catch /E21/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7148 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7149 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7150 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7151 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7152 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7153 if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7154 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7155 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7156 if x == "a"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7157 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7158 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7159 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7160 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7161 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7162 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7163 " The Xpath command does not accept 2^31 (negative); add explicitly:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7164 let Xpath = Xpath + 2147483648 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7165 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7166 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7167 set ma&
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7168 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7169
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7170 unlet! caught x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7171 delfunction F1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7172 delfunction F2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7173 delfunction G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7174 delfunction H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7175 delfunction R
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7176
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7177 Xcheck 2000403408
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7178
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7179
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7180 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
7181 " Test 76: Errors, interrupts, :throw during expression evaluation {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7182 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7183 " When a function call made during expression evaluation is aborted
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7184 " due to an error inside a :try/:endtry region or due to an interrupt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7185 " or a :throw, the expression evaluation is aborted as well. No
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7186 " message is displayed for the cancelled expression evaluation. On an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7187 " error not inside :try/:endtry, the expression evaluation continues.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7188 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7190 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7191
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7192 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7193
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7194 let taken = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7195
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7196 function! ERR(n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7197 let g:taken = g:taken . "E" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7198 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7199 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7201 function! ERRabort(n) abort
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7202 let g:taken = g:taken . "A" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7203 asdf
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7204 endfunction " returns -1; may cause follow-up msg for illegal var/func name
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7205
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7206 function! WRAP(n, arg)
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7207 let g:taken = g:taken . "W" . a:n
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7208 let g:saved_errmsg = v:errmsg
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7209 return arg
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7210 endfunction
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7211
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7212 function! INT(n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7213 let g:taken = g:taken . "I" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7214 "INTERRUPT9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7215 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7216 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7217
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7218 function! THR(n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7219 let g:taken = g:taken . "T" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7220 throw "should not be caught"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7221 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7222
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7223 function! CONT(n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7224 let g:taken = g:taken . "C" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7225 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7226
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7227 function! MSG(n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7228 let g:taken = g:taken . "M" . a:n
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7229 let errmsg = (a:n >= 37 && a:n <= 44) ? g:saved_errmsg : v:errmsg
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7230 let msgptn = (a:n >= 10 && a:n <= 27) ? "^$" : "asdf"
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7231 if errmsg !~ msgptn
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7232 let g:taken = g:taken . "x"
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7233 Xout "Expr" a:n.": Unexpected message:" v:errmsg
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7234 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7235 let v:errmsg = ""
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7236 let g:saved_errmsg = ""
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7237 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7238
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7239 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7240
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7241 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7242 let t = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7243 XloopINIT 1 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7244 while t <= 9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7245 Xloop 1 " X: 511
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7246 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7247 if t == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7248 let v{ERR(t) + CONT(t)} = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7249 elseif t == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7250 let v{ERR(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7251 elseif t == 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7252 let var = exists('v{ERR(t) + CONT(t)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7253 elseif t == 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7254 unlet v{ERR(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7255 elseif t == 5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7256 function F{ERR(t) + CONT(t)}()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7257 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7258 elseif t == 6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7259 function F{ERR(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7260 elseif t == 7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7261 let var = exists('*F{ERR(t) + CONT(t)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7262 elseif t == 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7263 delfunction F{ERR(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7264 elseif t == 9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7265 let var = ERR(t) + CONT(t)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7266 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7267 catch /asdf/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7268 " v:errmsg is not set when the error message is converted to an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7269 " exception. Set it to the original error message.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7270 let v:errmsg = substitute(v:exception, '^Vim:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7271 catch /^Vim\((\a\+)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7272 " An error exception has been thrown after the original error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7273 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7274 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7275 call MSG(t)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7276 let t = t + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7277 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7278 continue " discard an aborting error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7279 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7280 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7281 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7282 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7283 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7284 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7285
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7286 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7287 let t = 10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7288 XloopINIT 1024 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7289 while t <= 18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7290 Xloop 1 " X: 1024 * 511
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7291 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7292 if t == 10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7293 let v{INT(t) + CONT(t)} = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7294 elseif t == 11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7295 let v{INT(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7296 elseif t == 12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7297 let var = exists('v{INT(t) + CONT(t)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7298 elseif t == 13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7299 unlet v{INT(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7300 elseif t == 14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7301 function F{INT(t) + CONT(t)}()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7302 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7303 elseif t == 15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7304 function F{INT(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7305 elseif t == 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7306 let var = exists('*F{INT(t) + CONT(t)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7307 elseif t == 17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7308 delfunction F{INT(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7309 elseif t == 18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7310 let var = INT(t) + CONT(t)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7311 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7312 catch /^Vim\((\a\+)\)\=:\(Interrupt\)\@!/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7313 " An error exception has been triggered after the interrupt.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7314 let v:errmsg = substitute(v:exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7315 \ '^Vim\((\a\+)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7316 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7317 call MSG(t)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7318 let t = t + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7319 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7320 continue " discard interrupt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7321 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7322 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7323 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7324 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7325 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7326 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7327
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7328 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7329 let t = 19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7330 XloopINIT 1048576 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7331 while t <= 27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7332 Xloop 1 " X: 1048576 * 511
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7333 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7334 if t == 19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7335 let v{THR(t) + CONT(t)} = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7336 elseif t == 20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7337 let v{THR(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7338 elseif t == 21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7339 let var = exists('v{THR(t) + CONT(t)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7340 elseif t == 22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7341 unlet v{THR(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7342 elseif t == 23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7343 function F{THR(t) + CONT(t)}()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7344 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7345 elseif t == 24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7346 function F{THR(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7347 elseif t == 25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7348 let var = exists('*F{THR(t) + CONT(t)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7349 elseif t == 26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7350 delfunction F{THR(t) + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7351 elseif t == 27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7352 let var = THR(t) + CONT(t)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7353 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7354 catch /^Vim\((\a\+)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7355 " An error exception has been triggered after the :throw.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7356 let v:errmsg = substitute(v:exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7357 \ '^Vim\((\a\+)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7358 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7359 call MSG(t)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7360 let t = t + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7361 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7362 continue " discard exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7363 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7364 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7365 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7366 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7367 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7368 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7369
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7370 let v{ERR(28) + CONT(28)} = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7371 call MSG(28)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7372 let v{ERR(29) + CONT(29)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7373 call MSG(29)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7374 let var = exists('v{ERR(30) + CONT(30)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7375 call MSG(30)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7376 unlet v{ERR(31) + CONT(31)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7377 call MSG(31)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7378 function F{ERR(32) + CONT(32)}()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7379 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7380 call MSG(32)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7381 function F{ERR(33) + CONT(33)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7382 call MSG(33)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7383 let var = exists('*F{ERR(34) + CONT(34)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7384 call MSG(34)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7385 delfunction F{ERR(35) + CONT(35)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7386 call MSG(35)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7387 let var = ERR(36) + CONT(36)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7388 call MSG(36)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7389
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7390 let saved_errmsg = ""
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7391
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7392 let v{WRAP(37, ERRabort(37)) + CONT(37)} = 0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7393 call MSG(37)
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7394 let v{WRAP(38, ERRabort(38)) + CONT(38)}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7395 call MSG(38)
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7396 let var = exists('v{WRAP(39, ERRabort(39)) + CONT(39)}')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7397 call MSG(39)
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7398 unlet v{WRAP(40, ERRabort(40)) + CONT(40)}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7399 call MSG(40)
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7400 function F{WRAP(41, ERRabort(41)) + CONT(41)}()
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7401 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7402 call MSG(41)
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7403 function F{WRAP(42, ERRabort(42)) + CONT(42)}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7404 call MSG(42)
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7405 let var = exists('*F{WRAP(43, ERRabort(43)) + CONT(43)}')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7406 call MSG(43)
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7407 delfunction F{WRAP(44, ERRabort(44)) + CONT(44)}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7408 call MSG(44)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7409 let var = ERRabort(45) + CONT(45)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7410 call MSG(45)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7411
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7412 Xpath 1073741824 " X: 1073741824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7413
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7414 let expected = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7415 \ . "E1M1E2M2E3M3E4M4E5M5E6M6E7M7E8M8E9M9"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7416 \ . "I10M10I11M11I12M12I13M13I14M14I15M15I16M16I17M17I18M18"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7417 \ . "T19M19T20M20T21M21T22M22T23M23T24M24T25M25T26M26T27M27"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7418 \ . "E28C28M28E29C29M29E30C30M30E31C31M31E32C32M32E33C33M33"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7419 \ . "E34C34M34E35C35M35E36C36M36"
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7420 \ . "A37W37C37M37A38W38C38M38A39W39C39M39A40W40C40M40A41W41C41M41"
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7421 \ . "A42W42C42M42A43W43C43M43A44W44C44M44A45C45M45"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7422
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7423 if taken != expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7424 " The Xpath command does not accept 2^31 (negative); display explicitly:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7425 exec "!echo 2147483648 >>" . g:ExtraVimResult
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7426 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7427 Xout "'taken' is" taken "instead of" expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7428 if substitute(taken,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7429 \ '\(.*\)E3C3M3x\(.*\)E30C30M30x\(.*\)A39C39M39x\(.*\)',
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7430 \ '\1E3M3\2E30C30M30\3A39C39M39\4',
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7431 \ "") == expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7432 Xout "Is ++emsg_skip for var with expr_start non-NULL"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7433 \ "in f_exists ok?"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7434 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7435 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7436
341
b516a9f9d603 updated for version 7.0088
vimboss
parents: 336
diff changeset
7437 unlet! v var saved_errmsg taken expected
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7438 call delete(WA_t5)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7439 call delete(WA_t14)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7440 call delete(WA_t23)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7441 unlet! WA_t5 WA_t14 WA_t23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7442 delfunction WA_t5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7443 delfunction WA_t14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7444 delfunction WA_t23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7445
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7446 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7447
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7448 Xcheck 1610087935
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7449
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7450
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7451 "-------------------------------------------------------------------------------
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
7452 " Test 77: Errors, interrupts, :throw in name{brace-expression} {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7453 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7454 " When a function call made during evaluation of an expression in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7455 " braces as part of a function name after ":function" is aborted due
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7456 " to an error inside a :try/:endtry region or due to an interrupt or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7457 " a :throw, the expression evaluation is aborted as well, and the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7458 " function definition is ignored, skipping all commands to the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7459 " ":endfunction". On an error not inside :try/:endtry, the expression
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7460 " evaluation continues and the function gets defined, and can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7461 " called and deleted.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7462 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7463
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7464 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7465
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7466 XloopINIT 1 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7467
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7468 function! ERR() abort
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7469 Xloop 1 " X: 1 + 4 + 16 + 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7470 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7471 endfunction " returns -1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7472
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7473 function! OK()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7474 Xloop 2 " X: 2 * (1 + 4 + 16)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7475 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7476 return 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7477 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7478
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7479 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7480
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7481 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7482 function! F{1 + ERR() + OK()}(arg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7483 " F0 should be defined.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7484 if exists("a:arg") && a:arg == "calling"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7485 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7486 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7487 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7488 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7489 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7490 if v:errmsg != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7491 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7492 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7493 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7494
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7495 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7496 call F{1 + ERR() + OK()}("calling")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7497 if v:errmsg != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7498 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7499 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7500 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7501
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7502 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7503 delfunction F{1 + ERR() + OK()}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7504 if v:errmsg != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7505 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7506 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7507 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7509 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7510 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7511 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7512 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7513 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7514 function! G{1 + ERR() + OK()}(arg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7515 " G0 should not be defined, and the function body should be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7516 " skipped.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7517 if exists("a:arg") && a:arg == "calling"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7518 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7519 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7520 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7521 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7522 " Use an unmatched ":finally" to check whether the body is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7523 " skipped when an error occurs in ERR(). This works whether or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7524 " not the exception is converted to an exception.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7525 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7526 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7527 Xout "Body of G{1 + ERR() + OK()}() not skipped"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7528 " Discard the aborting error or exception, and break the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7529 " while loop.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7530 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7531 " End the try conditional and start a new one to avoid
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7532 " ":catch after :finally" errors.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7533 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7534 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7535 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7536 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7537
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7538 " When the function was not defined, this won't be reached - whether
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7539 " the body was skipped or not. When the function was defined, it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7540 " can be called and deleted here.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7541 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7542 Xout "G0() has been defined"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7543 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7544 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7545 call G{1 + ERR() + OK()}("calling")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7546 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7547 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7548 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7549 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7550 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7551 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7552 delfunction G{1 + ERR() + OK()}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7553 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7554 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7555 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7556 catch /asdf/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7557 " Jumped to when the function is not defined and the body is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7558 " skipped.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7559 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7560 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7561 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7562 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7563 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7564 Xpath 1073741824 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7565 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7566 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7567 endtry " jumped to when the body is not skipped
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7568 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7569 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7570 " The Xpath command does not accept 2^31 (negative); add explicitly:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7571 let Xpath = Xpath + 2147483648 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7572 Xout "Body of G{1 + ERR() + OK()}() not skipped, exception caught"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7573 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7574 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7575
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7576 Xcheck 1388671
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7577
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7578
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7579 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7580 " Test 78: Messages on parsing errors in expression evaluation {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7581 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7582 " When an expression evaluation detects a parsing error, an error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7583 " message is given and converted to an exception, and the expression
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7584 " evaluation is aborted.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7585 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7586
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7587 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7588
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7589 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7590
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7591 let taken = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7592
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7593 function! F(n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7594 let g:taken = g:taken . "F" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7595 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7596
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7597 function! MSG(n, enr, emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7598 let g:taken = g:taken . "M" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7599 let english = v:lang == "C" || v:lang =~ '^[Ee]n'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7600 if a:enr == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7601 Xout "TODO: Add message number for:" a:emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7602 let v:errmsg = ":" . v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7603 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7604 if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7605 if v:errmsg == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7606 Xout "Expr" a:n.": Message missing."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7607 let g:taken = g:taken . "x"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7608 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7609 let v:errmsg = escape(v:errmsg, '"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7610 Xout "Expr" a:n.": Unexpected message:" v:errmsg
119
e8f07016e34d updated for version 7.0042
vimboss
parents: 108
diff changeset
7611 Xout "Expected: " . a:enr . ': ' . a:emsg
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7612 let g:taken = g:taken . "X"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7613 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7614 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7615 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7616
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7617 function! CONT(n)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7618 let g:taken = g:taken . "C" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7619 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7620
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7621 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7622 XloopINIT 1 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7623
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7624 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7625 let t = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7626 while t <= 14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7627 let g:taken = g:taken . "T" . t
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7628 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7629 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7630 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7631 if t == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7632 let v{novar + CONT(t)} = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7633 elseif t == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7634 let v{novar + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7635 elseif t == 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7636 let var = exists('v{novar + CONT(t)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7637 elseif t == 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7638 unlet v{novar + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7639 elseif t == 5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7640 function F{novar + CONT(t)}()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7641 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7642 elseif t == 6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7643 function F{novar + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7644 elseif t == 7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7645 let var = exists('*F{novar + CONT(t)}')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7646 elseif t == 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7647 delfunction F{novar + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7648 elseif t == 9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7649 echo novar + CONT(t)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7650 elseif t == 10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7651 echo v{novar + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7652 elseif t == 11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7653 echo F{novar + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7654 elseif t == 12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7655 let var = novar + CONT(t)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7656 elseif t == 13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7657 let var = v{novar + CONT(t)}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7658 elseif t == 14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7659 let var = F{novar + CONT(t)}()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7660 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7661 catch /^Vim\((\a\+)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7662 " v:errmsg is not set when the error message is converted to an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7663 " exception. Set it to the original error message.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7664 let v:errmsg = substitute(v:exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7665 \ '^Vim\((\a\+)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7666 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7667 finally
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
7668 if t <= 8 && t != 3 && t != 7
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
7669 call MSG(t, 'E475', 'Invalid argument\>')
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
7670 else
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
7671 if !caught " no error exceptions ($VIMNOERRTHROW set)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7672 call MSG(t, 'E15', "Invalid expression")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7673 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7674 call MSG(t, 'E121', "Undefined variable")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7675 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7676 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7677 let t = t + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7678 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7679 continue " discard an aborting error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7680 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7681 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7682 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7683 Xloop 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7684 Xout t.":" v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7685 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7686
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7687 function! T(n, expr, enr, emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7688 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7689 let g:taken = g:taken . "T" . a:n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7690 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7691 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7692 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7693 execute "let var = " . a:expr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7694 catch /^Vim\((\a\+)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7695 " v:errmsg is not set when the error message is converted to an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7696 " exception. Set it to the original error message.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7697 let v:errmsg = substitute(v:exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7698 \ '^Vim\((\a\+)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7699 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7700 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7701 if !caught " no error exceptions ($VIMNOERRTHROW set)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7702 call MSG(a:n, 'E15', "Invalid expression")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7703 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7704 call MSG(a:n, a:enr, a:emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7705 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7706 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7707 " Discard an aborting error:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7708 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7709 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7710 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7711 Xloop 1 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7712 Xout a:n.":" v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7713 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7714 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7715
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7716 call T(15, 'Nofunc() + CONT(15)', 'E117', "Unknown function")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7717 call T(16, 'F(1 2 + CONT(16))', 'E116', "Invalid arguments")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7718 call T(17, 'F(1, 2) + CONT(17)', 'E118', "Too many arguments")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7719 call T(18, 'F() + CONT(18)', 'E119', "Not enough arguments")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7720 call T(19, '{(1} + CONT(19)', 'E110', "Missing ')'")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7721 call T(20, '("abc"[1) + CONT(20)', 'E111', "Missing ']'")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7722 call T(21, '(1 +) + CONT(21)', 'E15', "Invalid expression")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7723 call T(22, '1 2 + CONT(22)', 'E15', "Invalid expression")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7724 call T(23, '(1 ? 2) + CONT(23)', 'E109', "Missing ':' after '?'")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7725 call T(24, '("abc) + CONT(24)', 'E114', "Missing quote")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7726 call T(25, "('abc) + CONT(25)", 'E115', "Missing quote")
102
0aa0e89bfd5f updated for version 7.0039
vimboss
parents: 95
diff changeset
7727 call T(26, '& + CONT(26)', 'E112', "Option name missing")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7728 call T(27, '&asdf + CONT(27)', 'E113', "Unknown option")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7729
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7730 Xpath 134217728 " X: 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7731
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7732 let expected = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7733 \ . "T1M1T2M2T3M3T4M4T5M5T6M6T7M7T8M8T9M9T10M10T11M11T12M12T13M13T14M14"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7734 \ . "T15M15T16M16T17M17T18M18T19M19T20M20T21M21T22M22T23M23T24M24T25M25"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7735 \ . "T26M26T27M27"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7736
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7737 if taken != expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7738 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7739 Xout "'taken' is" taken "instead of" expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7740 if substitute(taken, '\(.*\)T3M3x\(.*\)', '\1T3M3\2', "") == expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7741 Xout "Is ++emsg_skip for var with expr_start non-NULL"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7742 \ "in f_exists ok?"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7743 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7744 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7745
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7746 unlet! var caught taken expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7747 call delete(WA_t5)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7748 unlet! WA_t5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7749 delfunction WA_t5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7750
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7751 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7752
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7753 Xcheck 134217728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7754
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7755
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7756 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7757 " Test 79: Throwing one of several errors for the same command {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7758 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7759 " When several errors appear in a row (for instance during expression
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7760 " evaluation), the first as the most specific one is used when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7761 " throwing an error exception. If, however, a syntax error is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7762 " detected afterwards, this one is used for the error exception.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7763 " On a syntax error, the next command is not executed, on a normal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7764 " error, however, it is (relevant only in a function without the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7765 " "abort" flag). v:errmsg is not set.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7766 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7767 " If throwing error exceptions is configured off, v:errmsg is always
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7768 " set to the latest error message, that is, to the more general
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7769 " message or the syntax error, respectively.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7770 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7771
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7772 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7773
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7774 XloopINIT 1 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7775
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7776 function! NEXT(cmd)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7777 exec a:cmd . " | Xloop 1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7778 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7779
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7780 call NEXT('echo novar') " X: 1 * 1 (checks nextcmd)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7781 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7782 call NEXT('let novar #') " X: 0 * 2 (skips nextcmd)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7783 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7784 call NEXT('unlet novar #') " X: 0 * 4 (skips nextcmd)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7785 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7786 call NEXT('let {novar}') " X: 0 * 8 (skips nextcmd)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7787 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7788 call NEXT('unlet{ novar}') " X: 0 * 16 (skips nextcmd)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7789
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7790 function! EXEC(cmd)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7791 exec a:cmd
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7792 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7793
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7794 function! MATCH(expected, msg, enr, emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7795 let msg = a:msg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7796 if a:enr == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7797 Xout "TODO: Add message number for:" a:emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7798 let msg = ":" . msg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7799 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7800 let english = v:lang == "C" || v:lang =~ '^[Ee]n'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7801 if msg !~ '^'.a:enr.':' || (english && msg !~ a:emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7802 let match = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7803 if a:expected " no match although expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7804 if a:msg == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7805 Xout "Message missing."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7806 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7807 let msg = escape(msg, '"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7808 Xout "Unexpected message:" msg
108
375b1d0f97b0 updated for version 7.0040
vimboss
parents: 102
diff changeset
7809 Xout "Expected:" a:enr . ": " . a:emsg
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7810 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7811 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7812 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7813 let match = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7814 if !a:expected " match although not expected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7815 let msg = escape(msg, '"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7816 Xout "Unexpected message:" msg
108
375b1d0f97b0 updated for version 7.0040
vimboss
parents: 102
diff changeset
7817 Xout "Expected none."
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7818 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7819 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7820 return match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7821 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7822
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7823 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7824
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7825 while 1 " dummy loop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7826 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7827 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7828 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7829 let thrmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7830 call EXEC('echo novar') " normal error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7831 catch /^Vim\((\a\+)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7832 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7833 let thrmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7834 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7835 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7836 if !caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7837 if !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7838 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7839 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7840 elseif !MATCH(1, thrmsg, 'E121', "Undefined variable")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7841 \ || v:errmsg != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7842 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7843 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7844 if !caught && !MATCH(1, v:errmsg, 'E15', "Invalid expression")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7845 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7846 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7847 break " discard error if $VIMNOERRTHROW == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7848 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7849 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7850
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7851 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7852 let cmd = "let"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7853 XloopINIT 1024 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7854 while cmd != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7855 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7856 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7857 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7858 let thrmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7859 call EXEC(cmd . ' novar #') " normal plus syntax error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7860 catch /^Vim\((\a\+)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7861 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7862 let thrmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7863 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7864 Xloop 1 " X: 1024 * (1 + 32)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7865 if !caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7866 if !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7867 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7868 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7869 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7870 if cmd == "let"
2591
88095f75d63b updated for version 7.3.015
Bram Moolenaar <bram@vim.org>
parents: 849
diff changeset
7871 let match = MATCH(0, thrmsg, 'E121', "Undefined variable")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7872 elseif cmd == "unlet"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7873 let match = MATCH(0, thrmsg, 'E108', "No such variable")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7874 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7875 if match " normal error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7876 Xloop 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7877 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7878 if !MATCH(1, thrmsg, 'E488', "Trailing characters")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7879 \|| v:errmsg != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7880 " syntax error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7881 Xloop 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7882 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7883 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7884 if !caught && !MATCH(1, v:errmsg, 'E488', "Trailing characters")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7885 " last error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7886 Xloop 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7887 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7888 if cmd == "let"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7889 let cmd = "unlet"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7890 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7891 let cmd = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7892 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7893 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7894 continue " discard error if $VIMNOERRTHROW == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7895 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7896 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7897
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7898 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7899 let cmd = "let"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7900 XloopINIT 2097152 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7901 while cmd != ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7902 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7903 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7904 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7905 let thrmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7906 call EXEC(cmd . ' {novar}') " normal plus syntax error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7907 catch /^Vim\((\a\+)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7908 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7909 let thrmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7910 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7911 Xloop 1 " X: 2097152 * (1 + 32)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7912 if !caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7913 if !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7914 Xloop 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7915 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7916 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7917 if MATCH(0, thrmsg, 'E121', "Undefined variable") " normal error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7918 Xloop 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7919 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7920 if !MATCH(1, thrmsg, 'E475', 'Invalid argument\>')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7921 \ || v:errmsg != "" " syntax error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7922 Xloop 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7923 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7924 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7925 if !caught && !MATCH(1, v:errmsg, 'E475', 'Invalid argument\>')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7926 " last error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7927 Xloop 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7928 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7929 if cmd == "let"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7930 let cmd = "unlet"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7931 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7932 let cmd = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7933 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7934 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7935 continue " discard error if $VIMNOERRTHROW == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7936 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7937 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7938
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7939 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7940 " The Xpath command does not accept 2^31 (negative); add explicitly:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7941 let Xpath = Xpath + 2147483648 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7942 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7943 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7944
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7945 unlet! next_command thrmsg match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7946 delfunction NEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7947 delfunction EXEC
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7948 delfunction MATCH
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7949
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7950 Xcheck 70288929
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7951
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7952
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7953 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7954 " Test 80: Syntax error in expression for illegal :elseif {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7955 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7956 " If there is a syntax error in the expression after an illegal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7957 " :elseif, an error message is given (or an error exception thrown)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7958 " for the illegal :elseif rather than the expression error.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7959 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7960
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7961 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7962
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7963 function! MSG(enr, emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7964 let english = v:lang == "C" || v:lang =~ '^[Ee]n'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7965 if a:enr == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7966 Xout "TODO: Add message number for:" a:emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7967 let v:errmsg = ":" . v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7968 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7969 let match = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7970 if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7971 let match = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7972 if v:errmsg == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7973 Xout "Message missing."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7974 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7975 let v:errmsg = escape(v:errmsg, '"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7976 Xout "Unexpected message:" v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7977 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7978 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7979 return match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7980 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7981
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7982 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7983 if 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7984 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7985 elseif 1 ||| 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7986 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7987 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7988 if !MSG('E584', ":elseif after :else")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7989 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7990 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7991
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7992 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7993 if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7994 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7995 elseif 1 ||| 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7996 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7997 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7998 if !MSG('E584', ":elseif after :else")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7999 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8000 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8001
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8002 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8003 elseif 1 ||| 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8004 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8005 if !MSG('E582', ":elseif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8006 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8007 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8008
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8009 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8010 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8011 elseif 1 ||| 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8012 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8013 Xpath 64 " X: 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8014 if !MSG('E582', ":elseif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8015 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8016 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8017
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8018 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8019 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8020 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8021 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8022 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8023 if 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8024 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8025 elseif 1 ||| 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8026 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8027 catch /^Vim\((\a\+)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8028 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8029 let v:errmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8030 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8031 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8032 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8033 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8034 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8035 if !MSG('E584', ":elseif after :else")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8036 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8037 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8038 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8039 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8040 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8041 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8042 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8043 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8044 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8045 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8046
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8047 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8048 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8049 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8050 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8051 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8052 if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8053 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8054 elseif 1 ||| 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8055 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8056 catch /^Vim\((\a\+)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8057 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8058 let v:errmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8059 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8060 Xpath 4096 " X: 4096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8061 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8062 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8063 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8064 if !MSG('E584', ":elseif after :else")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8065 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8066 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8067 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8068 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8069 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8070 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8071 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8072 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8073 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8074 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8075
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8076 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8077 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8078 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8079 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8080 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8081 elseif 1 ||| 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8082 catch /^Vim\((\a\+)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8083 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8084 let v:errmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8085 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8086 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8087 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8088 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8089 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8090 if !MSG('E582', ":elseif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8091 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8092 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8093 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8094 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8095 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8096 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8097 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8098 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8099 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8100 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8101
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8102 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8103 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8104 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8105 let v:errmsg = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8106 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8107 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8108 elseif 1 ||| 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8109 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8110 catch /^Vim\((\a\+)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8111 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8112 let v:errmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8113 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8114 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8115 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8116 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8117 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8118 if !MSG('E582', ":elseif without :if")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8119 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8120 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8121 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8122 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8123 Xpath 8388608 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8124 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8125 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8126 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8127 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8128 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8129
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8130 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8131
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8132 unlet! caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8133 delfunction MSG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8135 Xcheck 17895765
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8137
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8138 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8139 " Test 81: Discarding exceptions after an error or interrupt {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8140 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8141 " When an exception is thrown from inside a :try conditional without
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8142 " :catch and :finally clauses and an error or interrupt occurs before
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8143 " the :endtry is reached, the exception is discarded.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8144 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8145
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8146 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8147
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8148 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8149 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8150 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8151 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8152 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8153 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8154 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8155 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8156 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8157 " error after :throw: missing :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8158 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8159 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8160 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8161 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8162 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8163 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8164 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8165
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8166 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8167 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8168 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8169 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8170 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8171 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8172 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8173 endtry " INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8174 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8175 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8176 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8177 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8178 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8179 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8180
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8181 Xcheck 387
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8182
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8183
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8184 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8185 " Test 82: Ignoring :catch clauses after an error or interrupt {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8186 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8187 " When an exception is thrown and an error or interrupt occurs before
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8188 " the matching :catch clause is reached, the exception is discarded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8189 " and the :catch clause is ignored (also for the error or interrupt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8190 " exception being thrown then).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8191 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8193 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8194
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8195 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8196 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8197 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8198 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8199 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8200 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8201 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8202 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8203 " error after :throw: missing :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8204 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8205 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8206 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8207 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8208 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8209 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8210 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8211 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8212 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8213 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8214 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8215 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8216 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8217
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8218 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8219 function! E()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8220 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8221 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8222 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8223 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8224 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8225 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8226 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8227 " error after :throw: missing :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8228 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8229 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8230 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8231 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8232 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8233 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8234 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8235 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8236 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8237 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8238 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8239 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8240
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8241 call E()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8242 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8243 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8244
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8245 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8246 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8247 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8248 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8249 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8250 Xpath 131072 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8251 catch /.*/ "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8252 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8253 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8254 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8255 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8256 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8257 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8258 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8259 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8260 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8261 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8262 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8263 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8264
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8265 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8266 function I()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8267 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8268 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8269 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8270 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8271 Xpath 16777216 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8272 catch /.*/ "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8273 Xpath 33554432 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8274 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8275 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8276 Xpath 67108864 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8277 Xout v:exception "in" ExtraVimThrowpoint()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8278 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8279 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8280 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8281 Xpath 268435456 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8282 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8283 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8284
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8285 call I()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8286 Xpath 536870912 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8287 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8289 Xcheck 8454401
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8290
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8291
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8292 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8293 " Test 83: Executing :finally clauses after an error or interrupt {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8294 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8295 " When an exception is thrown and an error or interrupt occurs before
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8296 " the :finally of the innermost :try is reached, the exception is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8297 " discarded and the :finally clause is executed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8298 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8299
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8300 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8301
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8302 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8303 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8304 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8305 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8306 Xpath 2 " X: 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8307 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8308 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8309 " if 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8310 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8311 " error after :throw: missing :endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8312 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8313 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8314 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8315 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8316 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8317 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8318 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8319 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8320 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8321
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8322 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8323 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8324 Xpath 256 " X: 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8325 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8326 Xpath 512 " X: 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8327 throw "arrgh"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8328 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8329 finally "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8330 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8331 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8332 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8333 catch /arrgh/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8334 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8335 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8336 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8337 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8338
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8339 Xcheck 2835
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8340
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8341
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8342 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8343 " Test 84: Exceptions in autocommand sequences. {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8344 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8345 " When an exception occurs in a sequence of autocommands for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8346 " a specific event, the rest of the sequence is not executed. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8347 " command that triggered the autocommand execution aborts, and the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8348 " exception is propagated to the caller.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8349 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8350 " For the FuncUndefined event under a function call expression or
303
6a21eb563c34 updated for version 7.0080
vimboss
parents: 270
diff changeset
8351 " :call command, the function is not executed, even when it has
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8352 " been defined by the autocommands before the exception occurred.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8353 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8354
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8355 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8356
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8357 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8358
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8359 function! INT()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8360 "INTERRUPT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8361 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8362 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8363
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8364 aug TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8365 autocmd!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8366
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8367 autocmd User x1 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8368 autocmd User x1 throw "x1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8369 autocmd User x1 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8370
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8371 autocmd User x2 Xpath 4 " X: 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8372 autocmd User x2 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8373 autocmd User x2 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8374
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8375 autocmd User x3 Xpath 16 " X: 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8376 autocmd User x3 call INT()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8377 autocmd User x3 Xpath 32 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8378
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8379 autocmd FuncUndefined U1 function! U1()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8380 autocmd FuncUndefined U1 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8381 autocmd FuncUndefined U1 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8382 autocmd FuncUndefined U1 Xpath 128 " X: 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8383 autocmd FuncUndefined U1 throw "U1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8384 autocmd FuncUndefined U1 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8385
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8386 autocmd FuncUndefined U2 function! U2()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8387 autocmd FuncUndefined U2 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8388 autocmd FuncUndefined U2 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8389 autocmd FuncUndefined U2 Xpath 1024 " X: 1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8390 autocmd FuncUndefined U2 ASDF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8391 autocmd FuncUndefined U2 Xpath 2048 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8392
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8393 autocmd FuncUndefined U3 function! U3()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8394 autocmd FuncUndefined U3 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8395 autocmd FuncUndefined U3 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8396 autocmd FuncUndefined U3 Xpath 8192 " X: 8192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8397 autocmd FuncUndefined U3 call INT()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8398 autocmd FuncUndefined U3 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8399 aug END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8400
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8401 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8402 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8403 Xpath 32768 " X: 32768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8404 doautocmd User x1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8405 catch /x1/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8406 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8407 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8408
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8409 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8410 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8411 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8412 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8413 doautocmd User x2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8414 catch /asdf/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8415 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8416 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8417 Xpath 262144 " X: 262144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8418 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8419 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8420 " Propagate uncaught error exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8421 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8422 " ... but break loop for caught error exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8423 " or discard error and break loop if $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8424 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8425 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8426 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8427 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8428
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8429 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8430 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8431 Xpath 1048576 " X: 1048576
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8432 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8433 doautocmd User x3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8434 catch /Vim:Interrupt/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8435 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8436 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8437 Xpath 2097152 " X: 2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8438 if !caught && !$VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8439 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8440 " Propagate uncaught interrupt exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8441 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8442 " ... but break loop for caught interrupt exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8443 " or discard interrupt and break loop if $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8444 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8445 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8446 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8447 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8448
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8449 if exists("*U1") | delfunction U1 | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8450 if exists("*U2") | delfunction U2 | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8451 if exists("*U3") | delfunction U3 | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8452
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8453 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8454 Xpath 8388608 " X: 8388608
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8455 call U1()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8456 catch /U1/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8457 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8458 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8459
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8460 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8461 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8462 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8463 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8464 call U2()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8465 catch /ASDF/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8466 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8467 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8468 Xpath 67108864 " X: 67108864
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8469 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8470 Xpath 134217728 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8471 " Propagate uncaught error exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8472 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8473 " ... but break loop for caught error exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8474 " or discard error and break loop if $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8475 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8476 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8477 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8478 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8479
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8480 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8481 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8482 Xpath 268435456 " X: 268435456
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8483 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8484 call U3()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8485 catch /Vim:Interrupt/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8486 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8487 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8488 Xpath 536870912 " X: 536870912
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8489 if !caught && !$VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8490 Xpath 1073741824 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8491 " Propagate uncaught interrupt exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8492 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8493 " ... but break loop for caught interrupt exception,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8494 " or discard interrupt and break loop if $VIMNOINTTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8495 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8496 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8497 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8498 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8499 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8500 " The Xpath command does not accept 2^31 (negative); display explicitly:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8501 exec "!echo 2147483648 >>" . g:ExtraVimResult
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8502 Xout "Caught" v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8503 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8504
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8505 unlet caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8506 delfunction INT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8507 delfunction U1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8508 delfunction U2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8509 delfunction U3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8510 au! TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8511 aug! TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8512 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8513
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8514 Xcheck 934782101
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8515
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8516
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8517 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8518 " Test 85: Error exceptions in autocommands for I/O command events {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8519 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8520 " When an I/O command is inside :try/:endtry, autocommands to be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8521 " executed after it should be skipped on an error (exception) in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8522 " command itself or in autocommands to be executed before the command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8523 " In the latter case, the I/O command should not be executed either.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8524 " Example 1: BufWritePre, :write, BufWritePost
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8525 " Example 2: FileReadPre, :read, FileReadPost.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8526 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8527
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8528 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8529
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8530 function! MSG(enr, emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8531 let english = v:lang == "C" || v:lang =~ '^[Ee]n'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8532 if a:enr == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8533 Xout "TODO: Add message number for:" a:emsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8534 let v:errmsg = ":" . v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8535 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8536 let match = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8537 if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8538 let match = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8539 if v:errmsg == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8540 Xout "Message missing."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8541 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8542 let v:errmsg = escape(v:errmsg, '"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8543 Xout "Unexpected message:" v:errmsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8544 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8545 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8546 return match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8547 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8548
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8549 " Remove the autocommands for the events specified as arguments in all used
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8550 " autogroups.
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 10942
diff changeset
8551 function Delete_autocommands(...)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8552 let augfile = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8553 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8554 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8555 exec "redir >" . augfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8556 aug
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8557 redir END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8558 exec "edit" augfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8559 g/^$/d
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8560 norm G$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8561 let wrap = "w"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8562 while search('\%( \|^\)\@<=.\{-}\%( \)\@=', wrap) > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8563 let wrap = "W"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8564 exec "norm y/ \n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8565 let argno = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8566 while argno <= a:0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8567 exec "au!" escape(@", " ") a:{argno}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8568 let argno = argno + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8569 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8570 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8571 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8572 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8573 bwipeout!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8574 call delete(augfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8575 break " discard errors for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8576 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8577 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8578 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8579
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8580 call Delete_autocommands("BufWritePre", "BufWritePost")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8581
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8582 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8583 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8584 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8585 let post = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8586 aug TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8587 au! BufWritePost * let post = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8588 aug END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8589 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8590 write /n/o/n/e/x/i/s/t/e/n/t
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8591 catch /^Vim(write):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8592 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8593 let v:errmsg = substitute(v:exception, '^Vim(write):', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8594 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8595 Xpath 1 " X: 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8596 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8597 Xpath 2 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8598 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8599 let v:errmsg = substitute(v:errmsg, '^"/n/o/n/e/x/i/s/t/e/n/t" ',
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8600 \ '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8601 if !MSG('E212', "Can't open file for writing")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8602 Xpath 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8603 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8604 if post
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8605 Xpath 8 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8606 Xout "BufWritePost commands executed after write error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8607 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8608 au! TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8609 aug! TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8610 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8611 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8612 Xpath 16 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8613 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8614 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8615 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8616 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8617 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8618
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8619 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8620 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8621 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8622 let post = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8623 aug TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8624 au! BufWritePre * asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8625 au! BufWritePost * let post = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8626 aug END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8627 let tmpfile = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8628 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8629 exec "write" tmpfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8630 catch /^Vim\((write)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8631 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8632 let v:errmsg = substitute(v:exception, '^Vim\((write)\)\=:', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8633 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8634 Xpath 32 " X: 32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8635 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8636 Xpath 64 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8637 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8638 let v:errmsg = substitute(v:errmsg, '^"'.tmpfile.'" ', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8639 if !MSG('E492', "Not an editor command")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8640 Xpath 128 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8641 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8642 if filereadable(tmpfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8643 Xpath 256 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8644 Xout ":write command not suppressed after BufWritePre error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8645 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8646 if post
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8647 Xpath 512 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8648 Xout "BufWritePost commands executed after BufWritePre error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8649 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8650 au! TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8651 aug! TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8652 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8653 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8654 Xpath 1024 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8655 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8656 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8657 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8658 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8659 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8660
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8661 call delete(tmpfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8662
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8663 call Delete_autocommands("BufWritePre", "BufWritePost",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8664 \ "BufReadPre", "BufReadPost", "FileReadPre", "FileReadPost")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8665
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8666 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8667 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8668 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8669 let post = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8670 aug TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8671 au! FileReadPost * let post = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8672 aug END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8673 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8674 read /n/o/n/e/x/i/s/t/e/n/t
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8675 catch /^Vim(read):/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8676 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8677 let v:errmsg = substitute(v:exception, '^Vim(read):', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8678 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8679 Xpath 2048 " X: 2048
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8680 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8681 Xpath 4096 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8682 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8683 let v:errmsg = substitute(v:errmsg, ' /n/o/n/e/x/i/s/t/e/n/t$',
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8684 \ '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8685 if !MSG('E484', "Can't open file")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8686 Xpath 8192 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8687 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8688 if post
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8689 Xpath 16384 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8690 Xout "FileReadPost commands executed after write error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8691 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8692 au! TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8693 aug! TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8694 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8695 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8696 Xpath 32768 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8697 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8698 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8699 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8700 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8701 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8702
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8703 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8704 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8705 let infile = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8706 let tmpfile = tempname()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8707 exec "!echo XYZ >" . infile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8708 exec "edit" tmpfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8709 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8710 Xpath 65536 " X: 65536
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8711 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8712 let post = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8713 aug TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8714 au! FileReadPre * asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8715 au! FileReadPost * let post = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8716 aug END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8717 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8718 exec "0read" infile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8719 catch /^Vim\((read)\)\=:/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8720 let caught = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8721 let v:errmsg = substitute(v:exception, '^Vim\((read)\)\=:', '',
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8722 \ "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8723 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8724 Xpath 131072 " X: 131072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8725 if !caught && !$VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8726 Xpath 262144 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8727 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8728 let v:errmsg = substitute(v:errmsg, ' '.infile.'$', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8729 if !MSG('E492', "Not an editor command")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8730 Xpath 524288 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8731 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8732 if getline("1") == "XYZ"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8733 Xpath 1048576 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8734 Xout ":read command not suppressed after FileReadPre error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8735 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8736 if post
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8737 Xpath 2097152 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8738 Xout "FileReadPost commands executed after " .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8739 \ "FileReadPre error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8740 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8741 au! TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8742 aug! TMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8743 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8744 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8745 bwipeout!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8746 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8747 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8748 Xpath 4194304 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8749 Xout v:exception "in" v:throwpoint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8750 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8751 break " discard error for $VIMNOERRTHROW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8752 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8753 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8754
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8755 call delete(infile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8756 call delete(tmpfile)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8757 unlet! caught post infile tmpfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8758 delfunction MSG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8759 delfunction Delete_autocommands
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8760
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8761 Xcheck 198689
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8762
3918
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8763 "-------------------------------------------------------------------------------
3994
ed936effb1f3 updated for version 7.3.752
Bram Moolenaar <bram@vim.org>
parents: 3918
diff changeset
8764 " Test 86: setloclist crash {{{1
3918
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8765 "
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8766 " Executing a setloclist() on BufUnload shouldn't crash Vim
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8767 "-------------------------------------------------------------------------------
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8768
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8769 func F
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8770 au BufUnload * :call setloclist(0, [{'bufnr':1, 'lnum':1, 'col':1, 'text': 'tango down'}])
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8771
4774
531e598651fc updated for version 7.3.1134
Bram Moolenaar <bram@vim.org>
parents: 4182
diff changeset
8772 :lvimgrep /.*/ *.mak
3918
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8773 endfunc
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8774
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8775 XpathINIT
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8776
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8777 ExecAsScript F
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8778
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8779 delfunction F
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8780 Xout "No Crash for vimgrep on BufUnload"
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8781 Xcheck 0
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8782
4f0ddf4137ee updated for version 7.3.715
Bram Moolenaar <bram@vim.org>
parents: 2591
diff changeset
8783 "-------------------------------------------------------------------------------
4182
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8784 " Test 87 using (expr) ? funcref : funcref {{{1
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8785 "
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8786 " Vim needs to correctly parse the funcref and even when it does
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8787 " not execute the funcref, it needs to consume the trailing ()
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8788 "-------------------------------------------------------------------------------
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8789
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8790 XpathINIT
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8791
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8792 func Add2(x1, x2)
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8793 return a:x1 + a:x2
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8794 endfu
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8795
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8796 func GetStr()
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8797 return "abcdefghijklmnopqrstuvwxyp"
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8798 endfu
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8799
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8800 echo function('Add2')(2,3)
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8801
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8802 Xout 1 ? function('Add2')(1,2) : function('Add2')(2,3)
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8803 Xout 0 ? function('Add2')(1,2) : function('Add2')(2,3)
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8804 " Make sure, GetStr() still works.
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8805 Xout GetStr()[0:10]
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8806
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8807
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8808 delfunction GetStr
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8809 delfunction Add2
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8810 Xout "Successfully executed funcref Add2"
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8811
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8812 Xcheck 0
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8813
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8814 "-------------------------------------------------------------------------------
f4960ddda07c updated for version 7.3.843
Bram Moolenaar <bram@vim.org>
parents: 3994
diff changeset
8815 " Test 88: $VIMNOERRTHROW and $VIMNOINTTHROW support {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8816 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8817 " It is possible to configure Vim for throwing exceptions on error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8818 " or interrupt, controlled by variables $VIMNOERRTHROW and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8819 " $VIMNOINTTHROW. This is just for increasing the number of tests.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8820 " All tests here should run for all four combinations of setting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8821 " these variables to 0 or 1. The variables are intended for the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8822 " development phase only. In the final release, Vim should be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8823 " configured to always use error and interrupt exceptions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8824 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8825 " The test result is "OK",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8826 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8827 " - if the $VIMNOERRTHROW and the $VIMNOINTTHROW control are not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8828 " configured and exceptions are thrown on error and on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8829 " interrupt.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8830 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8831 " - if the $VIMNOERRTHROW or the $VIMNOINTTHROW control is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8832 " configured and works as intended.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8833 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8834 " What actually happens, is shown in the test output.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8835 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8836 " Otherwise, the test result is "FAIL", and the test output describes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8837 " the problem.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8838 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8839 " IMPORTANT: This must be the last test because it sets $VIMNOERRTHROW and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8840 " $VIMNOINTTHROW.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8841 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8842
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8843 XpathINIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8844
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8845 if ExtraVim()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8846
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8847 function! ThrowOnError()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8848 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8849 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8850 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8851 Xloop 1 " X: 1 + 8 + 64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8852 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8853 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8854 let caught = 1 " error exception caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8855 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8856 Xloop 2 " X: 2 + 16 + 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8857 return caught " discard aborting error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8858 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8859 Xloop 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8860 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8861
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8862 let quits_skipped = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8863
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8864 function! ThrowOnInterrupt()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8865 XloopNEXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8866 let caught = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8867 try
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8868 Xloop 1 " X: (1 + 8 + 64) * 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8869 "INTERRUPT3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8870 let dummy = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8871 let g:quits_skipped = g:quits_skipped + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8872 catch /.*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8873 let caught = 1 " interrupt exception caught
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8874 finally
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8875 Xloop 2 " X: (2 + 16 + 128) * 512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8876 return caught " discard interrupt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8877 endtry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8878 Xloop 4 " X: 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8879 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8880
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8881 function! CheckThrow(Type)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8882 execute 'return ThrowOn' . a:Type . '()'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8883 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8884
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8885 function! CheckConfiguration(type) " type is "error" or "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8886
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8887 let type = a:type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8888 let Type = substitute(type, '.*', '\u&', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8889 let VAR = '$VIMNO' . substitute(type, '\(...\).*', '\U\1', "") . 'THROW'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8890
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8891 if type == "error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8892 XloopINIT! 1 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8893 elseif type == "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8894 XloopINIT! 512 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8895 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8896
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8897 exec 'let requested_for_tests = exists(VAR) && ' . VAR . ' == 0'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8898 exec 'let suppressed_for_tests = ' . VAR . ' != 0'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8899 let used_in_tests = CheckThrow(Type)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8900
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8901 exec 'let ' . VAR . ' = 0'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8902 let request_works = CheckThrow(Type)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8903
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8904 exec 'let ' . VAR . ' = 1'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8905 let suppress_works = !CheckThrow(Type)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8906
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8907 if type == "error"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8908 XloopINIT! 262144 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8909 elseif type == "interrupt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8910 XloopINIT! 2097152 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8911
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8912 if g:quits_skipped != 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8913 Xloop 1 " X: 0*2097152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8914 Xout "Test environment error. Interrupt breakpoints skipped: "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8915 \ . g:quits_skipped . ".\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8916 \ . "Cannot check whether interrupt exceptions are thrown."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8917 return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8918 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8919 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8920
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8921 let failure =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8922 \ !suppressed_for_tests && !used_in_tests
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8923 \ || !request_works
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8924
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8925 let contradiction =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8926 \ used_in_tests
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8927 \ ? suppressed_for_tests && !request_works
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8928 \ : !suppressed_for_tests
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8929
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8930 if failure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8931 " Failure in configuration.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8932 Xloop 2 " X: 0 * 2* (262144 + 2097152)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8933 elseif contradiction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8934 " Failure in test logic. Should not happen.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8935 Xloop 4 " X: 0 * 4 * (262144 + 2097152)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8936 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8937
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8938 let var_control_configured =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8939 \ request_works != used_in_tests
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8940 \ || suppress_works == used_in_tests
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8941
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8942 let var_control_not_configured =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8943 \ requested_for_tests || suppressed_for_tests
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8944 \ ? request_works && !suppress_works
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8945 \ : request_works == used_in_tests
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8946 \ && suppress_works != used_in_tests
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8947
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8948 let with = used_in_tests ? "with" : "without"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8949
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8950 let set = suppressed_for_tests ? "non-zero" :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8951 \ requested_for_tests ? "0" : "unset"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8952
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8953 let although = contradiction && !var_control_not_configured
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8954 \ ? ",\nalthough "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8955 \ : ".\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8956
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8957 let output = "All tests were run " . with . " throwing exceptions on "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8958 \ . type . although
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8959
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8960 if !var_control_not_configured
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8961 let output = output . VAR . " was " . set . "."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8962
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8963 if !request_works && !requested_for_tests
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8964 let output = output .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8965 \ "\n" . Type . " exceptions are not thrown when " . VAR .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8966 \ " is\nset to 0."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8967 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8968
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8969 if !suppress_works && (!used_in_tests ||
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8970 \ !request_works &&
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8971 \ !requested_for_tests && !suppressed_for_tests)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8972 let output = output .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8973 \ "\n" . Type . " exceptions are thrown when " . VAR .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8974 \ " is set to 1."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8975 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8976
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8977 if !failure && var_control_configured
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8978 let output = output .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8979 \ "\nRun tests also with " . substitute(VAR, '^\$', '', "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8980 \ . "=" . used_in_tests . "."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8981 \ . "\nThis is for testing in the development phase only."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8982 \ . " Remove the \n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8983 \ . VAR . " control in the final release."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8984 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8985 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8986 let output = output .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8987 \ "The " . VAR . " control is not configured."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8988 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8989
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8990 Xout output
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8991 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8992
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8993 call CheckConfiguration("error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8994 Xpath 16777216 " X: 16777216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8995 call CheckConfiguration("interrupt")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8996 Xpath 33554432 " X: 33554432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8997 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8998
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8999 Xcheck 50443995
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9000
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9001 " IMPORTANT: No test should be added after this test because it changes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9002 " $VIMNOERRTHROW and $VIMNOINTTHROW.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9003
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9004
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9005 "-------------------------------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9006 " Modelines {{{1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9007 " vim: ts=8 sw=4 tw=80 fdm=marker
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9008 " vim: fdt=substitute(substitute(foldtext(),\ '\\%(^+--\\)\\@<=\\(\\s*\\)\\(.\\{-}\\)\:\ \\%(\"\ \\)\\=\\(Test\ \\d*\\)\:\\s*',\ '\\3\ (\\2)\:\ \\1',\ \"\"),\ '\\(Test\\s*\\)\\(\\d\\)\\D\\@=',\ '\\1\ \\2',\ "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9009 "-------------------------------------------------------------------------------