better error reporting for code:comment, and better docs for schememod

svn: r11211

original commit: e233989e1d04ed9d0cc4def485739819cb178432
This commit is contained in:
Matthew Flatt 2008-08-13 01:25:53 +00:00
parent c442655ac2
commit 7c83877190
2 changed files with 10 additions and 1 deletions

View File

@ -312,6 +312,12 @@
(advance c init-line!)]
[(and (pair? (syntax-e c))
(eq? (syntax-e (car (syntax-e c))) 'code:comment))
(let ([l (syntax->list c)])
(unless (and l (= 2 (length l)))
(raise-syntax-error
#f
"does not have a single sub-form"
c)))
(advance c init-line!)
(out "; " comment-color)
(let ([v (syntax->datum (cadr (syntax->list c)))])

View File

@ -122,7 +122,10 @@ without insetting the code.}
@defform[(schememod lang datum ...)]{Like @scheme[schemeblock], but
the @scheme[datum] are typeset inside a @schememodfont{#lang}-form
module whose language is @scheme[lang].}
module whose language is @scheme[lang]. The source location of
@scheme[lang] (relative to the body @scheme[datum]s) determines the
relative positioning of the @schememodfont{#lang} line in the typeset
output.}
@defform[(scheme datum ...)]{Like @scheme[schemeblock], but typeset on
a single line and wrapped with its enclosing paragraph, independent of