Commit 3ea91beb authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b0b9e39c
...@@ -91,8 +91,7 @@ type traceImported struct { ...@@ -91,8 +91,7 @@ type traceImported struct {
*traceEvent // imported event *traceEvent // imported event
ImportSpec *traceImport // imported via this spec ImportSpec *traceImport // imported via this spec
ImporterPkg *types.Package // from this package ImporterPkg *types.Package // from this package
ImportedAs map[string]string // in context where some packages are ImportedAs map[string]string // in context where some packages are imported as named (pkgpath -> pkgname)
// imported as named (pkgpath -> pkgname)
} }
// Package represents tracing-related information about a package // Package represents tracing-related information about a package
...@@ -152,9 +151,8 @@ func (p *Package) parseTraceEvent(srcfile *ast.File, pos token.Position, text st ...@@ -152,9 +151,8 @@ func (p *Package) parseTraceEvent(srcfile *ast.File, pos token.Position, text st
//println(buf.String()) //println(buf.String())
//println("---- 8< ----") //println("---- 8< ----")
tf, err := parser.ParseFile(p.traceFset, filename, buf.String(), 0) tf, err := parser.ParseFile(p.traceFset, filename, buf.String(), 0)
//fmt.Println("parse:", err)
if err != nil { if err != nil {
return nil, err // should already have pos' as prefix return nil, err // already has pos' as prefix
} }
p.traceFilev = append(p.traceFilev, tf) p.traceFilev = append(p.traceFilev, tf)
...@@ -178,9 +176,8 @@ func (p *Package) parseTraceEvent(srcfile *ast.File, pos token.Position, text st ...@@ -178,9 +176,8 @@ func (p *Package) parseTraceEvent(srcfile *ast.File, pos token.Position, text st
// typecheck prepared file to get trace func argument types // typecheck prepared file to get trace func argument types
// (type information lands into p.traceTypeInfo) // (type information lands into p.traceTypeInfo)
err = p.traceChecker.Files([]*ast.File{tf}) err = p.traceChecker.Files([]*ast.File{tf})
//fmt.Println("typecheck:", err)
if err != nil { if err != nil {
return nil, err // should already have pos' as prefix return nil, err // already has pos' as prefix
} }
return &traceEvent{Pos: pos, Pkgt: p, FuncDecl: declf}, nil return &traceEvent{Pos: pos, Pkgt: p, FuncDecl: declf}, nil
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment