Skip to content

Parser should not throw an error if predicate not present#924

Open
sc07kvm wants to merge 1 commit intoexpr-lang:masterfrom
sc07kvm:no_error_on_unknown_predicate
Open

Parser should not throw an error if predicate not present#924
sc07kvm wants to merge 1 commit intoexpr-lang:masterfrom
sc07kvm:no_error_on_unknown_predicate

Conversation

@sc07kvm
Copy link

@sc07kvm sc07kvm commented Feb 6, 2026

Context

A change introduced in #842 (related to #841) altered the previous behavior. The earlier behavior was intentional: functions can be provided via env at runtime.

If the following code works:

program, err := expr.Compile(`fn(1)`)
out, err := expr.Run(program, map[string]any{"fn": func(a int) int { return a }})

then this code should work as well:

program, err := expr.Compile(`upper(1)`, expr.DisableBuiltin("upper"))
out, err := expr.Run(program, map[string]any{"upper": func(a int) int { return a }})

Compatibility

#842 also introduced a backward-incompatible behavior in a minor release.

@sc07kvm sc07kvm force-pushed the no_error_on_unknown_predicate branch from c687e09 to 4fbf622 Compare February 7, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant