-
Notifications
You must be signed in to change notification settings - Fork 3
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
Recovery from bad input (syntax errors) #4
Comments
I confirmed the infinite loop problem and would like to work on fixing this as soon as possible. As for other bad patterns, I would like to consider a plan for error handling. Specifically, I thought of the following:
Here, we must be aware that these procedures are restricted by the pure attribute. Therefore, there is almost no way to communicate errors to the outside for these functions. Only the If you have any other ideas, I would be happy if you could share them. |
I think a PURE function can return a derived type. So you could make one something like type match_result |
This idea is a good insight for me, but I prefer the simplicity of operators returning a logical type, so I would like to use it in the Furthermore, in a function that returns this derived type, I want to preserve the option to implement it with operator overloads for string operations (//, /=, ==, etc.) for the type. |
Recovery from bad input has been implemented slightly defferently than stated above. See release v4.0 and the latest README.md for details. I consider this issue accomplished and will close it this week. Please let me know if you have any additional suggestions. Thank you @phreeplot for your suggestions! |
I've been testing forgex and so far it works well. My main issue is how it recovers from bad input. There are quite a few error_stops for bad input which is inconvenient when embedded in a larger program. I also found an infinite loop in syntax_tree_graph_m.F90 line 344-348 when an opening [ is not matched by a closing one ]. You also need to check something like self%tape%token_char.ne.'' to avoid this.
The text was updated successfully, but these errors were encountered: