go/ast.Spec.Pos (method)

91 uses

	go/ast (current package)
		ast.go#L33: 	Pos() token.Pos // position of first character belonging to the node
		ast.go#L210: 		return f.Type.Pos()
		ast.go#L499: 		return x.Type.Pos()
		ast.go#L504: func (x *SelectorExpr) Pos() token.Pos   { return x.X.Pos() }
		ast.go#L505: func (x *IndexExpr) Pos() token.Pos      { return x.X.Pos() }
		ast.go#L506: func (x *IndexListExpr) Pos() token.Pos  { return x.X.Pos() }
		ast.go#L507: func (x *SliceExpr) Pos() token.Pos      { return x.X.Pos() }
		ast.go#L508: func (x *TypeAssertExpr) Pos() token.Pos { return x.X.Pos() }
		ast.go#L509: func (x *CallExpr) Pos() token.Pos       { return x.Fun.Pos() }
		ast.go#L512: func (x *BinaryExpr) Pos() token.Pos     { return x.X.Pos() }
		ast.go#L513: func (x *KeyValueExpr) Pos() token.Pos   { return x.Key.Pos() }
		ast.go#L778: func (s *DeclStmt) Pos() token.Pos       { return s.Decl.Pos() }
		ast.go#L781: func (s *ExprStmt) Pos() token.Pos       { return s.X.Pos() }
		ast.go#L782: func (s *SendStmt) Pos() token.Pos       { return s.Chan.Pos() }
		ast.go#L783: func (s *IncDecStmt) Pos() token.Pos     { return s.X.Pos() }
		ast.go#L784: func (s *AssignStmt) Pos() token.Pos     { return s.Lhs[0].Pos() }
		commentmap.go#L95: 	s.pop(n.Pos())
		commentmap.go#L157: 			qpos = fset.Position(q.Pos()) // current node position
		commentmap.go#L305: 		r := cmp.Compare(a.Pos(), b.Pos())
		import.go#L34: 			if j > i && lineAt(fset, s.Pos()) > 1+lineAt(fset, d.Specs[j-1].End()) {
		import.go#L46: 			lastLine := lineAt(fset, lastSpec.Pos())
		import.go#L123: 		pos[i] = posSpan{s.Pos(), s.End()}
		import.go#L209: 			p := s.Pos()

	go/doc
		example.go#L314: 		return cmp.Compare(a.Pos(), b.Pos())
		reader.go#L704: 	origPos := newField.Type.Pos()

	go/parser
		parser.go#L887: 		pos0 = typ0.Pos()
		parser.go#L966: 					errPos = typ.Pos()
		parser.go#L1762: 				p.error(t.Pos(), "cannot parenthesize type in composite literal")
		parser.go#L1941: 		p.errorExpected(x[0].Pos(), "1 expression")
		parser.go#L1964: 		return &ast.BadStmt{From: x[0].Pos(), To: colon + 1}, false
		parser.go#L1987: 		p.error(x.Pos(), fmt.Sprintf("expression in %s must not be parenthesized", callType))
		parser.go#L2072: 	p.error(s.Pos(), fmt.Sprintf("expected %s, found %s (missing parentheses around composite literal?)", want, found))
		parser.go#L2073: 	return &ast.BadExpr{From: s.Pos(), To: p.safePos(s.End())}
		parser.go#L2284: 				p.errorExpected(lhs[0].Pos(), "1 expression")
		parser.go#L2296: 					p.errorExpected(lhs[0].Pos(), "1 or 2 expressions")
		parser.go#L2307: 					p.errorExpected(lhs[0].Pos(), "1 expression")
		parser.go#L2395: 			p.errorExpected(as.Lhs[len(as.Lhs)-1].Pos(), "at most 2 expressions")
		parser.go#L2407: 			Range:  as.Rhs[0].Pos(),
		resolver.go#L183: 		r.declErr(decl.Lhs[0].Pos(), "no new variables on left side of :=")
		resolver.go#L252: 		r.trace("node %T@%v", node, node.Pos())
		resolver.go#L362: 				r.openScope(n.Tag.Pos())
		resolver.go#L377: 		r.openScope(n.Assign.Pos())

	go/printer
		nodes.go#L143: 	line := p.lineFor(list[0].Pos())
		nodes.go#L152: 				p.setPos(x.Pos())
		nodes.go#L194: 		line = p.lineFor(x.Pos())
		nodes.go#L244: 				p.setPos(x.Pos())
		nodes.go#L788: 	yline := p.lineFor(x.Y.Pos())
		nodes.go#L814: 	p.setPos(expr.Pos())
		nodes.go#L1203: 				p.linebreak(p.lineFor(s.Pos()), 1, ignore, i == 0 || nindent == 0 || p.linesFrom(line) > 0)
		nodes.go#L1321: 		var b = p.lineFor(list[0].Pos())
		nodes.go#L1328: 				xb := p.lineFor(x.Pos())
		nodes.go#L1348: 	p.setPos(stmt.Pos())
		nodes.go#L1376: 			p.linebreak(p.lineFor(s.Stmt.Pos()), 1, ignore, true)
		nodes.go#L1530: 				p.setPos(s.Value.Pos())
		nodes.go#L1753: 						p.linebreak(p.lineFor(s.Pos()), 1, ignore, p.linesFrom(line) > 0)
		nodes.go#L1762: 						p.linebreak(p.lineFor(s.Pos()), 1, ignore, p.linesFrom(line) > 0)
		nodes.go#L1833: 	if from := n.Pos(); from.IsValid() {
		nodes.go#L1986: 			p.linebreak(p.lineFor(d.Pos()), min, ignore, tok == token.FUNC && p.numLines(d) > 1)
		printer.go#L1105: 		beg := n.Pos()

	go/types
		assignments.go#L583: 			lhsVars[i] = NewVar(lhs[i].Pos(), check.pkg, "_", nil)
		call.go#L162: 				pos = xlist[i].Pos()
		errors.go#L284: 	start, end := node.Pos(), node.End()
		errors.go#L301: 		pos := x.Pos()
		expr.go#L95: 		return x.Pos()
		expr.go#L256: 			check.dump("%v: found old type(%s): %s (new: %s)", x.Pos(), x, old.typ, typ)
		expr.go#L944: 		check.trace(e.Pos(), "-- expr %s", e)
		expr.go#L948: 			check.trace(e.Pos(), "=> %s", x)
		expr.go#L1047: 			check.funcInst(T, e.Pos(), x, ix, true)
		expr.go#L1151: 		panic(fmt.Sprintf("%s: unknown expression type %T", check.fset.Position(e.Pos()), e))
		index.go#L430: 	return x.orig.Pos()
		interface.go#L170: 			addEmbedded(f.Type.Pos(), parseUnion(check, f.Type))
		operand.go#L74: 	return x.expr.Pos()
		recording.go#L52: 			check.dump("%v: %s (type %s) is typed", x.Pos(), x, info.typ)
		recording.go#L109: 			pos := x.Pos()
		resolver.go#L540: 					par = &ast.Ident{NamePos: arg.Pos(), Name: "_"}
		signature.go#L265: 			recvType = check.instance(rparam.Type.Pos(), baseType, targs, nil, check.context())
		signature.go#L389: 			par := NewParam(ftype.Pos(), check.pkg, "", typ)
		stmt.go#L145: 				check.errorf(d, DuplicateDefault, "multiple defaults (first at %s)", check.fset.Position(first.Pos()))
		stmt.go#L154: 	scope := NewScope(check.scope, node.Pos(), node.End(), comment)
		stmt.go#L507: 		Y := &ast.BasicLit{ValuePos: s.X.Pos(), Kind: token.INT, Value: "1"} // use x's position
		stmt.go#L949: 				obj = NewVar(lhs.Pos(), check.pkg, "_", nil) // dummy variable
		struct.go#L126: 			pos := f.Type.Pos() // position of type, for errors
		typexpr.go#L176: 			tset := computeInterfaceTypeSet(check, e.Pos(), t) // TODO(gri) is this the correct position?
		typexpr.go#L234: 		check.trace(e0.Pos(), "-- type %s", e0)
		typexpr.go#L245: 				check.trace(e0.Pos(), "=> %s // %s", T, goTypeName(T))
		typexpr.go#L247: 				check.trace(e0.Pos(), "=> %s (under = %s) // %s", T, under, goTypeName(T))
		typexpr.go#L493: 					pos = ix.indices[i].Pos()
		util.go#L50: func startPos(n ast.Node) token.Pos { return n.Pos() }

	gotest.tools/v3/internal/source
		source.go#L70: 		case fileset.Position(node.Pos()).Line == lineNum: