continuing to optimize
This commit is contained in:
parent
df20eb4ee5
commit
28dbb9a74a
|
@ -395,12 +395,8 @@ EOF
|
||||||
(: assemble-statement (UnlabeledStatement -> String))
|
(: assemble-statement (UnlabeledStatement -> String))
|
||||||
;; Generates the code to assemble a statement.
|
;; Generates the code to assemble a statement.
|
||||||
(define (assemble-statement stmt)
|
(define (assemble-statement stmt)
|
||||||
(string-append
|
(define assembled
|
||||||
(if (current-emit-debug-trace?)
|
(cond
|
||||||
(format "if (typeof(window.console) !== 'undefined' && typeof(console.log) === 'function') { console.log(~s);\n}"
|
|
||||||
(format "~a" stmt))
|
|
||||||
"")
|
|
||||||
(cond
|
|
||||||
[(DebugPrint? stmt)
|
[(DebugPrint? stmt)
|
||||||
(format "MACHINE.params.currentOutputPort.writeDomNode(MACHINE, $('<span/>').text(~a));" (assemble-oparg (DebugPrint-value stmt)))]
|
(format "MACHINE.params.currentOutputPort.writeDomNode(MACHINE, $('<span/>').text(~a));" (assemble-oparg (DebugPrint-value stmt)))]
|
||||||
[(AssignImmediateStatement? stmt)
|
[(AssignImmediateStatement? stmt)
|
||||||
|
@ -516,7 +512,15 @@ EOF
|
||||||
val-string))]
|
val-string))]
|
||||||
[(Comment? stmt)
|
[(Comment? stmt)
|
||||||
;; TODO: maybe comments should be emitted as JavaScript comments.
|
;; TODO: maybe comments should be emitted as JavaScript comments.
|
||||||
""])))
|
""]))
|
||||||
|
(cond
|
||||||
|
[(current-emit-debug-trace?)
|
||||||
|
(string-append
|
||||||
|
(format "if (typeof(window.console) !== 'undefined' && typeof(console.log) === 'function') { console.log(~s);\n}"
|
||||||
|
(format "~a" stmt))
|
||||||
|
assembled)]
|
||||||
|
[else
|
||||||
|
assembled]))
|
||||||
|
|
||||||
|
|
||||||
(define-predicate natural? Natural)
|
(define-predicate natural? Natural)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user