Implemented array storage

This commit is contained in:
Eduard Urbach 2024-07-20 17:35:26 +02:00
parent 5dee0777e7
commit 52e87a8885
Signed by: eduard
GPG key ID: 49226B848C78F6C8
17 changed files with 150 additions and 45 deletions

View file

@ -79,6 +79,10 @@ func TestParse(t *testing.T) {
{"Function calls 27", "sum(a,b)*2+15*4", "(+ (* (λ sum a b) 2) (* 15 4))"},
{"Package function calls", "math.sum(a,b)", "(λ (. math sum) a b)"},
{"Package function calls 2", "generic.math.sum(a,b)", "(λ (. (. generic math) sum) a b)"},
{"Array access", "a[0]", "(@ a 0)"},
{"Array access 2", "a[b+c]", "(@ a (+ b c))"},
{"Array access 3", "a.b[c]", "(@ (. a b) c)"},
{"Array access 4", "a.b[c+d]", "(@ (. a b) (+ c d))"},
}
for _, test := range tests {