string_escape.l0
Module: string_escape
Source: compiler/stage2_l0/src/string_escape.l0 Language: Dea/L0
Imports / Includes
std.textstd.string
Symbols
- se_append_octal_digit
- se_append_octal_escape
- se_is_direct_c_byte
- se_is_trigraph_suffix
- se_encode_c_string_bytes
Function se_append_octal_digit
1
func se_append_octal_digit(cb: CharBuffer*, digit: int)
Append one octal digit in the range 0..7 .
Parameters:
cb: Character buffer to extend.digit: Octal digit value.
Function se_append_octal_escape
1
func se_append_octal_escape(cb: CharBuffer*, b: byte)
Append a byte using a fixed-width C octal escape.
Parameters:
cb: Character buffer to extend.b: Byte value to encode.
Function se_is_direct_c_byte
1
func se_is_direct_c_byte(b: byte) -> bool
Return whether a byte is printable ASCII that can be emitted directly in a C string.
Parameters:
b: Byte to inspect.
Returns: true for safe direct emission.
Function se_is_trigraph_suffix
1
func se_is_trigraph_suffix(b: byte) -> bool
Return whether a byte can complete a historical C trigraph spelling.
Parameters:
b: Byte to inspect.
Returns: true for the nine trigraph suffix bytes.
Function se_encode_c_string_bytes
1
func se_encode_c_string_bytes(data: string) -> string
Encode decoded string bytes for inclusion in a C string literal body.
Parameters:
data: Decoded byte string.
Returns: Escaped bytes suitable for inclusion between double quotes in C.