Skip to main content

Module ast

Module ast 

Source
Expand description

The abstract syntax tree: the typed shape a .vrf source parses into.

Everything here is zero-copy over the source &str (atoms/names borrow their slices) and every node that can be pointed at in an error carries its Span via Located.

Structs§

Atom
An atom is the triple (subject, predicate, object?) — the unit of identity — optionally qualified by a domain (physics.engine has fuel). Creature_A has flying and Creature_A has swimming are DIFFERENT atoms.
Literal
A literal is an atom, optionally negated (NOT ...).
Located
Container for data associated with its source location.
Program
A parsed program: a flat sequence of statements.

Enums§

Body
The body of an PREMISE or RULE.
Conn
How the literals in a WHEN/THEN group combine. A single-literal group is always Conn::And (the connective is irrelevant with one literal).
ListOp
List constraint operators (body of a list-style PREMISE).
Statement
A top-level statement.

Type Aliases§

Span
Source code fragment with line and column tracking.