mirror of
https://github.com/vlang/v.git
synced 2025-09-16 16:02:29 +03:00
toml: check for illegal characters, fix all related skipped tests (#12270)
This commit is contained in:
parent
eb364f0301
commit
8273c0582b
3 changed files with 31 additions and 24 deletions
|
@ -8,6 +8,19 @@ pub fn is_key_char(c byte) bool {
|
|||
return (c >= `a` && c <= `z`) || (c >= `A` && c <= `Z`) // || c == `_` || c == `-` <- these are identified when tokenizing
|
||||
}
|
||||
|
||||
// is_ascii_control_character returns true if `byte_char` is an ASCII control character.
|
||||
[inline]
|
||||
pub fn is_ascii_control_character(byte_char byte) bool {
|
||||
return (byte_char >= 0 && byte_char <= 0x1f) || byte_char == 0x7f
|
||||
}
|
||||
|
||||
// is_illegal_ascii_control_character returns true if a `byte_char` ASCII control character
|
||||
// is considered "illegal" in TOML .
|
||||
[inline]
|
||||
pub fn is_illegal_ascii_control_character(byte_char byte) bool {
|
||||
return byte_char != 0x09 && is_ascii_control_character(byte_char)
|
||||
}
|
||||
|
||||
[if trace_toml ?]
|
||||
pub fn printdbg(id string, message string) {
|
||||
eprintln(id + ' ' + message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue