File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -486,6 +486,9 @@ fn (mut s Scanner) extract_multiline_string() !string {
486
486
c := u8 (s.at ())
487
487
util.printdbg (@MOD + '.' + @STRUCT + '.' + @FN, 'c: `${c.ascii_str()} ` / ${c} (quote type: ${quote} /${quote.ascii_str()} )' )
488
488
489
+ if c == `\r ` {
490
+ continue
491
+ }
489
492
if c == `\n ` {
490
493
s.inc_line_number ()
491
494
lit + = c.ascii_str ()
Original file line number Diff line number Diff line change @@ -80,3 +80,16 @@ fn test_reset() {
80
80
s.reset ()
81
81
assert s.next () == `a`
82
82
}
83
+
84
+ const multiline_string_input = input.Config{
85
+ text: '"""abc\r\n def\n 123"""'
86
+ }
87
+
88
+ fn test_multiline_string () {
89
+ mut s := scanner.new_scanner (input: multiline_string_input) or { panic (err) }
90
+ tok := s.scan ()!
91
+ assert tok.kind == .quoted
92
+ assert tok.lit.contains ('abc' )
93
+ assert tok.lit.contains ('def' )
94
+ assert tok.lit.contains ('123' )
95
+ }
You can’t perform that action at this time.
0 commit comments