racket/collects/syntax/scribblings/readerr.scrbl
Eli Barzilay ac26fe7554 A ton of @scheme*' -> @racket*' and related updates.
Also, updates some of the mzlib files to point at `racket/*' libraries
rather than to `scheme/*' ones.
2011-06-25 04:08:47 -04:00

44 lines
1.8 KiB
Racket

#lang scribble/doc
@(require "common.rkt" (for-label syntax/readerr))
@title[#:tag "readerr"]{Raising @racket[exn:fail:read]}
@defmodule[syntax/readerr]
@defproc[(raise-read-error [msg-string string?]
[source any/c]
[line (or/c number? false/c)]
[col (or/c number? false/c)]
[pos (or/c number? false/c)]
[span (or/c number? false/c)])
any]{
Creates and raises an @racket[exn:fail:read] exception, using
@racket[msg-string] as the base error message.
Source-location information is added to the error message using the
last five arguments (if the @racket[error-print-source-location]
parameter is set to @racket[#t]). The @racket[source] argument is an
arbitrary value naming the source location---usually a file path
string. Each of the @racket[line], @racket[pos] arguments is
@racket[#f] or a positive exact integer representing the location
within @racket[source-name] (as much as known), @racket[col] is a
non-negative exact integer for the source column (if known), and
@racket[span] is @racket[#f] or a non-negative exact integer for an
item range starting from the indicated position.
The usual location values should point at the beginning of whatever it
is you were reading, and the span usually goes to the point the error
was discovered.}
@defproc[(raise-read-eof-error [msg-string string?]
[source any/c]
[line (or/c number? false/c)]
[col (or/c number? false/c)]
[pos (or/c number? false/c)]
[span (or/c number? false/c)])
any]{
Like @racket[raise-read-error], but raises @racket[exn:fail:read:eof]
instead of @racket[exn:fail:read].}