From: Mark Wooding Date: Sat, 25 Mar 2017 18:12:36 +0000 (+0000) Subject: src/final.lisp (test-module): Optionally clear the decks before parsing. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/commitdiff_plain/8ca4a019fd9fd7bf037b928116d5bf8fb57407ba src/final.lisp (test-module): Optionally clear the decks before parsing. --- diff --git a/doc/misc.tex b/doc/misc.tex index ba76cd8..e97fcb0 100644 --- a/doc/misc.tex +++ b/doc/misc.tex @@ -568,7 +568,7 @@ These symbols are defined in the @!optparse| package. \begin{describe}{var}{*debugout-pathname*} \end{describe} -\begin{describe}{fun}{test-module @ \&key :reason @> @} +\begin{describe}{fun}{test-module @ \&key :reason :clear @> @} \end{describe} \begin{describe}{fun} diff --git a/src/final.lisp b/src/final.lisp index b98acd1..0528491 100644 --- a/src/final.lisp +++ b/src/final.lisp @@ -39,14 +39,17 @@ (export '*debugout-pathname*) (defvar *debugout-pathname* #p"debugout.c") (export 'test-module) -(defun test-module (path &key reason) +(defun test-module (path &key reason clear) "Read a module from PATH, to exercise the machinery. + If CLEAR is non-nil, then reset the translator's state before proceeding. + If REASON is non-nil, then output the module to `*debugout-pathname*' with that REASON. Return a two-element list (NERROR NWARNING) of the number of errors and warnings encountered while processing the module." + (when clear (clear-the-decks)) (multiple-value-bind (module nerror nwarning) (count-and-report-errors () (read-module path)) (when (and module reason)