File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -361,9 +361,11 @@ static bool scan_string_literal(TSLexer *lexer) {
361361 // both of them
362362 if (lexer -> lookahead == opening_quote ) {
363363 advance (lexer );
364- // It was just one quote, so we've successfully reached the
365- // end of the literal
366- if (lexer -> lookahead != opening_quote ) {
364+ // It was just one quote, so we've successfully reached
365+ // the end of the literal. We also need to check that an
366+ // escaped quote isn't split in half by a line
367+ // continuation -- people do this!
368+ if (skip_literal_continuation_sequence (lexer ) && lexer -> lookahead != opening_quote ) {
367369 return true;
368370 }
369371 }
Original file line number Diff line number Diff line change @@ -200,6 +200,10 @@ program test
200200 print*, "12&bar"
201201 print*, "&
202202 &hello"
203+ print*, "this is "&
204+ &"one string"
205+ print*, "this is "&
206+ & // "two strings"
203207end program
204208
205209--------------------------------------------------------------------------------
@@ -216,6 +220,16 @@ end program
216220 (format_identifier)
217221 (output_item_list
218222 (string_literal)))
223+ (print_statement
224+ (format_identifier)
225+ (output_item_list
226+ (string_literal)))
227+ (print_statement
228+ (format_identifier)
229+ (output_item_list
230+ (concatenation_expression
231+ (string_literal)
232+ (string_literal))))
219233 (end_program_statement)))
220234
221235================================================================================
You can’t perform that action at this time.
0 commit comments