Skip to content

Conversation

mkeeler
Copy link
Member

@mkeeler mkeeler commented Sep 7, 2022

This is intended to allow the caller to supply some set of variables to be used when evaluating an expression.

This could be preferable to the caller templating an expression for 2 reasons:

  1. It allows the parsed expression to be reused with different values which could improve performance if the same general expression is evaluated many times.
  2. Variables are processed after general parsing and thus could not mess with how things are parsed.

TODOS:

  • Update tests including adding new ones dealing with variable expansion.
  • Handle the regex matching case. Right now a compiled regex is memoized within the MatchValue which may not be the same regex for the next invocation.
  • Handle more general interpolation such as X == "prefix-${var}"

This is intended to allow the caller to supply some set of variables to be used when evaluating an expression.

This could be preferable to the caller templating an expression for 2 reasons:

1. It allows the parsed expression to be reused with different values which could improve performance if the same general expression is evaluated many times.

2. Variables are processed after general parsing and thus could not mess with how things are parsed.
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