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

vfmt: line comments fixes

This commit is contained in:
Alexander Medvednikov
2019-11-18 13:10:31 +03:00
parent 439bb0c5de
commit 1ccd1979a4
11 changed files with 87 additions and 42 deletions

View File

@@ -589,6 +589,8 @@ fn (s mut Scanner) scan() ScanRes {
s.line_comment = s.text[start + 1..s.pos]
s.line_comment = s.line_comment.trim_space()
if s.is_fmt {
s.pos-- // fix line_nr, \n was read, and the comment is marked on the next line
s.line_nr--
return scan_res(.line_comment, s.line_comment)
}
//s.fgenln('// ${s.prev_tok.str()} "$s.line_comment"')