Skip to content

Conversation

s-k
Copy link

@s-k s-k commented Dec 21, 2022

Adds a macro that can be called inside a function and prints its name and arguments.

Adds a macro that can be called inside a function and prints its name and arguments.
) -> ExprSyntax {
var syntax = node.as(Syntax.self)
while syntax != nil && syntax!.as(FunctionDeclSyntax.self) == nil {
syntax = syntax!.parent
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that macro implementations are getting "detached" nodes, the parent of the main syntax node will always be nil, so #printArguments will always return the empty string.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a little unfortunate. So the solution of providing a 'spine' of the hierarchy is not the way to go?

@s-k s-k closed this by deleting the head repository Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants