Lines Matching refs:pos
33 pos scanner.Position member
55 pos: scanner.Position{
139 func (p *printer) printList(list []Expression, pos, endPos scanner.Position) {
141 p.printToken("[", pos)
142 if len(list) > 1 || pos.Line != endPos.Line {
202 p.unindent(p.pos)
215 func (p *printer) printToken(s string, pos scanner.Position) {
218 if pos == noPos {
219 pos = p.pos
223 p.printEndOfLineCommentsBefore(pos)
224 p.requestNewlinesForPos(pos)
227 p.printInLineCommentsBefore(pos)
233 p.pos = pos
237 func (p *printer) printInLineCommentsBefore(pos scanner.Position) {
238 for p.curComment < len(p.comments) && p.comments[p.curComment].Pos().Offset < pos.Offset {
252 func (p *printer) printEndOfLineCommentsBefore(pos scanner.Position) {
260 for p.curComment < len(p.comments) && p.comments[p.curComment].Pos().Line < pos.Line {
270 func (p *printer) requestNewlinesForPos(pos scanner.Position) bool {
271 if pos.Line > p.pos.Line {
273 if pos.Line > p.pos.Line+1 {
297 pos := p.pos
298 pos.Line++
299 p.printEndOfLineCommentsBefore(pos)
345 p.pos = comment.End()
379 func (p *printer) unindent(pos scanner.Position) {
380 p.printEndOfLineCommentsBefore(pos)