Dict literal now accepts expressions as keys. Key values are computed at evalutetion time and still must be integer or string

This commit is contained in:
2026-05-20 05:14:22 +02:00
parent 1aea1c14d2
commit 1055569dd6
6 changed files with 60 additions and 46 deletions
-19
View File
@@ -188,25 +188,6 @@ func StringEndsWithOperator(s string) bool {
return endingOperator(s) != SymNone
}
// func endingOperator(s string) (sym Symbol) {
// var matchLength = 0
// sym = SymNone
// lower := strings.TrimRight(strings.ToLower(s), " \t")
// for symbol, spec := range symbolMap {
// if strings.HasSuffix(lower, spec.repr) {
// if len(spec.repr) > matchLength {
// matchLength = len(spec.repr)
// if spec.kind == symClassOperator && (spec.opType == PosInfix || spec.opType == PosPrefix) {
// sym = symbol
// } else {
// sym = SymNone
// }
// }
// }
// }
// return
// }
func endingOperator(s string) (sym Symbol) {
var matchLength = 0
var repr string