Skip to content
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

[unused_macros] Detect when *wild* macros are unused #37

Open
elbrujohalcon opened this issue Dec 16, 2020 · 0 comments
Open

[unused_macros] Detect when *wild* macros are unused #37

elbrujohalcon opened this issue Dec 16, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@elbrujohalcon
Copy link
Collaborator

Currently, due to ktn_dodger limitations, some macro definitions are parsed as text.
For instance, the one below…

-define(UNUSED_MACRO_WITH_BROKEN(CODE), case ?CODE of code -> ??CODE) .

ktn_dodger does its best to parse all macro definitions but when you just drop some random piece of code there, it might be impossible to parse it.
In those scenarios, Hank sees the following syntax tree:

#tree{type = text,
      attr = #attr{pos = 10,ann = [],com = none},
      data = "-define( UNUSED_MACRO_WITH_BROKEN( CODE ) , case ?CODE of code -> ??CODE ) .\n"}

Basically a random block of text. It can't tell if that's a macro definition or not, let alone figure out the macro name and arity. So it doesn't tell you if that macro is actually unused.

@elbrujohalcon elbrujohalcon added the enhancement New feature or request label Dec 16, 2020
@elbrujohalcon elbrujohalcon added this to the 0.2.0 milestone Dec 16, 2020
@elbrujohalcon elbrujohalcon modified the milestones: 0.2.0, 1.0.0 Jan 7, 2021
@elbrujohalcon elbrujohalcon modified the milestones: 1.0.0, Eventually 🙄 May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant