From b0f1bc01b640713216949579e3d3c70714879e24 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Tue, 5 Apr 2011 21:21:06 +0000 Subject: [PATCH] log parse-js:js-parse-errors to *error-output* rather than dropping into the debugger this makes it easier to use the standalone program in a UNIX environment --- build/main.lisp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build/main.lisp b/build/main.lisp index 83f86f8..47a5e15 100644 --- a/build/main.lisp +++ b/build/main.lisp @@ -12,7 +12,7 @@ :toplevel mangle-toplevel) :beautify beautify)) -(defun main (argv) +(defun main-inner (argv) (declare (ignore argv)) (with-cli-options () (beautify no-sequences no-comment keep-dead-code mangle-toplevel overwrite &free rest) (let ((input-file (car rest)) @@ -49,3 +49,13 @@ :if-does-not-exist :create) (write-string result out)) (write-string result *standard-output*))))))) + +(defun main (argv) + (handler-case + (main-inner argv) + (parse-js:js-parse-error (err) + (progn (format *error-output* + "parse error at line ~a, column ~a~%" + (parse-js:js-parse-error-line err) + (parse-js:js-parse-error-char err)) + ""))))