Skip to content

Latest commit

 

History

History
59 lines (48 loc) · 3.52 KB

README.old.md

File metadata and controls

59 lines (48 loc) · 3.52 KB

Trees

Similar to https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/syntax.md#design-goals

  • MathLayout: Green nodes, simply represent the formula's structure like { type: "frac", values: [top, bottom] }. Are immutable, and are built from the bottom up. Could be renamed to MathStructure.
    • Categories of nodes include: rows, containers, tables, symbols, text, errors
  • MathLayoutZipper: Red nodes around it, a wrapper datastructure that keeps track of the parent nodes as you walk down the tree.
    • Also has editing utilities that create a new tree, which try to reuse as many of the green nodes as possible. As an implementation details, this is created lazily/on-demand. This means that they only incur an overhead when you actually use them.
  • MathAst: An actually parsed representation of the formula, which tries to assign a meaning to each symbol. Like tagging digits as numbers, or taking |x| and deciding that it's the absolute value of x.

Sources:

Structure

  • Display: display on screen, keeps references to the layout ranges for editing
  • Semantics: computed/parsed, keeps references to the layout ranges
  • Layout: core, for editing, user-input
  • Cosmetics: like colors or text annotations

Type Theory

References