We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
SyntaxProtocol.expand(macros:)
IfConfigDeclSyntax
Given the following code:
let sourceCode = """ #if true @inlinable #endif func f() {} """ let originalSyntax = Parser.parse(source: sourceCode) print(originalSyntax) let context = BasicMacroExpansionContext(lexicalContext: [], expansionDiscriminator: "", sourceFiles: [:]) let syntax = originalSyntax.expand(macros: [:]) { syntax in BasicMacroExpansionContext(sharingWith: context, lexicalContext: syntax.allMacroLexicalContexts()) } print(syntax)
I would expect to see (ignoring potential reformatting):
#if true @inlinable #endif func f() {}
But syntax drops everything in the IfConfigDeclSyntax node (#if onward) and just produces:
syntax
#if
func f() {}
originalSyntax is correct, so the issue is during macro expansion, not the initial parse.
originalSyntax
See above.
The text was updated successfully, but these errors were encountered:
Synced to Apple’s issue tracker as rdar://141840779
Sorry, something went wrong.
No branches or pull requests
Description
Given the following code:
I would expect to see (ignoring potential reformatting):
But
syntax
drops everything in theIfConfigDeclSyntax
node (#if
onward) and just produces:originalSyntax
is correct, so the issue is during macro expansion, not the initial parse.Steps to Reproduce
See above.
The text was updated successfully, but these errors were encountered: