Add char nul (#13241)

# Description

Adds `char nul`, `char null_byte` and `char zero_byte` named characters.
All of them generate 0x00 byte.

# User-Facing Changes
Three new named characters are added:
 * `char nul` - generates 0x00 byte
 * `char null_byte` - generates 0x00 byte
 * `char zero_byte` - generates 0x00 byte
This commit is contained in:
Bruce Weirdan 2024-06-27 01:49:44 +02:00 committed by GitHub
parent ee74ec7423
commit 46ed69ab12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,6 +19,9 @@ static CHAR_MAP: Lazy<IndexMap<&'static str, String>> = Lazy::new(|| {
// These are some regular characters that either can't be used or
// it's just easier to use them like this.
"nul" => '\x00'.to_string(), // nul character, 0x00
"null_byte" => '\x00'.to_string(), // nul character, 0x00
"zero_byte" => '\x00'.to_string(), // nul character, 0x00
// This are the "normal" characters section
"newline" => '\n'.to_string(),
"enter" => '\n'.to_string(),