psyntax uses define-syntax-rule
[bpt/guile.git] / module / texinfo.scm
CommitLineData
47f3ce52
AW
1;;;; (texinfo) -- parsing of texinfo into SXML
2;;;;
31d59769 3;;;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
47f3ce52
AW
4;;;; Copyright (C) 2004, 2009 Andy Wingo <wingo at pobox dot com>
5;;;; Copyright (C) 2001,2002 Oleg Kiselyov <oleg at pobox dot com>
6;;;;
7;;;; This file is based on SSAX's SSAX.scm.
8;;;;
9;;;; This library is free software; you can redistribute it and/or
10;;;; modify it under the terms of the GNU Lesser General Public
11;;;; License as published by the Free Software Foundation; either
12;;;; version 3 of the License, or (at your option) any later version.
13;;;;
14;;;; This library is distributed in the hope that it will be useful,
15;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17;;;; Lesser General Public License for more details.
18;;;;
19;;;; You should have received a copy of the GNU Lesser General Public
20;;;; License along with this library; if not, write to the Free Software
21;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22\f
23;;; Commentary:
24;;
25;; @subheading Texinfo processing in scheme
26;;
27;; This module parses texinfo into SXML. TeX will always be the
28;; processor of choice for print output, of course. However, although
29;; @code{makeinfo} works well for info, its output in other formats is
30;; not very customizable, and the program is not extensible as a whole.
31;; This module aims to provide an extensible framework for texinfo
32;; processing that integrates texinfo into the constellation of SXML
33;; processing tools.
34;;
35;; @subheading Notes on the SXML vocabulary
36;;
37;; Consider the following texinfo fragment:
38;;
39;;@example
40;; @@deffn Primitive set-car! pair value
41;; This function...
42;; @@end deffn
43;;@end example
44;;
45;; Logically, the category (Primitive), name (set-car!), and arguments
46;; (pair value) are ``attributes'' of the deffn, with the description as
47;; the content. However, texinfo allows for @@-commands within the
48;; arguments to an environment, like @code{@@deffn}, which means that
49;; texinfo ``attributes'' are PCDATA. XML attributes, on the other hand,
50;; are CDATA. For this reason, ``attributes'' of texinfo @@-commands are
51;; called ``arguments'', and are grouped under the special element, `%'.
52;;
53;; Because `%' is not a valid NCName, stexinfo is a superset of SXML. In
54;; the interests of interoperability, this module provides a conversion
55;; function to replace the `%' with `texinfo-arguments'.
56;;
57;;; Code:
58
59;; Comparison to xml output of texinfo (which is rather undocumented):
60;; Doesn't conform to texinfo dtd
61;; No DTD at all, in fact :-/
62;; Actually outputs valid xml, after transforming %
63;; Slower (although with caching the SXML that problem can go away)
64;; Doesn't parse menus (although menus are shite)
65;; Args go in a dedicated element, FBOFW
66;; Definitions are handled a lot better
67;; Does parse comments
68;; Outputs only significant line breaks (a biggie!)
69;; Nodes are treated as anchors, rather than content organizers (a biggie)
70;; (more book-like, less info-like)
71
72;; TODO
73;; Integration: help, indexing, plain text
74
75(define-module (texinfo)
76 #:use-module (sxml simple)
77 #:use-module (sxml transform)
78 #:use-module (sxml ssax input-parse)
79 #:use-module (srfi srfi-1)
80 #:use-module (srfi srfi-13)
81 #:export (call-with-file-and-dir
82 texi-command-specs
83 texi-command-depth
84 texi-fragment->stexi
85 texi->stexi
86 stexi->sxml))
87
88;; Some utilities
89
90(define (parser-error port message . rest)
05c29c5a 91 (apply throw 'parser-error port message rest))
47f3ce52
AW
92
93(define (call-with-file-and-dir filename proc)
94 "Call the one-argument procedure @var{proc} with an input port that
95reads from @var{filename}. During the dynamic extent of @var{proc}'s
96execution, the current directory will be @code{(dirname
97@var{filename})}. This is useful for parsing documents that can include
98files by relative path name."
99 (let ((current-dir (getcwd)))
100 (dynamic-wind
101 (lambda () (chdir (dirname filename)))
102 (lambda ()
103 (call-with-input-file (basename filename) proc))
104 (lambda () (chdir current-dir)))))
105
106;; Define this version here, because (srfi srfi-11)'s definition uses
107;; syntax-rules, which is really damn slow
108(define-macro (let*-values bindings . body)
109 (if (null? bindings) (cons 'begin body)
110 (apply
111 (lambda (vars initializer)
112 (let ((cont
113 (cons 'let*-values
114 (cons (cdr bindings) body))))
115 (cond
116 ((not (pair? vars)) ; regular let case, a single var
117 `(let ((,vars ,initializer)) ,cont))
118 ((null? (cdr vars)) ; single var, see the prev case
119 `(let ((,(car vars) ,initializer)) ,cont))
120 (else ; the most generic case
121 `(call-with-values (lambda () ,initializer)
122 (lambda ,vars ,cont))))))
123 (car bindings))))
124
125;;========================================================================
126;; Reflection on the XML vocabulary
127
128(define texi-command-specs
129 #;
130"A list of (@var{name} @var{content-model} . @var{args})
131
132@table @var
133@item name
134The name of an @@-command, as a symbol.
135
136@item content-model
137A symbol indicating the syntactic type of the @@-command:
138@table @code
139@item EMPTY-COMMAND
140No content, and no @code{@@end} is coming
141@item EOL-ARGS
142Unparsed arguments until end of line
143@item EOL-TEXT
144Parsed arguments until end of line
145@item INLINE-ARGS
146Unparsed arguments ending with @code{#\\@}}
147@item INLINE-TEXT
148Parsed arguments ending with @code{#\\@}}
149@item ENVIRON
150The tag is an environment tag, expect @code{@@end foo}.
151@item TABLE-ENVIRON
152Like ENVIRON, but with special parsing rules for its arguments.
153@item FRAGMENT
154For @code{*fragment*}, the command used for parsing fragments of
155texinfo documents.
156@end table
157
158@code{INLINE-TEXT} commands will receive their arguments within their
159bodies, whereas the @code{-ARGS} commands will receive them in their
160attribute list.
161
162@code{EOF-TEXT} receives its arguments in its body.
163
164@code{ENVIRON} commands have both: parsed arguments until the end of
165line, received through their attribute list, and parsed text until the
166@code{@@end}, received in their bodies.
167
168@code{EOF-TEXT-ARGS} receives its arguments in its attribute list, as in
169@code{ENVIRON}.
170
31d59769
AW
171In addition, @code{ALIAS} can alias one command to another. The alias
172will never be seen in parsed stexinfo.
173
47f3ce52
AW
174There are four @@-commands that are treated specially. @code{@@include}
175is a low-level token that will not be seen by higher-level parsers, so
176it has no content-model. @code{@@para} is the paragraph command, which
177is only implicit in the texinfo source. @code{@@item} has special
178syntax, as noted above, and @code{@@entry} is how this parser treats
179@code{@@item} commands within @code{@@table}, @code{@@ftable}, and
180@code{@@vtable}.
181
182Also, indexing commands (@code{@@cindex}, etc.) are treated specially.
183Their arguments are parsed, but they are needed before entering the
184element so that an anchor can be inserted into the text before the index
185entry.
186
187@item args
188Named arguments to the command, in the same format as the formals for a
189lambda. Only present for @code{INLINE-ARGS}, @code{EOL-ARGS},
190@code{ENVIRON}, @code{TABLE-ENVIRON} commands.
191@end table"
192 '(;; Special commands
193 (include #f) ;; this is a low-level token
194 (para PARAGRAPH)
195 (item ITEM)
196 (entry ENTRY . heading)
197 (noindent EMPTY-COMMAND)
198 (*fragment* FRAGMENT)
199
200 ;; Inline text commands
201 (*braces* INLINE-TEXT) ;; FIXME: make me irrelevant
202 (bold INLINE-TEXT)
203 (sample INLINE-TEXT)
204 (samp INLINE-TEXT)
205 (code INLINE-TEXT)
206 (kbd INLINE-TEXT)
207 (key INLINE-TEXT)
208 (var INLINE-TEXT)
209 (env INLINE-TEXT)
210 (file INLINE-TEXT)
211 (command INLINE-TEXT)
212 (option INLINE-TEXT)
213 (dfn INLINE-TEXT)
214 (cite INLINE-TEXT)
215 (acro INLINE-TEXT)
47f3ce52
AW
216 (email INLINE-TEXT)
217 (emph INLINE-TEXT)
218 (strong INLINE-TEXT)
219 (sample INLINE-TEXT)
220 (sc INLINE-TEXT)
221 (titlefont INLINE-TEXT)
222 (asis INLINE-TEXT)
223 (b INLINE-TEXT)
224 (i INLINE-TEXT)
225 (r INLINE-TEXT)
226 (sansserif INLINE-TEXT)
227 (slanted INLINE-TEXT)
228 (t INLINE-TEXT)
229
230 ;; Inline args commands
231 (value INLINE-ARGS . (key))
232 (ref INLINE-ARGS . (node #:opt name section info-file manual))
233 (xref INLINE-ARGS . (node #:opt name section info-file manual))
234 (pxref INLINE-ARGS . (node #:opt name section info-file manual))
31d59769 235 (url ALIAS . uref)
47f3ce52
AW
236 (uref INLINE-ARGS . (url #:opt title replacement))
237 (anchor INLINE-ARGS . (name))
238 (dots INLINE-ARGS . ())
239 (result INLINE-ARGS . ())
240 (bullet INLINE-ARGS . ())
241 (copyright INLINE-ARGS . ())
242 (tie INLINE-ARGS . ())
243 (image INLINE-ARGS . (file #:opt width height alt-text extension))
244
245 ;; EOL args elements
246 (node EOL-ARGS . (name #:opt next previous up))
247 (c EOL-ARGS . all)
248 (comment EOL-ARGS . all)
249 (setchapternewpage EOL-ARGS . all)
250 (sp EOL-ARGS . all)
251 (page EOL-ARGS . ())
252 (vskip EOL-ARGS . all)
253 (syncodeindex EOL-ARGS . all)
254 (contents EOL-ARGS . ())
255 (shortcontents EOL-ARGS . ())
256 (summarycontents EOL-ARGS . ())
257 (insertcopying EOL-ARGS . ())
258 (dircategory EOL-ARGS . (category))
259 (top EOL-ARGS . (title))
260 (printindex EOL-ARGS . (type))
406524ea 261 (paragraphindent EOL-ARGS . (indent))
47f3ce52
AW
262
263 ;; EOL text commands
264 (*ENVIRON-ARGS* EOL-TEXT)
265 (itemx EOL-TEXT)
266 (set EOL-TEXT)
267 (center EOL-TEXT)
268 (title EOL-TEXT)
269 (subtitle EOL-TEXT)
270 (author EOL-TEXT)
271 (chapter EOL-TEXT)
272 (section EOL-TEXT)
273 (appendix EOL-TEXT)
274 (appendixsec EOL-TEXT)
275 (unnumbered EOL-TEXT)
276 (unnumberedsec EOL-TEXT)
277 (subsection EOL-TEXT)
278 (subsubsection EOL-TEXT)
279 (appendixsubsec EOL-TEXT)
280 (appendixsubsubsec EOL-TEXT)
281 (unnumberedsubsec EOL-TEXT)
282 (unnumberedsubsubsec EOL-TEXT)
283 (chapheading EOL-TEXT)
284 (majorheading EOL-TEXT)
285 (heading EOL-TEXT)
286 (subheading EOL-TEXT)
287 (subsubheading EOL-TEXT)
288
289 (deftpx EOL-TEXT-ARGS . (category name . attributes))
290 (defcvx EOL-TEXT-ARGS . (category class name))
291 (defivarx EOL-TEXT-ARGS . (class name))
292 (deftypeivarx EOL-TEXT-ARGS . (class data-type name))
293 (defopx EOL-TEXT-ARGS . (category class name . arguments))
294 (deftypeopx EOL-TEXT-ARGS . (category class data-type name . arguments))
295 (defmethodx EOL-TEXT-ARGS . (class name . arguments))
296 (deftypemethodx EOL-TEXT-ARGS . (class data-type name . arguments))
297 (defoptx EOL-TEXT-ARGS . (name))
298 (defvrx EOL-TEXT-ARGS . (category name))
299 (defvarx EOL-TEXT-ARGS . (name))
300 (deftypevrx EOL-TEXT-ARGS . (category data-type name))
301 (deftypevarx EOL-TEXT-ARGS . (data-type name))
302 (deffnx EOL-TEXT-ARGS . (category name . arguments))
303 (deftypefnx EOL-TEXT-ARGS . (category data-type name . arguments))
304 (defspecx EOL-TEXT-ARGS . (name . arguments))
305 (defmacx EOL-TEXT-ARGS . (name . arguments))
306 (defunx EOL-TEXT-ARGS . (name . arguments))
307 (deftypefunx EOL-TEXT-ARGS . (data-type name . arguments))
308
309 ;; Indexing commands
310 (cindex INDEX . entry)
311 (findex INDEX . entry)
312 (vindex INDEX . entry)
313 (kindex INDEX . entry)
314 (pindex INDEX . entry)
315 (tindex INDEX . entry)
316
317 ;; Environment commands (those that need @end)
318 (texinfo ENVIRON . title)
319 (ignore ENVIRON . ())
320 (ifinfo ENVIRON . ())
321 (iftex ENVIRON . ())
322 (ifhtml ENVIRON . ())
323 (ifxml ENVIRON . ())
324 (ifplaintext ENVIRON . ())
325 (ifnotinfo ENVIRON . ())
326 (ifnottex ENVIRON . ())
327 (ifnothtml ENVIRON . ())
328 (ifnotxml ENVIRON . ())
329 (ifnotplaintext ENVIRON . ())
330 (titlepage ENVIRON . ())
331 (menu ENVIRON . ())
332 (direntry ENVIRON . ())
333 (copying ENVIRON . ())
334 (example ENVIRON . ())
335 (smallexample ENVIRON . ())
336 (display ENVIRON . ())
337 (smalldisplay ENVIRON . ())
338 (verbatim ENVIRON . ())
339 (format ENVIRON . ())
340 (smallformat ENVIRON . ())
341 (lisp ENVIRON . ())
342 (smalllisp ENVIRON . ())
343 (cartouche ENVIRON . ())
344 (quotation ENVIRON . ())
345
346 (deftp ENVIRON . (category name . attributes))
347 (defcv ENVIRON . (category class name))
348 (defivar ENVIRON . (class name))
349 (deftypeivar ENVIRON . (class data-type name))
350 (defop ENVIRON . (category class name . arguments))
351 (deftypeop ENVIRON . (category class data-type name . arguments))
352 (defmethod ENVIRON . (class name . arguments))
353 (deftypemethod ENVIRON . (class data-type name . arguments))
354 (defopt ENVIRON . (name))
355 (defvr ENVIRON . (category name))
356 (defvar ENVIRON . (name))
357 (deftypevr ENVIRON . (category data-type name))
358 (deftypevar ENVIRON . (data-type name))
359 (deffn ENVIRON . (category name . arguments))
360 (deftypefn ENVIRON . (category data-type name . arguments))
361 (defspec ENVIRON . (name . arguments))
362 (defmac ENVIRON . (name . arguments))
363 (defun ENVIRON . (name . arguments))
364 (deftypefun ENVIRON . (data-type name . arguments))
365
366 (table TABLE-ENVIRON . (formatter))
367 (itemize TABLE-ENVIRON . (formatter))
368 (enumerate TABLE-ENVIRON . (start))
369 (ftable TABLE-ENVIRON . (formatter))
370 (vtable TABLE-ENVIRON . (formatter))))
371
372(define command-depths
373 '((chapter . 1) (section . 2) (subsection . 3) (subsubsection . 4)
374 (top . 0) (unnumbered . 1) (unnumberedsec . 2)
375 (unnumberedsubsec . 3) (unnumberedsubsubsec . 4)
376 (appendix . 1) (appendixsec . 2) (appendixsection . 2)
377 (appendixsubsec . 3) (appendixsubsubsec . 4)))
378(define (texi-command-depth command max-depth)
379 "Given the texinfo command @var{command}, return its nesting level, or
380@code{#f} if it nests too deep for @var{max-depth}.
381
382Examples:
383@example
05c29c5a
AW
384 (texi-command-depth 'chapter 4) @result{} 1
385 (texi-command-depth 'top 4) @result{} 0
386 (texi-command-depth 'subsection 4) @result{} 3
387 (texi-command-depth 'appendixsubsec 4) @result{} 3
388 (texi-command-depth 'subsection 2) @result{} #f
47f3ce52
AW
389@end example"
390 (let ((depth (and=> (assq command command-depths) cdr)))
391 (and depth (<= depth max-depth) depth)))
392
393;; The % is for arguments
394(define (space-significant? command)
395 (memq command
396 '(example smallexample verbatim lisp smalllisp menu %)))
397
398;; Like a DTD for texinfo
399(define (command-spec command)
400 (or (assq command texi-command-specs)
401 (parser-error #f "Unknown command" command)))
402
403(define (inline-content? content)
404 (or (eq? content 'INLINE-TEXT) (eq? content 'INLINE-ARGS)))
405
406
407;;========================================================================
408;; Lower-level parsers and scanners
409;;
410;; They deal with primitive lexical units (Names, whitespaces, tags) and
411;; with pieces of more generic productions. Most of these parsers must
412;; be called in appropriate context. For example, complete-start-command
413;; must be called only when the @-command start has been detected and
414;; its name token has been read.
415
416;; Test if a string is made of only whitespace
417;; An empty string is considered made of whitespace as well
418(define (string-whitespace? str)
419 (or (string-null? str)
420 (string-every char-whitespace? str)))
421
422;; Like read-text-line, but allows EOF.
423(define read-eof-breaks '(*eof* #\return #\newline))
424(define (read-eof-line port)
425 (if (eof-object? (peek-char port))
426 (peek-char port)
427 (let* ((line (next-token '() read-eof-breaks
428 "reading a line" port))
429 (c (read-char port))) ; must be either \n or \r or EOF
430 (if (and (eq? c #\return) (eq? (peek-char port) #\newline))
431 (read-char port)) ; skip \n that follows \r
432 line)))
433
47f3ce52
AW
434(define (skip-whitespace port)
435 (skip-while '(#\space #\tab #\return #\newline) port))
436
437(define (skip-horizontal-whitespace port)
438 (skip-while '(#\space #\tab) port))
439
440;; command ::= Letter+
441
442;; procedure: read-command PORT
443;;
444;; Read a command starting from the current position in the PORT and
445;; return it as a symbol.
446(define (read-command port)
447 (let ((first-char (peek-char port)))
448 (or (char-alphabetic? first-char)
449 (parser-error port "Nonalphabetic @-command char: '" first-char "'")))
450 (string->symbol
451 (next-token-of
452 (lambda (c)
453 (cond
454 ((eof-object? c) #f)
455 ((char-alphabetic? c) c)
456 (else #f)))
457 port)))
458
459;; A token is a primitive lexical unit. It is a record with two fields,
460;; token-head and token-kind.
461;;
462;; Token types:
463;; END The end of a texinfo command. If the command is ended by },
464;; token-head will be #f. Otherwise if the command is ended by
465;; @end COMMAND, token-head will be COMMAND. As a special case,
466;; @bye is the end of a special @texinfo command.
467;; START The start of a texinfo command. The token-head will be a
468;; symbol of the @-command name.
469;; INCLUDE An @include directive. The token-head will be empty -- the
470;; caller is responsible for reading the include file name.
471;; ITEM @item commands have an irregular syntax. They end at the
472;; next @item, or at the end of the environment. For that
473;; read-command-token treats them specially.
474
475(define (make-token kind head) (cons kind head))
476(define token? pair?)
477(define token-kind car)
478(define token-head cdr)
479
480;; procedure: read-command-token PORT
481;;
482;; This procedure starts parsing of a command token. The current
483;; position in the stream must be #\@. This procedure scans enough of
484;; the input stream to figure out what kind of a command token it is
485;; seeing. The procedure returns a token structure describing the token.
486
487(define (read-command-token port)
488 (assert-curr-char '(#\@) "start of the command" port)
489 (let ((peeked (peek-char port)))
490 (cond
491 ((memq peeked '(#\! #\. #\? #\@ #\\ #\{ #\}))
492 ;; @-commands that escape characters
493 (make-token 'STRING (string (read-char port))))
494 (else
495 (let ((name (read-command port)))
496 (case name
497 ((end)
498 ;; got an ending tag
499 (let ((command (string-trim-both
500 (read-eof-line port))))
501 (or (and (not (string-null? command))
502 (string-every char-alphabetic? command))
503 (parser-error port "malformed @end" command))
504 (make-token 'END (string->symbol command))))
505 ((bye)
506 ;; the end of the top
507 (make-token 'END 'texinfo))
508 ((item)
509 (make-token 'ITEM 'item))
510 ((include)
511 (make-token 'INCLUDE #f))
512 (else
513 (make-token 'START name))))))))
514
515;; procedure+: read-verbatim-body PORT STR-HANDLER SEED
516;;
517;; This procedure must be called after we have read a string
518;; "@verbatim\n" that begins a verbatim section. The current position
519;; must be the first position of the verbatim body. This function reads
520;; _lines_ of the verbatim body and passes them to a STR-HANDLER, a
521;; character data consumer.
522;;
523;; The str-handler is a STR-HANDLER, a procedure STRING1 STRING2 SEED.
524;; The first STRING1 argument to STR-HANDLER never contains a newline.
525;; The second STRING2 argument often will. On the first invocation of the
526;; STR-HANDLER, the seed is the one passed to read-verbatim-body
527;; as the third argument. The result of this first invocation will be
528;; passed as the seed argument to the second invocation of the line
529;; consumer, and so on. The result of the last invocation of the
530;; STR-HANDLER is returned by the read-verbatim-body. Note a
531;; similarity to the fundamental 'fold' iterator.
532;;
533;; Within a verbatim section all characters are taken at their face
534;; value. It ends with "\n@end verbatim(\r)?\n".
535
536;; Must be called right after the newline after @verbatim.
537(define (read-verbatim-body port str-handler seed)
538 (let loop ((seed seed))
539 (let ((fragment (next-token '() '(#\newline)
540 "reading verbatim" port)))
541 ;; We're reading the char after the 'fragment', which is
542 ;; #\newline.
543 (read-char port)
544 (if (string=? fragment "@end verbatim")
545 seed
546 (loop (str-handler fragment "\n" seed))))))
547
548;; procedure+: read-arguments PORT
549;;
550;; This procedure reads and parses a production ArgumentList.
551;; ArgumentList ::= S* Argument (S* , S* Argument)* S*
552;; Argument ::= ([^@{},])*
553;;
554;; Arguments are the things in braces, i.e @ref{my node} has one
555;; argument, "my node". Most commands taking braces actually don't have
556;; arguments, they process text. For example, in
557;; @emph{@strong{emphasized}}, the emph takes text, because the parse
558;; continues into the braces.
559;;
560;; Any whitespace within Argument is replaced with a single space.
561;; Whitespace around an Argument is trimmed.
562;;
563;; The procedure returns a list of arguments. Afterwards the current
564;; character will be after the final #\}.
565
566(define (read-arguments port stop-char)
567 (define (split str)
568 (read-char port) ;; eat the delimiter
569 (let ((ret (map (lambda (x) (if (string-null? x) #f x))
570 (map string-trim-both (string-split str #\,)))))
571 (if (and (pair? ret) (eq? (car ret) #f) (null? (cdr ret)))
572 '()
573 ret)))
574 (split (next-token '() (list stop-char)
575 "arguments of @-command" port)))
576
577;; procedure+: complete-start-command COMMAND PORT
578;;
579;; This procedure is to complete parsing of an @-command. The procedure
580;; must be called after the command token has been read. COMMAND is a
581;; TAG-NAME.
582;;
583;; This procedure returns several values:
584;; COMMAND: a symbol.
585;; ARGUMENTS: command's arguments, as an alist.
586;; CONTENT-MODEL: the content model of the command.
587;;
588;; On exit, the current position in PORT will depend on the CONTENT-MODEL.
589;;
590;; Content model Port position
591;; ============= =============
592;; INLINE-TEXT One character after the #\{.
593;; INLINE-ARGS The first character after the #\}.
594;; EOL-TEXT The first non-whitespace character after the command.
595;; ENVIRON, TABLE-ENVIRON, EOL-ARGS, EOL-TEXT
596;; The first character on the next line.
597;; PARAGRAPH, ITEM, EMPTY-COMMAND
598;; The first character after the command.
599
600(define (arguments->attlist port args arg-names)
601 (let loop ((in args) (names arg-names) (opt? #f) (out '()))
602 (cond
603 ((symbol? names) ;; a rest arg
604 (reverse (if (null? in) out (acons names in out))))
605 ((and (not (null? names)) (eq? (car names) #:opt))
606 (loop in (cdr names) #t out))
607 ((null? in)
608 (if (or (null? names) opt?)
609 (reverse out)
610 (parser-error port "@-command expected more arguments:"
611 args arg-names names)))
612 ((null? names)
613 (parser-error port "@-command didn't expect more arguments:" in))
614 ((not (car in))
615 (or (and opt? (loop (cdr in) (cdr names) opt? out))
616 (parser-error "@-command missing required argument"
617 (car names))))
618 (else
619 (loop (cdr in) (cdr names) opt?
620 (cons (list (car names) (car in)) out))))))
621
622(define (parse-table-args command port)
623 (let* ((line (string-trim-both (read-text-line port)))
624 (length (string-length line)))
625 (define (get-formatter)
626 (or (and (not (zero? length))
627 (eq? (string-ref line 0) #\@)
628 (let ((f (string->symbol (substring line 1))))
629 (or (inline-content? (cadr (command-spec f)))
630 (parser-error
631 port "@item formatter must be INLINE" f))
632 f))
05c29c5a 633 (parser-error port "Invalid @item formatter" line)))
47f3ce52
AW
634 (case command
635 ((enumerate)
636 (if (zero? length)
637 '()
638 `((start
639 ,(if (or (and (eq? length 1)
640 (char-alphabetic? (string-ref line 0)))
641 (string-every char-numeric? line))
642 line
643 (parser-error
644 port "Invalid enumerate start" line))))))
645 ((itemize)
646 `((bullet
647 ,(or (and (eq? length 1) line)
648 (and (string-null? line) '(bullet))
649 (list (get-formatter))))))
650 (else ;; tables of various varieties
651 `((formatter (,(get-formatter))))))))
652
653(define (complete-start-command command port)
654 (define (get-arguments type arg-names stop-char)
655 (arguments->attlist port (read-arguments port stop-char) arg-names))
656
657 (let* ((spec (command-spec command))
658 (type (cadr spec))
659 (arg-names (cddr spec)))
660 (case type
31d59769
AW
661 ((ALIAS)
662 (complete-start-command arg-names port))
47f3ce52
AW
663 ((INLINE-TEXT)
664 (assert-curr-char '(#\{) "Inline element lacks {" port)
665 (values command '() type))
666 ((INLINE-ARGS)
667 (assert-curr-char '(#\{) "Inline element lacks {" port)
668 (values command (get-arguments type arg-names #\}) type))
669 ((EOL-ARGS)
670 (values command (get-arguments type arg-names #\newline) type))
671 ((ENVIRON ENTRY INDEX)
672 (skip-horizontal-whitespace port)
673 (values command (parse-environment-args command port) type))
674 ((TABLE-ENVIRON)
675 (skip-horizontal-whitespace port)
676 (values command (parse-table-args command port) type))
677 ((EOL-TEXT)
678 (skip-horizontal-whitespace port)
679 (values command '() type))
680 ((EOL-TEXT-ARGS)
681 (skip-horizontal-whitespace port)
682 (values command (parse-eol-text-args command port) type))
683 ((PARAGRAPH EMPTY-COMMAND ITEM FRAGMENT)
684 (values command '() type))
685 (else ;; INCLUDE shouldn't get here
686 (parser-error port "can't happen")))))
687
688;;-----------------------------------------------------------------------------
689;; Higher-level parsers and scanners
690;;
691;; They parse productions corresponding entire @-commands.
692
693;; Only reads @settitle, leaves it to the command parser to finish
694;; reading the title.
695(define (take-until-settitle port)
696 (or (find-string-from-port? "\n@settitle " port)
697 (parser-error port "No \\n@settitle found"))
698 (skip-horizontal-whitespace port)
699 (and (eq? (peek-char port) #\newline)
700 (parser-error port "You have a @settitle, but no title")))
701
702;; procedure+: read-char-data PORT EXPECT-EOF? STR-HANDLER SEED
703;;
704;; This procedure is to read the CharData of a texinfo document.
705;;
706;; text ::= (CharData | Command)*
707;;
708;; The procedure reads CharData and stops at @-commands (or
709;; environments). It also stops at an open or close brace.
710;;
711;; port
712;; a PORT to read
713;; expect-eof?
714;; a boolean indicating if EOF is normal, i.e., the character
715;; data may be terminated by the EOF. EOF is normal
716;; while processing the main document.
717;; preserve-ws?
718;; a boolean indicating if we are within a whitespace-preserving
719;; environment. If #t, suppress paragraph detection.
720;; str-handler
721;; a STR-HANDLER, see read-verbatim-body
722;; seed
723;; an argument passed to the first invocation of STR-HANDLER.
724;;
725;; The procedure returns two results: SEED and TOKEN. The SEED is the
726;; result of the last invocation of STR-HANDLER, or the original seed if
727;; STR-HANDLER was never called.
728;;
729;; TOKEN can be either an eof-object (this can happen only if expect-eof?
730;; was #t), or a texinfo token denoting the start or end of a tag.
731
732;; read-char-data port expect-eof? preserve-ws? str-handler seed
733(define read-char-data
734 (let* ((end-chars-eof '(*eof* #\{ #\} #\@ #\newline)))
735 (define (handle str-handler str1 str2 seed)
736 (if (and (string-null? str1) (string-null? str2))
737 seed
738 (str-handler str1 str2 seed)))
739
740 (lambda (port expect-eof? preserve-ws? str-handler seed)
741 (let ((end-chars ((if expect-eof? identity cdr) end-chars-eof)))
742 (let loop ((seed seed))
743 (let* ((fragment (next-token '() end-chars "reading char data" port))
744 (term-char (peek-char port))) ; one of end-chars
745 (cond
746 ((eof-object? term-char) ; only if expect-eof?
747 (values (handle str-handler fragment "" seed) term-char))
748 ((memq term-char '(#\@ #\{ #\}))
749 (values (handle str-handler fragment "" seed)
750 (case term-char
751 ((#\@) (read-command-token port))
752 ((#\{) (make-token 'START '*braces*))
753 ((#\}) (read-char port) (make-token 'END #f)))))
754 ((eq? term-char #\newline)
755 ;; Always significant, unless directly before an end token.
756 (let ((c (peek-next-char port)))
757 (cond
758 ((eof-object? c)
759 (or expect-eof?
760 (parser-error port "EOF while reading char data"))
761 (values (handle str-handler fragment "" seed) c))
762 ((eq? c #\@)
763 (let* ((token (read-command-token port))
764 (end? (eq? (token-kind token) 'END)))
765 (values
766 (handle str-handler fragment (if end? "" " ") seed)
767 token)))
768 ((and (not preserve-ws?) (eq? c #\newline))
769 ;; paragraph-separator ::= #\newline #\newline+
770 (skip-while '(#\newline) port)
771 (skip-horizontal-whitespace port)
772 (values (handle str-handler fragment "" seed)
773 (make-token 'PARA 'para)))
774 (else
775 (loop (handle str-handler fragment
776 (if preserve-ws? "\n" " ") seed)))))))))))))
777
778; procedure+: assert-token TOKEN KIND NAME
779; Make sure that TOKEN is of anticipated KIND and has anticipated NAME
780(define (assert-token token kind name)
781 (or (and (token? token)
782 (eq? kind (token-kind token))
783 (equal? name (token-head token)))
784 (parser-error #f "Expecting @end for " name ", got " token)))
785
786;;========================================================================
787;; Highest-level parsers: Texinfo to SXML
788
789;; These parsers are a set of syntactic forms to instantiate a SSAX
790;; parser. The user tells what to do with the parsed character and
791;; element data. These latter handlers determine if the parsing follows a
792;; SAX or a DOM model.
793
794;; syntax: make-command-parser fdown fup str-handler
795
796;; Create a parser to parse and process one element, including its
797;; character content or children elements. The parser is typically
798;; applied to the root element of a document.
799
800;; fdown
801;; procedure COMMAND ARGUMENTS EXPECTED-CONTENT SEED
802;;
803;; This procedure is to generate the seed to be passed to handlers
804;; that process the content of the element. This is the function
805;; identified as 'fdown' in the denotational semantics of the XML
806;; parser given in the title comments to (sxml ssax).
807;;
808;; fup
809;; procedure COMMAND ARGUMENTS PARENT-SEED SEED
810;;
811;; This procedure is called when parsing of COMMAND is finished.
812;; The SEED is the result from the last content parser (or from
813;; fdown if the element has the empty content). PARENT-SEED is the
814;; same seed as was passed to fdown. The procedure is to generate a
815;; seed that will be the result of the element parser. This is the
816;; function identified as 'fup' in the denotational semantics of
817;; the XML parser given in the title comments to (sxml ssax).
818;;
819;; str-handler
820;; A STR-HANDLER, see read-verbatim-body
821;;
822
823;; The generated parser is a
824;; procedure COMMAND PORT SEED
825;;
826;; The procedure must be called *after* the command token has been read.
827
828(define (read-include-file-name port)
829 (let ((x (string-trim-both (read-eof-line port))))
830 (if (string-null? x)
831 (error "no file listed")
832 x))) ;; fixme: should expand @value{} references
833
834(define (sxml->node-name sxml)
835 "Turn some sxml string into a valid node name."
836 (let loop ((in (string->list (sxml->string sxml))) (out '()))
837 (if (null? in)
838 (apply string (reverse out))
839 (if (memq (car in) '(#\{ #\} #\@ #\,))
840 (loop (cdr in) out)
841 (loop (cdr in) (cons (car in) out))))))
842
843(define (index command arguments fdown fup parent-seed)
844 (case command
845 ((deftp defcv defivar deftypeivar defop deftypeop defmethod
846 deftypemethod defopt defvr defvar deftypevr deftypevar deffn
847 deftypefn defspec defmac defun deftypefun)
848 (let ((args `((name ,(string-append (symbol->string command) "-"
849 (cadr (assq 'name arguments)))))))
850 (fup 'anchor args parent-seed
851 (fdown 'anchor args 'INLINE-ARGS '()))))
852 ((cindex findex vindex kindex pindex tindex)
853 (let ((args `((name ,(string-append (symbol->string command) "-"
854 (sxml->node-name
855 (assq 'entry arguments)))))))
856 (fup 'anchor args parent-seed
857 (fdown 'anchor args 'INLINE-ARGS '()))))
858 (else parent-seed)))
859
860(define (make-command-parser fdown fup str-handler)
861 (lambda (command port seed)
862 (let visit ((command command) (port port) (sig-ws? #f) (parent-seed seed))
863 (let*-values (((command arguments expected-content)
864 (complete-start-command command port)))
865 (let* ((parent-seed (index command arguments fdown fup parent-seed))
866 (seed (fdown command arguments expected-content parent-seed))
867 (eof-closes? (or (memq command '(texinfo para *fragment*))
868 (eq? expected-content 'EOL-TEXT)))
869 (sig-ws? (or sig-ws? (space-significant? command)))
870 (up (lambda (s) (fup command arguments parent-seed s)))
871 (new-para (lambda (s) (fdown 'para '() 'PARAGRAPH s)))
872 (make-end-para (lambda (p) (lambda (s) (fup 'para '() p s)))))
873
874 (define (port-for-content)
875 (if (eq? expected-content 'EOL-TEXT)
876 (call-with-input-string (read-text-line port) identity)
877 port))
878
879 (cond
880 ((memq expected-content '(EMPTY-COMMAND INLINE-ARGS EOL-ARGS INDEX
881 EOL-TEXT-ARGS))
882 ;; empty or finished by complete-start-command
883 (up seed))
884 ((eq? command 'verbatim)
885 (up (read-verbatim-body port str-handler seed)))
886 (else
887 (let loop ((port (port-for-content))
888 (expect-eof? eof-closes?)
889 (end-para identity)
890 (need-break? (and (not sig-ws?)
891 (memq expected-content
892 '(ENVIRON TABLE-ENVIRON
893 ENTRY ITEM FRAGMENT))))
894 (seed seed))
895 (cond
896 ((and need-break? (or sig-ws? (skip-whitespace port))
897 (not (memq (peek-char port) '(#\@ #\})))
898 (not (eof-object? (peek-char port))))
899 ;; Even if we have an @, it might be inline -- check
900 ;; that later
901 (let ((seed (end-para seed)))
902 (loop port expect-eof? (make-end-para seed) #f
903 (new-para seed))))
904 (else
905 (let*-values (((seed token)
906 (read-char-data
907 port expect-eof? sig-ws? str-handler seed)))
908 (cond
909 ((eof-object? token)
910 (case expect-eof?
911 ((include #f) (end-para seed))
912 (else (up (end-para seed)))))
913 (else
914 (case (token-kind token)
915 ((STRING)
916 ;; this is only @-commands that escape
917 ;; characters: @}, @@, @{ -- new para if need-break
918 (let ((seed ((if need-break? end-para identity) seed)))
919 (loop port expect-eof?
920 (if need-break? (make-end-para seed) end-para) #f
921 (str-handler (token-head token) ""
922 ((if need-break? new-para identity)
923 seed)))))
924 ((END)
925 ;; The end will only have a name if it's for an
926 ;; environment
927 (cond
928 ((memq command '(item entry))
929 (let ((spec (command-spec (token-head token))))
930 (or (eq? (cadr spec) 'TABLE-ENVIRON)
931 (parser-error
932 port "@item not ended by @end table/enumerate/itemize"
933 token))))
934 ((eq? expected-content 'ENVIRON)
935 (assert-token token 'END command)))
936 (up (end-para seed)))
937 ((ITEM)
938 (cond
939 ((memq command '(enumerate itemize))
940 (up (visit 'item port sig-ws? (end-para seed))))
941 ((eq? expected-content 'TABLE-ENVIRON)
942 (up (visit 'entry port sig-ws? (end-para seed))))
943 ((memq command '(item entry))
944 (visit command port sig-ws? (up (end-para seed))))
945 (else
946 (parser-error
947 port "@item must be within a table environment"
948 command))))
949 ((PARA)
950 ;; examine valid paragraphs?
951 (loop port expect-eof? end-para (not sig-ws?) seed))
952 ((INCLUDE)
953 ;; Recurse for include files
954 (let ((seed (call-with-file-and-dir
955 (read-include-file-name port)
956 (lambda (port)
957 (loop port 'include end-para
958 need-break? seed)))))
959 (loop port expect-eof? end-para need-break? seed)))
960 ((START) ; Start of an @-command
961 (let* ((head (token-head token))
962 (type (cadr (command-spec head)))
963 (inline? (inline-content? type))
964 (seed ((if (and inline? (not need-break?))
965 identity end-para) seed))
966 (end-para (if inline?
967 (if need-break? (make-end-para seed)
968 end-para)
969 identity))
970 (new-para (if (and inline? need-break?)
971 new-para identity)))
972 (loop port expect-eof? end-para (not inline?)
973 (visit head port sig-ws? (new-para seed)))))
974 (else
975 (parser-error port "Unknown token type" token))))))))))))))))
976
977;; procedure: reverse-collect-str-drop-ws fragments
978;;
979;; Given the list of fragments (some of which are text strings), reverse
980;; the list and concatenate adjacent text strings. We also drop
981;; "unsignificant" whitespace, that is, whitespace in front, behind and
982;; between elements. The whitespace that is included in character data
983;; is not affected.
984(define (reverse-collect-str-drop-ws fragments)
985 (cond
986 ((null? fragments) ; a shortcut
987 '())
988 ((and (string? (car fragments)) ; another shortcut
989 (null? (cdr fragments)) ; remove single ws-only string
990 (string-whitespace? (car fragments)))
991 '())
992 (else
993 (let loop ((fragments fragments) (result '()) (strs '())
994 (all-whitespace? #t))
995 (cond
996 ((null? fragments)
997 (if all-whitespace?
998 result ; remove leading ws
999 (cons (apply string-append strs) result)))
1000 ((string? (car fragments))
1001 (loop (cdr fragments) result (cons (car fragments) strs)
1002 (and all-whitespace?
1003 (string-whitespace? (car fragments)))))
1004 (else
1005 (loop (cdr fragments)
1006 (cons
1007 (car fragments)
1008 (cond
1009 ((null? strs) result)
1010 (all-whitespace?
1011 (if (null? result)
1012 result ; remove trailing whitespace
1013 (cons " " result))); replace interstitial ws with
1014 ; one space
1015 (else
1016 (cons (apply string-append strs) result))))
1017 '() #t)))))))
1018
1019(define (make-dom-parser)
1020 (make-command-parser
1021 (lambda (command args content seed) ; fdown
1022 '())
1023 (lambda (command args parent-seed seed) ; fup
1024 (let ((seed (reverse-collect-str-drop-ws seed)))
1025 (acons command
1026 (if (null? args) seed (acons '% args seed))
1027 parent-seed)))
1028 (lambda (string1 string2 seed) ; str-handler
1029 (if (string-null? string2)
1030 (cons string1 seed)
1031 (cons* string2 string1 seed)))))
1032
1033(define parse-environment-args
1034 (let ((parser (make-dom-parser)))
1035 ;; duplicate arguments->attlist to avoid unnecessary splitting
1036 (lambda (command port)
1037 (let ((args (cdar (parser '*ENVIRON-ARGS* port '())))
1038 (arg-names (cddr (command-spec command))))
1039 (cond
1040 ((not arg-names)
1041 (if (null? args) '()
1042 (parser-error port "@-command doesn't take args" command)))
1043 ((eq? arg-names #t)
1044 (list (cons 'arguments args)))
1045 (else
1046 (let loop ((args args) (arg-names arg-names) (out '()))
1047 (cond
1048 ((null? arg-names)
1049 (if (null? args) (reverse! out)
1050 (parser-error port "@-command didn't expect more args"
1051 command args)))
1052 ((symbol? arg-names)
1053 (reverse! (acons arg-names args out)))
1054 ((null? args)
1055 (parser-error port "@-command expects more args"
1056 command arg-names))
1057 ((and (string? (car args)) (string-index (car args) #\space))
1058 => (lambda (i)
1059 (let ((rest (substring/shared (car args) (1+ i))))
1060 (if (zero? i)
1061 (loop (cons rest (cdr args)) arg-names out)
1062 (loop (cons rest (cdr args)) (cdr arg-names)
1063 (cons (list (car arg-names)
1064 (substring (car args) 0 i))
1065 out))))))
1066 (else
1067 (loop (cdr args) (cdr arg-names)
1068 (if (and (pair? (car args)) (eq? (caar args) '*braces*))
1069 (acons (car arg-names) (cdar args) out)
1070 (cons (list (car arg-names) (car args)) out))))))))))))
1071
1072(define (parse-eol-text-args command port)
1073 ;; perhaps parse-environment-args should be named more
1074 ;; generically.
1075 (parse-environment-args command port))
1076
1077;; procedure: texi-fragment->stexi STRING
1078;;
1079;; A DOM parser for a texinfo fragment STRING.
1080;;
1081;; The procedure returns an SXML tree headed by the special tag,
1082;; *fragment*.
1083
1084(define (texi-fragment->stexi string-or-port)
1085 "Parse the texinfo commands in @var{string-or-port}, and return the
1086resultant stexi tree. The head of the tree will be the special command,
1087@code{*fragment*}."
1088 (define (parse port)
1089 (postprocess (car ((make-dom-parser) '*fragment* port '()))))
1090 (if (input-port? string-or-port)
1091 (parse string-or-port)
1092 (call-with-input-string string-or-port parse)))
1093
1094;; procedure: texi->stexi PORT
1095;;
1096;; This is an instance of a SSAX parser above that returns an SXML
1097;; representation of the texinfo document ready to be read at PORT.
1098;;
1099;; The procedure returns an SXML tree. The port points to the
1100;; first character after the @bye, or to the end of the file.
1101
1102(define (texi->stexi port)
1103 "Read a full texinfo document from @var{port} and return the parsed
1104stexi tree. The parsing will start at the @code{@@settitle} and end at
1105@code{@@bye} or EOF."
1106 (let ((parser (make-dom-parser)))
1107 (take-until-settitle port)
1108 (postprocess (car (parser 'texinfo port '())))))
1109
1110(define (car-eq? x y) (and (pair? x) (eq? (car x) y)))
1111(define (make-contents tree)
1112 (define (lp in out depth)
1113 (cond
1114 ((null? in) (values in (cons 'enumerate (reverse! out))))
1115 ((and (pair? (cdr in)) (texi-command-depth (caadr in) 4))
1116 => (lambda (new-depth)
1117 (let ((node-name (and (car-eq? (car in) 'node)
1118 (cadr (assq 'name (cdadar in))))))
1119 (cond
1120 ((< new-depth depth)
1121 (values in (cons 'enumerate (reverse! out))))
1122 ((> new-depth depth)
1123 (let ((out-cdr (if (null? out) '() (cdr out)))
1124 (out-car (if (null? out) (list 'item) (car out))))
1125 (let*-values (((new-in new-out) (lp in '() (1+ depth))))
1126 (lp new-in
1127 (cons (append out-car (list new-out)) out-cdr)
1128 depth))))
1129 (else ;; same depth
1130 (lp (cddr in)
1131 (cons
1132 `(item (para
1133 ,@(if node-name
1134 `((ref (% (node ,node-name))))
1135 (cdadr in))))
1136 out)
1137 depth))))))
1138 (else (lp (cdr in) out depth))))
1139 (let*-values (((_ contents) (lp tree '() 1)))
1140 `((chapheading "Table of Contents") ,contents)))
1141
1142(define (trim-whitespace str trim-left? trim-right?)
1143 (let* ((left-space? (and (not trim-left?)
1144 (string-prefix? " " str)))
1145 (right-space? (and (not trim-right?)
1146 (string-suffix? " " str)))
1147 (tail (append! (string-tokenize str)
1148 (if right-space? '("") '()))))
1149 (string-join (if left-space? (cons "" tail) tail))))
1150
1151(define (postprocess tree)
1152 (define (loop in out state first? sig-ws?)
1153 (cond
1154 ((null? in)
1155 (values (reverse! out) state))
1156 ((string? (car in))
1157 (loop (cdr in)
1158 (cons (if sig-ws? (car in)
1159 (trim-whitespace (car in) first? (null? (cdr in))))
1160 out)
1161 state #f sig-ws?))
1162 ((pair? (car in))
1163 (case (caar in)
1164 ((set)
1165 (if (null? (cdar in)) (error "@set missing arguments" in))
1166 (if (string? (cadar in))
1167 (let ((i (string-index (cadar in) #\space)))
1168 (if i
1169 (loop (cdr in) out
1170 (acons (substring (cadar in) 0 i)
1171 (cons (substring (cadar in) (1+ i)) (cddar in))
1172 state)
1173 #f sig-ws?)
1174 (loop (cdr in) out (acons (cadar in) (cddar in) state)
1175 #f sig-ws?)))
1176 (error "expected a constant to define for @set" in)))
1177 ((value)
1178 (loop (fold-right cons (cdr in)
1179 (or (and=>
1180 (assoc (cadr (assq 'key (cdadar in))) state) cdr)
1181 (error "unknown value" (cdadar in) state)))
1182 out
1183 state #f sig-ws?))
1184 ((copying)
1185 (loop (cdr in) out (cons (car in) state) #f sig-ws?))
1186 ((insertcopying)
1187 (loop (fold-right cons (cdr in)
1188 (or (cdr (assoc 'copying state))
1189 (error "copying isn't set yet")))
1190 out
1191 state #f sig-ws?))
1192 ((contents)
1193 (loop (cdr in) (fold cons out (make-contents tree)) state #f sig-ws?))
1194 (else
1195 (let*-values (((kid-out state)
1196 (loop (car in) '() state #t
1197 (or sig-ws? (space-significant? (caar in))))))
1198 (loop (cdr in) (cons kid-out out) state #f sig-ws?)))))
1199 (else ; a symbol
1200 (loop (cdr in) (cons (car in) out) state #t sig-ws?))))
1201
1202 (call-with-values
1203 (lambda () (loop tree '() '() #t #f))
1204 (lambda (out state) out)))
1205
1206;; Replace % with texinfo-arguments.
1207(define (stexi->sxml tree)
1208 "Transform the stexi tree @var{tree} into sxml. This involves
1209replacing the @code{%} element that keeps the texinfo arguments with an
1210element for each argument.
1211
1212FIXME: right now it just changes % to @code{texinfo-arguments} -- that
1213doesn't hang with the idea of making a dtd at some point"
1214 (pre-post-order
1215 tree
1216 `((% . ,(lambda (x . t) (cons 'texinfo-arguments t)))
1217 (*text* . ,(lambda (x t) t))
1218 (*default* . ,(lambda (x . t) (cons x t))))))
1219
1220;;; arch-tag: 73890afa-597c-4264-ae70-46fe7756ffb5
1221;;; texinfo.scm ends here