From 8ca4a019fd9fd7bf037b928116d5bf8fb57407ba Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 25 Mar 2017 18:12:36 +0000 Subject: [PATCH] src/final.lisp (test-module): Optionally clear the decks before parsing. --- doc/misc.tex | 2 +- src/final.lisp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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 @@ (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) -- 2.11.0