mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +01:00
Resolve used packages during type checking
This commit is contained in:
1 parent
366a9388b3
commit
1255b162ea
5 files changed
+138
-35
No files matched your search
@@ -50,7 +50,7 @@ func Do(args []string, g Generator) error {
|
||||
return err
|
||||
}
|
||||
|
||||
c, err := check.Check(tm, files...)
|
||||
c, err := check.Check(tm, files, resolveUse)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -125,6 +125,14 @@ func ParseFiles(tm *token.Map, filenames []string, opts *parse.Options) (files [
|
||||
return files, nil
|
||||
}
|
||||
|
||||
func resolveUse(usePath string) ([]byte, error) {
|
||||
wuffsRoot, err := WuffsRoot()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ioutil.ReadFile(filepath.Join(wuffsRoot, "gen", "wuffs", filepath.FromSlash(usePath)))
|
||||
}
|
||||
|
||||
var cachedWuffsRoot struct {
|
||||
mu sync.Mutex
|
||||
value string
|
||||
|
||||
Reference in new issue
Block a user