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

scanner: minor cleanup in ident_string() (#18971)

This commit is contained in:
yuyi 2023-07-26 19:52:22 +08:00 committed by GitHub
parent b35ad8a657
commit 125c571d4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1150,7 +1150,7 @@ fn (mut s Scanner) ident_string() string {
col: s.pos - s.last_nl_pos - 1 col: s.pos - s.last_nl_pos - 1
} }
q := s.text[s.pos] q := s.text[s.pos]
is_quote := q == scanner.single_quote || q == scanner.double_quote is_quote := q in [scanner.single_quote, scanner.double_quote]
is_raw := is_quote && s.pos > 0 && s.text[s.pos - 1] == `r` && !s.is_inside_string is_raw := is_quote && s.pos > 0 && s.text[s.pos - 1] == `r` && !s.is_inside_string
is_cstr := is_quote && s.pos > 0 && s.text[s.pos - 1] == `c` && !s.is_inside_string is_cstr := is_quote && s.pos > 0 && s.text[s.pos - 1] == `c` && !s.is_inside_string
// don't interpret quote as "start of string" quote when a string interpolation has // don't interpret quote as "start of string" quote when a string interpolation has