From 0ce9a04e955eef9b056ecd7f4b5cef706eabe189 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Mon, 12 Feb 2024 06:08:49 +0800 Subject: [PATCH] testdata/gop-sample --- cl/expr.go | 10 +++++----- testdata/__gop-sample/go.mod | 5 ----- testdata/{__gop-sample => gop-sample}/a.gop | 0 testdata/{__gop-sample => gop-sample}/b.gop | 0 testdata/{__gop-sample => gop-sample}/cpkag/b/ab.gop | 0 testdata/{__gop-sample/gop.mod => gop-sample/go.mod} | 4 +--- testdata/{__gop-sample => gop-sample}/go.sum | 0 7 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 testdata/__gop-sample/go.mod rename testdata/{__gop-sample => gop-sample}/a.gop (100%) rename testdata/{__gop-sample => gop-sample}/b.gop (100%) rename testdata/{__gop-sample => gop-sample}/cpkag/b/ab.gop (100%) rename testdata/{__gop-sample/gop.mod => gop-sample/go.mod} (52%) rename testdata/{__gop-sample => gop-sample}/go.sum (100%) diff --git a/cl/expr.go b/cl/expr.go index c970fb706..6aa0a865e 100644 --- a/cl/expr.go +++ b/cl/expr.go @@ -120,11 +120,6 @@ func compileIdent(ctx *blockCtx, ident *ast.Ident, flags int) (pkg gox.PkgRef, k goto find } - // function alias - if compileFuncAlias(ctx, scope, ident, flags) { - return - } - // pkgRef object if (flags & clIdentSelectorExpr) != 0 { if name == "C" && len(ctx.clookups) > 0 { @@ -139,6 +134,11 @@ func compileIdent(ctx *blockCtx, ident *ast.Ident, flags int) (pkg gox.PkgRef, k } } + // function alias + if compileFuncAlias(ctx, scope, ident, flags) { + return + } + // object from import . "xxx" if compilePkgRef(ctx, gox.PkgRef{}, ident, flags, objPkgRef) { return diff --git a/testdata/__gop-sample/go.mod b/testdata/__gop-sample/go.mod deleted file mode 100644 index 73330159c..000000000 --- a/testdata/__gop-sample/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module gop-sample - -go 1.21.5 - -toolchain go1.21.6 diff --git a/testdata/__gop-sample/a.gop b/testdata/gop-sample/a.gop similarity index 100% rename from testdata/__gop-sample/a.gop rename to testdata/gop-sample/a.gop diff --git a/testdata/__gop-sample/b.gop b/testdata/gop-sample/b.gop similarity index 100% rename from testdata/__gop-sample/b.gop rename to testdata/gop-sample/b.gop diff --git a/testdata/__gop-sample/cpkag/b/ab.gop b/testdata/gop-sample/cpkag/b/ab.gop similarity index 100% rename from testdata/__gop-sample/cpkag/b/ab.gop rename to testdata/gop-sample/cpkag/b/ab.gop diff --git a/testdata/__gop-sample/gop.mod b/testdata/gop-sample/go.mod similarity index 52% rename from testdata/__gop-sample/gop.mod rename to testdata/gop-sample/go.mod index 1b1598e6a..c0f1743dd 100644 --- a/testdata/__gop-sample/gop.mod +++ b/testdata/gop-sample/go.mod @@ -1,5 +1,3 @@ module gop-sample -go 1.21 - -gop 1.1 +go 1.18 diff --git a/testdata/__gop-sample/go.sum b/testdata/gop-sample/go.sum similarity index 100% rename from testdata/__gop-sample/go.sum rename to testdata/gop-sample/go.sum