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
The lexer currently reports user errors through panics (In particular, there is currently only one user error, "token limit reached", i.e. TokenLimitReachedError).
As the lexer is used in the parser, which already previously got refactored from reporting user errors as panics in #1764, it might be surprising to users of the parser that user errors are still reported as panics in some cases.
Suggested Solution
Refactor the lexer to report user errors, such as the "token limit reached" error (TokenLimitReachedError), to be reported as an error return value, instead of a panic.
The text was updated successfully, but these errors were encountered:
In addition to the token limit reached error, there's also the memory usage error (errors.MemoryError) which is a user error, but a fatal error (stop parsing).
Memory error is currently a panic not only in the lexer, but also in parser. We would need to refactor both the lexer and parser parser to return memory error, instead of panicking.
Issue to be solved
The lexer currently reports user errors through panics (In particular, there is currently only one user error, "token limit reached", i.e.
TokenLimitReachedError
).As the lexer is used in the parser, which already previously got refactored from reporting user errors as panics in #1764, it might be surprising to users of the parser that user errors are still reported as panics in some cases.
Suggested Solution
Refactor the lexer to report user errors, such as the "token limit reached" error (
TokenLimitReachedError
), to be reported as an error return value, instead of a panic.The text was updated successfully, but these errors were encountered: