mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 20:45:06 +02:00
Bug fixes, explicitly handle const's
This commit is contained in:
parent
e1d7ac548f
commit
113e0d740b
1 changed files with 9 additions and 4 deletions
|
@ -104,6 +104,8 @@
|
||||||
(lambda (expr)
|
(lambda (expr)
|
||||||
(analyze expr id))
|
(analyze expr id))
|
||||||
(ast:lambda-body exp))))
|
(ast:lambda-body exp))))
|
||||||
|
((const? exp) #f)
|
||||||
|
((quote? exp) #f)
|
||||||
((ref? exp)
|
((ref? exp)
|
||||||
(let ((var (adb:get/default exp (adb:make-var))))
|
(let ((var (adb:get/default exp (adb:make-var))))
|
||||||
(adbv:set-ref-by! var (cons lid (adbv:ref-by var)))
|
(adbv:set-ref-by! var (cons lid (adbv:ref-by var)))
|
||||||
|
@ -127,9 +129,10 @@
|
||||||
|
|
||||||
; Application:
|
; Application:
|
||||||
((app? exp)
|
((app? exp)
|
||||||
(map (lambda (e)
|
(for-each
|
||||||
(analyze e lid))
|
(lambda (e)
|
||||||
exp))
|
(analyze e lid))
|
||||||
|
exp))
|
||||||
;TODO ((app? exp) (map (lambda (e) (wrap-mutables e globals)) exp))
|
;TODO ((app? exp) (map (lambda (e) (wrap-mutables e globals)) exp))
|
||||||
|
|
||||||
; Nothing to analyze for these?
|
; Nothing to analyze for these?
|
||||||
|
@ -153,6 +156,8 @@
|
||||||
(lambda (expr)
|
(lambda (expr)
|
||||||
(analyze2 expr))
|
(analyze2 expr))
|
||||||
(ast:lambda-body exp))))
|
(ast:lambda-body exp))))
|
||||||
|
((const? exp) #f)
|
||||||
|
((quote? exp) #f)
|
||||||
;; TODO:
|
;; TODO:
|
||||||
; ((ref? exp)
|
; ((ref? exp)
|
||||||
; (let ((var (adb:get/default exp (adb:make-var))))
|
; (let ((var (adb:get/default exp (adb:make-var))))
|
||||||
|
@ -169,7 +174,7 @@
|
||||||
,(analyze2 (if->else exp))))
|
,(analyze2 (if->else exp))))
|
||||||
; Application:
|
; Application:
|
||||||
((app? exp)
|
((app? exp)
|
||||||
(map (lambda (e) (analyze2 e)) exp))
|
(for-each (lambda (e) (analyze2 e)) exp))
|
||||||
(else #f)))
|
(else #f)))
|
||||||
|
|
||||||
;; TODO: make another pass for simple lambda's
|
;; TODO: make another pass for simple lambda's
|
||||||
|
|
Loading…
Add table
Reference in a new issue