Skip to content

Commit

Permalink
fix gop build for go1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
visualfc committed Nov 2, 2023
1 parent 5d7c4ef commit ea6d740
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/internal/load/gop.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build go1.16
// +build go1.16
//go:build go1.18
// +build go1.18

/*
* Copyright (c) 2022 The GoPlus Authors (goplus.org). All rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions cmd/internal/load/nogop.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !go1.16
// +build !go1.16
//go:build !go1.18
// +build !go1.18

/*
* Copyright (c) 2022 The GoPlus Authors (goplus.org). All rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions cmd/internal/repl/gop.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build go1.16
// +build go1.16
//go:build go1.18
// +build go1.18

/*
* Copyright (c) 2022 The GoPlus Authors (goplus.org). All rights reserved.
Expand Down
9 changes: 8 additions & 1 deletion pkg/github.com/goplus/gop/builtin/ng/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
q "github.com/goplus/gop/builtin/ng"

"go/constant"
"go/token"
"reflect"

"github.com/goplus/igop"
Expand Down Expand Up @@ -101,7 +102,13 @@ func init() {
},
TypedConsts: map[string]igop.TypedConst{},
UntypedConsts: map[string]igop.UntypedConst{
"GopPackage": {"untyped bool", constant.MakeBool(bool(q.GopPackage))},
"GopPackage": {"untyped bool", constant.MakeBool(bool(q.GopPackage))},
"Int128_IsUntyped": {"untyped bool", constant.MakeBool(bool(q.Int128_IsUntyped))},
"Int128_Max": {"untyped int", constant.MakeFromLiteral("170141183460469231731687303715884105727", token.INT, 0)},
"Int128_Min": {"untyped int", constant.MakeFromLiteral("-170141183460469231731687303715884105728", token.INT, 0)},
"Uint128_IsUntyped": {"untyped bool", constant.MakeBool(bool(q.Uint128_IsUntyped))},
"Uint128_Max": {"untyped int", constant.MakeFromLiteral("340282366920938463463374607431768211455", token.INT, 0)},
"Uint128_Min": {"untyped int", constant.MakeInt64(int64(q.Uint128_Min))},
},
})
}

0 comments on commit ea6d740

Please sign in to comment.