1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

scanner: allow \e escape used for ANSI colors (#7177)

This commit is contained in:
Lukas Neubert 2020-12-07 17:21:34 +01:00 committed by GitHub
parent b5982b638a
commit f30faf2627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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