type go/token.Pos
298 uses
go/token (current package)
position.go#L79: type Pos int
position.go#L86: const NoPos Pos = 0
position.go#L89: func (p Pos) IsValid() bool {
position.go#L218: func (f *File) LineStart(line int) Pos {
position.go#L227: return Pos(f.base + f.lines[line-1])
position.go#L268: func (f *File) Pos(offset int) Pos {
position.go#L272: return Pos(f.base + offset)
position.go#L279: func (f *File) Offset(p Pos) int {
position.go#L289: func (f *File) Line(p Pos) int {
position.go#L334: func (f *File) position(p Pos, adjusted bool) (pos Position) {
position.go#L346: func (f *File) PositionFor(p Pos, adjusted bool) (pos Position) {
position.go#L359: func (f *File) Position(p Pos) (pos Position) {
position.go#L473: func (s *FileSet) file(p Pos) *File {
position.go#L500: func (s *FileSet) File(p Pos) (f *File) {
position.go#L512: func (s *FileSet) PositionFor(p Pos, adjusted bool) (pos Position) {
position.go#L524: func (s *FileSet) Position(p Pos) (pos Position) {
go/ast
ast.go#L34: Pos() token.Pos // position of first character belonging to the node
ast.go#L35: End() token.Pos // position of first character immediately after the node
ast.go#L66: Slash token.Pos // position of "/" starting the comment
ast.go#L70: func (c *Comment) Pos() token.Pos { return c.Slash }
ast.go#L71: func (c *Comment) End() token.Pos { return token.Pos(int(c.Slash) + len(c.Text)) }
ast.go#L80: func (g *CommentGroup) Pos() token.Pos { return g.List[0].Pos() }
ast.go#L81: func (g *CommentGroup) End() token.Pos { return g.List[len(g.List)-1].End() }
ast.go#L205: func (f *Field) Pos() token.Pos {
ast.go#L212: func (f *Field) End() token.Pos {
ast.go#L221: Opening token.Pos // position of opening parenthesis/brace, if any
ast.go#L223: Closing token.Pos // position of closing parenthesis/brace, if any
ast.go#L226: func (f *FieldList) Pos() token.Pos {
ast.go#L238: func (f *FieldList) End() token.Pos {
ast.go#L274: From, To token.Pos // position range of bad expression
ast.go#L279: NamePos token.Pos // identifier position
ast.go#L288: Ellipsis token.Pos // position of "..."
ast.go#L300: ValuePos token.Pos // literal position
ast.go#L314: Lbrace token.Pos // position of "{"
ast.go#L316: Rbrace token.Pos // position of "}"
ast.go#L322: Lparen token.Pos // position of "("
ast.go#L324: Rparen token.Pos // position of ")"
ast.go#L336: Lbrack token.Pos // position of "["
ast.go#L338: Rbrack token.Pos // position of "]"
ast.go#L344: Lbrack token.Pos // position of "["
ast.go#L349: Rbrack token.Pos // position of "]"
ast.go#L357: Lparen token.Pos // position of "("
ast.go#L359: Rparen token.Pos // position of ")"
ast.go#L365: Lparen token.Pos // position of "("
ast.go#L367: Ellipsis token.Pos // position of "..." (token.NoPos if there is no "...")
ast.go#L368: Rparen token.Pos // position of ")"
ast.go#L375: Star token.Pos // position of "*"
ast.go#L383: OpPos token.Pos // position of Op
ast.go#L391: OpPos token.Pos // position of Op
ast.go#L401: Colon token.Pos // position of ":"
ast.go#L423: Lbrack token.Pos // position of "["
ast.go#L430: Struct token.Pos // position of "struct" keyword
ast.go#L439: Func token.Pos // position of "func" keyword (token.NoPos if there is no "func")
ast.go#L446: Interface token.Pos // position of "interface" keyword
ast.go#L453: Map token.Pos // position of "map" keyword
ast.go#L460: Begin token.Pos // position of "chan" keyword or "<-" (whichever comes first)
ast.go#L461: Arrow token.Pos // position of "<-" (token.NoPos if there is no "<-")
ast.go#L469: func (x *BadExpr) Pos() token.Pos { return x.From }
ast.go#L470: func (x *Ident) Pos() token.Pos { return x.NamePos }
ast.go#L471: func (x *Ellipsis) Pos() token.Pos { return x.Ellipsis }
ast.go#L472: func (x *BasicLit) Pos() token.Pos { return x.ValuePos }
ast.go#L473: func (x *FuncLit) Pos() token.Pos { return x.Type.Pos() }
ast.go#L474: func (x *CompositeLit) Pos() token.Pos {
ast.go#L480: func (x *ParenExpr) Pos() token.Pos { return x.Lparen }
ast.go#L481: func (x *SelectorExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L482: func (x *IndexExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L483: func (x *SliceExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L484: func (x *TypeAssertExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L485: func (x *CallExpr) Pos() token.Pos { return x.Fun.Pos() }
ast.go#L486: func (x *StarExpr) Pos() token.Pos { return x.Star }
ast.go#L487: func (x *UnaryExpr) Pos() token.Pos { return x.OpPos }
ast.go#L488: func (x *BinaryExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L489: func (x *KeyValueExpr) Pos() token.Pos { return x.Key.Pos() }
ast.go#L490: func (x *ArrayType) Pos() token.Pos { return x.Lbrack }
ast.go#L491: func (x *StructType) Pos() token.Pos { return x.Struct }
ast.go#L492: func (x *FuncType) Pos() token.Pos {
ast.go#L498: func (x *InterfaceType) Pos() token.Pos { return x.Interface }
ast.go#L499: func (x *MapType) Pos() token.Pos { return x.Map }
ast.go#L500: func (x *ChanType) Pos() token.Pos { return x.Begin }
ast.go#L502: func (x *BadExpr) End() token.Pos { return x.To }
ast.go#L503: func (x *Ident) End() token.Pos { return token.Pos(int(x.NamePos) + len(x.Name)) }
ast.go#L504: func (x *Ellipsis) End() token.Pos {
ast.go#L510: func (x *BasicLit) End() token.Pos { return token.Pos(int(x.ValuePos) + len(x.Value)) }
ast.go#L511: func (x *FuncLit) End() token.Pos { return x.Body.End() }
ast.go#L512: func (x *CompositeLit) End() token.Pos { return x.Rbrace + 1 }
ast.go#L513: func (x *ParenExpr) End() token.Pos { return x.Rparen + 1 }
ast.go#L514: func (x *SelectorExpr) End() token.Pos { return x.Sel.End() }
ast.go#L515: func (x *IndexExpr) End() token.Pos { return x.Rbrack + 1 }
ast.go#L516: func (x *SliceExpr) End() token.Pos { return x.Rbrack + 1 }
ast.go#L517: func (x *TypeAssertExpr) End() token.Pos { return x.Rparen + 1 }
ast.go#L518: func (x *CallExpr) End() token.Pos { return x.Rparen + 1 }
ast.go#L519: func (x *StarExpr) End() token.Pos { return x.X.End() }
ast.go#L520: func (x *UnaryExpr) End() token.Pos { return x.X.End() }
ast.go#L521: func (x *BinaryExpr) End() token.Pos { return x.Y.End() }
ast.go#L522: func (x *KeyValueExpr) End() token.Pos { return x.Value.End() }
ast.go#L523: func (x *ArrayType) End() token.Pos { return x.Elt.End() }
ast.go#L524: func (x *StructType) End() token.Pos { return x.Fields.End() }
ast.go#L525: func (x *FuncType) End() token.Pos {
ast.go#L531: func (x *InterfaceType) End() token.Pos { return x.Methods.End() }
ast.go#L532: func (x *MapType) End() token.Pos { return x.Value.End() }
ast.go#L533: func (x *ChanType) End() token.Pos { return x.Value.End() }
ast.go#L597: From, To token.Pos // position range of bad statement
ast.go#L610: Semicolon token.Pos // position of following ";"
ast.go#L617: Colon token.Pos // position of ":"
ast.go#L631: Arrow token.Pos // position of "<-"
ast.go#L638: TokPos token.Pos // position of Tok
ast.go#L647: TokPos token.Pos // position of Tok
ast.go#L654: Go token.Pos // position of "go" keyword
ast.go#L660: Defer token.Pos // position of "defer" keyword
ast.go#L666: Return token.Pos // position of "return" keyword
ast.go#L674: TokPos token.Pos // position of Tok
ast.go#L681: Lbrace token.Pos // position of "{"
ast.go#L683: Rbrace token.Pos // position of "}", if any (may be absent due to syntax error)
ast.go#L688: If token.Pos // position of "if" keyword
ast.go#L697: Case token.Pos // position of "case" or "default" keyword
ast.go#L699: Colon token.Pos // position of ":"
ast.go#L705: Switch token.Pos // position of "switch" keyword
ast.go#L713: Switch token.Pos // position of "switch" keyword
ast.go#L721: Case token.Pos // position of "case" or "default" keyword
ast.go#L723: Colon token.Pos // position of ":"
ast.go#L729: Select token.Pos // position of "select" keyword
ast.go#L735: For token.Pos // position of "for" keyword
ast.go#L744: For token.Pos // position of "for" keyword
ast.go#L746: TokPos token.Pos // position of Tok; invalid if Key == nil
ast.go#L755: func (s *BadStmt) Pos() token.Pos { return s.From }
ast.go#L756: func (s *DeclStmt) Pos() token.Pos { return s.Decl.Pos() }
ast.go#L757: func (s *EmptyStmt) Pos() token.Pos { return s.Semicolon }
ast.go#L758: func (s *LabeledStmt) Pos() token.Pos { return s.Label.Pos() }
ast.go#L759: func (s *ExprStmt) Pos() token.Pos { return s.X.Pos() }
ast.go#L760: func (s *SendStmt) Pos() token.Pos { return s.Chan.Pos() }
ast.go#L761: func (s *IncDecStmt) Pos() token.Pos { return s.X.Pos() }
ast.go#L762: func (s *AssignStmt) Pos() token.Pos { return s.Lhs[0].Pos() }
ast.go#L763: func (s *GoStmt) Pos() token.Pos { return s.Go }
ast.go#L764: func (s *DeferStmt) Pos() token.Pos { return s.Defer }
ast.go#L765: func (s *ReturnStmt) Pos() token.Pos { return s.Return }
ast.go#L766: func (s *BranchStmt) Pos() token.Pos { return s.TokPos }
ast.go#L767: func (s *BlockStmt) Pos() token.Pos { return s.Lbrace }
ast.go#L768: func (s *IfStmt) Pos() token.Pos { return s.If }
ast.go#L769: func (s *CaseClause) Pos() token.Pos { return s.Case }
ast.go#L770: func (s *SwitchStmt) Pos() token.Pos { return s.Switch }
ast.go#L771: func (s *TypeSwitchStmt) Pos() token.Pos { return s.Switch }
ast.go#L772: func (s *CommClause) Pos() token.Pos { return s.Case }
ast.go#L773: func (s *SelectStmt) Pos() token.Pos { return s.Select }
ast.go#L774: func (s *ForStmt) Pos() token.Pos { return s.For }
ast.go#L775: func (s *RangeStmt) Pos() token.Pos { return s.For }
ast.go#L777: func (s *BadStmt) End() token.Pos { return s.To }
ast.go#L778: func (s *DeclStmt) End() token.Pos { return s.Decl.End() }
ast.go#L779: func (s *EmptyStmt) End() token.Pos {
ast.go#L785: func (s *LabeledStmt) End() token.Pos { return s.Stmt.End() }
ast.go#L786: func (s *ExprStmt) End() token.Pos { return s.X.End() }
ast.go#L787: func (s *SendStmt) End() token.Pos { return s.Value.End() }
ast.go#L788: func (s *IncDecStmt) End() token.Pos {
ast.go#L791: func (s *AssignStmt) End() token.Pos { return s.Rhs[len(s.Rhs)-1].End() }
ast.go#L792: func (s *GoStmt) End() token.Pos { return s.Call.End() }
ast.go#L793: func (s *DeferStmt) End() token.Pos { return s.Call.End() }
ast.go#L794: func (s *ReturnStmt) End() token.Pos {
ast.go#L800: func (s *BranchStmt) End() token.Pos {
ast.go#L804: return token.Pos(int(s.TokPos) + len(s.Tok.String()))
ast.go#L806: func (s *BlockStmt) End() token.Pos {
ast.go#L815: func (s *IfStmt) End() token.Pos {
ast.go#L821: func (s *CaseClause) End() token.Pos {
ast.go#L827: func (s *SwitchStmt) End() token.Pos { return s.Body.End() }
ast.go#L828: func (s *TypeSwitchStmt) End() token.Pos { return s.Body.End() }
ast.go#L829: func (s *CommClause) End() token.Pos {
ast.go#L835: func (s *SelectStmt) End() token.Pos { return s.Body.End() }
ast.go#L836: func (s *ForStmt) End() token.Pos { return s.Body.End() }
ast.go#L837: func (s *RangeStmt) End() token.Pos { return s.Body.End() }
ast.go#L883: EndPos token.Pos // end of spec (overrides Path.Pos if nonzero)
ast.go#L901: Assign token.Pos // position of '=', if any
ast.go#L909: func (s *ImportSpec) Pos() token.Pos {
ast.go#L915: func (s *ValueSpec) Pos() token.Pos { return s.Names[0].Pos() }
ast.go#L916: func (s *TypeSpec) Pos() token.Pos { return s.Name.Pos() }
ast.go#L918: func (s *ImportSpec) End() token.Pos {
ast.go#L925: func (s *ValueSpec) End() token.Pos {
ast.go#L934: func (s *TypeSpec) End() token.Pos { return s.Type.End() }
ast.go#L951: From, To token.Pos // position range of bad declaration
ast.go#L967: TokPos token.Pos // position of Tok
ast.go#L969: Lparen token.Pos // position of '(', if any
ast.go#L971: Rparen token.Pos // position of ')', if any
ast.go#L986: func (d *BadDecl) Pos() token.Pos { return d.From }
ast.go#L987: func (d *GenDecl) Pos() token.Pos { return d.TokPos }
ast.go#L988: func (d *FuncDecl) Pos() token.Pos { return d.Type.Pos() }
ast.go#L990: func (d *BadDecl) End() token.Pos { return d.To }
ast.go#L991: func (d *GenDecl) End() token.Pos {
ast.go#L997: func (d *FuncDecl) End() token.Pos {
ast.go#L1035: Package token.Pos // position of "package" keyword
ast.go#L1044: func (f *File) Pos() token.Pos { return f.Package }
ast.go#L1045: func (f *File) End() token.Pos {
ast.go#L1062: func (p *Package) Pos() token.Pos { return token.NoPos }
ast.go#L1063: func (p *Package) End() token.Pos { return token.NoPos }
commentmap.go#L117: func (s *nodeStack) pop(pos token.Pos) (top Node) {
filter.go#L369: var pos token.Pos
import.go#L55: func lineAt(fset *token.FileSet, pos token.Pos) int {
import.go#L92: Start token.Pos
import.go#L93: End token.Pos
import.go#L121: var end token.Pos
print.go#L244: case token.Pos:
resolve.go#L21: func (p *pkgBuilder) error(pos token.Pos, msg string) {
resolve.go#L25: func (p *pkgBuilder) errorf(pos token.Pos, format string, args ...interface{}) {
scope.go#L92: func (obj *Object) Pos() token.Pos {
go/build
build.go#L1356: pos token.Pos
go/doc
doc.go#L90: Pos, End token.Pos // position range of the comment containing the marker
exports.go#L237: func copyConstType(typ ast.Expr, pos token.Pos) ast.Expr {
go/parser
parser.go#L46: pos token.Pos // token position
parser.go#L54: syncPos token.Pos // last synchronization position
parser.go#L354: func (p *parser) error(pos token.Pos, msg string) {
parser.go#L373: func (p *parser) errorExpected(pos token.Pos, msg string) {
parser.go#L391: func (p *parser) expect(tok token.Token) token.Pos {
parser.go#L402: func (p *parser) expect2(tok token.Token) (pos token.Pos) {
parser.go#L415: func (p *parser) expectClosing(tok token.Token, context string) token.Pos {
parser.go#L533: func (p *parser) safePos(pos token.Pos) (res token.Pos) {
parser.go#L536: res = token.Pos(p.file.Base() + p.file.Size()) // EOF position
parser.go#L1013: var arrow token.Pos
parser.go#L1223: var colons [N - 1]token.Pos
parser.go#L1269: var ellipsis token.Pos
parser.go#L1863: pos token.Pos
parser.go#L2408: var lparen, rparen token.Pos
go/printer
nodes.go#L130: func (p *printer) exprList(prev0 token.Pos, list []ast.Expr, depth int, mode exprListMode, next0 token.Pos, isIncomplete bool) {
nodes.go#L1761: func (p *printer) distanceFrom(startPos token.Pos, startOutCol int) int {
printer.go#L90: cachedPos token.Pos
printer.go#L193: func (p *printer) posFor(pos token.Pos) token.Position {
printer.go#L198: func (p *printer) lineFor(pos token.Pos) int {
printer.go#L962: case token.Pos:
go/scanner
scanner.go#L782: func (s *Scanner) Scan() (pos token.Pos, tok token.Token, lit string) {
golang.org/x/pkgsite/internal/godoc
encode_ast.gen.go#L54: x.Lbrack = token.Pos(d.DecodeInt())
encode_ast.gen.go#L121: x.TokPos = token.Pos(d.DecodeInt())
encode_ast.gen.go#L178: x.From = token.Pos(d.DecodeInt())
encode_ast.gen.go#L180: x.To = token.Pos(d.DecodeInt())
encode_ast.gen.go#L233: x.From = token.Pos(d.DecodeInt())
encode_ast.gen.go#L235: x.To = token.Pos(d.DecodeInt())
encode_ast.gen.go#L288: x.From = token.Pos(d.DecodeInt())
encode_ast.gen.go#L290: x.To = token.Pos(d.DecodeInt())
encode_ast.gen.go#L347: x.ValuePos = token.Pos(d.DecodeInt())
encode_ast.gen.go#L414: x.OpPos = token.Pos(d.DecodeInt())
encode_ast.gen.go#L475: x.Lbrace = token.Pos(d.DecodeInt())
encode_ast.gen.go#L479: x.Rbrace = token.Pos(d.DecodeInt())
encode_ast.gen.go#L536: x.TokPos = token.Pos(d.DecodeInt())
encode_ast.gen.go#L607: x.Lparen = token.Pos(d.DecodeInt())
encode_ast.gen.go#L611: x.Ellipsis = token.Pos(d.DecodeInt())
encode_ast.gen.go#L613: x.Rparen = token.Pos(d.DecodeInt())
encode_ast.gen.go#L674: x.Case = token.Pos(d.DecodeInt())
encode_ast.gen.go#L678: x.Colon = token.Pos(d.DecodeInt())
encode_ast.gen.go#L741: x.Begin = token.Pos(d.DecodeInt())
encode_ast.gen.go#L743: x.Arrow = token.Pos(d.DecodeInt())
encode_ast.gen.go#L808: x.Case = token.Pos(d.DecodeInt())
encode_ast.gen.go#L812: x.Colon = token.Pos(d.DecodeInt())
encode_ast.gen.go#L916: x.Slash = token.Pos(d.DecodeInt())
encode_ast.gen.go#L985: x.Lbrace = token.Pos(d.DecodeInt())
encode_ast.gen.go#L989: x.Rbrace = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1093: x.Defer = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1148: x.Ellipsis = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1203: x.Semicolon = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1311: x.Opening = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1315: x.Closing = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1453: x.For = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1646: x.Func = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1721: x.TokPos = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1725: x.Lparen = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1729: x.Rparen = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1782: x.Go = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1841: x.NamePos = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1910: x.If = token.Pos(d.DecodeInt())
encode_ast.gen.go#L1991: x.EndPos = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2050: x.TokPos = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2115: x.Lbrack = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2119: x.Rbrack = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2176: x.Interface = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2239: x.Colon = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2300: x.Colon = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2359: x.Map = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2420: x.Lparen = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2424: x.Rparen = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2497: x.For = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2503: x.TokPos = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2562: x.Return = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2672: x.Select = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2788: x.Arrow = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2865: x.Lbrack = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2875: x.Rbrack = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2928: x.Star = token.Pos(d.DecodeInt())
encode_ast.gen.go#L2987: x.Struct = token.Pos(d.DecodeInt())
encode_ast.gen.go#L3052: x.Switch = token.Pos(d.DecodeInt())
encode_ast.gen.go#L3121: x.Lparen = token.Pos(d.DecodeInt())
encode_ast.gen.go#L3125: x.Rparen = token.Pos(d.DecodeInt())
encode_ast.gen.go#L3194: x.Assign = token.Pos(d.DecodeInt())
encode_ast.gen.go#L3259: x.Switch = token.Pos(d.DecodeInt())
encode_ast.gen.go#L3322: x.OpPos = token.Pos(d.DecodeInt())
encode_ast.gen.go#L3939: x.Package = token.Pos(d.DecodeInt())
golang.org/x/pkgsite/internal/godoc/dochtml/internal/render
linkify.go#L563: func addComment(cg **ast.CommentGroup, pos token.Pos, text string) {
golang.org/x/pkgsite/internal/godoc/internal/doc
doc.go#L105: Pos, End token.Pos // position range of the comment containing the marker
example.go#L466: var stdPos, otherPos token.Pos
example.go#L473: pos token.Pos
exports.go#L237: func copyConstType(typ ast.Expr, pos token.Pos) ast.Expr {
 |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |