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