cleaning up
This commit is contained in:
parent
7a5a8311b9
commit
3959a0a95c
12
compile.rkt
12
compile.rkt
|
@ -774,14 +774,8 @@
|
||||||
[(and (LocalRef? exp)
|
[(and (LocalRef? exp)
|
||||||
(not (LocalRef-unbox? exp)))
|
(not (LocalRef-unbox? exp)))
|
||||||
(let ([entry (list-ref cenv (LocalRef-depth exp))])
|
(let ([entry (list-ref cenv (LocalRef-depth exp))])
|
||||||
(printf "~s\n" entry)
|
entry)]
|
||||||
(cond
|
|
||||||
[(StaticallyKnownLam? entry)
|
|
||||||
entry]
|
|
||||||
[(Const? entry)
|
|
||||||
entry]
|
|
||||||
[else
|
|
||||||
'?]))]
|
|
||||||
[(ToplevelRef? exp)
|
[(ToplevelRef? exp)
|
||||||
(let: ([name : (U Symbol False ModuleVariable)
|
(let: ([name : (U Symbol False ModuleVariable)
|
||||||
(list-ref (Prefix-names (ensure-prefix (list-ref cenv (ToplevelRef-depth exp))))
|
(list-ref (Prefix-names (ensure-prefix (list-ref cenv (ToplevelRef-depth exp))))
|
||||||
|
@ -791,8 +785,10 @@
|
||||||
name]
|
name]
|
||||||
[else
|
[else
|
||||||
'?]))]
|
'?]))]
|
||||||
|
|
||||||
[(Constant? exp)
|
[(Constant? exp)
|
||||||
(make-Const (Constant-v exp))]
|
(make-Const (Constant-v exp))]
|
||||||
|
|
||||||
[else
|
[else
|
||||||
'?]))
|
'?]))
|
||||||
|
|
||||||
|
|
|
@ -303,6 +303,11 @@ EOF
|
||||||
"4\n5\n16\n")
|
"4\n5\n16\n")
|
||||||
|
|
||||||
|
|
||||||
|
(test/exn '(let ([x 0])
|
||||||
|
(set! x "foo")
|
||||||
|
(add1 x))
|
||||||
|
"Error: Expected number as argument 1 but received foo")
|
||||||
|
|
||||||
|
|
||||||
#;(test (read (open-input-file "tests/conform/program0.sch"))
|
#;(test (read (open-input-file "tests/conform/program0.sch"))
|
||||||
(port->string (open-input-file "tests/conform/expected0.txt")))
|
(port->string (open-input-file "tests/conform/expected0.txt")))
|
Loading…
Reference in New Issue
Block a user