Parse and ast math expressions

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2026-03-12 11:25:55 +01:00
parent 8cc8488de4
commit 8c02dbd672
8 changed files with 196 additions and 51 deletions

View file

@ -33,6 +33,7 @@ use winnow::stream::Location;
use winnow::stream::Recoverable;
use winnow::stream::Stream;
use winnow::token::any;
use winnow::token::literal;
use winnow::token::one_of;
use winnow::token::rest;
use winnow::token::take_until;
@ -535,7 +536,7 @@ fn ident<'input>(input: &mut Input<'input>) -> PResult<'input, NomoInput> {
.context(ParseError::ctx().msg("Expected an ident, but found a literal instead"))
.parse_next(input)?;
let literal_start = alpha1;
let literal_start = alt((alpha1, "_"));
(
literal_start,