Closed joerg-holtmann closed 2 years ago
Analysis:
Because we use a whitespace-aware solution to implement a python-like style in our DSL, however then the indentations became more sensitive and important, i.e. we use indentation (here, i.e. BEGIN
and END
) to identify the hierarchy of code. This is the context of this issue.
The reason for this issue is that when we don't give any element to a data instance structure (e.g. EAPackage
), it means the line (EAPackage
) will have the same (or less) indentation as the next line. But a deeper indentation is needed to be identified as a BEGIN
, so it would occur error due to BEGIN
being missing. That's what we could see in the problem window.
Solution: Actually, there are two thinking to solve this issue:
Considering the feasibility, I choose the second way to fix the issue. The key code could be seen the method allowEmptyElement
in the post-processing plugin.
Results:
Empty elements are not allowed, even if all sub-elements are defined to be optional in the grammar (e.g., empty EAPackage).