Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
parenscript
parenscript
Commits
76f33d35
Verified
Commit
76f33d35
authored
Oct 15, 2018
by
Vladimir Sedach
Browse files
Fix RETURN trying to grab declarations from body-less let/flet/etc
parent
b513da9d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/macros.lisp
View file @
76f33d35
...
...
@@ -3,6 +3,7 @@
;;; Copyright 2006 Luca Capello
;;; Copyright 2010-2012 Vladimir Sedach
;;; Copyright 2010-2013 Daniel Gackle
;;; Copyright 2012, 2014 Boris Smilga
;;; SPDX-License-Identifier: BSD-3-Clause
...
...
src/special-operators.lisp
View file @
76f33d35
...
...
@@ -287,10 +287,18 @@ invocations or not.")
((
continue
break
throw
)
;; non-local exit
form
)
;; implicit progn forms
((
with
label
let
flet
labels
macrolet
symbol-macrolet
)
((
with
)
;; deprecated and will be removed
`
(
,
(
first
form
)
,
(
second
form
)
,@
(
butlast
(
cddr
form
))
(
return-from
,
tag
,
(
car
(
last
(
cddr
form
))))))
;; implicit body (declaration + progn) forms
((
let
flet
labels
macrolet
symbol-macrolet
)
(
multiple-value-bind
(
body
declarations
)
(
parse-body
(
cddr
form
))
`
(
,
(
first
form
)
,
(
second
form
)
,@
declarations
,@
(
butlast
body
)
(
return-from
,
tag
,
(
car
(
last
body
))))))
(
progn
`
(
progn
,@
(
butlast
(
cdr
form
))
(
return-from
,
tag
,
(
car
(
last
(
cdr
form
))))))
...
...
@@ -462,8 +470,8 @@ Parenscript now implements implicit return, update your code! Things like (lambd
(
define-expression-operator
let
(
bindings
&body
body
)
(
with-declaration-effects
(
body
body
)
(
flet
((
rename
(
x
)
(
first
x
))
(
var
(
x
)
(
second
x
))
(
val
(
x
)
(
third
x
)))
(
var
(
x
)
(
second
x
))
(
val
(
x
)
(
third
x
)))
(
let*
((
new-lexicals
())
(
normalized-bindings
(
mapcar
(
lambda
(
x
)
...
...
tests/output-tests.lisp
View file @
76f33d35
...
...
@@ -4054,6 +4054,34 @@ for (var i = 0; i < 5; i += 1) {
(
or
(
not
foo
)
(
not
(
not
foo
))
(
not
(
not
(
not
foo
))))
"!foo || foo || !foo;"
)
(
test-ps-js
empty-let
(
defun
foo
()
(
let
((
a
(
bar
)))))
"function foo() {
var a = bar();
return null;
};"
)
(
test-ps-js
empty-let*
(
defun
foo
()
(
let*
((
a
(
bar
)))))
"function foo() {
var a = bar();
return null;
};"
)
(
test-ps-js
defun-no-body-declare
(
defun
foo
()
(
declare
(
ignore
x
)))
"function foo() {
return null;
};"
)
(
test-ps-js
defun-no-body-let-decare
(
defun
foo
()
(
let
()
(
declare
(
ignore
x
))))
"function foo() {
return null;
};"
)
(
test-ps-js
empty-defun-docstring-declare
(
defun
foo
(
x
)
"docstring"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment