File tree 3 files changed +3
-9
lines changed
3 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ func (c *compiler) compileFiles(a []*ast.File) *adt.Vertex { // Or value?
275
275
// - anything in an anonymous file
276
276
//
277
277
for _ , f := range a {
278
- if p := internal . GetPackageInfo ( f ); p . IsAnonymous () {
278
+ if f . PackageName () == "" {
279
279
continue
280
280
}
281
281
for _ , d := range f .Decls {
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import (
21
21
"cuelang.org/go/cue/ast"
22
22
"cuelang.org/go/cue/build"
23
23
"cuelang.org/go/cue/errors"
24
- "cuelang.org/go/internal"
25
24
)
26
25
27
26
// TODO(resolve): this is also done in compile, do we need both?
@@ -32,7 +31,7 @@ func (r *Runtime) ResolveFiles(p *build.Instance) (errs errors.Error) {
32
31
// may be linked to any top-level entry of any of the files.
33
32
allFields := map [string ]ast.Node {}
34
33
for _ , f := range p .Files {
35
- if p := internal . GetPackageInfo ( f ); p . IsAnonymous () {
34
+ if f . PackageName () == "" {
36
35
continue
37
36
}
38
37
for _ , d := range f .Decls {
@@ -44,7 +43,7 @@ func (r *Runtime) ResolveFiles(p *build.Instance) (errs errors.Error) {
44
43
}
45
44
}
46
45
for _ , f := range p .Files {
47
- if p := internal . GetPackageInfo ( f ); p . IsAnonymous () {
46
+ if f . PackageName () == "" {
48
47
continue
49
48
}
50
49
err := resolveFile (idx , f , p , allFields )
Original file line number Diff line number Diff line change @@ -138,11 +138,6 @@ type PkgInfo struct {
138
138
Name string
139
139
}
140
140
141
- // IsAnonymous reports whether the package is anonymous.
142
- func (p * PkgInfo ) IsAnonymous () bool {
143
- return p .Name == "" || p .Name == "_"
144
- }
145
-
146
141
func GetPackageInfo (f * ast.File ) PkgInfo {
147
142
for i , d := range f .Decls {
148
143
switch x := d .(type ) {
You can’t perform that action at this time.
0 commit comments