Skip to main content

Module mouth

Module mouth 

Source
Expand description

The mouth is a thin interface over a file, responsible for reading characters and associating them with catcodes

Structs§

Mouth
MouthOptions

Enums§

FoodType

Constants§

BIB_DATA_LITERALS
The characters a Mouth::with_bib_data_literals mouth reads as data: % & #, which BibTeX’s lexer hands back as ordinary characters (OXIDIZED_DESIGN #74), and @, which the entry scaffold’s handler names (\csname bib@field@…\endcsname) carry. A document’s active @ (1810.11524’s amsrefs list reads @book{…} records through it) re-entered \bib from inside the scaffold without end; Perl, reading the scaffold under the live catcodes (BibTeX.pool.ltxml:166), errs 24 times.

Functions§

byte_mouth_pending_tail
Byte offset in s where a trailing INCOMPLETE UTF-8 sequence in the byte spelling begins (s.len() when there is none). The text-run merge in Document::open_text_internal re-decodes only from there: the bytes of one character arrive one token at a time (tex.web §1034: one char node per byte), so a run is complete only once its last continuation byte is on, and everything before the pending lead byte is already decoded (or invalid and final). Invariant relied on: a decoded character in U+00C2..U+00F4 (é, Ã) is never followed by raw continuation bytes without their own lead — well-formed input never produces that shape, so the one preceding character this looks back at is only ever re-merged when it IS the pending lead byte.
decode_byte_mouth_runs
Decode raw input bytes as text when no encoding has been declared: valid UTF-8 is taken as-is, anything else is a Latin-1 passthrough (byte → char).
decode_input_bytes
text_symbol_char
The single character \<current encoding><cs> typesets, if it is a \DeclareTextSymbol glyph (a primitive with a one-character string body).
tokenize
Tokenize a string under the standard catcode table — Perl Package.pm:Tokenize L1019-1023.
tokenize_bib_literal
Tokenize a string under the standard catcode table, reading % & # as ordinary characters rather than comment, alignment tab and parameter.
tokenize_internal
Tokenize a string under the style-file catcode table — Perl Package.pm:TokenizeInternal L1026-1030.
utf8_c1_catcode_key
The value marking a C1 character (U+0080-U+009F) whose catcode TeX code assigned under [utf8] (\catcode’s setter, tex_character.rs), so a byte of a byte-decoded line stays that active character (OD #481’s addendum).
utf8_undeclared_error_key
The value holding utf8.def’s undeclared-character error installed for ch (utf8_def.rs), which only that definition matches.