syntax::ast

Module make

source
Expand description

This module contains free-standing functions for creating AST fragments out of smaller pieces.

Note that all functions here intended to be stupid constructors, which just assemble a finish node from immediate children. If you want to do something smarter than that, it belongs to the ext submodule.

Keep in mind that from_text functions should be kept private. The public API should require to assemble every node piecewise. The trick of parse(format!()) we use internally is an implementation detail – long term, it will be replaced with direct tree manipulation.

Modules§

  • While the parent module defines basic atomic “constructors”, the ext module defines shortcuts for common things.

Functions§