Skip to content

filter nodes #3

@knsh14

Description

@knsh14

some people want to ignore some node.
I think some refactor step to achieve.

1st step

change tree function.
use switch statement to call specific func to using map to get specific func.
before

switch n.(type) {
  case *ast....
}

after

f := functions[fmt.Sprintf("%T", node)]
f(w, ....)

2nd step

create empty function to pass node.

3rd step

set pass function to map when ignore node is given.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions