Skip to content

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

@elbrujohalcon

Description

@elbrujohalcon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions