Fix invalid indices when content is not long enough

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2026-03-09 15:20:07 +01:00
parent fa1582f3ad
commit 462355b6f2
4 changed files with 25 additions and 7 deletions

14
tests/checks.rs Normal file
View file

@ -0,0 +1,14 @@
#[test]
fn check_files() {
let files = std::fs::read_dir("tests/checks/").unwrap();
for file in files {
let input = std::fs::read_to_string(file.unwrap().path()).unwrap();
let parsed = nomo::parser::parse(input.into()).unwrap();
let ast = nomo::ast::parse(parsed.tokens()).unwrap();
let _emit = nomo::emit::emit_machine(ast);
}
}

View file

@ -0,0 +1,2 @@
{{if en}}{{ end}}