mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
cgo: improve error locations for cgo-constructed AST
This is mostly useful for debugging missing type conversions in CGo. With this change, errors will have the correct source location in C files.
This commit is contained in:
committed by
Ron Evans
parent
2f2d62cc0c
commit
8e7ea92d44
+6
-4
@@ -30,10 +30,11 @@ type Program struct {
|
||||
type Package struct {
|
||||
*Program
|
||||
*build.Package
|
||||
Imports map[string]*Package
|
||||
Importing bool
|
||||
Files []*ast.File
|
||||
Pkg *types.Package
|
||||
Imports map[string]*Package
|
||||
Importing bool
|
||||
Files []*ast.File
|
||||
tokenFiles map[string]*token.File
|
||||
Pkg *types.Package
|
||||
types.Info
|
||||
}
|
||||
|
||||
@@ -106,6 +107,7 @@ func (p *Program) newPackage(pkg *build.Package) *Package {
|
||||
Scopes: make(map[ast.Node]*types.Scope),
|
||||
Selections: make(map[*ast.SelectorExpr]*types.Selection),
|
||||
},
|
||||
tokenFiles: map[string]*token.File{},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user