The current grammar allows nesting of natural language constructs such as tuple of ..., (N, 3) array, dict of {...: ...}. This can quickly lead to doctypes that are actually more confusing to read. I currently see two solutions to this:
-
Disallow in grammar I could rewrite the grammar in a way that only allows natural language constructs in simple contexts and without nesting. However, this requires a more complex grammar and some duplication.
-
Warn I'd prefer to find a solution that warns users that they might want to improve the readability of the expression. Maybe that can be integrated with DoctypeTransformer.
The current grammar allows nesting of natural language constructs such as
tuple of ...,(N, 3) array,dict of {...: ...}. This can quickly lead to doctypes that are actually more confusing to read. I currently see two solutions to this:Disallow in grammar I could rewrite the grammar in a way that only allows natural language constructs in simple contexts and without nesting. However, this requires a more complex grammar and some duplication.
Warn I'd prefer to find a solution that warns users that they might want to improve the readability of the expression. Maybe that can be integrated with
DoctypeTransformer.