1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: fix formatting of 'import mod as alias'

This commit is contained in:
Delyan Angelov
2019-12-31 20:26:44 +02:00
committed by Alexander Medvednikov
parent 286a0a1371
commit 222f2f08f6
3 changed files with 11 additions and 5 deletions

View File

@ -171,7 +171,9 @@ fn (p mut Parser) fnext() {
p.fgen_nl()
p.fmt_inc()
}
if p.token_idx >= p.tokens.len {
return
}
// Skip comments and add them to vfmt output
if p.tokens[p.token_idx].tok in [.line_comment, .mline_comment] {
// Newline before the comment and after consts and closing }