If either the left or the right side of an alternation happens to be the EmptySet, then don't bother to allocate or return an alternation. Instead, return the other side.
Modify compilerkit_alternation_new to return GObject *. Check if either the left or right are the emptyset, and if so, return the other side instead.
Write a test case in src/alternation-test.c that verifies that compilerkit_alternation_new works as intended.
Any progress on this? For a hint, take a look at the concatenation compilerkit_concatenation_new function. It's similar to what you'd need to do to close this issue.
If either the left or the right side of an alternation happens to be the EmptySet, then don't bother to allocate or return an alternation. Instead, return the other side.
compilerkit_alternation_new
to returnGObject *
. Check if either theleft
orright
are the emptyset, and if so, return the other side instead.src/alternation-test.c
that verifies thatcompilerkit_alternation_new
works as intended.