Commit | Line | Data |
---|---|---|
e33ea301 MW |
1 | ;;; -*-lisp-*- |
2 | ;;; | |
3 | ;;; Debugging utilities for Sod | |
4 | ;;; | |
5 | ;;; (c) 2015 Straylight/Edgeware | |
6 | ;;; | |
7 | ||
8 | ;;;----- Licensing notice --------------------------------------------------- | |
9 | ;;; | |
10 | ;;; This file is part of the Sensble Object Design, an object system for C. | |
11 | ;;; | |
12 | ;;; SOD is free software; you can redistribute it and/or modify | |
13 | ;;; it under the terms of the GNU General Public License as published by | |
14 | ;;; the Free Software Foundation; either version 2 of the License, or | |
15 | ;;; (at your option) any later version. | |
16 | ;;; | |
17 | ;;; SOD is distributed in the hope that it will be useful, | |
18 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ;;; GNU General Public License for more details. | |
21 | ;;; | |
22 | ;;; You should have received a copy of the GNU General Public License | |
23 | ;;; along with SOD; if not, write to the Free Software Foundation, | |
24 | ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
25 | ||
26 | (cl:in-package #:sod) | |
27 | ||
76618d28 MW |
28 | (export '*debugout-pathname*) |
29 | (defvar *debugout-pathname* #p"debugout.c") | |
30 | ||
e33ea301 MW |
31 | (export 'test-module) |
32 | (defun test-module (path reason) | |
33 | "Reset the translator's state, read a module from PATH and output it with | |
34 | REASON, returning the result as a string." | |
35 | (unless *builtin-module* (make-builtin-module)) | |
36 | (clear-the-decks) | |
37 | (setf *module-map* (make-hash-table :test #'equal)) | |
76618d28 MW |
38 | (with-open-file (out *debugout-pathname* |
39 | :direction :output | |
40 | :if-exists :supersede | |
41 | :if-does-not-exist :create) | |
e33ea301 MW |
42 | (output-module (read-module path) reason out))) |
43 | ||
44 | ;;;----- That's all, folks -------------------------------------------------- |