Skip to content

Commit 5f39ad7

Browse files
committed
add Expr::value
1 parent 66bed65 commit 5f39ad7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ast/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,13 @@ pub enum Expr {
10361036
Lambda(LambdaFunction),
10371037
}
10381038

1039+
impl Expr {
1040+
/// Creates a new [`Expr::Value`]
1041+
pub fn value(value: impl Into<ValueWithSpan>) -> Self {
1042+
Expr::Value(value.into())
1043+
}
1044+
}
1045+
10391046
/// The contents inside the `[` and `]` in a subscript expression.
10401047
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
10411048
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]

0 commit comments

Comments
 (0)