From d0ba33304760318fd7db5af09024360c6426e920 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 16 Apr 2008 03:09:57 +0000 Subject: [PATCH] more mysterx doc work (all ported, but need re-org and clean-up) svn: r9327 original commit: 6abe2deff279f93fb9b51108d20a8e3cc8a72e75 --- collects/scribble/bnf.ss | 5 ++++- collects/scribble/manual.ss | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/collects/scribble/bnf.ss b/collects/scribble/bnf.ss index 1d124ebc..4edf1290 100644 --- a/collects/scribble/bnf.ss +++ b/collects/scribble/bnf.ss @@ -8,7 +8,7 @@ (provide BNF nonterm BNF-seq - BNF-alt ; single-lie alternatives + BNF-alt BNF-alt/close ; single-line alternatives BNF-etc BNF-group optional kleenestar kleeneplus kleenerange) @@ -47,6 +47,9 @@ (define (BNF-alt . l) (interleave l alt)) + (define (BNF-alt/close . l) + (interleave l " | ")) + (define BNF-etc "...") (define/kw (nonterm #:body s) diff --git a/collects/scribble/manual.ss b/collects/scribble/manual.ss index 17628cfa..d7fcf2ea 100644 --- a/collects/scribble/manual.ss +++ b/collects/scribble/manual.ss @@ -2296,6 +2296,15 @@ [(_ super) null])) + (define (flatten-splices l) + (let loop ([l l]) + (cond + [(null? l) null] + [(splice? (car l)) + (append (splice-run (car l)) + (loop (cdr l)))] + [else (cons (car l) (loop (cdr l)))]))) + (define-syntax *defclass (syntax-rules () [(_ *include-class name super (intf ...) body ...) @@ -2315,7 +2324,7 @@ null whole-page? make-class-index-desc))) - (list body ...))))])) + (flatten-splices (list body ...)))))])) (define-syntax defclass (syntax-rules ()