pull/9/head
Matthew Butterick 10 years ago
parent e69ab2ff5f
commit 3d8a22b6b5

@ -5,8 +5,8 @@
(define-syntax-rule (new-module-begin body-exprs ...)
(#%module-begin
(module inner pollen/lang/doclang_raw
;; first three lines are positional arguments for doclang_raw
(module inner pollen/lang/doclang-raw
;; first three lines are positional arguments for doclang-raw
;; doclang_raw is a version of scribble/doclang with the decoder disabled
main-raw ; id of export
(λ(x) x) ; post-process function
@ -60,7 +60,7 @@
(define wants-decoder? (member here-ext (map to-string DECODABLE_EXTENSIONS)))
(define main (apply (cond
[(equal? here-ext "ptree") (λ xs (decode (cons PTREE_ROOT_NODE xs)
#:xexpr-elements-proc (λ(xs) (filter (compose1 not (bound/c whitespace?)) xs))))]
#:xexpr-elements-proc (λ(xs) (filter (compose1 not (def/c whitespace?)) xs))))]
;; 'root is the hook for the decoder function.
;; If it's not a defined identifier, it just hits #%top and becomes `(root ,@body ...)
[wants-decoder? root]

@ -1,14 +0,0 @@
#lang racket/base
(require (for-syntax racket/base))
(provide bound/c (rename-out (top~ #%top)))
(define-syntax-rule (top~ . id)
(λ x `(id ,@x)))
(define-syntax (bound/c stx)
(syntax-case stx ()
[(_ x)
(if (identifier-binding #'x )
#'x
#'(#%top . x))]))

@ -1,5 +0,0 @@
#lang racket/base
(require "bound.rkt")
(bar "hello") ; bar is unbound
((bound/c bar) "hello")

@ -37,7 +37,7 @@
`(id ,@(if (equal? attrs null) null (list (reverse attrs))) ,@body)))
(define-syntax (bound/c stx)
(define-syntax (def/c stx)
(syntax-case stx ()
[(_ x)
(if (identifier-binding #'x )

Loading…
Cancel
Save