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

run vfmt on http, net, sync, strconv

This commit is contained in:
Alexander Medvednikov
2019-12-22 01:41:42 +03:00
parent 28ecfb231d
commit 848cd3cb3e
18 changed files with 523 additions and 404 deletions

View File

@ -181,9 +181,10 @@ fn (p mut Parser) fnext() {
comment := comment_token.lit
// Newline before the comment, but not between two // comments,
// and not right after `{`, there's already a newline there
if i > 0 && p.tokens[i-1].tok != .line_comment &&
if i > 0 && ((p.tokens[i-1].tok != .line_comment &&
p.tokens[i-1].tok != .lcbr &&
comment_token.line_nr > p.tokens[i-1].line_nr {
comment_token.line_nr > p.tokens[i-1].line_nr) ||
p.tokens[i-1].tok == .hash) { // TODO not sure why this is needed, newline wasn't added after a hash
p.fgen_nl()
}
if i > 0 && p.tokens[i-1].tok == .rcbr && p.scanner.fmt_indent == 0 {