Closed innovimax closed 2 months ago
I don't think so. In the case where the grammar parses successfully and a single parse is returned, the root element is determined by the users grammar. In the first example, the root element is ixml
because that's the root element in the ixml grammar. In the third example, I added ixml
because the parse failed. In the sixth example, I added ixml
because the user asked for multiple parses. On further thought, the step should probably just return a sequence of results in that case.
Then perhaps, unwrapping example 3 and example 6 would do the trick
I think that the principle of least surprise (POLA) enforce the idea that the output should be consistent whatever the context we're in
At the moment, the specification as it is gives different ixml or no wrapper on different context
I would recommend that example 2, 4 and 5 to add a wrapper to avoid surprises