{"size": 2114, "ext": "scrbl", "max_stars_repo_path": "pkgs/racket-doc/syntax/scribblings/readerr.scrbl", "max_stars_repo_name": "lkh01/racket", "max_stars_repo_stars_event_min_datetime": "2018-07-29T04:13:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T16:11:17.000Z", "max_issues_repo_path": "pkgs/racket-doc/syntax/scribblings/readerr.scrbl", "max_issues_repo_name": "lkh01/racket", "max_issues_repo_issues_event_min_datetime": "2017-08-25T20:26:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T17:48:40.000Z", "max_forks_repo_path": "pkgs/racket-doc/syntax/scribblings/readerr.scrbl", "max_forks_repo_name": "lkh01/racket", "max_forks_repo_forks_event_min_datetime": "2016-04-25T11:47:57.000Z", "max_forks_repo_forks_event_max_datetime": "2017-05-09T14:52:48.000Z"}
{"max_stars_count": 10, "max_issues_count": 15, "max_forks_count": 3, "avg_line_length": 45.9565217391, "max_line_length": 81, "alphanum_fraction": 0.6300851466}
#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 exact-positive-integer? false/c)]
                           [col (or/c exact-nonnegative-integer? false/c)]
                           [pos (or/c exact-positive-integer? false/c)]
                           [span (or/c exact-nonnegative-integer? false/c)]
                           [#:extra-srclocs extra-srclocs (listof srcloc?) '()]) 
         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 and the @racket[extra-srclocs]
(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] (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 exact-positive-integer? false/c)]
                               [col (or/c exact-nonnegative-integer? false/c)]
                               [pos (or/c exact-positive-integer? false/c)]
                               [span (or/c exact-nonnegative-integer? false/c)]) 
         any]{

Like @racket[raise-read-error], but raises @racket[exn:fail:read:eof]
instead of @racket[exn:fail:read].}
