note on source-path arg

dev-subparser
Matthew Butterick 5 years ago
parent 1ca370478c
commit 4732784dee

@ -913,14 +913,15 @@ grammars.
A program written in @litchar{#lang brag} produces a module that provides a few A program written in @litchar{#lang brag} produces a module that provides a few
bindings. The most important of these is @racket[parse]: bindings. The most important of these is @racket[parse]:
@defproc[(parse [source any/c #f] @defproc[(parse [source-path any/c #f]
[token-source (or/c (sequenceof token) [token-source (or/c (sequenceof token)
(-> token))]) (-> token))])
syntax?]{ syntax?]{
Parses the sequence of @tech{tokens} according to the rules in the grammar, using the Parses a series of @tech{tokens} according to the rules in the grammar, using the
first rule as the start production. The parse must completely consume first rule of the grammar for the initial production. The parse must completely consume
@racket[token-source]. @racket[token-source]. The optional @racket[source-path] argument is used to enrich the
syntax-location fields.
The @deftech{token source} can either be a sequence, or a 0-arity function that The @deftech{token source} can either be a sequence, or a 0-arity function that
produces @tech{tokens}. produces @tech{tokens}.

Loading…
Cancel
Save