| 1 | module main |
| 2 | |
| 3 | import v.token |
| 4 | |
| 5 | type FilteredLines = map[ErrorType]map[int]bool |
| 6 | |
| 7 | fn (mut fl FilteredLines) comments(is_multi bool, pos token.Pos) { |
| 8 | if !is_multi { |
| 9 | return |
| 10 | } |
| 11 | for ln in pos.line_nr + 1 .. pos.last_line + 1 { |
| 12 | fl[.space_indent][ln] = true |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | fn (mut fl FilteredLines) assigns(pos token.Pos) { |
| 17 | if pos.line_nr == pos.last_line { |
| 18 | return |
| 19 | } |
| 20 | for ln in pos.line_nr + 1 .. pos.last_line { |
| 21 | fl[.trailing_space][ln] = true |
| 22 | fl[.space_indent][ln] = true |
| 23 | } |
| 24 | fl[.trailing_space][pos.line_nr] = true |
| 25 | fl[.space_indent][pos.last_line] = true |
| 26 | } |
| 27 | |