Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for parseCallExpr (0.1 sec)

  1. src/go/printer/testdata/parser.go

    	}
    
    	pos := p.expect(token.GO)
    	call := p.parseCallExpr()
    	p.expectSemi()
    	if call == nil {
    		return &ast.BadStmt{pos, pos + 2} // len("go")
    	}
    
    	return &ast.GoStmt{pos, call}
    }
    
    func (p *parser) parseDeferStmt() ast.Stmt {
    	if p.trace {
    		defer un(trace(p, "DeferStmt"))
    	}
    
    	pos := p.expect(token.DEFER)
    	call := p.parseCallExpr()
    	p.expectSemi()
    	if call == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  2. src/go/parser/parser.go

    		s := &ast.IncDecStmt{X: x[0], TokPos: p.pos, Tok: p.tok}
    		p.next()
    		return s, false
    	}
    
    	// expression
    	return &ast.ExprStmt{X: x[0]}, false
    }
    
    func (p *parser) parseCallExpr(callType string) *ast.CallExpr {
    	x := p.parseRhs() // could be a conversion: (some type)(x)
    	if t := ast.Unparen(x); t != x {
    		p.error(x.Pos(), fmt.Sprintf("expression in %s must not be parenthesized", callType))
    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