arr-ai / wbnf

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

Empty{} values from the Delim rule should appear as nil nodes in the correct branch, not in @empty #44

Open ghost opened 4 years ago

ghost commented 4 years ago

I'm going to merge this as is, I don't know if it is possible to determine the branch name where the nil values should be added to. will create an issue to resolve this later

Originally posted by @anz-gordonj7 in https://github.com/arr-ai/wbnf/pull/43#issuecomment-592262697

marcelocantos commented 4 years ago

They should go into the same branch as the lhs of the : operator. This might be possible only if the top node of the lhs is a Named or Rule. I think this needs to be required for all < and > variants in order to build the binary tree structure correctly. Perhaps it also applies to , variants.