Add getters for Span and improve error handling - #146
Conversation
|
The added functionality seems to be used nowhere |
|
Sorry for not explaining the motivation for these changes earlier. For basic diagnostics, we need access to error information (RichError) in order to report error from compiler to text editor. Currently, since all RichError fields are private, the only available option is to extract the error as a string. We already have a basic diagnostics implementation, but it depends on our fork. Similarly, for parser and AST nodes, we need access to the location (Span) of elements to implement features like goToDefinition. At the moment, this is not possible because the relevant data is inaccessible. Since adding getters for these fields does not introduce any breaking changes, it would be very helpful if this functionality could be added. |
Description
This pull request introduces getter methods for Span in Parse and AST nodes, and adds getters for RichError fields. These changes make span and error information more accessible, simplifying the development of tools for SimplicityHL.
Impact