This commit adds a parser, complete with tests. The parser implements
an iterator which returns Datum. It wraps around a Lexer and uses the
Lexer's iterator interfact to consume lexemes. It may return an error
which may wrap around a LexError or a fully lexed lexeme.

In the implementation of the Parser bugs were found in the lexer
package. This resulted in the lexing tests being extended as well as
several small logic updates.

The number package has had slight tweaks to make number representations
less cumbersome.

Finally, the Datum display logic in the sexpr package has also been updated.

Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2025-05-19 14:38:11 -07:00
parent a48fc52fab
commit 86f905ba1d
5 changed files with 632 additions and 29 deletions

View file

@ -18,7 +18,7 @@
#![cfg_attr(not(test), no_std)]
#![feature(let_chains)]
#![feature(iter_collect_into)]
#![feature(impl_trait_in_assoc_type)]
#![feature(if_let_guard)]
pub mod sexpr;
pub mod lexer;