diff --git a/src/lang/compiler/compile-statement.lisp b/src/lang/compiler/compile-statement.lisp index 1653a52..fb39424 100644 --- a/src/lang/compiler/compile-statement.lisp +++ b/src/lang/compiler/compile-statement.lisp @@ -150,10 +150,10 @@ (defun func-env-add-macrolet-bindings (func-env bindings) (flet ((aux (func-env0 binding) (let ((symbol (macrolet-binding-symbol binding)) - (arguments (macrolet-binding-arguments binding)) - (body (macrolet-binding-body binding))) + (arguments (macrolet-binding-arguments binding)) + (body (macrolet-binding-body binding))) (function-environment-add-macro symbol arguments body - func-env0)))) + func-env0)))) (reduce #'aux bindings :initial-value func-env))) (defun compile-macrolet-statements (statements var-env func-env) @@ -162,11 +162,10 @@ (defun compile-macrolet (form var-env func-env) (let ((bindings (macrolet-bindings form)) (statements (macrolet-statements form))) - (let ((func-env1 (func-env-add-macrolet-bindings func-env - bindings))) + (let ((func-env1 (func-env-add-macrolet-bindings func-env bindings))) (let ((statements1 (compile-macrolet-statements statements - var-env - func-env1))) + var-env + func-env1))) (let ((statements2 (indent 2 statements1))) (format nil "{~%~A}~%" statements2)))))) diff --git a/src/lang/syntax.lisp b/src/lang/syntax.lisp index a84d284..36d80fe 100644 --- a/src/lang/syntax.lisp +++ b/src/lang/syntax.lisp @@ -80,14 +80,14 @@ :symbol-macrolet-binding-p :symbol-macrolet-binding-symbol :symbol-macrolet-binding-expansion - ;; Macrolet statement + ;; Macrolet statement :macrolet-p :macrolet-bindings :macrolet-statements ;; Macrolet statement - binding :macrolet-binding-p :macrolet-binding-symbol - :macrolet-binding-arguments + :macrolet-binding-arguments :macrolet-binding-body ;; Do statement :do-p @@ -510,8 +510,8 @@ (cl-pattern:match object ((name bindings . _) (and (cl-cuda-symbol-p name) - (alexandria:proper-list-p bindings) - (mapcar #'cl-cuda-symbol-p bindings))) + (alexandria:proper-list-p bindings) + (mapcar #'cl-cuda-symbol-p bindings))) (_ nil))) (defun macrolet-binding-symbol (binding) diff --git a/t/lang/compiler/compile-statement.lisp b/t/lang/compiler/compile-statement.lisp index ac5226e..3d8f8b0 100644 --- a/t/lang/compiler/compile-statement.lisp +++ b/t/lang/compiler/compile-statement.lisp @@ -17,7 +17,7 @@ :compile-if :compile-let :compile-symbol-macrolet - :compile-macrolet + :compile-macrolet :compile-do :compile-with-shared-memory :compile-set @@ -125,14 +125,14 @@ (let ((var-env (empty-variable-environment)) (func-env (empty-function-environment))) (let ((lisp-code '(macrolet ((square (x) `(* ,x ,x))) - (return (square 2)))) + (return (square 2)))) (c-code (unlines "{" " return (2 * 2);" "}"))) (is (compile-macrolet lisp-code var-env func-env) c-code "basic case 1")) (let ((lisp-code '(macrolet ((optimized-square (x) (* x x))) - (return (optimized-square 2)))) + (return (optimized-square 2)))) (c-code (unlines "{" " return 4;" "}"))) diff --git a/t/lang/syntax.lisp b/t/lang/syntax.lisp index d253530..b22c812 100644 --- a/t/lang/syntax.lisp +++ b/t/lang/syntax.lisp @@ -186,11 +186,11 @@ (diag "Macrolet statement") (ok (macrolet-p '(macrolet ((x () 'expanded-x)) - (return))) + (return))) "basic case 1") (ok (macrolet-p '(macrolet ((x () 'expanded-x)) - (do-something) - (return))) + (do-something) + (return))) "basic case 2") (ok (macrolet-p '(macrolet ((x () 'expanded-x)))) "basic case 3")