Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for BadExpr (0.25 sec)

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

    		// TODO determine a better range for BadExpr below
    		par.List = []*ast.Field{{Type: &ast.BadExpr{pos, pos}}}
    		return par
    	}
    
    	// recv type must be of the form ["*"] identifier
    	recv := par.List[0]
    	base := deref(recv.Type)
    	if _, isIdent := base.(*ast.Ident); !isIdent {
    		p.errorExpected(base.Pos(), "(unqualified) identifier")
    		par.List = []*ast.Field{{Type: &ast.BadExpr{recv.Pos(), recv.End()}}}
    	}
    
    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/cmd/compile/internal/syntax/positions.go

    			return MakePos(n.Pos().Base(), 1, 1)
    
    		// declarations
    		// case *ImportDecl:
    		// case *ConstDecl:
    		// case *TypeDecl:
    		// case *VarDecl:
    		// case *FuncDecl:
    
    		// expressions
    		// case *BadExpr:
    		// case *Name:
    		// case *BasicLit:
    		case *CompositeLit:
    			if n.Type != nil {
    				m = n.Type
    				continue
    			}
    			return n.Pos()
    		case *KeyValueExpr:
    			m = n.Key
    		// case *FuncLit:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/syntax/parser.go

    					}
    				}
    			} else {
    				msg = "mixed named and unnamed parameters"
    			}
    			p.syntaxErrorAt(errPos, msg)
    		}
    	}
    
    	return
    }
    
    func (p *parser) badExpr() *BadExpr {
    	b := new(BadExpr)
    	b.pos = p.pos()
    	return b
    }
    
    // ----------------------------------------------------------------------------
    // Statements
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  4. src/go/parser/parser.go

    			if index[1] == nil {
    				p.error(colons[0], "middle index required in 3-index slice")
    				index[1] = &ast.BadExpr{From: colons[0] + 1, To: colons[1]}
    			}
    			if index[2] == nil {
    				p.error(colons[1], "final index required in 3-index slice")
    				index[2] = &ast.BadExpr{From: colons[1] + 1, To: rbrack}
    			}
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    	switch n.(type) {
    	case *ast.ArrayType:
    		return 1 << nArrayType
    	case *ast.AssignStmt:
    		return 1 << nAssignStmt
    	case *ast.BadDecl:
    		return 1 << nBadDecl
    	case *ast.BadExpr:
    		return 1 << nBadExpr
    	case *ast.BadStmt:
    		return 1 << nBadStmt
    	case *ast.BasicLit:
    		return 1 << nBasicLit
    	case *ast.BinaryExpr:
    		return 1 << nBinaryExpr
    	case *ast.BlockStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  6. src/go/ast/walk.go

    			Walk(v, n.Type)
    		}
    		if n.Tag != nil {
    			Walk(v, n.Tag)
    		}
    		if n.Comment != nil {
    			Walk(v, n.Comment)
    		}
    
    	case *FieldList:
    		walkList(v, n.List)
    
    	// Expressions
    	case *BadExpr, *Ident, *BasicLit:
    		// nothing to do
    
    	case *Ellipsis:
    		if n.Elt != nil {
    			Walk(v, n.Elt)
    		}
    
    	case *FuncLit:
    		Walk(v, n.Type)
    		Walk(v, n.Body)
    
    	case *CompositeLit:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  7. src/go/types/exprstring.go

    	// operator precedences. (This assumes that the AST was
    	// generated by a Go parser.)
    
    	switch x := x.(type) {
    	default:
    		fmt.Fprintf(buf, "(ast: %T)", x) // nil, ast.BadExpr, ast.KeyValueExpr
    
    	case *ast.Ident:
    		buf.WriteString(x.Name)
    
    	case *ast.Ellipsis:
    		buf.WriteString("...")
    		if x.Elt != nil {
    			WriteExpr(buf, x.Elt)
    		}
    
    	case *ast.BasicLit:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 08 19:31:44 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  8. src/go/ast/ast.go

    }
    
    // An expression is represented by a tree consisting of one
    // or more of the following concrete expression nodes.
    type (
    	// A BadExpr node is a placeholder for an expression containing
    	// syntax errors for which a correct expression node cannot be
    	// created.
    	//
    	BadExpr struct {
    		From, To token.Pos // position range of bad expression
    	}
    
    	// An Ident node represents an identifier.
    	Ident struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    	case *ast.UnaryExpr:
    		children = append(children, tok(n.OpPos, len(n.Op.String())))
    
    	case *ast.ValueSpec:
    		// TODO(adonovan): ValueSpec.{Doc,Comment}?
    
    	case *ast.BadDecl, *ast.BadExpr, *ast.BadStmt:
    		// nop
    	}
    
    	// TODO(adonovan): opt: merge the logic of ast.Inspect() into
    	// the switch above so we can make interleaved callbacks for
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/syntax/walk.go

    		if n.Recv != nil {
    			w.node(n.Recv)
    		}
    		w.node(n.Name)
    		w.fieldList(n.TParamList)
    		w.node(n.Type)
    		if n.Body != nil {
    			w.node(n.Body)
    		}
    
    	// 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:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:55:04 UTC 2023
    - 5.7K bytes
    - Viewed (0)
Back to top