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

scanner: : str inter fix

This commit is contained in:
Alexander Medvednikov 2022-10-27 11:08:32 +03:00
parent 18c7da9a5e
commit 604f19adba

View File

@ -1240,7 +1240,7 @@ fn (mut s Scanner) ident_string() string {
// No } in this string, so it's not a valid `{x}` interpolation
break
}
if s.text[i] in [`=`, `\n`, s.inter_quote] {
if s.text[i] in [`=`, `:`, `\n`, s.inter_quote] {
// We reached the end of the line or string without reaching "}".
// Also if there's "=", there's no way it's a valid interpolation expression:
// e.g. `println("{a.b = 42}")`