Skip to main content

Module parse

Module parse 

Source
Expand description

Text → syntax tree: the JSX subset a .design file is written in.

Structs§

Attr
Element
File
Import
Pos
A line and column, both from 1.

Enums§

Child
TextPart
Value

Constants§

MAX_DEPTH
How deep elements, arrays and objects may nest in one file: far beyond any real design, and well inside the stack the parser recurses on.
MAX_NUMBER
The largest number a design may write, in either direction: far beyond any real design, and small enough that layout and painting stay finite.

Functions§

in_range
n, written s, if it lies within ±MAX_NUMBER.
number
A number as a design writes one — digits, a - and a . — held to ±MAX_NUMBER: in braces, and inside a string that holds numbers, like a gradient’s angle or a view box.
parse
Parses a whole file, or gives the one problem where it first went wrong.