Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for isTypeName (0.21 sec)

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

    	default:
    		// all other nodes are not proper expressions
    		p.errorExpected(x.Pos(), "expression")
    		x = &ast.BadExpr{x.Pos(), x.End()}
    	}
    	return x
    }
    
    // isTypeName reports whether x is a (qualified) TypeName.
    func isTypeName(x ast.Expr) bool {
    	switch t := x.(type) {
    	case *ast.BadExpr:
    	case *ast.Ident:
    	case *ast.SelectorExpr:
    		_, isIdent := t.X.(*ast.Ident)
    		return isIdent
    	default:
    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/printer/nodes.go

    	p.linebreak(p.lineFor(b.Rbrace), 1, ignore, true)
    	p.setPos(b.Rbrace)
    	p.print(token.RBRACE)
    }
    
    func isTypeName(x ast.Expr) bool {
    	switch t := x.(type) {
    	case *ast.Ident:
    		return true
    	case *ast.SelectorExpr:
    		return isTypeName(t.X)
    	}
    	return false
    }
    
    func stripParens(x ast.Expr) ast.Expr {
    	if px, strip := x.(*ast.ParenExpr); strip {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
Back to top