adding comments to the intermediate language to help me trace what's going on in the simulator
This commit is contained in:
parent
24f988c45a
commit
185b9f197c
|
@ -132,7 +132,9 @@
|
||||||
|
|
||||||
PopControlFrame
|
PopControlFrame
|
||||||
|
|
||||||
DebugPrint))
|
DebugPrint
|
||||||
|
Comment
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
;; Debug print statement.
|
;; Debug print statement.
|
||||||
|
@ -215,6 +217,8 @@
|
||||||
#:transparent)
|
#:transparent)
|
||||||
|
|
||||||
|
|
||||||
|
(define-struct: Comment ([val : Any])
|
||||||
|
#:transparent)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,8 @@ EOF
|
||||||
[(PushControlFrame/Prompt? stmt)
|
[(PushControlFrame/Prompt? stmt)
|
||||||
(next)]
|
(next)]
|
||||||
[(PopControlFrame? stmt)
|
[(PopControlFrame? stmt)
|
||||||
|
(next)]
|
||||||
|
[(Comment? stmt)
|
||||||
(next)]))]))
|
(next)]))]))
|
||||||
|
|
||||||
|
|
||||||
|
@ -292,7 +294,10 @@ EOF
|
||||||
(format "[~a]" (assemble-oparg (PushImmediateOntoEnvironment-value stmt)))]
|
(format "[~a]" (assemble-oparg (PushImmediateOntoEnvironment-value stmt)))]
|
||||||
[else
|
[else
|
||||||
(assemble-oparg (PushImmediateOntoEnvironment-value stmt))])])
|
(assemble-oparg (PushImmediateOntoEnvironment-value stmt))])])
|
||||||
val-string))])))
|
val-string))]
|
||||||
|
[(Comment? stmt)
|
||||||
|
;; TODO: maybe comments should be emitted as JavaScript comments.
|
||||||
|
""])))
|
||||||
|
|
||||||
|
|
||||||
(define-predicate natural? Natural)
|
(define-predicate natural? Natural)
|
||||||
|
|
|
@ -60,6 +60,8 @@
|
||||||
[(PushControlFrame/Prompt? stmt)
|
[(PushControlFrame/Prompt? stmt)
|
||||||
(label->labels (PushControlFrame/Prompt-label stmt))]
|
(label->labels (PushControlFrame/Prompt-label stmt))]
|
||||||
[(PopControlFrame? stmt)
|
[(PopControlFrame? stmt)
|
||||||
|
empty]
|
||||||
|
[(Comment? stmt)
|
||||||
empty]))
|
empty]))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,8 @@
|
||||||
#f]
|
#f]
|
||||||
|
|
||||||
[(PopControlFrame? stmt)
|
[(PopControlFrame? stmt)
|
||||||
|
#f]
|
||||||
|
[(Comment? stmt)
|
||||||
#f]))
|
#f]))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,8 @@
|
||||||
(step-push-control-frame/prompt! m i)]
|
(step-push-control-frame/prompt! m i)]
|
||||||
[(PopControlFrame? i)
|
[(PopControlFrame? i)
|
||||||
(step-pop-control-frame! m i)]
|
(step-pop-control-frame! m i)]
|
||||||
|
[(Comment? i)
|
||||||
|
'ok]
|
||||||
)])
|
)])
|
||||||
(increment-pc! m)))
|
(increment-pc! m)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user