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

toml: simplify bool keys in scanner and parser (#12625)

This commit is contained in:
Larpon
2021-11-30 13:26:47 +01:00
committed by GitHub
parent 1b691e7612
commit f50f409ad7
2 changed files with 6 additions and 7 deletions

View File

@@ -125,8 +125,7 @@ pub fn (mut s Scanner) scan() ?token.Token {
if util.is_key_char(byte_c) {
key := s.extract_key()
key_lower_case := key.to_lower()
if key_lower_case == 'true' || key_lower_case == 'false' {
if !s.is_left_of_assign && (key == 'true' || key == 'false') {
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'identified a boolean "$key" ($key.len)')
return s.new_token(.boolean, key, key.len)
}