Add implicit tagbody to dolist
This commit is contained in:
parent
97d472bf6a
commit
e2df0bcefe
|
@ -1172,7 +1172,7 @@ sub macro_dolist {
|
|||
|
||||
slurp_token($ts, RPAREN, "Expected ) after list-form or result-form in dolist");
|
||||
|
||||
my $body = macro_progn($ts);
|
||||
my $body = macro_tagbody($ts);
|
||||
|
||||
return create_block(
|
||||
"nil",
|
||||
|
|
15
t/dolist.t
15
t/dolist.t
|
@ -1,4 +1,4 @@
|
|||
(plan 5)
|
||||
(plan 6)
|
||||
|
||||
(expect "dolist - body is evaluated with every element"
|
||||
(let ((lst (list 1 2 5 'cool 'list 'bro nil))
|
||||
|
@ -29,3 +29,16 @@
|
|||
(unless (null e)
|
||||
(throw 'test 'fail))))
|
||||
'ok)))
|
||||
|
||||
(defun nop () nil)
|
||||
|
||||
(expect "dolist - implicit tagbody"
|
||||
(equal 'ok
|
||||
(catch 'test
|
||||
(dolist (e (list 1) 'ok)
|
||||
nil
|
||||
(go end)
|
||||
middle
|
||||
(throw 'test 'fail)
|
||||
end)
|
||||
'ok)))
|
||||
|
|
Loading…
Reference in a new issue