mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +02:00
Determine if vars are defined within a loop
This commit is contained in:
parent
e4e6f23f0e
commit
3cf0e0a0c7
1 changed files with 12 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
;; TODO:
|
;; TODO:
|
||||||
;; - identify refs within named lets
|
;; - identify refs within named lets
|
||||||
|
;; and also, whether refs are defined (or not) in loop
|
||||||
;; - will probably need to hook into analysis DB in production version
|
;; - will probably need to hook into analysis DB in production version
|
||||||
;; - will this find function work for optimized CPS? should test that, too
|
;; - will this find function work for optimized CPS? should test that, too
|
||||||
;; - does find need to be more robust? Are there false positives?
|
;; - does find need to be more robust? Are there false positives?
|
||||||
|
@ -24,6 +25,17 @@
|
||||||
"lambda-"
|
"lambda-"
|
||||||
(number->string id)
|
(number->string id)
|
||||||
(if has-cont "-cont" ""))))
|
(if has-cont "-cont" ""))))
|
||||||
|
(args* (ast:lambda-args exp))
|
||||||
|
(args (if (null? args*)
|
||||||
|
'()
|
||||||
|
(formals->list args*)))
|
||||||
|
)
|
||||||
|
(when lp
|
||||||
|
(for-each
|
||||||
|
(lambda (a)
|
||||||
|
(write `(,a defined in a loop))
|
||||||
|
(newline))
|
||||||
|
args)
|
||||||
)
|
)
|
||||||
`(,sym ,(ast:lambda-args exp)
|
`(,sym ,(ast:lambda-args exp)
|
||||||
,@(map (lambda (e) (scan e lp)) (ast:lambda-body exp))))
|
,@(map (lambda (e) (scan e lp)) (ast:lambda-body exp))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue