Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 121 for Tok (0.44 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/assign/assign.go

    	inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
    
    	nodeFilter := []ast.Node{
    		(*ast.AssignStmt)(nil),
    	}
    	inspect.Preorder(nodeFilter, func(n ast.Node) {
    		stmt := n.(*ast.AssignStmt)
    		if stmt.Tok != token.ASSIGN {
    			return // ignore :=
    		}
    		if len(stmt.Lhs) != len(stmt.Rhs) {
    			// If LHS and RHS have different cardinality, they can't be the same.
    			return
    		}
    		for i, lhs := range stmt.Lhs {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/rangefunc/rewrite.go

    	if len(loop.checkBranch) > 0 {
    		did := make(map[branch]bool)
    		for _, br := range loop.checkBranch {
    			if did[br] {
    				continue
    			}
    			did[br] = true
    			doBranch := &syntax.BranchStmt{Tok: br.tok, Label: &syntax.Name{Value: br.label}}
    			list = append(list, r.ifNext(syntax.Eql, r.branchNext[br], true, doBranch))
    		}
    	}
    
    	curLoop := loop.depth - 1
    	curLoopIndex := curLoop - 1
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:05:44 UTC 2024
    - 41.6K bytes
    - Viewed (0)
  3. src/cmd/fix/fix.go

    	if err == nil {
    		return t
    	}
    	return ""
    }
    
    // declImports reports whether gen contains an import of path.
    func declImports(gen *ast.GenDecl, path string) bool {
    	if gen.Tok != token.IMPORT {
    		return false
    	}
    	for _, spec := range gen.Specs {
    		impspec := spec.(*ast.ImportSpec)
    		if importPath(impspec) == path {
    			return true
    		}
    	}
    	return false
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 14.6K bytes
    - Viewed (0)
  4. src/go/internal/gccgoimporter/parser_test.go

    		p.init("test.gox", strings.NewReader(test.typ), make(map[string]*types.Package))
    		p.version = "v2"
    		p.pkgname = test.id
    		p.pkgpath = test.id
    		p.maybeCreatePackage()
    		typ := p.parseType(p.pkg)
    
    		if p.tok != scanner.EOF {
    			t.Errorf("expected full parse, stopped at %q", p.lit)
    		}
    
    		// interfaces must be explicitly completed
    		if ityp, _ := typ.(*types.Interface); ityp != nil {
    			ityp.Complete()
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 26 20:35:55 UTC 2018
    - 2.8K bytes
    - Viewed (0)
  5. src/internal/types/errors/generrordocs.go

    	}
    	_, err = conf.Check("types", fset, []*ast.File{file}, info)
    	if err != nil {
    		log.Fatalf("Check failed: %s", err)
    	}
    	for _, decl := range file.Decls {
    		decl, ok := decl.(*ast.GenDecl)
    		if !ok || decl.Tok != token.CONST {
    			continue
    		}
    		for _, spec := range decl.Specs {
    			spec, ok := spec.(*ast.ValueSpec)
    			if !ok || len(spec.Names) == 0 {
    				continue
    			}
    			obj := info.ObjectOf(spec.Names[0])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 03:14:42 UTC 2023
    - 3K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/labels.go

    			stmtBranches(s.Stmt)
    
    		case *syntax.BranchStmt:
    			if s.Label == nil {
    				return // checked in 1st pass (check.stmt)
    			}
    
    			// determine and validate target
    			name := s.Label.Value
    			switch s.Tok {
    			case syntax.Break:
    				// spec: "If there is a label, it must be that of an enclosing
    				// "for", "switch", or "select" statement, and that is the one
    				// whose execution terminates."
    				valid := false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/atomic/atomic.go

    	nodeFilter := []ast.Node{
    		(*ast.AssignStmt)(nil),
    	}
    	inspect.Preorder(nodeFilter, func(node ast.Node) {
    		n := node.(*ast.AssignStmt)
    		if len(n.Lhs) != len(n.Rhs) {
    			return
    		}
    		if len(n.Lhs) == 1 && n.Tok == token.DEFINE {
    			return
    		}
    
    		for i, right := range n.Rhs {
    			call, ok := right.(*ast.CallExpr)
    			if !ok {
    				continue
    			}
    			fn := typeutil.StaticCallee(pass.TypesInfo, call)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unreachable/unreachable.go

    		*ast.IncDecStmt,
    		*ast.ReturnStmt,
    		*ast.SendStmt:
    		// no statements inside
    
    	case *ast.BlockStmt:
    		for _, stmt := range x.List {
    			d.findLabels(stmt)
    		}
    
    	case *ast.BranchStmt:
    		switch x.Tok {
    		case token.GOTO:
    			if x.Label != nil {
    				d.hasGoto[x.Label.Name] = true
    			}
    
    		case token.BREAK:
    			stmt := d.breakTarget
    			if x.Label != nil {
    				stmt = d.labels[x.Label.Name]
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/syntax/nodes.go

    		stmt
    	}
    
    	AssignStmt struct {
    		Op       Operator // 0 means no operation
    		Lhs, Rhs Expr     // Rhs == nil means Lhs++ (Op == Add) or Lhs-- (Op == Sub)
    		simpleStmt
    	}
    
    	BranchStmt struct {
    		Tok   token // Break, Continue, Fallthrough, or Goto
    		Label *Name
    		// Target is the continuation of the control flow after executing
    		// the branch; it is computed by the parser if CheckBranches is set.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:38 UTC 2023
    - 9K bytes
    - Viewed (0)
  10. src/go/doc/reader.go

    		if s, ok := d.Specs[0].(*ast.ValueSpec); ok {
    			return s.Names[0].Name
    		}
    	}
    	return ""
    }
    
    func sortedValues(m []*Value, tok token.Token) []*Value {
    	list := make([]*Value, len(m)) // big enough in any case
    	i := 0
    	for _, val := range m {
    		if val.Decl.Tok == tok {
    			list[i] = val
    			i++
    		}
    	}
    	list = list[0:i]
    
    	slices.SortFunc(list, func(a, b *Value) int {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 27.5K bytes
    - Viewed (0)
Back to top