diff --git a/parser/src/ast/expr.rs b/parser/src/ast/expr.rs index ae6e96b..267da27 100644 --- a/parser/src/ast/expr.rs +++ b/parser/src/ast/expr.rs @@ -71,8 +71,6 @@ pub enum Postfix { StructCall(Vec<(Identifier, Expression)>), Index(Expression), As(TypeExpr), - RangeInclusive, - RangeExclusive, } #[derive(Debug, Clone, Serialize)] @@ -83,8 +81,6 @@ pub enum Prefix { New(Option), Not, Neg, - RangeInclusive, - RangeExclusive, } #[derive(Debug, Clone, Serialize)] diff --git a/parser/src/grammar.pest b/parser/src/grammar.pest index 7add0ea..308cbd6 100644 --- a/parser/src/grammar.pest +++ b/parser/src/grammar.pest @@ -504,9 +504,6 @@ as_px = { "as" ~ type_expr } -range_end_inc_px = { "..=" } -range_end_exc_px = { ".." } - postfix = { field_px | call_px @@ -514,8 +511,6 @@ postfix = { | struct_px | index_px | as_px - | range_end_inc_px - | range_end_exc_px } // ------------------------------------------------------ @@ -528,8 +523,6 @@ ref_px = { "&" } new_px = { "new" ~ generics? } not_px = { "!" } neg_px = { "-" } -range_start_inc_px = { "..=" } -range_start_exc_px = { ".." } prefix = { deref_px @@ -538,8 +531,6 @@ prefix = { | new_px | not_px | neg_px - | range_start_inc_px - | range_start_exc_px } // ------------------------------------------------------ diff --git a/parser/src/parser/common/expr.rs b/parser/src/parser/common/expr.rs index 7de634e..9dbb5c1 100644 --- a/parser/src/parser/common/expr.rs +++ b/parser/src/parser/common/expr.rs @@ -140,8 +140,6 @@ impl<'a> TryFrom> for Prefix { ), Rule::not_px => Self::Not, Rule::neg_px => Self::Neg, - Rule::range_start_inc_px => Self::RangeInclusive, - Rule::range_start_exc_px => Self::RangeExclusive, _ => return AstError::bug_unimplemented(pair), }) @@ -185,9 +183,6 @@ impl<'a> TryFrom> for Postfix { ast_expr!(Postfix::As(inner.next().unwrap().try_into())) } - Rule::range_end_inc_px => Ok(Postfix::RangeInclusive), - Rule::range_end_exc_px => Ok(Postfix::RangeExclusive), - _ => AstError::bug_unimplemented(pair), } } diff --git a/src/codegen.rs b/src/codegen.rs index 33a6b31..ff3e0f1 100644 --- a/src/codegen.rs +++ b/src/codegen.rs @@ -206,8 +206,6 @@ impl GetRust for Prefix { Self::Not => "!", Self::New(_) => "", Self::Neg => "-", - Self::RangeInclusive => "..=", - Self::RangeExclusive => "..", } .to_string() } @@ -304,9 +302,6 @@ impl GetRust for Postfix { } Postfix::As(ty) => format!(" as {}", ty.get_rust()), - - Postfix::RangeInclusive => String::from("..="), - Postfix::RangeExclusive => String::from(".."), } } }