syntax errors caught.
This commit is contained in:
parent
90851d27c6
commit
753e1d80f9
|
@ -140,6 +140,9 @@
|
||||||
Repl.prototype.executeCompiledProgram = function(compiledResult,
|
Repl.prototype.executeCompiledProgram = function(compiledResult,
|
||||||
onDoneSuccess, onDoneFail) {
|
onDoneSuccess, onDoneFail) {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
if (compiledResult.type === 'error') {
|
||||||
|
return onDoneFail(compiledResult);
|
||||||
|
} else {
|
||||||
// compiledResult.compiledCodes is an array of function chunks.
|
// compiledResult.compiledCodes is an array of function chunks.
|
||||||
// The evaluation leaves the value register of the machine
|
// The evaluation leaves the value register of the machine
|
||||||
// to contain the list of values from toplevel evaluation.
|
// to contain the list of values from toplevel evaluation.
|
||||||
|
@ -162,6 +165,7 @@
|
||||||
codeFunction(that.M, onGoodEvaluation, onBadEvaluation);
|
codeFunction(that.M, onGoodEvaluation, onBadEvaluation);
|
||||||
},
|
},
|
||||||
onDoneSuccess);
|
onDoneSuccess);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
(let loop ()
|
(let loop ()
|
||||||
(define eval
|
(define eval
|
||||||
(parameterize ([sandbox-memory-limit 256]
|
(parameterize ([sandbox-memory-limit 256]
|
||||||
|
[sandbox-eval-limits '(+inf.0 256)]
|
||||||
[sandbox-output (current-output-port)]
|
[sandbox-output (current-output-port)]
|
||||||
[sandbox-network-guard my-network-guard])
|
[sandbox-network-guard my-network-guard])
|
||||||
(printf "memory limit: ~s mb\n" (sandbox-memory-limit))
|
(printf "memory limit: ~s mb\n" (sandbox-memory-limit))
|
||||||
|
|
|
@ -77,7 +77,6 @@
|
||||||
[else #f]))
|
[else #f]))
|
||||||
;; Compile the program here...
|
;; Compile the program here...
|
||||||
(with-handlers ([exn:fail? (lambda (exn)
|
(with-handlers ([exn:fail? (lambda (exn)
|
||||||
(printf "Error: ~s\n" (exn-message exn))
|
|
||||||
(write-json (hash 'type "error"
|
(write-json (hash 'type "error"
|
||||||
'message (exn-message exn))
|
'message (exn-message exn))
|
||||||
op))])
|
op))])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user