Repository navigation
Closed
Labels
enhancementA request for a new feature or improvement.feature requestA request for a new feature or functionality.needs testingIssues that require additional testing or verification.
Description
Parent: #439
Summary
Add source-level async and await syntax without performing coroutine lowering.
Scope
- Reserve
asyncandawaitin the lexer with stable token names and spans. - Parse
async fun name(...) -> T { ... }wherever an ordinary function declaration is valid. - Parse prefix
await expressionwith documented precedence. - Preserve async declarations and await expressions in the source AST.
- Support visibility parsing as
pub async fun; continue rejecting every publicmaindeclaration. - Produce focused diagnostics for missing
fun, missing await operand, invalid declaration order, and malformed bodies. - Keep
externandexportasync forms syntactically representable only if needed for a precise semantic rejection; do not silently accept them as synchronous functions.
Completion criteria
- Lexer and parser unit tests cover valid nested expressions and malformed syntax.
- AST debug output exposes async declarations and await nodes.
- Existing identifiers and declaration parsing regressions remain green apart from the intentional keyword reservation.
- Parser changes do not add LLVM or runtime dependencies.
Semantic legality and types are handled separately from this issue.
Implementation audit — 2026-09-23
Verified the lexer/parser/AST implementation and reran async_frontend with the complete parser and frontend test suites. Async flags, await result types/spans and malformed forms are covered. Private async main is deliberately rejected until its executor entry contract is provided; ordinary main remains supported. This closes the syntax task, not the runtime parent #439.
Metadata
Metadata
Assignees
Labels
enhancementA request for a new feature or improvement.feature requestA request for a new feature or functionality.needs testingIssues that require additional testing or verification.
Activity
LunaStev commentedon Sep 23, 2026
Verified the lexer/parser/AST implementation and reran
async_frontendwith the complete parser and frontend test suites. Async flags, await result types/spans and malformed forms are covered. Private async main is deliberately rejected until its executor entry contract is provided; ordinary main remains supported. This closes the syntax task, not the runtime parent #439.