---
title: "latex-parse-stage0 — 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/stage0.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/stage0.groupant/>

# latex-parse-stage0

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:** top parses a table; one row/one cell unwraps, otherwise any row with>1 cells yields Aligned, else Gathered. table removes exactly one trailing row consisting of one empty cell. list increments depth and rejects>400 before processing; Close succeeds only for Brace/TableBrace, & only for table-enabled stop. script parses its argument before checking existing sub/sup slot. (bytes 8102–22977)
- **part of:** [latex-parse](https://md.groupants.elamur.ai/free/en/mova/latex/src/parse.rs.groupant/)
- **repository folder:** [`latex/src/parse.rs.groupant/stage0.groupant`](https://github.com/ElamurAI/mova-free/tree/main/latex/src/parse.rs.groupant/stage0.groupant)
- **repository commit:** `855da7bd4a7b`

> **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) |
| `stop_failure_order` | stop_failure_order | partial source derived model | [stop_failure_order](#stop-failure-order) |
| `script_attachment` | script_attachment | partial source derived model | [script_attachment](#script-attachment) |

## Model text


### descriptant

#### latex-parse-stage0

top parses a table; one row/one cell unwraps, otherwise any row with>1 cells yields Aligned, else Gathered. table removes exactly one trailing row consisting of one empty cell. list increments depth and rejects>400 before processing; Close succeeds only for Brace/TableBrace, & only for table-enabled stop. script parses its argument before checking existing sub/sup slot.

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

top parses a table; one row/one cell unwraps, otherwise any row with>1 cells yields Aligned, else Gathered. table removes exactly one trailing row consisting of one empty cell. list increments depth and rejects>400 before processing; Close succeeds only for Brace/TableBrace, & only for table-enabled stop. script parses its argument before checking existing sub/sup slot.

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

### invariant

#### Scoped invariants

Unmatched Close cannot be silently ignored. A duplicate superscript with missing argument reports MissingArg before DoubleSup. Rows with multiple empty cells are not removed by the trailing-empty rule. Decimal dot merges only once and only when followed by a digit.

End under Marker terminates; otherwise it is pushed back and mapped through eof(stop), e.g Brace->UnclosedGroup, Right->MissingRight. Explicit Close under Right yields ExtraClose rather than MissingRight.

Without a prior atom, script base is Group(empty()). Existing Scripts receives the missing slot; duplicate slot errors after argument parsing. Prime runs saturate u8 at255, so counts>=255 lose multiplicity.

### composition

#### Scoped interaction

Table/argument routines feed stage1 macro checks and stage2 command dispatch, then normalize atom vectors using ast::norm. This scope also converts Unicode font letters and handles environment arguments before body parsing.

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

Unmatched Close cannot be silently ignored. A duplicate superscript with missing argument reports MissingArg before DoubleSup. Rows with multiple empty cells are not removed by the trailing-empty rule. Decimal dot merges only once and only when followed by a digit.

### reverse_reconstruction

Top output Char(x) can come from one-cell token sequences with discarded whitespace/presentation commands. Env rows lose at most one trailing empty row separator; extra separators can encode retained empty rows. Num('12') preimages include macro substitution digits as well as literal12, but a Space between digits prevents merging.

### stop_failure_order

End under Marker terminates; otherwise it is pushed back and mapped through eof(stop), e.g Brace->UnclosedGroup, Right->MissingRight. Explicit Close under Right yields ExtraClose rather than MissingRight.

### script_attachment

Without a prior atom, script base is Group(empty()). Existing Scripts receives the missing slot; duplicate slot errors after argument parsing. Prime runs saturate u8 at255, so counts>=255 lose multiplicity.

### 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.
