Replies: 2 comments 2 replies
-
We eventually expose an object containing both the issues and the root of the AST (see https://github.com/Strumenta/kolasu/blob/2114ed39aea92b6bbe367e5a8dd48df5ec20c0a9/core/src/main/kotlin/com/strumenta/kolasu/parsing/KolasuParser.kt#L259-L264). |
Beta Was this translation helpful? Give feedback.
-
The parseTreeToAst is less internal, as it needs to be implemented. IMHO it would be cleaner (and clearer) to have the parseTreeToAst function just return the additional issues together with the AST (like parse), and let the caller handle the collection of all the issues instead of having to provide the results in two different ways. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Given
https://github.com/Strumenta/kolasu-kuki-languageserver/blob/ba34065fb9267bbb5904fe7801e9088759b77117/ast/src/main/kotlin/com/strumenta/kuki/parser/KukiKolasuParser.kt#L28-L32
Any reason why it is implemented in this way, with the "side effect" of mutating the issues parameter directly, instead of returning both the ast and the issues as a result of the call?
This seems intentionally, given the signature at https://github.com/Strumenta/kolasu/blob/2114ed39aea92b6bbe367e5a8dd48df5ec20c0a9/core/src/main/kotlin/com/strumenta/kolasu/parsing/KolasuParser.kt#L141-L146 (seems to be the same in 1.6)
Beta Was this translation helpful? Give feedback.
All reactions