Skip to main content

luaur_ast/records/
ast_expr.rs

1//! Faithful port of Luau `AstExpr : AstNode` (`Ast/include/Luau/Ast.h`).
2//!
3//! The abstract base of every expression node. It adds no fields over `AstNode`
4//! (only the `as_expr` override). `#[repr(C)]` with `base` first keeps the
5//! `AstNode` subobject at offset 0 so the RTTI pointer casts in [`crate::rtti`]
6//! are sound.
7
8use crate::records::ast_node::AstNode;
9
10#[repr(C)]
11#[derive(Debug, Clone)]
12pub struct AstExpr {
13    pub base: AstNode,
14}