---
title: "latex-parse-stage2 — Mova code model"
description: "Mova code model of latex/src/parse.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/latex/src/parse.rs.groupant/stage2.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/latex/src/parse.rs.groupant/stage2.groupant/>

# latex-parse-stage2

The groupant beside latex/src/parse.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

## Facts

- **kind:** groupant_fragment
- **status:** partial source bound model
- **source:** [`latex/src/parse.rs`](https://github.com/ElamurAI/mova-free/blob/main/latex/src/parse.rs)
- **source SHA-256:** `f463a4a8e13c7702…`
- **covers:** genfrac reads left,right,thickness,style,numerator,denominator before validating delimiter forms. Zero-thickness predicate trims leading0/dots then requires remaining chars ASCII letters; matching parentheses choose binomial, otherwise Atop or frac styles. root collects to literal Cmd(of), parses marked index then body. command first expands nonraw macros, then dispatches Entry; unknown names delegate to stage1. (bytes 27699–42330)
- **part of:** [latex-parse](https://md.groupants.elamur.ai/free/en/mova/latex/src/parse.rs.groupant/)
- **repository folder:** [`latex/src/parse.rs.groupant/stage2.groupant`](https://github.com/ElamurAI/mova-free/tree/main/latex/src/parse.rs.groupant/stage2.groupant)
- **repository commit:** `48f2e6f74146`

> **Implementation material.** A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

## Components

| component | label | where |
|---|---|---|
| **approximant** | partial | [approximant](#approximant) |
| **ast** | partial | `../syntax.json` |
| **composition** | partial | [composition](#composition) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | executed bounded checks | [tests](#tests) |

## Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

| id | type | label | where |
|---|---|---|---|
| `behavior_complement` | behavior_complement | partial source derived model | [behavior_complement](#behavior-complement) |
| `reverse_reconstruction` | reverse_reconstruction | partial source derived model | [reverse_reconstruction](#reverse-reconstruction) |
| `command_erasure` | command_erasure | partial source derived model | [command_erasure](#command-erasure) |
| `unicode_admission` | unicode_admission | partial source derived model | [unicode_admission](#unicode-admission) |

## Model text


### descriptant

#### latex-parse-stage2

genfrac reads left,right,thickness,style,numerator,denominator before validating delimiter forms. Zero-thickness predicate trims leading0/dots then requires remaining chars ASCII letters; matching parentheses choose binomial, otherwise Atop or frac styles. root collects to literal Cmd(of), parses marked index then body. command first expands nonraw macros, then dispatches Entry; unknown names delegate to stage1.

Epoch 2026-10-31: replaced stage topic lists with concrete transitions, exclusions and compatible antecedents. Four meaningful typed views replace the previous six-view bookkeeping catalog. Shared syntax and source byte bounds are unchanged.

### approximant

#### Scoped forward relation

genfrac reads left,right,thickness,style,numerator,denominator before validating delimiter forms. Zero-thickness predicate trims leading0/dots then requires remaining chars ASCII letters; matching parentheses choose binomial, otherwise Atop or frac styles. root collects to literal Cmd(of), parses marked index then body. command first expands nonraw macros, then dispatches Entry; unknown names delegate to stage1.

This is an exact source-derived partial model, not an executable approximate replacement.

### invariant

#### Scoped invariants

Bad genfrac delimiters cannot outrank a prior missing denominator. Unicode escapes for controls or reserved TeX syntax characters cannot yield atoms. Space/Ignore commands yield no atom; Phantom discards its raw argument rather than preserving hidden structure.

Space/Ignore drop token, SpaceArg/IgnoreArg consume raw arg then drop, TextColor drops color and splices content, Eqno consumes until boundary. Their discarded arguments have unconstrained preimages.

Numeric code parsing accepts decimal or x/X hex; successful char must be noncontrol and outside the reserved set. Table lookup/font normalization can map the admitted scalar to a symbol/font node rather than Char.

### composition

#### Scoped interaction

Entry dispatch builds AST values consumed by printers; parser unit tests in this scope witness only selected branches, not full TeX validation.

The manifest binds this stage to the unchanged parent syntax projection and exact source byte range. Parent cost remains an upper accounting context; no independent whole-file invocation or execution count is assigned to this fragment.

### models

### behavior_complement

Bad genfrac delimiters cannot outrank a prior missing denominator. Unicode escapes for controls or reserved TeX syntax characters cannot yield atoms. Space/Ignore commands yield no atom; Phantom discards its raw argument rather than preserving hidden structure.

### reverse_reconstruction

frac12 and frac{1}{2} yield equal fractions. genfrac style outside0/1 falls back to plain, so original style text is lost. Thickness strings accepted by the zero predicate—including letter-only strings—share zero behavior; exact TeX dimension semantics cannot be reconstructed.

### command_erasure

Space/Ignore drop token, SpaceArg/IgnoreArg consume raw arg then drop, TextColor drops color and splices content, Eqno consumes until boundary. Their discarded arguments have unconstrained preimages.

### unicode_admission

Numeric code parsing accepts decimal or x/X hex; successful char must be noncontrol and outside the reserved set. Table lookup/font normalization can map the admitted scalar to a symbol/font node rather than Char.

### tests

#### Evidence — 2026-10-31

parse::tests (7 named tests); integration unbalanced_is_an_error_with_position and macros_newcommand_def_let_declareop

Selected library filters ast:: lex:: macros:: parse:: print:: table:: and integration gate excluding document_extraction_with_preamble_macros and random_token_soup_never_panics_and_roundtrips. Direct rustc --test latex/build.rs exercises private helpers. All selected tests twice debug/release with identical sorted names. Four compiled mutants at build/AST/parser/printer boundaries fail assertions then exact restoration passes. These do not individually cover every source. Build-main failure effects, allocation failures and universal roundtrip are unproved. Strict Clippy reports existing lints. No corpus/live VMM/API/GPU/full-school/held-out tests.
