Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for ElemList (0.26 sec)

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

    				continue
    			}
    			m = n.X
    		case *Operation:
    			if n.Y != nil {
    				m = n.X
    				continue
    			}
    			return n.Pos()
    		case *CallExpr:
    			m = n.Fun
    		case *ListExpr:
    			if len(n.ElemList) > 0 {
    				m = n.ElemList[0]
    				continue
    			}
    			return n.Pos()
    		// types
    		// case *ArrayType:
    		// case *SliceType:
    		// case *DotsType:
    		// case *StructType:
    		// case *Field:
    		// case *InterfaceType:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/nodes.go

    	// Value
    	BasicLit struct {
    		Value string
    		Kind  LitKind
    		Bad   bool // true means the literal Value has syntax errors
    		expr
    	}
    
    	// Type { ElemList[0], ElemList[1], ... }
    	CompositeLit struct {
    		Type     Expr // nil means no literal type
    		ElemList []Expr
    		NKeys    int // number of elements with keys
    		Rbrace   Pos
    		expr
    	}
    
    	// Key: Value
    	KeyValueExpr struct {
    		Key, Value Expr
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:38 UTC 2023
    - 9K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/index.go

    		return nil
    	}
    	if l, _ := index.(*syntax.ListExpr); l != nil {
    		if n := len(l.ElemList); n <= 1 {
    			check.errorf(e, InvalidSyntaxTree, "invalid use of ListExpr for index expression %v with %d indices", e, n)
    			return nil
    		}
    		// len(l.ElemList) > 1
    		check.error(l.ElemList[1], InvalidIndex, invalidOp+"more than one index")
    		index = l.ElemList[0] // continue with first index
    	}
    	return index
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 15 16:16:58 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/printer.go

    		if n.Type != nil {
    			p.print(n.Type)
    		}
    		p.print(_Lbrace)
    		if p.form == ShortForm {
    			if len(n.ElemList) > 0 {
    				p.print(_Name, "…")
    			}
    		} else {
    			if n.NKeys > 0 && n.NKeys == len(n.ElemList) {
    				p.printExprLines(n.ElemList)
    			} else {
    				p.printExprList(n.ElemList)
    			}
    		}
    		p.print(_Rbrace)
    
    	case *ParenExpr:
    		p.print(_Lparen, n.X, _Rparen)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 07:17:27 UTC 2023
    - 21.5K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/syntax/walk.go

    	// expressions
    	case *BadExpr: // nothing to do
    	case *Name: // nothing to do
    	case *BasicLit: // nothing to do
    
    	case *CompositeLit:
    		if n.Type != nil {
    			w.node(n.Type)
    		}
    		w.exprList(n.ElemList)
    
    	case *KeyValueExpr:
    		w.node(n.Key)
    		w.node(n.Value)
    
    	case *FuncLit:
    		w.node(n.Type)
    		w.node(n.Body)
    
    	case *ParenExpr:
    		w.node(n.X)
    
    	case *SelectorExpr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:55:04 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/stmt.go

    	if p, _ := sKey.(*syntax.ListExpr); p != nil {
    		if len(p.ElemList) < 2 {
    			check.error(s, InvalidSyntaxTree, "invalid lhs in range clause")
    			return
    		}
    		// len(p.ElemList) >= 2
    		sKey = p.ElemList[0]
    		sValue = p.ElemList[1]
    		if len(p.ElemList) > 2 {
    			// delay error reporting until we know more
    			sExtra = p.ElemList[2]
    		}
    	}
    	isDef := rclause.Def
    	rangeVar := rclause.X
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/expr.go

    				goto Error
    			}
    			if len(e.ElemList) == 0 {
    				break
    			}
    			// Convention for error messages on invalid struct literals:
    			// we mention the struct type only if it clarifies the error
    			// (e.g., a duplicate field error doesn't need the struct type).
    			fields := utyp.fields
    			if _, ok := e.ElemList[0].(*syntax.KeyValueExpr); ok {
    				// all elements must have keys
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 51.7K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/syntax/parser.go

    			// key ':' value
    			l := new(KeyValueExpr)
    			l.pos = p.pos()
    			p.next()
    			l.Key = e
    			l.Value = p.bare_complitexpr()
    			e = l
    			x.NKeys++
    		}
    		x.ElemList = append(x.ElemList, e)
    		return false
    	})
    	p.xnest--
    
    	return x
    }
    
    // ----------------------------------------------------------------------------
    // Types
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/syntax/nodes_test.go

    	// embed expressions in a composite literal so we can test key:value and naked composite literals
    	testPos(t, exprs, "package p; var _ = T{ ", " }",
    		func(f *File) Node { return f.DeclList[0].(*VarDecl).Values.(*CompositeLit).ElemList[0] },
    	)
    
    	// embed types in a function  signature so we can test ... types
    	testPos(t, types, "package p; func f(", ")",
    		func(f *File) Node { return f.DeclList[0].(*FuncDecl).Type.ParamList[0].Type },
    	)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 18:45:06 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/call.go

    					v = w
    					v_used = v.used
    				}
    			}
    		}
    		check.exprOrType(&x, n, true)
    		if v != nil {
    			v.used = v_used // restore v.used
    		}
    	case *syntax.ListExpr:
    		return check.useN(n.ElemList, lhs)
    	default:
    		check.rawExpr(nil, &x, e, nil, true)
    	}
    	return x.mode != invalid
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31.5K bytes
    - Viewed (0)
Back to top