constant prefix name 'preset_' changed to 'control_'. 'control_export_all' constant added.
This commit is contained in:
parent
181a9210d5
commit
43b7d3b15e
19
preset.go
19
preset.go
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user