repair quadraic behavior for a Scribble document's top level

The recursive macro used by `#%module-begin` had a `...` in a pattern
that only matches once, but the match is attempted every time around,
and the `...` list accumulated the body of the module.

Thanks to Shriram Krishnamurthi for reporting the problem.
This commit is contained in:
Matthew Flatt 2014-12-12 08:21:30 -07:00
parent 6d43de50ef
commit 2f3e989cf5

View File

@ -17,9 +17,9 @@
(define-syntax (doc-begin stx)
(syntax-case stx ()
[(_ m-id post-process (expr ...))
[(_ m-id post-process exprs)
#`(begin
(define m-id (post-process (decode (list . #,(reverse (syntax->list #'(expr ...)))))))
(define m-id (post-process (decode (list . #,(reverse (syntax->list #'exprs))))))
(provide m-id))]
[(_ m-id post-process exprs . body)
;; `body' probably starts with lots of string constants; it's