Cleanup; documentation

This commit is contained in:
Georges Dupéron 2017-01-26 05:33:38 +01:00
parent 9e7086624e
commit 1aea43aeba
4 changed files with 52 additions and 12 deletions

View File

@ -20,8 +20,8 @@ env:
# Supply more than one RACKET_VERSION (as in the example below) to # Supply more than one RACKET_VERSION (as in the example below) to
# create a Travis-CI build matrix to test against multiple Racket # create a Travis-CI build matrix to test against multiple Racket
# versions. # versions.
- RACKET_VERSION=6.0 #- RACKET_VERSION=6.0
- RACKET_VERSION=6.1 #- RACKET_VERSION=6.1
- RACKET_VERSION=6.1.1 - RACKET_VERSION=6.1.1
- RACKET_VERSION=6.2 - RACKET_VERSION=6.2
- RACKET_VERSION=6.3 - RACKET_VERSION=6.3
@ -29,6 +29,7 @@ env:
- RACKET_VERSION=6.5 - RACKET_VERSION=6.5
- RACKET_VERSION=6.6 - RACKET_VERSION=6.6
- RACKET_VERSION=6.7 - RACKET_VERSION=6.7
- RACKET_VERSION=6.8
- RACKET_VERSION=HEAD - RACKET_VERSION=HEAD
matrix: matrix:
@ -50,9 +51,11 @@ before_script:
# `raco pkg install --deps search-auto` to install any required # `raco pkg install --deps search-auto` to install any required
# packages without it getting stuck on a confirmation prompt. # packages without it getting stuck on a confirmation prompt.
script: script:
- raco test -x -p subtemplate - raco test -p subtemplate
- raco setup --check-pkg-deps --pkgs subtemplate
- raco pkg install doc-coverage
- raco doc-coverage subtemplate
- raco pkg install --deps search-auto cover cover-codecov
- raco cover -b -f codecov -d $TRAVIS_BUILD_DIR/coverage .
after_success: after_success:
- raco setup --check-pkg-deps --pkgs subtemplate
- raco pkg install --deps search-auto cover cover-coveralls
- raco cover -b -f coveralls -d $TRAVIS_BUILD_DIR/coverage .

View File

@ -8,7 +8,7 @@
"stxparse-info")) "stxparse-info"))
(define build-deps '("scribble-lib" (define build-deps '("scribble-lib"
"racket-doc")) "racket-doc"))
(define scribblings '(("scribblings/subtemplate.scrbl" ()))) (define scribblings '(("scribblings/subtemplate.scrbl" () (parsing-library))))
(define pkg-desc "Description Here") (define pkg-desc "Description Here")
(define version "0.0") (define version "0.0")
(define pkg-authors '(georges)) (define pkg-authors '(georges))

View File

@ -171,7 +171,8 @@
(car depths) (car depths)
#'check-ellipsis-count-ddd)))) #'check-ellipsis-count-ddd))))
(define-for-syntax/case-args ((sub*template tmpl-form) (self . tmpl)) (define-for-syntax/case-args ((sub*template tmpl-form)
(self tmpl . maybe-props))
(define acc '()) (define acc '())
;; Finds identifiers of the form zᵢ, and return a list of existing xᵢ bindings ;; Finds identifiers of the form zᵢ, and return a list of existing xᵢ bindings
@ -195,7 +196,7 @@
;; like (quasitemplate . tmpl) ;; like (quasitemplate . tmpl)
(define result (define result
(quasisyntax/top-loc #'self (quasisyntax/top-loc #'self
(#,tmpl-form . tmpl))) (#,tmpl-form tmpl . maybe-props)))
;; Make sure that we remove duplicates, otherwise we'll get errors if we ;; Make sure that we remove duplicates, otherwise we'll get errors if we
;; define the same derived id twice. ;; define the same derived id twice.
(define/with-syntax ([bound (define/with-syntax ([bound

View File

@ -1,10 +1,46 @@
#lang scribble/manual #lang scribble/manual
@require[@for-label[subtemplate @require[@for-label[subtemplate
syntax/parse/experimental/template
racket/base]] racket/base]]
@title{subtemplate} @title{Subtemplate}
@author{georges} @author[@author+email["Georges Dupéron" "georges.duperon@gmail.com"]]
@defmodule[subtemplate] @defmodule[subtemplate]
Package Description Here @defform*[{(subtemplate template)
(subtemplate template #:properties (prop ...))}
#:contracts
([prop identifier?])]{
Like @racket[template], but automatically derives identifiers for any
@racket[yᵢ …] which is not bound as a syntax pattern variable, based on a
corresponding @racket[xᵢ …] which is bound as a syntax pattern variable.
Note that the syntax pattern variables must be matched with one of the
patched forms from @racket[stxparse-info/parse] or
@racket[stxparse-info/case], instead of the syntax pattern-matching forms from
@racket[syntax/parse] or @racket[racket/base], respectively.}
@defform*[{(quasisubtemplate template)
(quasisubtemplate template #:properties (prop ...))}
#:contracts
([prop identifier?])]{
Like @racket[quasitemplate], but automatically derives identifiers for any
@racket[yᵢ …] which is not bound as a syntax pattern variable, based on a
corresponding @racket[xᵢ …] which is bound as a syntax pattern variable, in
the same way as @racket[subtemplate].
Note that the syntax pattern variables must be matched with one of the
patched forms from @racket[stxparse-info/parse] or
@racket[stxparse-info/case], instead of the syntax pattern-matching forms from
@racket[syntax/parse] or @racket[racket/base], respectively.
}
@subsection{Overriding the default @racket[#'…] and @racket[#`…]}
@defmodule[subtemplate/override]
The @racketmodname[subtemplate/override] module re-provides
@racket[subtemplate] as @racket[syntax], and @racket[quasisubtemplate] as
@racket[quasisyntax]. This allows @racketmodname[subtemplate] to be used via
the reader shorthands @racket[#'…] and @racket[#`…].