operator-dot: added support to access dict value by exprssion; example: D.key, D."key", D.expr

This commit is contained in:
2026-04-30 07:06:20 +02:00
parent 32c0b45255
commit 610e2df5f5
2 changed files with 14 additions and 0 deletions
+3
View File
@@ -39,6 +39,9 @@ func TestDictParser(t *testing.T) {
//"b":2,
"c":3
}`, map[any]any{"a": 1, "c": 3}, nil},
/* 13 */ {`D={"a":1, "b":2}; D."a"`, int64(1), nil},
/* 14 */ {`D={"a":1, "b":2}; D.a`, int64(1), nil},
/* 15 */ {`D={1:"a", 2:"b", 3:"c"}; D.(1+2)`, "c", nil},
}
succeeded := 0