It might very well be that I am doing this wrong.
I am implementing a query api, where a single line of text is parsed to apply a filter.
The string could be:
And using parentheses is supported as well to force affinity. eg.
I have an identifier and a value separated by an operator, and possibly surrounded by parentheses.
var identifier = TerminalFactory.CreateCSharpIdentifier("identifier");
var value = new FreeTextLiteral("value", FreeTextOptions.AllowEof, "$", ")");
The value can be any type, and contain spaces if need be. This all works, but as explained the escaping of the end parentheses somehow doesn't. It will throw an exception if mathing start and end parentheses don't exist, and haven't been properly escaped. But
it won't remove escaping from the string.
As I understood it, I would have to tell the freetext literal that when it encountered either a $ or a ) then a new token started.