Sign in

    dowdiness/js_engine/ast does not have a README file

    BinOp

    pub(all) enum BinOp {
    Add
    Sub
    Mul
    Div
    Mod
    EqEq
    EqEqEq
    NotEq
    NotEqEq
    Lt
    Gt
    LtEq
    GtEq
    And
    Or
    NullishCoalesce
    BitAnd
    BitOr
    BitXor
    LShift
    RShift
    URShift
    Exp
    In
    Instanceof
    }

    impl Eq for BinOp
    impl Show for BinOp

    ClassMethod

    pub(all) struct ClassMethod {
    key : Expr
    value : Expr
    kind : PropKind
    computed : Bool
    is_static : Bool
    }

    impl Eq for ClassMethod
    impl Show for ClassMethod

    CompoundOp

    pub(all) enum CompoundOp {
    AddAssign
    SubAssign
    MulAssign
    DivAssign
    ModAssign
    ExpAssign
    BitAndAssign
    BitOrAssign
    BitXorAssign
    LShiftAssign
    RShiftAssign
    URShiftAssign
    LogicalAndAssign
    LogicalOrAssign
    NullishAssign
    }

    impl Eq for CompoundOp
    impl Show for CompoundOp

    Expr

    pub(all) enum Expr {
    NumberLit(Double,
    Loc
    )
    StringLit(String,
    Loc
    )
    BoolLit(Bool,
    Loc
    )
    NullLit(
    Loc
    )
    UndefinedLit(
    Loc
    )
    Ident(String,
    Loc
    )
    Binary(BinOp, Expr, Expr,
    Loc
    )
    Unary(UnaryOp, Expr,
    Loc
    )
    Assign(String, Expr,
    Loc
    )
    Call(Expr, Array[Expr],
    Loc
    )
    Member(Expr, String,
    Loc
    )
    Ternary(Expr, Expr, Expr,
    Loc
    )
    FuncExpr(String?, Array[String], Array[Stmt],
    Loc
    )
    FuncExprExt(String?, Array[Param], String?, Array[Stmt],
    Loc
    )
    Grouping(Expr,
    Loc
    )
    ObjectLit(Array[Property],
    Loc
    )
    ArrayLit(Array[Expr],
    Loc
    )
    ComputedMember(Expr, Expr,
    Loc
    )
    MemberAssign(Expr, String, Expr,
    Loc
    )
    ComputedAssign(Expr, Expr, Expr,
    Loc
    )
    NewExpr(Expr, Array[Expr],
    Loc
    )
    ThisExpr(
    Loc
    )
    UpdateExpr(UpdateOp, Expr, Bool,
    Loc
    )
    CompoundAssign(CompoundOp, Expr, Expr,
    Loc
    )
    Comma(Expr, Expr,
    Loc
    )
    TemplateLit(Array[String], Array[Expr],
    Loc
    )
    ArrowFunc(Array[String], Array[Stmt],
    Loc
    )
    ArrowFuncExt(Array[Param], String?, Array[Stmt],
    Loc
    )
    SpreadExpr(Expr,
    Loc
    )
    RegexLit(String, String,
    Loc
    )
    DestructureAssign(Pattern, Expr,
    Loc
    )
    OptionalMember(Expr, String,
    Loc
    )
    OptionalComputedMember(Expr, Expr,
    Loc
    )
    OptionalCall(Expr, Array[Expr],
    Loc
    )
    ClassExpr(String?, Expr?, Array[ClassMethod],
    Loc
    )
    SuperCall(Array[Expr],
    Loc
    )
    SuperMember(String,
    Loc
    )
    SuperComputedMember(Expr,
    Loc
    )
    NewTargetExpr(
    Loc
    )
    TaggedTemplate(Expr, Array[String], Array[Expr],
    Loc
    )
    }

    impl Eq for Expr
    impl Show for Expr

    Param

    pub(all) struct Param {
    name : String
    default_val : Expr?
    pattern : Pattern?
    }

    impl Eq for Param
    impl Show for Param

    Pattern

    pub(all) enum Pattern {
    IdentPat(String)
    ArrayPat(Array[Pattern?], Pattern?)
    ObjectPat(Array[PropPat], Pattern?)
    }

    impl Eq for Pattern
    impl Show for Pattern

    Program

    pub(all) struct Program {
    stmts : Array[Stmt]
    }

    impl Eq for Program
    impl Show for Program

    PropKind

    pub(all) enum PropKind {
    Init
    Get
    Set
    Spread
    }

    impl Eq for PropKind
    impl Show for PropKind

    PropPat

    pub(all) struct PropPat {
    key : String
    value : Pattern
    default_val : Expr?
    }

    impl Eq for PropPat
    impl Show for PropPat

    Property

    pub(all) struct Property {
    key : Expr
    value : Expr
    kind : PropKind
    computed : Bool
    }

    impl Eq for Property
    impl Show for Property

    Stmt

    pub(all) enum Stmt {
    ExprStmt(Expr,
    Loc
    )
    VarDecl(VarKind, String, Expr?,
    Loc
    )
    Block(Array[Stmt],
    Loc
    )
    StmtList(Array[Stmt],
    Loc
    )
    IfStmt(Expr, Stmt, Stmt?,
    Loc
    )
    WhileStmt(Expr, Stmt,
    Loc
    )
    ForStmt(Stmt?, Expr?, Expr?, Stmt,
    Loc
    )
    FuncDecl(String, Array[String], Array[Stmt],
    Loc
    )
    FuncDeclExt(String, Array[Param], String?, Array[Stmt],
    Loc
    )
    ReturnStmt(Expr?,
    Loc
    )
    BreakStmt(String?,
    Loc
    )
    ContinueStmt(String?,
    Loc
    )
    ThrowStmt(Expr,
    Loc
    )
    TryCatchStmt(Array[Stmt], String?, Array[Stmt]?, Array[Stmt]?,
    Loc
    )
    SwitchStmt(Expr, Array[SwitchCase],
    Loc
    )
    DoWhileStmt(Stmt, Expr,
    Loc
    )
    ForInStmt(VarKind?, String, Expr, Stmt,
    Loc
    )
    ForOfStmt(VarKind?, String, Expr, Stmt,
    Loc
    )
    ForInStmtPat(VarKind, Pattern, Expr, Stmt,
    Loc
    )
    ForOfStmtPat(VarKind, Pattern, Expr, Stmt,
    Loc
    )
    DestructureDecl(VarKind, Pattern, Expr,
    Loc
    )
    LabeledStmt(String, Stmt,
    Loc
    )
    ClassDecl(String, Expr?, Array[ClassMethod],
    Loc
    )
    }

    impl Eq for Stmt
    impl Show for Stmt

    SwitchCase

    pub(all) struct SwitchCase {
    condition : Expr?
    body : Array[Stmt]
    }

    impl Eq for SwitchCase
    impl Show for SwitchCase

    UnaryOp

    pub(all) enum UnaryOp {
    Neg
    Pos
    Not
    Typeof
    Void
    Delete
    BitNot
    }

    impl Eq for UnaryOp
    impl Show for UnaryOp

    UpdateOp

    pub(all) enum UpdateOp {
    Increment
    Decrement
    }

    impl Eq for UpdateOp
    impl Show for UpdateOp

    VarKind

    pub(all) enum VarKind {
    LetKind
    ConstKind
    VarKind
    }

    impl Eq for VarKind
    impl Show for VarKind

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io