Previous part: Balancing brackets - 3
Our error reporting is quite poor, the only thing we know for sure is either brackets are balanced or not.
We can start with case splitting between mismatched and missing brackets:
Still not good enough! We need more information. Let’s break down reporting for each type one by one.
All what is left is just put these expression on their places:
Full source code is available here.