Stdlib module compiler/frontend/parser.vit
This page is a wiki-style reference for one concrete stdlib file. It explains what the file owns, where it fits in the family, and how to decide whether this is the right surface to depend on.
compiler/frontend/parser.vit.Family: compiler
Kind: compiler-facing or orchestrator module
Page style: this reference follows the same “encyclopedic card + portrait + usage contract” logic as the keyword pages, but for stdlib modules.
Summary
Overview
| Field | Value |
|---|---|
| Path | compiler/frontend/parser.vit |
| Family | compiler |
| Kind | compiler-facing or orchestrator module |
| Line count | 59 |
| Declared procedures | 11 |
| Declared forms/picks | 2 |
`compiler/frontend/parser.vit` is a compiler-facing or orchestrator module inside the `compiler` family. It should be read as one focused slice of the broader family responsibility: Compiler-owned stdlib surfaces that support self-hosted compiler and driver integration.
Purpose
This file should be chosen because of responsibility, not because its name “sounds close enough”. Inside the compiler family, it carries one focused part of the contract and keeps that responsibility separate from neighboring concerns.
- Use this module when structured exchange format is part of the feature, not just an incidental output.
- A self-hosted compiler flow can reuse structured helpers without pretending they are general stdlib entry points.
- A driver surface can depend on this family while still keeping its public contract documented elsewhere.
Top-level API inventory
| Surface | Items |
|---|---|
| Procedures | _trim_after_prefix, _index_of_char, _first_word, _last_index_of_char, _split_args, _parse_expr, _parse_stmt, _parse_params, _parse_proc_signature, _parse_proc_decl, parse_lexed |
| Forms | ParsedSource, ProcParseResult |
| Picks | none declared at top level |
| Constants | none declared at top level |
Imported surfaces
This file does not advertise a top-level `use` surface in its opening declarations. That often means it is either self-contained or an aggregation layer.
How to use this module
Start by reading the file as an ownership boundary. Ask three questions: what enters this module, what stable types or procedures it exports, and what adjacent module should stay outside of it.
- Open the family page first to understand why this area of the stdlib exists.
- Read the source excerpt below to see the namespace, imports, and first declared surfaces.
- Check the neighbor list to avoid coupling this module with an adjacent responsibility by habit.
Source shape
space vitte/stdlib_checked/compiler_frontend_parser
form ParsedSource {
value: int
}
form ProcParseResult {
value: int
}
proc _trim_after_prefix() -> int {
give 0
}
The excerpt is not meant to replace the file. It exists to make the module recognizable at first glance, the same way a Wikipedia infobox helps the reader orient before reading the whole article.
Integration boundaries
Within compiler, this file should remain focused. If a future helper changes the host boundary, scheduling boundary, or data-shape boundary, it probably belongs in a neighbor module instead of being added here by convenience.
- Family responsibility: Compiler-owned stdlib surfaces that support self-hosted compiler and driver integration.
- Family architecture role: This family is not general-purpose business code. It exists to support compiler-owned flows where the compiler and stdlib need a shared contract.