mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Issue #243 - Edge case that comes up w/match
This was never handled properly but never noticed it until doing expansions for the match macros.
This commit is contained in:
parent
57d679ec22
commit
8064ebef5f
1 changed files with 16 additions and 3 deletions
|
@ -1269,7 +1269,8 @@
|
|||
(cdr local)
|
||||
(env:lookup (caar exp) env #f)))))
|
||||
;(log `(DONE WITH env:lookup ,(caar exp) ,val ,(tagged-list? 'macro val)))
|
||||
(if (tagged-list? 'macro val)
|
||||
(cond
|
||||
((tagged-list? 'macro val)
|
||||
;; Expand macro here so we can catch begins in the expanded code,
|
||||
;; including nested begins
|
||||
(let ((expanded (macro:expand this-exp val env rename-env local-renamed)))
|
||||
|
@ -1282,7 +1283,19 @@
|
|||
env
|
||||
rename-env
|
||||
local-env
|
||||
local-renamed))
|
||||
local-renamed)))
|
||||
((Cyc-macro? val)
|
||||
(let ((expanded (macro:expand this-exp (list 'macro val) env rename-env local-renamed)))
|
||||
(_expand-body
|
||||
result
|
||||
(cons
|
||||
expanded ;(macro:expand this-exp val env)
|
||||
(cdr exp))
|
||||
env
|
||||
rename-env
|
||||
local-env
|
||||
local-renamed)))
|
||||
(else
|
||||
;; No macro, use main expand function to process
|
||||
(_expand-body
|
||||
(cons
|
||||
|
@ -1294,7 +1307,7 @@
|
|||
env
|
||||
rename-env
|
||||
local-env
|
||||
local-renamed))))
|
||||
local-renamed)))))
|
||||
(else
|
||||
;(log 'app)
|
||||
(_expand-body
|
||||
|
|
Loading…
Add table
Reference in a new issue