type Pos … var NoPos … // MakePos creates a new Pos value with the given base, and (file-absolute) // line and column. func MakePos(base *PosBase, line, col uint) Pos { … } // IsKnown reports whether the position p is known. // A position is known if it either has a non-nil // position base, or a non-zero line number. func (p Pos) IsKnown() bool { … } // Before reports whether the position p comes before q in the source. // For positions in different files, ordering is by filename. func (p Pos) Before(q Pos) bool { … } // After reports whether the position p comes after q in the source. // For positions in different files, ordering is by filename. func (p Pos) After(q Pos) bool { … } func (p Pos) LineNumber() string { … } func (p Pos) LineNumberHTML() string { … } // Filename returns the name of the actual file containing this position. func (p Pos) Filename() string { … } // Base returns the position base. func (p Pos) Base() *PosBase { … } // SetBase sets the position base. func (p *Pos) SetBase(base *PosBase) { … } // RelFilename returns the filename recorded with the position's base. func (p Pos) RelFilename() string { … } // RelLine returns the line number relative to the position's base. func (p Pos) RelLine() uint { … } // RelCol returns the column number relative to the position's base. func (p Pos) RelCol() uint { … } // AbsFilename() returns the absolute filename recorded with the position's base. func (p Pos) AbsFilename() string { … } // FileIndex returns the file index of the position's base's absolute // filename within the PosTable that it was registered. func (p Pos) FileIndex() int { … } func (p Pos) String() string { … } // Format formats a position as "filename:line" or "filename:line:column", // controlled by the showCol flag and if the column is known (!= 0). // For positions relative to line directives, the original position is // shown as well, as in "filename:line[origfile:origline:origcolumn]" if // showOrig is set. func (p Pos) Format(showCol, showOrig bool) string { … } // WriteTo a position to w, formatted as Format does. func (p Pos) WriteTo(w io.Writer, showCol, showOrig bool) { … } // format formats a (filename, line, col) tuple as "filename:line" (showCol // is false or col == 0) or "filename:line:column" (showCol is true and col != 0). func format(w io.Writer, filename string, line, col uint, showCol bool) { … } // formatstr wraps format to return a string. func formatstr(filename string, line, col uint, showCol bool) string { … } type PosBase … // NewFileBase returns a new *PosBase for a file with the given (relative and // absolute) filenames. func NewFileBase(filename, absFilename string) *PosBase { … } // NewLinePragmaBase returns a new *PosBase for a line directive of the form // // //line filename:line:col // /*line filename:line:col*/ // // at position pos. func NewLinePragmaBase(pos Pos, filename, absFilename string, line, col uint) *PosBase { … } // NewInliningBase returns a copy of the orig PosBase with the given inlining // index. If orig == nil, NewInliningBase panics. func NewInliningBase(orig *PosBase, inlTreeIndex int) *PosBase { … } var noPos … // Pos returns the position at which base is located. // If b == nil, the result is the zero position. func (b *PosBase) Pos() *Pos { … } // Filename returns the filename recorded with the base. // If b == nil, the result is the empty string. func (b *PosBase) Filename() string { … } // AbsFilename returns the absolute filename recorded with the base. // If b == nil, the result is the empty string. func (b *PosBase) AbsFilename() string { … } const FileSymPrefix … // FileIndex returns the index of the base's absolute filename within // its PosTable's FileTable. It panics if it hasn't been registered // with a PosTable. If b == nil, the result is -1. func (b *PosBase) FileIndex() int { … } // Line returns the line number recorded with the base. // If b == nil, the result is 0. func (b *PosBase) Line() uint { … } // Col returns the column number recorded with the base. // If b == nil, the result is 0. func (b *PosBase) Col() uint { … } // InliningIndex returns the index into the global inlining // tree recorded with the base. If b == nil or the base has // not been inlined, the result is < 0. func (b *PosBase) InliningIndex() int { … } type lico … const ( lineBits … lineMax … ) const bogusLine … const ( isStmtBits … isStmtMax … ) const ( xlogueBits … xlogueMax … ) const ( colBits … colMax … ) const isStmtShift … const isStmtMask … const xlogueShift … const xlogueMask … const colShift … const lineShift … const PosDefaultStmt … const PosIsStmt … const PosNotStmt … type PosXlogue … const PosDefaultLogue … const PosPrologueEnd … const PosEpilogueBegin … func makeLicoRaw(line, col uint) lico { … } // This is a not-position that will not be elided. // Depending on the debugger (gdb or delve) it may or may not be displayed. func makeBogusLico() lico { … } func makeLico(line, col uint) lico { … } func (x lico) Line() uint { … } func (x lico) SameLine(y lico) bool { … } func (x lico) Col() uint { … } func (x lico) IsStmt() uint { … } func (x lico) Xlogue() PosXlogue { … } // withNotStmt returns a lico for the same location, but not a statement func (x lico) withNotStmt() lico { … } // withDefaultStmt returns a lico for the same location, with default isStmt func (x lico) withDefaultStmt() lico { … } // withIsStmt returns a lico for the same location, tagged as definitely a statement func (x lico) withIsStmt() lico { … } // withXlogue attaches a prologue/epilogue attribute to a lico func (x lico) withXlogue(xlogue PosXlogue) lico { … } // withStmt returns a lico for the same location with specified is_stmt attribute func (x lico) withStmt(stmt uint) lico { … } func (x lico) lineNumber() string { … } func (x lico) lineNumberHTML() string { … } func (x lico) atColumn1() lico { … }