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

@ -1,6 +1,15 @@
---
source: tests/file_tests.rs
expression: emit
info:
input: "{{= _name }}\n{{= a_name }}\n{{= name }}\n{{= _name1 }}\n{{= _namE }}\n{{= name1 }}"
context:
_namE: Foo
name1: Foo
name: Foo
_name: Foo
a_name: Foo
_name1: Foo
input_file: tests/cases/identifiers.nomo
---
VMInstructions {
@ -35,7 +44,7 @@ VMInstructions {
content: "\n" (26..27),
},
LoadFromContextToSlot {
name: "1name" (31..36),
name: "name" (31..35),
slot: VariableSlot {
index: 2,
},
@ -46,10 +55,10 @@ VMInstructions {
},
},
AppendContent {
content: "\n" (39..40),
content: "\n" (38..39),
},
LoadFromContextToSlot {
name: "_name1" (44..50),
name: "_name1" (43..49),
slot: VariableSlot {
index: 3,
},
@ -60,10 +69,10 @@ VMInstructions {
},
},
AppendContent {
content: "\n" (53..54),
content: "\n" (52..53),
},
LoadFromContextToSlot {
name: "_namE" (58..63),
name: "_namE" (57..62),
slot: VariableSlot {
index: 4,
},
@ -74,10 +83,10 @@ VMInstructions {
},
},
AppendContent {
content: "\n" (66..67),
content: "\n" (65..66),
},
LoadFromContextToSlot {
name: "name1" (71..76),
name: "name1" (70..75),
slot: VariableSlot {
index: 5,
},