If no config file specified reads config from ${XDG_CONFIG_DIR:-~/.config}/boomer/config.
Also now config parsing is performed automatically according to object fields.
In current state macro expands to following code:
case normIdent(key)
of "scrollspeed":
result.scrollSpeed = parseFloat(value)
of "dragvelocityfactor":
result.dragVelocityFactor = parseFloat(value)
of "dragfriction":
result.dragFriction = parseFloat(value)
of "scalefriction":
result.scaleFriction = parseFloat(value)
of "fps":
result.fps = parseInt(value)
else:
raise
var e`gensym340155: owned(ref CatchableError)
new(e`gensym340155)
e`gensym340155.msg = "Unknown config key " & key
e`gensym340155.parent = nil
e`gensym340155
Which is almost exactly the same as handwritten one, except identifiers are compared style insensitively, so you dont have to follow exact field naming in the config. Also value are automatically parsed to int/float and additional handling can be added as needed.
If no config file specified reads config from
${XDG_CONFIG_DIR:-~/.config}/boomer/config
. Also now config parsing is performed automatically according to object fields.In current state macro expands to following code:
Which is almost exactly the same as handwritten one, except identifiers are compared style insensitively, so you dont have to follow exact field naming in the config. Also value are automatically parsed to int/float and additional handling can be added as needed.