purescript-analyzer icon indicating copy to clipboard operation
purescript-analyzer copied to clipboard

Rethink the value of convenience nodes

Open purefunctor opened this issue 2 years ago • 0 comments

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

purefunctor avatar Aug 25 '23 16:08 purefunctor