Skip to main content

luaur_ast/records/
ast_expr_unary.rs

1use crate::records::ast_expr::AstExpr;
2
3#[repr(C)]
4#[derive(Debug)]
5pub struct AstExprUnary {
6    pub base: AstExpr,
7    pub op: AstExprUnaryOp,
8    pub expr: *mut AstExpr,
9}
10
11#[repr(u32)]
12#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13#[allow(non_camel_case_types)]
14pub enum AstExprUnaryOp {
15    Not,
16    Minus,
17    Len,
18}
19
20impl crate::rtti::AstNodeClass for AstExprUnary {
21    const CLASS_INDEX: i32 = crate::rtti::ast_rtti_index("AstExprUnary");
22}
23
24#[allow(non_upper_case_globals)]
25impl AstExprUnary {
26    pub const Not: AstExprUnaryOp = AstExprUnaryOp::Not;
27    pub const Minus: AstExprUnaryOp = AstExprUnaryOp::Minus;
28    pub const Len: AstExprUnaryOp = AstExprUnaryOp::Len;
29}
30
31pub type AstExprUnary_Op = AstExprUnaryOp;