X7ROOT File Manager
Current Path:
/opt/golang/1.19.4/src/cmd/compile/internal/types2
opt
/
golang
/
1.19.4
/
src
/
cmd
/
compile
/
internal
/
types2
/
📁
..
📄
api.go
(17.37 KB)
📄
api_test.go
(79.44 KB)
📄
array.go
(803 B)
📄
assignments.go
(13.89 KB)
📄
basic.go
(1.48 KB)
📄
builtins.go
(23.73 KB)
📄
builtins_test.go
(9.89 KB)
📄
call.go
(19.08 KB)
📄
chan.go
(910 B)
📄
check.go
(17.12 KB)
📄
check_test.go
(8.96 KB)
📄
compilersupport.go
(1.05 KB)
📄
context.go
(4.34 KB)
📄
context_test.go
(2.3 KB)
📄
conversions.go
(8.27 KB)
📄
decl.go
(27.86 KB)
📄
errorcalls_test.go
(1.15 KB)
📄
errors.go
(7.62 KB)
📄
errors_test.go
(1.01 KB)
📄
example_test.go
(7.41 KB)
📄
expr.go
(54.01 KB)
📄
gccgosizes.go
(1017 B)
📄
hilbert_test.go
(3.63 KB)
📄
importer_test.go
(913 B)
📄
index.go
(11.13 KB)
📄
infer.go
(24.86 KB)
📄
initorder.go
(9.55 KB)
📄
instantiate.go
(9.93 KB)
📄
instantiate_test.go
(5.98 KB)
📄
interface.go
(6.04 KB)
📄
issues_test.go
(17.4 KB)
📄
labels.go
(7.05 KB)
📄
lookup.go
(17.01 KB)
📄
main_test.go
(336 B)
📄
map.go
(659 B)
📄
mono.go
(9.03 KB)
📄
mono_test.go
(2.65 KB)
📄
named.go
(22.4 KB)
📄
named_test.go
(2.35 KB)
📄
object.go
(18.8 KB)
📄
object_test.go
(5.13 KB)
📄
objset.go
(928 B)
📄
operand.go
(10.62 KB)
📄
package.go
(2.67 KB)
📄
pointer.go
(635 B)
📄
predicates.go
(14.64 KB)
📄
resolver.go
(24.88 KB)
📄
resolver_test.go
(4.81 KB)
📄
return.go
(4.34 KB)
📄
scope.go
(9.38 KB)
📄
selection.go
(3.99 KB)
📄
self_test.go
(2.58 KB)
📄
signature.go
(12.1 KB)
📄
sizeof_test.go
(1.28 KB)
📄
sizes.go
(7.56 KB)
📄
sizes_test.go
(3.25 KB)
📄
slice.go
(577 B)
📄
stdlib_test.go
(8.8 KB)
📄
stmt.go
(25.66 KB)
📄
struct.go
(6.24 KB)
📄
subst.go
(10.78 KB)
📄
termlist.go
(3.68 KB)
📄
termlist_test.go
(7.18 KB)
📁
testdata
📄
tuple.go
(929 B)
📄
type.go
(2.92 KB)
📄
typelists.go
(1.84 KB)
📄
typeparam.go
(4.75 KB)
📄
typeset.go
(13.87 KB)
📄
typeset_test.go
(2.41 KB)
📄
typestring.go
(10.61 KB)
📄
typestring_test.go
(4.11 KB)
📄
typeterm.go
(3.52 KB)
📄
typeterm_test.go
(5.08 KB)
📄
typexpr.go
(14.8 KB)
📄
unify.go
(18.34 KB)
📄
union.go
(6.1 KB)
📄
universe.go
(7.58 KB)
📄
validtype.go
(7.77 KB)
📄
version.go
(2.13 KB)
Editing: version.go
// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package types2 import ( "cmd/compile/internal/syntax" "fmt" "regexp" "strconv" "strings" ) // langCompat reports an error if the representation of a numeric // literal is not compatible with the current language version. func (check *Checker) langCompat(lit *syntax.BasicLit) { s := lit.Value if len(s) <= 2 || check.allowVersion(check.pkg, 1, 13) { return } // len(s) > 2 if strings.Contains(s, "_") { check.versionErrorf(lit, "go1.13", "underscores in numeric literals") return } if s[0] != '0' { return } radix := s[1] if radix == 'b' || radix == 'B' { check.versionErrorf(lit, "go1.13", "binary literals") return } if radix == 'o' || radix == 'O' { check.versionErrorf(lit, "go1.13", "0o/0O-style octal literals") return } if lit.Kind != syntax.IntLit && (radix == 'x' || radix == 'X') { check.versionErrorf(lit, "go1.13", "hexadecimal floating-point literals") } } // allowVersion reports whether the given package // is allowed to use version major.minor. func (check *Checker) allowVersion(pkg *Package, major, minor int) bool { // We assume that imported packages have all been checked, // so we only have to check for the local package. if pkg != check.pkg { return true } ma, mi := check.version.major, check.version.minor return ma == 0 && mi == 0 || ma > major || ma == major && mi >= minor } type version struct { major, minor int } // parseGoVersion parses a Go version string (such as "go1.12") // and returns the version, or an error. If s is the empty // string, the version is 0.0. func parseGoVersion(s string) (v version, err error) { if s == "" { return } matches := goVersionRx.FindStringSubmatch(s) if matches == nil { err = fmt.Errorf(`should be something like "go1.12"`) return } v.major, err = strconv.Atoi(matches[1]) if err != nil { return } v.minor, err = strconv.Atoi(matches[2]) return } // goVersionRx matches a Go version string, e.g. "go1.12". var goVersionRx = regexp.MustCompile(`^go([1-9][0-9]*)\.(0|[1-9][0-9]*)$`)
Upload File
Create Folder