152eb3aa038227e1379e5c57dbce12c01f29f52d
[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 (file-comment
13   "$Header$")
14
15 (defparameter *format-whitespace-chars*
16   (vector #\space
17           #\newline
18           ;; We leave out this non-STANDARD-CHARACTER entry from this table
19           ;; when we're running in the cross-compilation host, since ANSI
20           ;; doesn't require the cross-compilation host to know what a tab is.
21           #-sb-xc-host (code-char tab-char-code)))
22
23 (defvar *format-directive-expanders*
24   (make-array char-code-limit :initial-element nil))
25 (defvar *format-directive-interpreters*
26   (make-array char-code-limit :initial-element nil))
27
28 (defvar *default-format-error-control-string* nil)
29 (defvar *default-format-error-offset* nil)
30 \f
31 ;;;; specials used to communicate information
32
33 ;;; Used both by the expansion stuff and the interpreter stuff. When it is
34 ;;; non-NIL, up-up-and-out (~:^) is allowed. Otherwise, ~:^ isn't allowed.
35 (defvar *up-up-and-out-allowed* nil)
36
37 ;;; Used by the interpreter stuff. When it non-NIL, its a function that will
38 ;;; invoke PPRINT-POP in the right lexical environemnt.
39 (defvar *logical-block-popper* nil)
40
41 ;;; Used by the expander stuff. This is bindable so that ~<...~:>
42 ;;; can change it.
43 (defvar *expander-next-arg-macro* 'expander-next-arg)
44
45 ;;; Used by the expander stuff. Initially starts as T, and gets set to NIL
46 ;;; if someone needs to do something strange with the arg list (like use
47 ;;; the rest, or something).
48 (defvar *only-simple-args*)
49
50 ;;; Used by the expander stuff. We do an initial pass with this as NIL.
51 ;;; If someone doesn't like this, they (throw 'need-orig-args nil) and we try
52 ;;; again with it bound to T. If this is T, we don't try to do anything
53 ;;; fancy with args.
54 (defvar *orig-args-available* nil)
55
56 ;;; Used by the expander stuff. List of (symbol . offset) for simple args.
57 (defvar *simple-args*)