-
Notifications
You must be signed in to change notification settings - Fork 0
Description
At the moment input lines are split into tokens based on separators and then an attempt is made to convert the token to the specified type. This works reasonably well but it requires us to prohibit separators that are (possible) characters in the token we want to parse into a type. For example, if we use $integer in a condition we can't use + or - as separators because those characters can occur in $integer.
An alternative, and maybe better approach, would be to define a regex for each type and use the regex to identify tokens for each type on each input line. The challenge with this approach is that we don't know how the token we want to match with the regex is separated from the text around it. We would need to somehow invert the pattern. The other challenge is that we would need to translate chrono::format::strftime date/time format strings (which can be specified by the user) into a regex. If we can solve those challenges, however, we remove all the nasty separator validation logic in expression::Validator and don't need to bother the user with making sure that the correct separators are supplied using add-separator and remove-separator command arguments.