You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pollen/pollen 130801/doclang2_raw.rkt

29 lines
1.0 KiB
Racket

#lang racket
;; A slightly nicer version of doclang where the parameters are keyword-based
;; rather than positional. Delegates off to the original doclang.
(require (prefix-in doclang: "doclang_raw.rkt")
(for-syntax racket/base
syntax/parse))
(provide (except-out (all-from-out racket) #%module-begin)
(rename-out [*module-begin #%module-begin]))
;; Module wrapper ----------------------------------------
(define-syntax (*module-begin stx)
(syntax-parse stx
[(_ (~or (~optional (~seq #:id id))
(~optional (~seq #:post-process post-process))
(~optional (~seq #:exprs exprs)))
...
. body)
(with-syntax ([id (or (attribute id)
#'doc)]
[post-process (or (attribute post-process)
#'values)]
[exprs (or (attribute exprs)
#'())])
#'(doclang:#%module-begin id post-process exprs . body))]))