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

gogrep: remove unused *types.Info field from the matcher #204

Merged
merged 1 commit into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions internal/mvdan.cc/gogrep/kludge.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ package gogrep
import (
"go/ast"
"go/token"
"go/types"
)

// This is an ugly way to use gogrep as a library.
// It can go away when there will be another option.

// Parse creates a gogrep pattern out of a given string expression.
func Parse(fset *token.FileSet, expr string) (*Pattern, error) {
m := matcher{
fset: fset,
Info: &types.Info{},
}
m := matcher{fset: fset}
node, err := m.parseExpr(expr)
if err != nil {
return nil, err
Expand Down
3 changes: 0 additions & 3 deletions internal/mvdan.cc/gogrep/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"go/ast"
"go/token"
"go/types"
)

type matcher struct {
Expand All @@ -16,8 +15,6 @@ type matcher struct {
// node values recorded by name, excluding "_" (used only by the
// actual matching phase)
values map[string]ast.Node

*types.Info
}

type varInfo struct {
Expand Down