hawdb 0.38.0

An embedded Rust graph database for local data-plane workloads
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# Owned SQL/PGQ token PEG

`hawdb-sql-syntax` owns the bounded token PEG used by the default relational
SELECT and EXPLAIN SELECT execution paths, including prepared statements and
plan-template cache misses. No feature, environment variable or host opt-in is
required. The syntax-only CREATE PROPERTY GRAPH and GRAPH_TABLE entry points
also use PEG. Relational DDL/DML, materialized views, branch lifecycle and paged SHOW commands use PEG as well.
Cypher defaults to a grammar compiled by the external `peg` crate for all
supported statements, clauses, patterns, values, predicates and projections.
Its former grammar builder and backend-selection feature have been removed.
Typed projection and sort actions lower each fully matched item and release its
temporary captures; other ASTs lower the completed tree. SQL uses the owned
matcher described below. Neither language retries a handwritten parser after a
syntax, semantic or resource error.

Parser routing is explicit by statement family:

| Family | Default path |
| --- | --- |
| SELECT, EXPLAIN [ANALYZE] SELECT | Owned token PEG, then relational IR lowering |
| CREATE PROPERTY GRAPH, GRAPH_TABLE syntax APIs | Owned token PEG; existing catalog/binder/execution admission still applies |
| Relational DDL/DML and materialized-view statements | Owned token PEG in `hawdb-sql`, then direct relational IR lowering |
| Branch commands | Bounded SQL token PEG and branch AST transformation |
| Cypher statements, standalone pipelines and stored predicates | Compiled `peg` grammar and typed AST lowering |

