mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: keep single empty lines (#8189)
This commit is contained in:
@@ -20,6 +20,7 @@ pub fn (pos Position) extend(end Position) Position {
|
||||
return {
|
||||
pos |
|
||||
len: end.pos - pos.pos + end.len
|
||||
last_line: end.last_line
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,11 +33,16 @@ pub fn (pos Position) extend_with_last_line(end Position, last_line int) Positio
|
||||
}
|
||||
}
|
||||
|
||||
pub fn (mut pos Position) update_last_line(last_line int) {
|
||||
pos.last_line = last_line - 1
|
||||
}
|
||||
|
||||
[inline]
|
||||
pub fn (tok &Token) position() Position {
|
||||
return Position{
|
||||
len: tok.len
|
||||
line_nr: tok.line_nr - 1
|
||||
pos: tok.pos
|
||||
last_line: tok.line_nr - 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user