aboutsummaryrefslogtreecommitdiff
path: root/src/ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.rs')
-rw-r--r--src/ast.rs17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/ast.rs b/src/ast.rs
index 07b5c39..96fe8ab 100644
--- a/src/ast.rs
+++ b/src/ast.rs
@@ -59,6 +59,7 @@ pub enum Statement {
59#[derive(Debug, Eq, PartialEq, Clone)] 59#[derive(Debug, Eq, PartialEq, Clone)]
60pub enum Expr { 60pub enum Expr {
61 Node, 61 Node,
62 FieldAccess(Vec<Identifier>),
62 Unit, 63 Unit,
63 Lit(Literal), 64 Lit(Literal),
64 Ident(Identifier), 65 Ident(Identifier),
@@ -71,22 +72,6 @@ pub enum Expr {
71} 72}
72 73
73impl Expr { 74impl Expr {
74 pub fn int(int: i128) -> Expr {
75 Self::Lit(Literal::Int(int))
76 }
77
78 pub fn str(s: &str) -> Expr {
79 Self::Lit(Literal::Str(s.to_owned()))
80 }
81
82 pub const fn false_() -> Expr {
83 Self::Lit(Literal::Bool(false))
84 }
85
86 pub const fn true_() -> Expr {
87 Self::Lit(Literal::Bool(true))
88 }
89
90 pub fn boxed(self) -> Box<Expr> { 75 pub fn boxed(self) -> Box<Expr> {
91 Box::new(self) 76 Box::new(self)
92 } 77 }