All supported SQL families now use PEG without a fallback or an upstream
parser dependency, including test builds. Cypher also uses PEG throughout; resource and performance
qualification remains tracked under [#1375](https://github.com/nowledge-co/hawdb/issues/1375).
A PEG syntax, semantic or resource error is returned directly. Accepting PGQ
syntax does not activate unqualified PGQ execution.

The executable grammar imports only reachable shared relational/expression rules
before compilation. DDL/DML CSTs lower directly to HawDB IR. Balanced raw groups
are confined to recognized unsupported clauses and custom type modifiers; they
never produce executable expressions. Unsupported clause diagnostics use owned,
static priority metadata and do not echo source payloads.

The frozen admission keyword inventory preserves the previous conservative token
and recursive-work accounting while using HawDB's lexer. The SELECT/EXPLAIN
16 MiB input cap stays in place. DDL/DML preserve acceptance of larger inputs
containing a single large literal or comment, with token, PEG work, capture,
memo and language nesting limits still enforced. Contiguous `==` remains valid
in DDL/DML expressions as before; the SELECT syntax profile rejects it.

## Design reference

DuckDB 2.0 makes its PEG frontend the default. Its
[parser documentation](https://duckdb.org/docs/preview/sql/peg_parser) describes
token matching, packrat memoization, source locations, suggestions and grammar
extensions. Its [implementation guide](https://github.com/duckdb/duckdb/blob/main/src/parser/peg/README.md)
separates grammar matching from AST transformation and describes named rule
composition and native matchers. Ordered choice makes rule order significant;
it does not guarantee that adding an alternative preserves the old language.

HawDB adopts that separation without copying DuckDB code or adding a parser
generator dependency. The bounded existing language does not yet justify a
textual grammar compiler, generated transformer framework, runtime plugin ABI,
custom tokenizer registration or catalog-aware completion. Those are separate
features, not consequences of using PEG.

## Grammar and transformation

`src/parser/frontend/grammar.rs` defines named rules using typed Rust
combinators: token/keyword, sequence, ordered choice, optional, repetition,
and positive/negative lookahead. Keywords match unquoted words case-insensitively.
The SQL grammar exports `Statement` and `FromItem` alternatives; PGQ prepends
its rules before immutable compilation. Compilation resolves named references
to numeric rule IDs, so matching does not hash rule names. In particular,
GRAPH_TABLE composes inside joins and FROM lists rather than retrying after a
SQL parse error.
A negative keyword guard prevents a broken GRAPH_TABLE prefix from becoming
an ordinary relation.

`src/peg.rs` builds a compact tree of named captures. SQL/PGQ matching has no
native callbacks: precedence levels, function arguments, graph paths,
property-graph definitions, aliases and clauses are PEG rules.
`src/parser/expression.rs` folds matched expression captures;
`src/parser/frontend/transform.rs` transforms only the selected tree into the
existing syntax AST. The former recursive expression and graph parsers have
been removed. Transformation does not select grammar alternatives or mutate
catalog/execution state.

The relational entry adds constant SELECT, implicit projection aliases, the
upstream-compatible explicit table-alias policy, empty projections, read-only
EXPLAIN, vector table-function arguments and nonblocking-lock syntax (rejected
by semantic admission). It shares clause, scalar and join grammar with PGQ.
LIKE/ILIKE/ESCAPE, function ALL and aggregate FILTER are syntax nodes; their
existing relational semantic restrictions remain authoritative. PGQ binders
reject the newly represented relational-only expressions until qualified.

`hawdb-sql/src/parser/owned.rs` lowers selected syntax directly into HawDB's
relational expression IR. It no longer constructs upstream semantic ASTs or
runs a second tokenizer for string literals. Contributing-token source spans
retain their established contract (parentheses/unary punctuation and function
closing delimiters do not enlarge them). Line starts and sparse UTF-8
checkpoints translate byte locations without repeatedly scanning whole lines.
An independent 102-case literal/span fixture from main `9c355e9a46` freezes
PostgreSQL E/U& decoding, invalid escape refusals and source locations.
SQL statement, expression and table-function parsing remains bounded by lexer
and PEG limits.

Grammar compilation rejects duplicate or unresolved names, direct/indirect
left recursion (including through nullable prefixes/lookahead), and nullable
repetition. Right recursion is permitted within the runtime depth bound.
Alternatives are attempted from the same token position; the first success
wins. A later sequence failure does not revisit an earlier successful choice.
The AST transformer and grammar form one internal contract and change together.

Cypher `LOAD CSV` uses its compiled PEG grammar and typed AST transformation.
The grammar recognizes optional headers, literal/parameter sources and an
optional literal field terminator; decoding validates the one-character ASCII
terminator. Conversion functions are recognized in scalar expressions and
property/SET values. List-row indexes in property values retain their distinct
binding-index AST. Ordinary values and predicate operands keep their existing
syntax boundaries. Four nonsemantic envelope/flag rules are inlined so these
additions fit the original 256-rule cap. Conversion recursion participates in
the existing language-depth budget. The CSV reader, typed import policy and
atomic execution remain the existing embedded library implementation.

## Resources and diagnostics

The SQL matcher runs continuations on an explicit work stack rather than the host
thread stack. This permits a graph pattern at its 128-level limit to contain an
expression at its independent 128-level limit without overflowing a Rust thread.
Admission still bounds internal expression frames, work, captures and memo
entries. Two language-depth domains carry subtree heights in memoized captures;
reusing a capture in a deeper context cannot bypass either limit. Depth refusal
retains its expression or graph error code. Grammar prefixes must match before
entering guarded content, so a rejected alternative does not consume language
nesting admission.

Grammar compilation lowers the resolved PEG expressions into a linear instruction
stream. Parsing uses a program counter and one heap work stack shared by rule
returns and expression scopes. Instructions retain ordered-choice commitment,
capture rollback and isolated lookahead diagnostics; named rules retain the
same memoized captures and language nesting heights. Validation runs before
compilation; each resolved rule expression is released after lowering. The
compiled grammar retains rule names, instructions and expectation pools, without
retaining the expression tree. Temporary branch links live in jump operands
until patching finishes, avoiding per-branch compilation allocations.

Only match or mismatch travels between instructions. Fatal work, depth,
memo, capture and repetition errors return immediately from the matcher, before
optional, repeated or lookahead expressions can consume them. A local flag
therefore records match or mismatch without carrying an owned syntax error.
Work charging and depth admission still follow the original rule and expression
entries, rather than counting implementation instructions. Jump and scope cleanup
instructions do not alter the public resource-budget boundaries.

Named-rule calls fuse expression entry and cleanup into the call/return pair.
Keyword-only choices test the original ordered keyword range without allocating
an expression continuation. Both retain the original logical charges and depth
checks, including exhaustion partway through a choice and the first alternative's
diagnostic when a later alternative matches. Lookahead still isolates diagnostics,
and failed memo entries retain them for later ordinary calls.

A parser invocation owns its memo table and capture arena. Successful and
failed named rules are cached by rule ID and token position; successful hits
reuse capture IDs instead of cloning syntax trees. Each rule caches its greatest
visited token directly and keeps one older position inline. History storage is
allocated only when a rule visits a third distinct position. Its first two older
records fit inside that allocation;
further visits use a bounded small vector, dense slots or permanent sparse
storage. The direct slot remains accessible without following the history pointer.
These forms share the same logical entry budget and retain pending, successful
and failed results. The direct slots are bounded by the compiled grammar's
256-rule cap, not the input length. The direct slots occupy one local array,
owned by the parse invocation and borrowed by the matcher. Constant initialization
and borrowing avoid copying the whole table into the matcher. Compilation resolves
all rule IDs within the same existing cap. The array contains 22,528 bytes of fixed
metadata on the qualified 64-bit platform; histories still allocate separately and
retain the same logical entry budget.

This trades heap allocations for stack storage. The additional inline history
increases the fixed table from 12,288 to 22,528 bytes on the qualified native
64-bit platform. An ARM64 worker compiled with optimization level 1 and ThinLTO
against the release library preserves all 18,744 corpus outcomes and complete
rendered diagnostics in cold and warmed threads at 256 and 512 KiB. At 128 KiB
both this implementation and the preceding PEG implementation abort. These are
results for the pinned compiler and probe configuration, not a general minimum
stack guarantee or a browser runtime measurement.

A nonzero state word also encodes the matched arena node ID, leaving zero for
empty optional slots without a separate enum discriminant. End positions and
optional diagnostics are retained. Node IDs come from the capture arena's
allocation range, so this representation adds no input or node admission cap.

Capture children are ranges in one edge arena. A reusable scratch vector
collects children during matching. Failed expressions and lookahead roll back
only that scratch vector; nodes and edges remain append-only because
memoized results may reference them. The AST transformer reads child ranges
without cloning temporary child lists.

Token failures store positions and thin references to the grammar's static
expectation fields, rendering source text only for the final error. This avoids
copying a two-word string reference into every memo entry and continuation.
These references stay inside one matching invocation; returned parse trees and
syntax errors remain independent of the grammar, input and token lifetimes.
Cached diagnostics preserve the farthest failure through later reuse. Lookahead discards its own speculative diagnostic. Optional/repeated
branches discard absent-prefix mismatches while preserving deeper failures. Ordinary syntax errors select the farthest byte
position, with the first expectation retained on ties. Expected-token sets and
interactive completion are not exposed yet.

The shared engine defaults to 4,000,000 matching work units, 262,144 memo
entries, 262,144 capture nodes and separately 262,144 capture edges, and 128
nested matcher expressions. SQL/PGQ uses an 8,192-frame internal matcher budget
because each language level spans multiple grammar rules; its independent
expression and graph language budgets remain exactly 128. The explicit work
stack enforces internal frame admission without recursive host-stack growth.
Work counts rule dispatch, combinator evaluation and token-adjacency checks.
The engine has no native matcher callbacks or AST value arena. These are logical
bounds, not a byte-precise allocator admission guarantee or a wall-clock limit.
The existing full lexer limits remain 16 MiB input, 1,000,000 tokens and 64 nested
block comments; expression and graph language nesting each remain 128. The
first-token dispatch helper reads only the prefix and does not enforce the
whole-input byte cap. Complete owned SELECT/EXPLAIN and SQL/PGQ syntax parsing
still enforce that cap; DML/DDL bodies retain their existing admission behavior. Numeric underscores must be surrounded by digits; malformed
separators fail lexically in both the relational and PGQ syntax entries.

`ParserLimitExceeded` identifies PEG work/storage/internal-depth refusal.
Expression and graph language-depth failures retain
`ExpressionNestingLimitExceeded` and `GraphPatternNestingLimitExceeded`.
Resource failures are fatal across
choice, optional, repetition and lookahead, and are never treated as a failed
alternative. All state is per invocation, so rejected input cannot poison the
next parse. No syntax repairs are applied.

## Qualification and remaining boundary

Existing syntax and frontend differential fixtures remain the compatibility
oracle. Engine regressions include malformed nested alternatives that would
have exponential cost without failure memoization, cache reuse, source spans,
and exact budget boundaries. Source-bound local parser campaigns supplement
those cases. See [test ownership](TEST_INDEX.md#owned-sqlpgq-token-peg).

The local parser-only benchmark is reproducible with:

```console
cargo bench --locked -p hawdb-sql-syntax --bench frontend
cargo bench --locked -p hawdb-sql-syntax --bench frontend -- --shapes
```

The default mode mixes five short SQL/PGQ statement shapes; `--shapes` also
isolates minimal queries, malformed PGQ, 500-column projections, 64 joins and
a 4 MiB rejected word. It warms the grammar before emitting nine CSV samples
per workload. Exclude the first sample and interleave identical benchmark
sources against baseline and candidate revisions. Allocation measurements need
a separate instrumented probe; timings from that probe include its overhead.
Results and tested revisions belong in the PR, not a checked-in run log.

PEG still adds matching/capture overhead relative to handwritten parsing.
Further statement-family promotion still requires positive/negative parity,
executable lowering, query-result/plan coverage and resource measurements, as
required by the
[SQL/PGQ specification](specs/POSTGRES_SQL_PGQ_SPEC.md).

## Frozen migration baseline

The `frontend_peg_baseline_v1.jsonl` SQL fixture records 1,009 public parser
outcomes from main `0f611b6dec`. The Cypher
`migration_peg_baseline_v1.jsonl` fixture records statement and pipeline results
for all 1,427 inventory queries (2,854 records). Each accepted result has the
SHA-256 of its complete UTF-8 Rust Debug AST, including source spans. Rejections
record Parse or Semantic. These fixtures supplement semantic equality checks:
Cypher `AstNode` equality deliberately ignores spans. They must not be refreshed
from the candidate parser to hide migration differences. The original query
inventories remain the source of query text and provenance.

An independently exported 489-case generated SELECT/DDL/DML baseline from
main `9c355e9a46` covers quoted and Unicode locations, empty forms, storage
options, aliases, conflict clauses and rejected statements. Eight additional
frozen timing shapes preserve full Debug-IR validation before measurement.
The manual timing diagnostic emits nine candidate samples per unchanged shape
(2,000 iterations for short queries, 100 for each 500-column projection).
Compare against the separately built baseline revision and discard sample zero.

The memo table caches each rule's greatest visited token directly. Older entries
use a bounded small vector, direct indexing for dense token visits, or a hash
map for sparse visits. Dense storage has at most four logical slots per occupied
entry and converts permanently to sparse storage on a large gap/backward range
extension. Logical entry limits, failed/pending entries and cached nesting
heights are unchanged. Lexical atoms check the same work/depth budget and finish
without a redundant continuation frame.

Baseline and candidate builds must use **different Cargo target directories**,
including their transitive local crates. Sharing a target directory across
worktrees can reuse another worktree's library or benchmark binary even while
rebuilding top-level crates. Check compilation paths and binary identity before
using measurements. All 1,608 SQL and 2,854 Cypher frozen records were re-exported
from independently compiled main `9c355e9a46` in a new main-only target directory;
all acceptance/error classes and complete Debug-AST hashes matched. Earlier
shared-target timing comparisons are invalid and must not support readiness.

## Cypher grammar continuation

Cypher's value rules cover exact negative/decimal token adjacency, parameters,
strings, row-bound properties, nested lists and timestamp forms. Data rules
construct CREATE/MERGE and system-variable ASTs directly. Pattern rules cover
labels, directions, finite/shortest hop ranges and ordered mutation clauses;
anonymous names, including existence-pattern names inside predicates, are
allocated in source order only while folding the selected CST.

Procedure rules match positional/named options, maps, yields and legacy graph
algorithm RETURN lists before typed lowering. The standalone vector-search
and legacy graph-algorithm admission boundaries, exact legacy diagnostic
positions, duplicate checks and bounded projected-filter contract remain.
`project_graph` string predicates use the same WHERE PEG with the existing
16 KiB and sixteen-conjunct semantic contract.
Balanced procedure-option maps share the 32-level recursive-language budget.
Token-source adjacency remains part of the compiled syntax. The Cypher matcher
bounds named-rule work and logical node/edge counts, including captures later
released by failed branches or typed actions. It does not use packrat memoization.
Value and structural recursion guards, together with AST depth validation,
retain the 32-level language bound. Generic SQL memo and matcher-frame budget
tests stay with the SQL engine; Cypher tests directly check its own work,
capture and nesting refusals, including UTF-8 error locations.

All Cypher entry points use this one grammar without an opt-in or fallback.
The compatibility diagnostic layer records the first failure at the farthest
token and restores lookahead diagnostics. Total Option entry wrappers disable
only `peg`'s unused duplicate diagnostics. Early native nesting refusals still
have known message/location differences on overdeep inputs; those remain part
of resource qualification rather than an established compatibility result.

A further 420 statement/pipeline records were exported from independently
compiled main `9c355e9a46` in its main-only target directory. They cover these
newly migrated families, source spans, exact numeric and hop-range spacing,
legacy CALL admission and combined nesting. No fixture is refreshed from the
candidate. Pure-path tests also verify the absence of native AST captures.

WHERE rules preserve boolean grouping, comparison chains, indexable property
comparisons, ID comparison spacing, IN, string predicates and bounded existence
patterns. WITH/RETURN rules cover precedence, aggregates, list functions and
postfixes, CASE, ordering, pagination and aliases. Scalar and CASE-value contexts
retain their different timestamp admission. Specialized CASE AST variants are
folded only from recognized equivalent CST shapes; arbitrary CASE expressions
retain the general AST and recursive budget.

A further 8,946 statement/pipeline records freeze expressions, predicates,
wrappers, truncation, schema and combined depth boundaries. Their complete
Debug-AST hashes and rejection classes were exported from independently built
main `9c355e9a46`, then compared with the candidate with zero differences. They
replace live calls into the deleted handwritten test oracle. Nine independently
exported malformed graph-algorithm cases preserve exact diagnostics. Existing
pipeline and anonymous-name tests remain against the public PEG entry points.

Removing the legacy parsers establishes routing, not performance readiness.
Parser timing and allocator/RSS qualification must still be assessed against
independent baseline builds without weakening existing resource gates.

Latest-main integration at `2ae7e88614` (#1411) adds bare row-bound values in
node patterns and classifies read-only UNWIND as a query pipeline. The PEG
value rule and selected-tree lowering retain both changes without restoring the
handwritten parser. All 12,220 earlier Cypher records were independently
re-exported from that main revision and matched the integrated candidate. The
older fixtures stay immutable: `migration_main_1411_peg_baseline_v1.jsonl`
records the eight intentional main transitions with their previous fingerprints,
plus 132 independently exported row-bound/CASE/context outcomes. Existing
#1411 parser and embedded query tests remain intact.

The independent `migration_keyword_context_peg_baseline_v1.jsonl` adds 2,380
main `2ae7e88614` outcomes for keyword-named properties, all specialized
CASE families, including coalesced-difference floors, combined depth limits, row-binding refusals and scalar/SET/value
context differences. Dedicated PEG alternatives preserve specialized CASE on
`true`, `false`, `null` and `CASE` properties; they retain constant-value and
same-property admission. Scalar value-list lowering rejects reserved CASE row
bindings, and SET's ordinary-value branch preserves the CASE/COALESCE prefix
refusal. The compiled-rule cap stays 256; no resource budget is raised.

CST folding constructs owned identifier pairs and joined names directly, and
single predicates/comparisons return without allocating temporary predicate
vectors. Existing independent Debug-AST/error fixtures cover the resulting
ASTs, including comparison chains and nested boolean scopes. The shared VM and
memo storage remain unchanged by this allocation cleanup; no parser budget or
fixture is weakened. Parser peak allocation and RSS qualification remain open.

Main #1403 unifies ORDER BY with RETURN/WITH expression syntax. The PEG sort
rule now shares projection arithmetic, aggregates, path expressions and null
tests; direct column/property/id forms retain their dedicated AST variants.
The inherited planner resolves aggregate sort expressions against projected
aggregates and retains grouped-scope checks for composite expressions.
`migration_main_1403_order_expressions_peg_baseline_v1.jsonl` records 42 explicit
transitions from the earlier oracles plus 672 new context, direction, depth and
refusal cases, independently exported from main `0892820255`. Older fixtures
remain immutable; transition layers require matching previous fingerprints.
The dedicated sort whitelist is removed without raising any parser budget.

## Main compatibility after 0.25.0

The migration also preserves main `fd10958dd37b8878151aeb73ff0477d189b5db5e`,
including #1504's Mem Cypher contracts and #1429's exact SQL arithmetic and
Decimal types. The independently compiled main exports are recorded in
`migration_main_1514_mem_peg_baseline_v1.jsonl` (1,537 Cypher outcomes,
including 290 explicit transitions),
`migration_main_1514_mem_api_peg_baseline_v1.jsonl` (112 independently exported
Mem API and list-append outcomes), and
`frontend_main_1514_numeric_peg_baseline_v1.jsonl` (92 SQL outcomes,
including 52 transitions). Earlier oracle files remain immutable. Tests verify
complete AST and contributing spans, or the parse/semantic rejection category;
the expected results come from main rather than the PEG candidate.

Cypher recognizes the core list-function catalog (including `list_append`),
string scalars, computed read-side UNWIND, and null-preserving
or older-value-preserving CASE SET directly through the compiled PEG. SQL PEG
recognizes numeric casts and lowers arithmetic, constant numeric mutation values,
and Decimal schema types directly. DDL/DML retain their former 47-call recursive
expression boundary independently of SELECT's 128-level limit. A bounded capture
walk checks the resulting AST height before constructing recursive boxes, so
flat arithmetic and cast chains cannot bypass the height limit.

These compatibility results do not resolve the throughput, heap, rendered-error,
or end-to-end performance gates described above.

The covering-index transition fixture records the source-bound INCLUDE grammar
and AST change from main `058085fa2`. The partial-index transition fixture
records the subsequent WHERE grammar and AST change from main `ebc2c9c4a`.
Tests check each transition against its predecessor and the current parser.

`frontend_main_1514_numeric_alias_peg_baseline_v1.jsonl` adds 1,005 independent
main outcomes across SELECT, INSERT, UPDATE, DELETE, and column defaults. It
covers integer aliases, FLOAT precision, signed scale modifiers with comments,
quoted custom type refusals, and overflow boundaries. Statement casts keep the
broader numeric alias contract of DDL/DML; SELECT retains its narrower contract.
Both use the same PEG expression grammar with explicit entry-specific rules and
lower directly into numeric IR. Modifier values are read from already matched
lexer tokens, including signs separated from digits by comments or whitespace.