Expand description
Byte-level scanner for Erlang source.
Tracks position (line, column, byte offset), skips comments and strings, and exposes helpers the reader uses to find function clauses and call sites. Not a full Erlang tokenizer: just what the v1 xref reader needs.
A separate block-oriented tokenizer exists in backhopper_erlang::tokenizer.
Consolidation is deferred until a third consumer needs it.
Structs§
Functions§
- arity_
from_ commas - Returns the arity inferred from the argument-list source
(a, b, c). Empty parens yields 0; one or more top-level commas yields commas+1. - walk_
paren_ group - Scans the balanced
(...)group at the current(, which must be the next byte. Tracks nested(),[],{}, and<<>>; skips strings, quoted atoms, char literals, and%comments. At each byte that can begin an identifier or?macrouse,on_identruns with the cursor on that byte so callers can surface nested call sites; if it returns false the byte is consumed and the walk continues. Reports the top-level comma count, whether any non-whitespace content appeared, and whether the matching)was reached.