Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

parenthesize lambdas/objects in a few more cases, to ensure valid output

  • Loading branch information...
commit ec1e9fd1fbfdf145cb23e72a3046fd9bbfdd0582 1 parent 02bc35c
@mishoo authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/codegen.lisp
6 src/codegen.lisp
@@ -66,7 +66,7 @@ characters in string S to STREAM."
(needs-parens (expr)
(case (car expr)
- (:function ; dot/call on a function
+ ((:function :object) ; dot/call on a function
; requires the parens only
; when the function identifier
; appears as the first "thing"
@@ -75,7 +75,7 @@ characters in string S to STREAM."
:for (this p) :on stack
:when (eq (car p) :stat) :do (return t)
:unless (and (eq (cadr p) this)
- (member (car p) '(:seq :call :binary))) :do (return nil)))
+ (member (car p) '(:seq :call :dot :sub :conditional))) :do (return nil)))
((:name :array :string :dot :sub :call :regexp) nil)
(t t)))
@@ -104,7 +104,7 @@ characters in string S to STREAM."
:for line = (gencode this)
:when (and (not beautify)
(not next))
- :do (setq line (ppcre:regex-replace ";+$" line ""))
+ :do (setq line (ppcre:regex-replace ";+$" line ""))
:collect (indent line)))
,(indent "}"))
Please sign in to comment.
Something went wrong with that request. Please try again.