arr-ai / wbnf

ωBNF implementation
Apache License 2.0
7 stars 4 forks source link

Cleaner access to node children #21

Closed marcelocantos closed 4 years ago

marcelocantos commented 4 years ago

https://github.com/arr-ai/arrai/pull/27/files#diff-90e2fa4d3876193ff0a365b526e9691bR174 could do with a helper method that returns a Many even if the corresponding branch field is missing.

Maybe MustMany shouldn't panic on a missing field? https://github.com/arr-ai/wbnf/blob/b5a6f48e355e992c7eef01a84886650cba0411d7/ast/node.go#L152

ghost commented 4 years ago

ast.All and ast.One