Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 32 for declStmt (0.1 sec)

  1. src/cmd/compile/internal/types2/stmt.go

    	// reset context for statements of inner blocks
    	inner := ctxt &^ (fallthroughOk | finalSwitchCase | inTypeSwitch)
    
    	switch s := s.(type) {
    	case *syntax.EmptyStmt:
    		// ignore
    
    	case *syntax.DeclStmt:
    		check.declStmt(s.DeclList)
    
    	case *syntax.LabeledStmt:
    		check.hasLabel = true
    		check.stmt(ctxt, s.Stmt)
    
    	case *syntax.ExprStmt:
    		// spec: "With the exception of specific built-in functions,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  2. src/cmd/fix/fix.go

    	case *ast.MapType:
    		walkBeforeAfter(&n.Key, before, after)
    		walkBeforeAfter(&n.Value, before, after)
    	case *ast.ChanType:
    		walkBeforeAfter(&n.Value, before, after)
    
    	case *ast.BadStmt:
    	case *ast.DeclStmt:
    		walkBeforeAfter(&n.Decl, before, after)
    	case *ast.EmptyStmt:
    	case *ast.LabeledStmt:
    		walkBeforeAfter(&n.Stmt, before, after)
    	case *ast.ExprStmt:
    		walkBeforeAfter(&n.X, before, after)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 14.6K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/syntax/printer.go

    			// don't print chan (<-chan T) as chan <-chan T
    			p.print(_Lparen)
    			p.print(n.Elem)
    			p.print(_Rparen)
    		} else {
    			p.print(n.Elem)
    		}
    
    	// statements
    	case *DeclStmt:
    		p.printDecl(n.DeclList)
    
    	case *EmptyStmt:
    		// nothing to print
    
    	case *LabeledStmt:
    		p.print(outdent, n.Label, _Colon, indent, newline, n.Stmt)
    
    	case *ExprStmt:
    		p.print(n.X)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 07:17:27 UTC 2023
    - 21.5K bytes
    - Viewed (0)
  4. src/go/parser/parser_test.go

    	if err != nil {
    		t.Fatal(err)
    	}
    
    	// RHS refers to undefined globals; LHS does not.
    	as := f.Decls[0].(*ast.FuncDecl).Body.List[0].(*ast.DeclStmt).Decl.(*ast.GenDecl).Specs[0].(*ast.ValueSpec)
    	for _, v := range as.Values {
    		id := v.(*ast.Ident)
    		if id.Obj != nil {
    			t.Errorf("rhs %s has Obj, should not", id.Name)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 31 20:26:14 UTC 2024
    - 24.6K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/decl.go

    	if !check.conf.IgnoreFuncBodies && fdecl.Body != nil {
    		check.later(func() {
    			check.funcBody(decl, obj.name, sig, fdecl.Body, nil)
    		}).describef(obj, "func %s", obj.name)
    	}
    }
    
    func (check *Checker) declStmt(list []syntax.Decl) {
    	pkg := check.pkg
    
    	first := -1                // index of first ConstDecl in the current group, or -1
    	var last *syntax.ConstDecl // last ConstDecl with init expressions, or nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
  6. src/go/types/decl.go

    	if !check.conf.IgnoreFuncBodies && fdecl.Body != nil {
    		check.later(func() {
    			check.funcBody(decl, obj.name, sig, fdecl.Body, nil)
    		}).describef(obj, "func %s", obj.name)
    	}
    }
    
    func (check *Checker) declStmt(d ast.Decl) {
    	pkg := check.pkg
    
    	check.walkDecl(d, func(d decl) {
    		switch d := d.(type) {
    		case constDecl:
    			top := len(check.delayed)
    
    			// declare all constants
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31K bytes
    - Viewed (0)
  7. src/go/printer/testdata/parser.go

    }
    
    func (p *parser) parseStmt() (s ast.Stmt) {
    	if p.trace {
    		defer un(trace(p, "Statement"))
    	}
    
    	switch p.tok {
    	case token.CONST, token.TYPE, token.VAR:
    		s = &ast.DeclStmt{p.parseDecl()}
    	case
    		// tokens that may start a top-level expression
    		token.IDENT, token.INT, token.FLOAT, token.CHAR, token.STRING, token.FUNC, token.LPAREN, // operand
    		token.LBRACK, token.STRUCT, // composite type
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/ssa/_gen/rulegen.go

    			u.node(field)
    		}
    	case *ast.Field:
    		u.node(node.Type)
    
    	// statements
    
    	case *ast.BlockStmt:
    		defer u.scoped()()
    		for _, stmt := range node.List {
    			u.node(stmt)
    		}
    	case *ast.DeclStmt:
    		u.node(node.Decl)
    	case *ast.IfStmt:
    		if node.Init != nil {
    			u.node(node.Init)
    		}
    		u.node(node.Cond)
    		u.node(node.Body)
    		if node.Else != nil {
    			u.node(node.Else)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Sep 02 22:09:21 UTC 2023
    - 48.7K bytes
    - Viewed (0)
  9. src/go/printer/nodes.go

    	return false
    }
    
    func (p *printer) stmt(stmt ast.Stmt, nextIsRBrace bool) {
    	p.setPos(stmt.Pos())
    
    	switch s := stmt.(type) {
    	case *ast.BadStmt:
    		p.print("BadStmt")
    
    	case *ast.DeclStmt:
    		p.decl(s.Decl)
    
    	case *ast.EmptyStmt:
    		// nothing to do
    
    	case *ast.LabeledStmt:
    		// a "correcting" unindent immediately following a line break
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
  10. src/go/parser/parser.go

    	defer decNestLev(incNestLev(p))
    
    	if p.trace {
    		defer un(trace(p, "Statement"))
    	}
    
    	switch p.tok {
    	case token.CONST, token.TYPE, token.VAR:
    		s = &ast.DeclStmt{Decl: p.parseDecl(stmtStart)}
    	case
    		// tokens that may start an expression
    		token.IDENT, token.INT, token.FLOAT, token.IMAG, token.CHAR, token.STRING, token.FUNC, token.LPAREN, // operands
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
Back to top