ptrn => body, ctor ptrn => body, or index [ptrn] => body of a MatchExpr. More...
#include <mim/ast/ast.h>
Public Member Functions | |
| Arm (Loc loc, std::optional< nat_t > index, Dbg ctor, Ptr< Ptrn > ptrn, Ptr< Expr > body) | |
| const Ptrn * | ptrn () const |
| const Expr * | body () const |
| std::optional< nat_t > | index () const |
| The case this arm selects by literal index, as in 1 (h, t). | |
| Dbg | ctor () const |
| The constructor in Cons (h, t); a bare Nil is an unannotated IdPtrn instead. | |
| virtual void | bind (Scopes &) const |
| Lam * | emit (Emitter &, const Def *dom=nullptr) const |
dom is the case's payload type if the scrutinee is a Variant; otherwise ptrn() determines the domain. | |
| void | stream (fe::Tab &, std::ostream &) const override |
| Public Member Functions inherited from mim::ast::Node | |
| Loc | loc () const |
| void | dump () const |
Additional Inherited Members | |
| Protected Member Functions inherited from mim::ast::Node | |
| Node (Loc loc) | |
|
inline |
Definition at line 694 of file ast.h.
References body(), ctor(), index(), mim::ast::Node::loc(), mim::ast::Node::Node(), and ptrn().
|
virtual |
Definition at line 269 of file bind.cpp.
References mim::ast::Expr::bind(), mim::ast::Ptrn::bind(), body(), and ptrn().
Referenced by mim::ast::MatchExpr::bind().
|
inline |
|
inline |
The constructor in Cons (h, t); a bare Nil is an unannotated IdPtrn instead.
Definition at line 706 of file ast.h.
Referenced by Arm(), and mim::ast::MatchExpr::emit_().
dom is the case's payload type if the scrutinee is a Variant; otherwise ptrn() determines the domain.
Definition at line 644 of file emit.cpp.
References mim::Check::alpha(), body(), emit(), mim::ast::Ptrn::emit_type(), mim::ast::Ptrn::emit_value(), mim::ast::Node::loc(), ptrn(), and mim::Def::set().
Referenced by emit(), and mim::ast::MatchExpr::emit_().
|
inline |
The case this arm selects by literal index, as in 1 (h, t).
Definition at line 704 of file ast.h.
Referenced by Arm(), mim::ast::MatchExpr::emit_(), and stream().
|
inline |
|
overridevirtual |
Implements mim::ast::Node.
Definition at line 173 of file stream.cpp.
References body(), index(), ptrn(), and mim::ast::S::S().