You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This regex accepts empty string, so the lexgen state never failed and instead looped when it's supposed to fail.
Now, I've never needed this in a lexer, but this kind of rule can be used to switch to another state on failure, so I guess it's not completely useless. However I suspect for the majority of the use cases it actually means a bug in the lexer, so perhaps it makes sense to generate a warning for rules that accept empty strings, with a pragma to explicitly suppress the warning.
The text was updated successfully, but these errors were encountered:
Recently I debugged a lexer with this rule:
This regex accepts empty string, so the lexgen state never failed and instead looped when it's supposed to fail.
Now, I've never needed this in a lexer, but this kind of rule can be used to switch to another state on failure, so I guess it's not completely useless. However I suspect for the majority of the use cases it actually means a bug in the lexer, so perhaps it makes sense to generate a warning for rules that accept empty strings, with a pragma to explicitly suppress the warning.
The text was updated successfully, but these errors were encountered: