File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -486,6 +486,9 @@ fn (mut s Scanner) extract_multiline_string() !string {
486486 c := u8 (s.at ())
487487 util.printdbg (@MOD + '.' + @STRUCT + '.' + @FN, 'c: `${c.ascii_str()} ` / ${c} (quote type: ${quote} /${quote.ascii_str()} )' )
488488
489+ if c == `\r ` {
490+ continue
491+ }
489492 if c == `\n ` {
490493 s.inc_line_number ()
491494 lit + = c.ascii_str ()
Original file line number Diff line number Diff line change @@ -80,3 +80,16 @@ fn test_reset() {
8080 s.reset ()
8181 assert s.next () == `a`
8282}
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