commit 9a58b20fd82e878f69c879b0987b71306f0c1f6c
parent 43517e3ee0e7f4a850044cb601c46df693f4b70d
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date: Wed, 7 Feb 2024 22:16:48 -0500
Add @sharpindex and use it to index sharped tokens.
Diffstat:
6 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/STYLE.md b/STYLE.md
@@ -42,3 +42,7 @@ Use our @rsvar macro for syntactic variables that occur in code
examples. This will emit an `@r{}` wrapper for the syntactic variable,
ensuring (where it's possible to ensure such things) that it appears
in Roman font.
+
+## Indexing
+
+Use our `@sharpindex` macro to index names that begin with '#'.
diff --git a/doc/r7rs-small/formal-syntax.texinfo b/doc/r7rs-small/formal-syntax.texinfo
@@ -204,6 +204,12 @@ in the grammar of numbers can appear in either upper or lower case.
| @code{+nan.0} | @code{-nan.0}
@end format
+@sharpindex{b}
+@sharpindex{o}
+@sharpindex{x}
+@sharpindex{e}
+@sharpindex{i}
+
@format
@svar{suffix} @expansion{} @svar{empty}
| @svar{exponent marker} @svar{sign} @atleastone{@svar{digit 10}}
diff --git a/doc/r7rs-small/lexical-conventions.texinfo b/doc/r7rs-small/lexical-conventions.texinfo
@@ -117,6 +117,8 @@ A semicolon (@samp{;}) indicates the start of a line comment. The
comment continues to the end of the line on which the semicolon
appears.
+@sharpindex{;}
+
Another way to indicate a comment is to prefix a @svar{datum}
(cf. @ref{External representations formal}) with @code{#;} and
optional @svar{whitespace}. The comment consists of the comment prefix
diff --git a/doc/r7rs-small/procedures/booleans.texinfo b/doc/r7rs-small/procedures/booleans.texinfo
@@ -3,6 +3,10 @@
@cindex true
@cindex false
+@sharpindex{t}
+@sharpindex{f}
+@sharpindex{true}
+@sharpindex{false}
The standard boolean objects for true and false are written as @code{#t}
and @code{#f}. Alternatively, they can be written @code{#true} and
diff --git a/doc/r7rs-small/procedures/numbers.texinfo b/doc/r7rs-small/procedures/numbers.texinfo
@@ -321,11 +321,19 @@ The syntax of the written representations for numbers is described
formally in @ref{Formal syntax}. Note that case is not significant in
numerical constants.
+@sharpindex{b}
+@sharpindex{o}
+@sharpindex{d}
+@sharpindex{x}
+
A number can be written in binary, octal, decimal, or hexadecimal by
the use of a radix prefix. The radix prefixes are @code{#b} (binary),
@code{#o} (octal), @code{#d} (decimal), and @code{#x} (hexadecimal). With
no radix prefix, a number is assumed to be expressed in decimal.
+@sharpindex{e}
+@sharpindex{i}
+
A numerical constant can be specified to be either exact or inexact
by a prefix. The prefixes are @code{#e} for exact, and @code{#i} for
inexact. An exactness prefix can appear before or after any radix prefix
diff --git a/doc/r7rs-small/r7rs-texinfo-macros.texinfo b/doc/r7rs-small/r7rs-texinfo-macros.texinfo
@@ -169,3 +169,11 @@ R@sup{6}RS
@inlineraw{tex, $\\langle$\text\$\\rangle$}
@end macro
@end iftex
+
+@c --- Indexing
+
+@c Add a sharped token to the function index under its the key
+@c of the first character after #.
+@macro sharpindex {token}
+@findex @sortas{\token\} #\token\
+@end macro