compiler/stage2_l0/src/string_escape.l0

Module string_escape

Overview Symbols grouped by source file: compiler/stage2_l0/src/string_escape.l0

Module: string_escape

Source: compiler/stage2_l0/src/string_escape.l0 Language: Dea/L0

Imports / Includes

  • std.text
  • std.string

Symbols

Function se_append_octal_digit

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

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

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

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

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.