3 Commits

Author SHA1 Message Date
amery 3c4f0261d8 Merge branch 'main' into next-amery 2023-09-03 15:08:06 +00:00
amery 2b5dcec64d lexer: add Hint to Error, which is expanded as "%s" instead of "%q"
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-08-31 20:11:58 +00:00
amery 4aa6233e4f lexer: refactor Error.Error()'s prefix generator
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-08-31 20:11:34 +00:00
-20
View File
@@ -64,23 +64,3 @@ func (p *Position) StepLine() {
p.Line++
p.Column = 1
}
// Add adds a relative position considering
// potential new lines
func (p *Position) Add(rel Position) {
if p.Line == 0 {
p.Reset()
}
switch {
case rel.Line == 0:
// nothing
case rel.Line > 1:
// includes new lines
p.Line += rel.Line - 1
p.Column = rel.Column
default:
// same line
p.Column += rel.Column - 1
}
}