constant prefix name 'preset_' changed to 'control_'. 'control_export_all' constant added.

This commit is contained in:
Celestino Amoroso 2024-04-06 03:01:17 +02:00
parent 181a9210d5
commit 43b7d3b15e

View File

@ -3,11 +3,16 @@ package expr
import "strings" import "strings"
// Preset variables // Preset control variables
const ( const (
preset_last_result = "_last" control_last_result = "_last"
preset_bool_shortcut = "_bool_shortcut" control_bool_shortcut = "_bool_shortcut"
preset_import_path = "_import_path" control_import_path = "_import_path"
)
// Other control variables
const (
control_export_all = "_export_all"
) )
// Initial values // Initial values
@ -16,8 +21,8 @@ const (
) )
func initDefaultVars(ctx exprContext) { func initDefaultVars(ctx exprContext) {
ctx.SetVar(preset_bool_shortcut, true) ctx.SetVar(control_bool_shortcut, true)
ctx.SetVar(preset_import_path, init_import_path) ctx.SetVar(control_import_path, init_import_path)
} }
func enable(ctx exprContext, name string) { func enable(ctx exprContext, name string) {
@ -45,7 +50,7 @@ func isEnabled(ctx exprContext, name string) (status bool) {
return return
} }
func getPresetString(ctx exprContext, name string) (s string, exists bool) { func getControlString(ctx exprContext, name string) (s string, exists bool) {
var v any var v any
if v, exists = ctx.GetVar(name); exists { if v, exists = ctx.GetVar(name); exists {
s, exists = v.(string) s, exists = v.(string)