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)
|
(cdr local)
|
||||||
(env:lookup (caar exp) env #f)))))
|
(env:lookup (caar exp) env #f)))))
|
||||||
;(log `(DONE WITH env:lookup ,(caar exp) ,val ,(tagged-list? 'macro val)))
|
;(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,
|
;; Expand macro here so we can catch begins in the expanded code,
|
||||||
;; including nested begins
|
;; including nested begins
|
||||||
(let ((expanded (macro:expand this-exp val env rename-env local-renamed)))
|
(let ((expanded (macro:expand this-exp val env rename-env local-renamed)))
|
||||||
|
@ -1282,7 +1283,19 @@
|
||||||
env
|
env
|
||||||
rename-env
|
rename-env
|
||||||
local-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
|
;; No macro, use main expand function to process
|
||||||
(_expand-body
|
(_expand-body
|
||||||
(cons
|
(cons
|
||||||
|
@ -1294,7 +1307,7 @@
|
||||||
env
|
env
|
||||||
rename-env
|
rename-env
|
||||||
local-env
|
local-env
|
||||||
local-renamed))))
|
local-renamed)))))
|
||||||
(else
|
(else
|
||||||
;(log 'app)
|
;(log 'app)
|
||||||
(_expand-body
|
(_expand-body
|
||||||
|
|
Loading…
Add table
Reference in a new issue