-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing Error need to point to the code #4
Comments
The new struct shouldn't pass a Position to the new struct but instead a much lighter one without the filename and filetext parameters. But instead put those parameters in the new struct. |
I'm definitely not happy with the result, I think I need to found a new implementation, it's too bulky. I've two ideas how to do it more efficiently :
|
This is done. |
The "reverse lexer" is just dumb, we can instead store a span in tokens, and in the AST |
Is your feature request related to a problem? Please describe.
Add error that clearly point to the code.
Describe the solution you'd like
Token
enum intoTokenType
Token
that stores a TokenType and a range, named the span.After that the token stream has the location in the code.
CodeLocation
that will have a functionspan()
that return the span of the AST.CodeLocation
)When an error occurs, you can use the span of the most coherent AST node and spawn an error.-> Replace anyhow error with custom errors #30The text was updated successfully, but these errors were encountered: