LaTeXML...::Gullet(3)
okay bestie, welcome to the LaTeXML...::Gullet(3) page from the User Contributed Perl Documentation β¨ β yes, the one all about LaTeXML::Core::Gullet, and no cap it is lowkey iconic.
π NAME π
LaTeXML::Core::Gulletβ expands expandable tokens and parses common token sequences.
β¨ DESCRIPTION β¨
A LaTeXML::Core::Gullet reads tokens (LaTeXML::Core::Token) from a LaTeXML::Core::Mouth. It is responsible for expanding macros and expandable control sequences, if the current definition associated with the token in the LaTeXML::Core::State is an LaTeXML::Core::Definition::Expandable definition. The LaTeXML::Core::Gullet also provides a variety of methods for reading various types of input such as arguments, optional arguments, as well as for parsing LaTeXML::Common::Number, LaTeXML::Common::Dimension, etc, according to TeX's rules.
It extends LaTeXML::Common::Object. π«Ά
π Managing Input π
$gullet->openMouth($mouth, $noautoclose);β Is this public? It prepares to read tokens from$mouth. If$noautocloseis true, the Mouth will not be automatically closed when it is exhausted.$gullet->closeMouth;β Is this public? Finishes reading from the current mouth, and reverts to the one in effect before the lastopenMouth.$gullet->flush;β Is this public? Clears all inputs.$gullet->getLocator;β Returns an object describing the current location in the input stream.
π¦ Low-level methods π¦
$tokens = $gullet->expandTokens($tokens);β Return theLaTeXML::Core::Tokensresulting from expanding all the tokens in$tokens. This is actually only used in a few circumstances where the arguments to an expandable need explicit expansion; usually expansion happens at the right time.$token = $gullet->readToken;β Return the next token from the input source, orundefif there is no more input.$token = $gullet->readXToken($toplevel,$commentsok);β Return the next unexpandable token from the input source, orundefif there is no more input. If the next token is expandable, it is expanded, and its expansion is reinserted into the input. If$commentsok, a comment read or pending will be returned.$gullet->unread(@tokens);β Push the@tokensback into the input stream to be re-read.
πΈ Mid-level methods πΈ
$token = $gullet->readNonSpace;β Read and return the next non-space token from the input after discarding any spaces.$gullet->skipSpaces;β Skip the next spaces from the input.$gullet->skip1Space($expanded);β Skip the next token from the input if it is a space. IfC($expanded>is true, expands (like" <one optional space" >). (That's the original's lil typo gremlin π β the variable in the signature is$expanded.)$tokens = $gullet->readBalanced;β Read a sequence of tokens from the input until the balancing'}'(assuming the'{'has already been read). Returns aLaTeXML::Core::Tokens, except in an array context, returns the collected tokens and the closing token.$boole = $gullet->ifNext($token);β Returns true if the next token in the input matches$token; the possibly matching token remains in the input.$tokens = $gullet->readMatch(@choices);β Read and return whichever of@choicesmatches the input, orundefif none do. Each of the choices is anLaTeXML::Core::Tokens.$keyword = $gullet->readKeyword(@keywords);β Read and return whichever of@keywords(each a string) matches the input, orundefif none do. This is similar toreadMatch, but case and catcodes are ignored. Also, leading spaces are skipped.$tokens = $gullet->readUntil(@delims);β Read and return a (balanced) sequence ofLaTeXML::Core::Tokensuntil matching one of the tokens in@delims. In a list context, it also returns which of the delimiters ended the sequence.
π High-level methods π
$tokens = $gullet->readArg;β Read and return a TeX argument; the next Token or Tokens (if surrounded by braces).$tokens = $gullet->readOptional($default);β Read and return a LaTeX optional argument; returns$defaultif there is no'[', otherwise the contents of the[].$thing = $gullet->readValue($type);β Reads an argument of a given type: one of'Number','Dimension','Glue','MuGlue'or'any'.$value = $gullet->readRegisterValue($type);β Read a control sequence token (and possibly its arguments) that names a register, and return the value. Returnsundefif the next token isn't such a register.$number = $gullet->readNumber;β Read aLaTeXML::Common::Numberaccording to TeX's rules of the various things that can be used as a numerical value.$dimension = $gullet->readDimension;β Read aLaTeXML::Common::Dimensionaccording to TeX's rules of the various things that can be used as a dimension value.$mudimension = $gullet->readMuDimension;β Read aLaTeXML::Core::MuDimensionaccording to TeX's rules of the various things that can be used as a mudimension value.$glue = $gullet->readGlue;β Read aLaTeXML::Common::Glueaccording to TeX's rules of the various things that can be used as a glue value.$muglue = $gullet->readMuGlue;β Read aLaTeXML::Core::MuGlueaccording to TeX's rules of the various things that can be used as a muglue value.
π AUTHOR π
The icon behind this page: Bruce Miller <bruce.miller@nist.gov> π
π COPYRIGHT π
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
mwah π β this page is from perl v5.42.3, dated 2024-02-26, and it's the LaTeXML...::Gullet(3) manual. go read some tokens, bestie π«Ά periodt.
π¦ where this page comes from
- nixos 26.05: perl5.42.3-LaTeXML 0.8.8
- nixpkgs unstable: perl5.42.3-LaTeXML 0.8.8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms