purescript-analyzer
purescript-analyzer copied to clipboard
Rethink the value of convenience nodes
At the moment, the CST defines the following "general" syntax nodes. They effectively mimic the types found in the language-cst-parser written in PureScript and emulate types such as Array, NonEmptyArray, and Tuple.
ZeroOrMore and OneOrMore is particularly useful for repeated nodes between two other nodes i.e. with something like a b* c, these two constructs, it's easier to know "when" b starts and ends.
Likewise, they can also be replaced with specialized types, so rather than ZeroOrMore(Pattern), we'd have PatternList, etc...
https://github.com/purefunctor/purescript-analyzer/blob/227128e4700b3105e0e19da8f547fd46f80ba2e9/crates/syntax/src/lib.rs#L205-L218