Skip to main content

Crate nova_parser

Crate nova_parser 

Source
Expand description

Parser for the Nova programming language.

Converts a Vec<Spanned<Token>> (from nova-lexer) into an ast::File. A hand-written recursive-descent parser: after an error it skips to the next item or statement boundary and keeps going.

§Usage

use nova_diagnostics::FileDb;
use nova_lexer::lex;
use nova_parser::parse;

let mut db = FileDb::new();
let file_id = db.add("main.nova", "fn main() {}");
let source = db.get_source(file_id).unwrap();
let (tokens, _lex_errs) = lex(source, file_id);
let (ast, _parse_errs) = parse(&tokens, file_id);

Structs§

Parsed
What parse_recovering returns.

Enums§

ParseError
A parse error with source location.

Functions§

parse
Parse a token stream into a File AST.
parse_recovering
parse, also naming the items it dropped (spec docs/superpowers/specs/2026-10-08-phase-3-2-lsp-core-design.md §3.2). The language server’s analysis calls this; every other caller uses parse, whose result is the same file and errors.