diff --git a/cmd/tools/vtest-cleancode.v b/cmd/tools/vtest-cleancode.v index 152060337a..82da52603c 100644 --- a/cmd/tools/vtest-cleancode.v +++ b/cmd/tools/vtest-cleancode.v @@ -11,7 +11,8 @@ const ( vet_folders = [ 'vlib/sqlite', 'vlib/v', - 'vlib/x/ttf/', + 'vlib/x/json2', + 'vlib/x/ttf', 'cmd/v', 'cmd/tools', 'examples/2048', @@ -85,6 +86,7 @@ const ( 'vlib/strings/', 'vlib/time/', 'vlib/vweb/', + 'vlib/x/json2', 'vlib/x/websocket/', ] ) diff --git a/vlib/x/json2/scanner.v b/vlib/x/json2/scanner.v index f8adb70fd3..a04aaa9926 100644 --- a/vlib/x/json2/scanner.v +++ b/vlib/x/json2/scanner.v @@ -151,7 +151,8 @@ fn (mut s Scanner) text_scan() Token { if s.text[s.pos] == `"` { break } else if !s.text[s.pos].is_hex_digit() { - return s.error('`${s.text[s.pos].ascii_str()}` is not a hex digit') + x := s.text[s.pos].ascii_str() + return s.error('`$x` is not a hex digit') } codepoint << s.text[s.pos] } @@ -241,9 +242,11 @@ fn (mut s Scanner) num_scan() Token { // invalid_token returns an error token with the invalid token message. fn (s Scanner) invalid_token() Token { if s.text[s.pos] >= 32 && s.text[s.pos] <= 126 { - return s.error('invalid token `${s.text[s.pos].ascii_str()}`') + x := s.text[s.pos].ascii_str() + return s.error('invalid token `$x`') } else { - return s.error('invalid token ${s.text[s.pos].str_escaped()}') + x := s.text[s.pos].str_escaped() + return s.error('invalid token `$x`') } }