📎 Detect overlaping sub-uninos
#1765
Labels
enhancement
New feature request or improvement to existing functionality
good first issue
Good for newcomers
task
A task, an action that needs to be performed
tooling
Our own build, development, and release tooling


Description
#1745 introduced codegen support for unions over sub-unions. For example, we can now write
JsExprOrSpread = JsExpr | JsSpreadin our grammar and the codegen then knows thatJsExprOrSpreadcan be any expression or a spread element.The goal is to add a check to the codegen to fail if any two sub-unions of a union type are overlapping because it leads to disambiguity. For example, let's assume we have the following definition:
The sub-unions
JsExprOrFunctionDeclarationandJsExprOrSpreadare overlapping because both containJsExpr.The problem is that it's now unclear if an expression should be wrapped as a
JsExprOrFunctionDeclarationorJsExprOrSpread.You can trigger the code gen by running
cargo xtask syntaxin the project root.The text was updated successfully, but these errors were encountered: