-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrectly parsed directives #298
Comments
Yep, we parse directives like extras, but Swift is actually restrictive enough with its macro system that we can do better. That is, I was leaving open the possibility that there could be something like:
But Swift doesn't allow this case (it says "Unexpected '}' in conditional compilation block"), and I suspect they disallow any such cases. It probably makes sense to just add this into the |
I observed that the directives (https://docs.swift.org/swift-book/documentation/the-swift-programming-language/statements/#Compiler-Control-Statements) do not parse well.
Tree:
I think the
[statements][5, 12] ... [directive][8, 8] - [8, 14]
should be nested under[directive][4, 8] - [4, 17]
?And in some sense the we need the entire
if-elseif
like parsing here.The text was updated successfully, but these errors were encountered: