This includes:
- Passing a Sema to completeExpression to allow for named values in the expression.
- Update the Sema interface to include completion for matchers and values.
- Change the parser to use the Sema for completion, instead of going directly to Registry.
This approach requires a bunch of common logic to be duplicated between individual Sema implementations. Instead, you could have a virtual function in this class that returns (a const reference to) a map of named values, which would be called by this function and getNamedValue.
You might also consider changing the parser API to pass the map separately (along with Sema) to the parser. That way, you could also avoid complicating Sema too much as a result of having to allow completeExpression to take custom Semas.