Compare commits
2 Commits
4d9b7dfa55
..
v0.3.6
| Author | SHA1 | Date | |
|---|---|---|---|
| 3bd2c58fc3 | |||
| f8f6ff9e11 |
@@ -64,29 +64,3 @@ func (p *Position) StepLine() {
|
||||
p.Line++
|
||||
p.Column = 1
|
||||
}
|
||||
|
||||
// Next returns a new Position one rune forward
|
||||
// on the line
|
||||
func (p Position) Next() Position {
|
||||
if p.Line == 0 {
|
||||
p.Reset()
|
||||
}
|
||||
|
||||
return Position{
|
||||
Line: p.Line,
|
||||
Column: p.Column + 1,
|
||||
}
|
||||
}
|
||||
|
||||
// NextLine returns a new Position at the begining of the next
|
||||
// line.
|
||||
func (p Position) NextLine() Position {
|
||||
if p.Line == 0 {
|
||||
p.Reset()
|
||||
}
|
||||
|
||||
return Position{
|
||||
Line: p.Line + 1,
|
||||
Column: 1,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user