mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: fix dump removing empty lines (#18452)
This commit is contained in:
parent
5001b17336
commit
5d0af69bfd
@ -10,6 +10,8 @@ fn squash_multiple_empty_lines() {
|
||||
|
||||
println('b')
|
||||
|
||||
dump('c')
|
||||
|
||||
c := 0
|
||||
|
||||
d := 0
|
||||
|
@ -8,6 +8,8 @@ fn squash_multiple_empty_lines() {
|
||||
|
||||
println('b')
|
||||
|
||||
dump('c')
|
||||
|
||||
|
||||
c := 0
|
||||
|
||||
|
@ -33,12 +33,15 @@ fn keep_single_empty_line() {
|
||||
|
||||
println('c')
|
||||
|
||||
dump('d')
|
||||
|
||||
d := 0
|
||||
|
||||
if true {
|
||||
println('e')
|
||||
}
|
||||
|
||||
dump('f')
|
||||
f := 0
|
||||
arr << MyStruct{}
|
||||
|
||||
|
@ -328,9 +328,11 @@ fn (mut p Parser) check_expr(precedence int) !ast.Expr {
|
||||
p.next()
|
||||
}
|
||||
p.check(.rpar)
|
||||
mut pos := p.tok.pos()
|
||||
pos.update_last_line(p.prev_tok.line_nr)
|
||||
node = ast.DumpExpr{
|
||||
expr: expr
|
||||
pos: spos.extend(p.tok.pos())
|
||||
pos: spos.extend(pos)
|
||||
}
|
||||
}
|
||||
.key_offsetof {
|
||||
|
Loading…
Reference in New Issue
Block a user