Simplified Evaluate function

This commit is contained in:
Eduard Urbach 2025-02-27 23:28:17 +01:00
parent 3d294eb35c
commit fbcadae268
Signed by: eduard
GPG key ID: 49226B848C78F6C8
14 changed files with 318 additions and 133 deletions

View file

@ -33,7 +33,7 @@ const (
LogicalAnd // &&
LogicalOr // ||
Define // :=
Period // .
Dot // .
Range // ..
Call // x()
Array // [x]

View file

@ -216,14 +216,14 @@ func TestDefine(t *testing.T) {
}
}
func TestPeriod(t *testing.T) {
func TestDot(t *testing.T) {
tokens := token.Tokenize([]byte(`a.b.c`))
expected := []token.Kind{
token.Identifier,
token.Period,
token.Dot,
token.Identifier,
token.Period,
token.Dot,
token.Identifier,
token.EOF,
}

View file

@ -35,7 +35,7 @@ func operator(tokens List, buffer []byte, i Position) (List, Position) {
case "+=":
kind = AddAssign
case ".":
kind = Period
kind = Dot
case "..":
kind = Range
case ":=":