mirror of
https://github.com/vlang/v.git
synced 2025-09-24 04:48:28 -04:00
This commit is contained in:
parent
be31491834
commit
000b4169d6
2
vlib/v/fmt/tests/.gitattributes
vendored
Normal file
2
vlib/v/fmt/tests/.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*_crlf_* binary
|
||||
*_lf_* binary
|
12
vlib/v/fmt/tests/vfmt_off_vfmt_on_with_crlf_expected.vv
Normal file
12
vlib/v/fmt/tests/vfmt_off_vfmt_on_with_crlf_expected.vv
Normal file
@ -0,0 +1,12 @@
|
||||
module main
|
||||
|
||||
fn main() {
|
||||
// vfmt off
|
||||
a := [
|
||||
1, 2, 3,
|
||||
4, 5, 6,
|
||||
]
|
||||
// vfmt on
|
||||
|
||||
println('Hello World!')
|
||||
}
|
12
vlib/v/fmt/tests/vfmt_off_vfmt_on_with_crlf_input.vv
Normal file
12
vlib/v/fmt/tests/vfmt_off_vfmt_on_with_crlf_input.vv
Normal file
@ -0,0 +1,12 @@
|
||||
module main
|
||||
|
||||
fn main() {
|
||||
// vfmt off
|
||||
a := [
|
||||
1, 2, 3,
|
||||
4, 5, 6,
|
||||
]
|
||||
// vfmt on
|
||||
|
||||
println('Hello World!')
|
||||
}
|
@ -1068,11 +1068,11 @@ pub fn (mut s Scanner) text_scan() token.Token {
|
||||
mut comment_line_end := s.pos
|
||||
if s.text[s.pos - 1] == b_cr {
|
||||
comment_line_end--
|
||||
} else {
|
||||
// fix line_nr, \n was read; the comment is marked on the next line
|
||||
s.pos--
|
||||
s.line_nr--
|
||||
}
|
||||
// fix line_nr, \n was read; the comment is marked on the next line
|
||||
s.pos--
|
||||
s.line_nr--
|
||||
if s.should_parse_comment() {
|
||||
s.line_comment = s.text[start + 1..comment_line_end]
|
||||
mut comment := s.line_comment
|
||||
|
Loading…
x
Reference in New Issue
Block a user