carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
http://docs.carbon-lang.dev/
Other
32.24k stars 1.48k forks source link

Move child count and bracketing information for parse nodes into the node kind definition. #4000

Closed zygoloid closed 4 months ago

zygoloid commented 4 months ago

Instead of tracking the bracketing and child count information in the kind macro in node_kind.def, provide it to NodeKind::Define in typed_nodes.h. If a node is both bracketed and has a fixed child count, track both facts and check them both in tree verification, since it's easy to do so now.

The overall goal here is to reduce node_kind.def down to a simple list of names. I have a slightly different approach in mind for the token kinds.