Skip to main content

Module lexer

Module lexer 

Source
Expand description

Lexer primitives and keywords for the Fiducia language.

This module provides shared tokenization utilities used by all Fiducia parsers: keywords, identifiers, numeric/string/boolean literals, file paths, whitespace, and comment handling.

Modules§

keyword
Reserved keyword constants shared across Fiducia parsers.
symbol
Operator and punctuation symbol constants.

Functions§

binder
Parse the name of name : (a variable, parameter or carrier), committed at the :.
bool_literal
Parse a boolean literal (true or false).
file_path
Parse a file path, as written up to the closing quote: what it names is the front end’s to decide, not the grammar’s.
hex
Parse a hex literal: 0x[0-9a-fA-F][0-9a-fA-F_]*.
identifier
Parse an identifier: a word that is not a keyword.
offset
Zero-consuming parser returning the current byte offset — used to record a reference site’s offset (e.g. a channel’s sender/receiver, a mapping’s region name) alongside its own span.
reserved
Parse a reserved token (keyword or symbol) as an exact literal match.
text
Parse a text literal: "..." of printable ASCII, with the escapes \\, \", \n and \t; committed after the opening quote.
upper_identifier
Parse an identifier whose first character is ASCII uppercase: UpperCamelCase. Used for process names in declaration position (proc Name(...)) and process references (Name(args)).
ws
Skip whitespace and comments (zero or more).

Type Aliases§

Input
Parser input type: a &str that tracks its own byte offset (winnow::stream::Location), enabling Parser::span()/with_span() and current_token_start() for span and error-position tracking.
PResult
Result type alias for parser functions.