r7rs-small-texinfo

Unnamed repository; edit this file 'description' to name the repository.
git clone https://kaka.farm/~git/r7rs-small-texinfo
Log | Files | Refs

commit 195d31a85483feb29a089f513fe288af2fde4962
parent 4cc8407c36cdebc9bc0de297b627f9b1b304cb7a
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date:   Mon,  5 Feb 2024 18:54:57 -0500

Formal syntax: Fix node & section off-by-one-ness.

Diffstat:
Mdoc/r7rs-small/formal-syntax.texinfo | 47++++++++++++++++++++++++-----------------------
1 file changed, 24 insertions(+), 23 deletions(-)

diff --git a/doc/r7rs-small/formal-syntax.texinfo b/doc/r7rs-small/formal-syntax.texinfo @@ -1,6 +1,16 @@ @node Formal syntax @section Formal syntax +This section provides a formal syntax for Scheme written in an extended BNF. + +All spaces in the grammar are for legibility. Case is not significant except in the definitions +of @svar{letter}, @svar{character name} and @svar{mnemonic escape}; for example, #x1A and #X1a are +equivalent, but foo and Foo and #\space and #\Space are distinct. @svar{empty} stands for the +empty string. + +The following extensions to BNF are used to make the description more concise: @svar{thing}* +means zero or more occurrences of @svar{thing}; and @svar{thing}+ means at least one @svar{thing}. + @menu * Lexical structure:: * External representations formal:: @@ -14,19 +24,6 @@ @node Lexical structure @subsection Lexical structure -This section provides a formal syntax for Scheme written in an extended BNF. - -All spaces in the grammar are for legibility. Case is not significant except in the definitions -of @svar{letter}, @svar{character name} and @svar{mnemonic escape}; for example, #x1A and #X1a are -equivalent, but foo and Foo and #\space and #\Space are distinct. @svar{empty} stands for the -empty string. - -The following extensions to BNF are used to make the description more concise: @svar{thing}* -means zero or more occurrences of @svar{thing}; and @svar{thing}+ means at least one @svar{thing}. - -@node External representations formal -@subsection External representations (formal) - This section describes how individual tokens(identifiers, numbers, etc.) are formed from sequences of characters. The following sections describe how expressions and programs are formed from sequences of tokens. @@ -157,8 +154,8 @@ characters used in the grammar of numbers can appear in either upper or lower ca @svar{digit 10} ⟶@svar{digit} @svar{digit 16} ⟶@svar{digit 10} ∣a ∣b ∣c ∣d ∣e ∣f -@node Expressions formal -@subsection Expressions (formal) +@node External representations formal +@subsection External representations (formal) @svar{Datum} is what the read procedure (section 6.13.2) successfully parses. Note that any string that parses as an @svar{expression} will also parse as a @svar{datum}. @@ -175,8 +172,8 @@ string that parses as an @svar{expression} will also parse as a @svar{datum}. @svar{vector} ⟶#(@svar{datum}*) @svar{label} ⟶# @svar{uinteger 10} -@node Quasiquotations -@subsection Quasiquotations +@node Expressions formal +@subsection Expressions (formal) The definitions in this and the following subsections assume that all the syntax keywords defined in this report have been properly imported from their libraries, and that none of @@ -264,8 +261,8 @@ them have been redefined or shadowed. @svar{includer} ⟶ ∣(include @svar{string}+) ∣(include-ci @svar{string}+) -@node Transformers -@subsection Transformers +@node Quasiquotations +@subsection Quasiquotations The following grammar for quasiquote expressions is not context-free. It is presented as a recipe for generating an infinite number of production rules. Imagine a copy of the @@ -293,8 +290,8 @@ following rules for D = 1, 2, 3, @dots{}, where D is the nesting depth. sometimes be confused with either an @svar{unquotation D} or a @svar{splicing unquotation D}. The interpretation as an @svar{unquotation} or @svar{splicing unquotation D} takes precedence. -@node Programs and definitions -@subsection Programs and definitions +@node Transformers +@subsection Transformers Note: Though this grammar does not say so, a top-level syntax-rules pattern must be a list pattern, not a vector pattern or an identifier pattern. @@ -330,8 +327,9 @@ a list pattern, not a vector pattern or an identifier pattern. @svar{ellipsis} ⟶@svar{an identifier defaulting to ...} @svar{underscore} ⟶@svar{the identifier _} -@node Libraries formal -@subsection Libraries (formal) +@node Programs and definitions +@subsection Programs and definitions + @svar{program} ⟶ @svar{import declaration}+ @svar{command or definition}+ @svar{command or definition} ⟶@svar{command} @@ -353,3 +351,6 @@ a list pattern, not a vector pattern or an identifier pattern. @svar{accessor} ⟶@svar{identifier} @svar{mutator} ⟶@svar{identifier} @svar{syntax definition} ⟶ (define-syntax @svar{keyword} @svar{transformer spec}) + +@node Libraries formal +@subsection Libraries (formal)