scanner: fix warning for \" after string interpolation (#8510)

pull/8519/head
Lukas Neubert 2021-02-02 13:14:06 +01:00 committed by GitHub
parent 1de299ad22
commit 58b37519e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -609,7 +609,7 @@ fn (mut s Scanner) text_scan() token.Token {
// end of `$expr` // end of `$expr`
// allow `'$a.b'` and `'$a.c()'` // allow `'$a.b'` and `'$a.c()'`
if s.is_inter_start && next_char == `\\` if s.is_inter_start && next_char == `\\`
&& s.look_ahead(2) !in [`x`, `n`, `r`, `\\`, `t`, `e`] { && s.look_ahead(2) !in [`x`, `n`, `r`, `\\`, `t`, `e`, `"`] {
s.warn('unknown escape sequence \\${s.look_ahead(2)}') s.warn('unknown escape sequence \\${s.look_ahead(2)}')
} }
if s.is_inter_start && next_char == `(` { if s.is_inter_start && next_char == `(` {