RustQ.Rust.AST (rustq v0.6.0)

Copy Markdown View Source

Small Rust AST/IR used by macro frontends before final RustQ validation.

This is intentionally much smaller than Rust's full grammar. It captures the Rust-shaped nodes that RustQ.Meta.defrust/2 can produce from valid Elixir AST, then renders them only at the final fragment-validation boundary.

Summary

Types

pat()

@type pat() ::
  RustQ.Rust.AST.PatVar.t()
  | RustQ.Rust.AST.PatWildcard.t()
  | RustQ.Rust.AST.PatPath.t()
  | RustQ.Rust.AST.PatLiteral.t()
  | RustQ.Rust.AST.PatNone.t()
  | RustQ.Rust.AST.PatSome.t()
  | RustQ.Rust.AST.PatAtomGuard.t()
  | RustQ.Rust.AST.PatTuple.t()
  | RustQ.Rust.AST.PatOk.t()
  | RustQ.Rust.AST.PatErr.t()
  | RustQ.Rust.AST.PatPathTuple.t()
  | RustQ.Rust.AST.PatStruct.t()

stmt()

@type stmt() ::
  RustQ.Rust.AST.Let.t()
  | RustQ.Rust.AST.LetElse.t()
  | RustQ.Rust.AST.Assign.t()
  | RustQ.Rust.AST.ExprStmt.t()
  | RustQ.Rust.AST.Return.t()
  | RustQ.Rust.AST.EarlyReturn.t()
  | RustQ.Rust.AST.IfLet.t()
  | RustQ.Rust.AST.For.t()

type()

@type type() ::
  RustQ.Rust.AST.TypePath.t()
  | RustQ.Rust.AST.TypeRef.t()
  | RustQ.Rust.AST.TypeOption.t()
  | RustQ.Rust.AST.TypeResult.t()
  | RustQ.Rust.AST.TypeNifResult.t()
  | RustQ.Rust.AST.TypeVec.t()
  | RustQ.Rust.AST.TypeUnit.t()

vis()

@type vis() :: :pub | :crate | nil

Functions

expr_node?(term)

pat_node?(term)

type_node?(term)