Formatter option is now composed of two data: flags (lower 16 bits) and indentation size (higher 16 bits).

DictType and ListType formatter use both indent and flag options.
Simple-store now makes a DictType from its data and its ToString() function returns dict.ToString()
This commit is contained in:
2024-06-11 16:32:01 +02:00
parent 56d6d06d15
commit 9fb611aa20
8 changed files with 126 additions and 42 deletions
+3 -1
View File
@@ -31,7 +31,9 @@ func evalContextValue(ctx ExprContext, self *term) (v any, err error) {
}
if sourceCtx != nil {
if formatter, ok := sourceCtx.(Formatter); ok {
if formatter, ok := sourceCtx.(DictFormat); ok {
v = formatter.ToDict()
} else if formatter, ok := sourceCtx.(Formatter); ok {
v = formatter.ToString(0)
} else {
// keys := sourceCtx.EnumVars(func(name string) bool { return name[0] != '_' })