regexp-tree
regexp-tree copied to clipboard
Consider using non-null value for "empty string"
Right now various productions such as /(?:)/
, /1|/
, etc. can produce null
values in place of sub-expressions when parsed.
It could be useful (as in just "nice") to have instead a separate node type like { type: "Empty" }
so that one could always expect node.type
to work whenever node
is supposed to be an expression without extra check for null
.