8e1bbe3201ba539e00fc0d2e1bbcaeab92c00bf9
[sbcl.git] / src / code / early-format.lisp
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
9
10 (in-package "SB!FORMAT")
11
12 (defparameter *format-whitespace-chars*
13   (vector #\space
14           #\newline
15           ;; We leave out this non-STANDARD-CHARACTER entry from this table
16           ;; when we're running in the cross-compilation host, since ANSI
17           ;; doesn't require the cross-compilation host to know what a tab is.
18           #-sb-xc-host (code-char tab-char-code)))
19
20 (defvar *format-directive-expanders*
21   (make-array char-code-limit :initial-element nil))
22 (defvar *format-directive-interpreters*
23   (make-array char-code-limit :initial-element nil))
24
25 (defvar *default-format-error-control-string* nil)
26 (defvar *default-format-error-offset* nil)
27 \f
28 ;;;; specials used to communicate information
29
30 ;;; Used both by the expansion stuff and the interpreter stuff. When it is
31 ;;; non-NIL, up-up-and-out (~:^) is allowed. Otherwise, ~:^ isn't allowed.
32 (defvar *up-up-and-out-allowed* nil)
33
34 ;;; Used by the interpreter stuff. When it non-NIL, its a function that will
35 ;;; invoke PPRINT-POP in the right lexical environemnt.
36 (defvar *logical-block-popper* nil)
37
38 ;;; Used by the expander stuff. This is bindable so that ~<...~:>
39 ;;; can change it.
40 (defvar *expander-next-arg-macro* 'expander-next-arg)
41
42 ;;; Used by the expander stuff. Initially starts as T, and gets set to NIL
43 ;;; if someone needs to do something strange with the arg list (like use
44 ;;; the rest, or something).
45 (defvar *only-simple-args*)
46
47 ;;; Used by the expander stuff. We do an initial pass with this as NIL.
48 ;;; If someone doesn't like this, they (THROW 'NEED-ORIG-ARGS NIL) and we try
49 ;;; again with it bound to T. If this is T, we don't try to do anything
50 ;;; fancy with args.
51 (defvar *orig-args-available* nil)
52
53 ;;; Used by the expander stuff. List of (symbol . offset) for simple args.
54 (defvar *simple-args*)