Skip to content

Commit f2aa039

Browse files
committed
Document newly-added operations in the Mutable Symbol Tables page of the docs.
Documentation for #183.
1 parent 1e64b6e commit f2aa039

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

doc/tutorial.qbk

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ Now we just need to put the pieces together to make a parser:
10421042

10431043
We've got a few new bits in play here, so let's break it down. `'M'_l` is a
10441044
/literal parser/. That is, it is a parser that parses a literal `char`, code
1045-
point, or string. In this case, a `char` "M" is being parsed. The `_l` bit
1045+
point, or string. In this case, a `char` `'M'` is being parsed. The `_l` bit
10461046
at the end is a _udl_ suffix that you can put after any `char`, `char32_t`, or
10471047
`char const *` to form a literal parser. You can also make a literal parser
10481048
by writing _lit_, passing an argument of one of the previously mentioned
@@ -1134,13 +1134,6 @@ The full program:
11341134

11351135
[self_filling_symbol_table_example]
11361136

1137-
[note It is possible to add symbols to a _symbols_ permanently. To do so, you
1138-
have to use a mutable _symbols_ object `s`, and add the symbols by calling
1139-
`s.insert_for_next_parse()`, instead of `s.insert()`. These two operations
1140-
are orthogonal, so if you want to both add a symbol to the table for the
1141-
current top-level parse, and leave it in the table for subsequent top-level
1142-
parses, you need to call both functions. ]
1143-
11441137
[tip _symbols_ also has a call operator that does exactly what
11451138
`.insert_for_next_parse()` does. This allows you to chain additions with a
11461139
convenient syntax, like this:
@@ -1157,6 +1150,19 @@ non-Unicode parsing of a character encoding that is not a subset of Unicode
11571150
(EBCDIC, for instance), it could cause problems. See the section on _unicode_
11581151
for more information.]
11591152

1153+
It is possible to add symbols to a _symbols_ permanently. To do so, you
1154+
have to use a mutable _symbols_ object `s`, and add the symbols by calling
1155+
`s.insert_for_next_parse()`, instead of `s.insert()`. These two operations
1156+
are orthogonal, so if you want to both add a symbol to the table for the
1157+
current top-level parse, and leave it in the table for subsequent top-level
1158+
parses, you need to call both functions.
1159+
1160+
It is also possible to erase a single entry from the symbol table, or to clear
1161+
the symbol table entirely. Just as with insertion, there are versions of
1162+
erase and clear for the current parse, and another that applies only to
1163+
subsequent parses. The full set of operations can be found in the _symbols_
1164+
API docs.
1165+
11601166
[endsect]
11611167

11621168
[section The Parsers And Their Uses]

0 commit comments

Comments
 (0)