pub enum Expr {
Literal(Lit),
Ident(String),
IdentFnSubCall(FullIdent),
PrefixOp {
op: TokenKind,
expr: Box<Expr>,
},
InfixOp {
op: TokenKind,
lhs: Box<Expr>,
rhs: Box<Expr>,
},
New(String),
FnApplication {
callee: Box<Expr>,
args: Vec<Option<Expr>>,
},
WithScoped,
MemberExpression {
base: Box<Expr>,
property: String,
},
}Variants§
Literal(Lit)
Ident(String)
IdentFnSubCall(FullIdent)
An identifier, identifier with array access, sub or function call This grammar is ambiguous, so will need to be resolved at runtime TODO we can probably make a different type for
- Ident without array access or SubCall without args
- Ident with array access or FnCall with args or
- FnCall without args
- SubCall with args
PrefixOp
InfixOp
New(String)
FnApplication
WithScoped
MemberExpression
Implementations§
Source§impl Expr
impl Expr
pub fn ident2(name: impl Into<String>) -> Self
pub fn ident(name: impl Into<String>) -> Self
pub fn int(i: isize) -> Self
pub fn int_str(i: impl Into<String>) -> Self
pub fn bool(b: bool) -> Self
pub fn str(s: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
pub fn member(base: Expr, property: impl Into<String>) -> Self
pub fn fn_application(callee: Expr, args: Vec<Expr>) -> Self
Trait Implementations§
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more