Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for isTypeElem (0.13 sec)

  1. src/cmd/compile/internal/syntax/parser.go

    			if len(x.ArgList) == 1 && !x.HasDots && (force || isTypeElem(x.ArgList[0])) {
    				// x = name "(" x.ArgList[0] ")"
    				return name, x.ArgList[0]
    			}
    		}
    	}
    	return nil, x
    }
    
    // isTypeElem reports whether x is a (possibly parenthesized) type element expression.
    // The result is false if x could be a type element OR an ordinary (value) expression.
    func isTypeElem(x Expr) bool {
    	switch x := x.(type) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  2. src/go/parser/parser.go

    				// x = name "(" x.ArgList[0] ")"
    				return name, x.Args[0]
    			}
    		}
    	}
    	return nil, x
    }
    
    // isTypeElem reports whether x is a (possibly parenthesized) type element expression.
    // The result is false if x could be a type element OR an ordinary (value) expression.
    func isTypeElem(x ast.Expr) bool {
    	switch x := x.(type) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  3. src/go/printer/nodes.go

    func isTypeElem(x ast.Expr) bool {
    	switch x := x.(type) {
    	case *ast.ArrayType, *ast.StructType, *ast.FuncType, *ast.InterfaceType, *ast.MapType, *ast.ChanType:
    		return true
    	case *ast.UnaryExpr:
    		return x.Op == token.TILDE
    	case *ast.BinaryExpr:
    		return isTypeElem(x.X) || isTypeElem(x.Y)
    	case *ast.ParenExpr:
    		return isTypeElem(x.X)
    	}
    	return false
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/printer.go

    	switch x := x.(type) {
    	case *Operation:
    		if x.Y == nil {
    			// name *x.X combines to name*x.X if x.X is not a type element
    			return x.Op == Mul && !isTypeElem(x.X)
    		}
    		// binary expressions
    		return combinesWithName(x.X) && !isTypeElem(x.Y)
    	case *ParenExpr:
    		// name(x) combines but we are making sure at
    		// the call site that x is never parenthesized.
    		panic("unexpected parenthesized expression")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 07:17:27 UTC 2023
    - 21.5K bytes
    - Viewed (0)
Back to top