Fixed range

This commit is contained in:
2026-05-17 05:52:23 +02:00
parent 212d5d69b5
commit 46c6f5ffdd
4 changed files with 0 additions and 23 deletions
-4
View File
@@ -71,8 +71,6 @@ pub enum Postfix {
StructCall(Vec<(Identifier, Expression)>), StructCall(Vec<(Identifier, Expression)>),
Index(Expression), Index(Expression),
As(TypeExpr), As(TypeExpr),
RangeInclusive,
RangeExclusive,
} }
#[derive(Debug, Clone, Serialize)] #[derive(Debug, Clone, Serialize)]
@@ -83,8 +81,6 @@ pub enum Prefix {
New(Option<Generics>), New(Option<Generics>),
Not, Not,
Neg, Neg,
RangeInclusive,
RangeExclusive,
} }
#[derive(Debug, Clone, Serialize)] #[derive(Debug, Clone, Serialize)]
-9
View File
@@ -504,9 +504,6 @@ as_px = {
"as" ~ type_expr "as" ~ type_expr
} }
range_end_inc_px = { "..=" }
range_end_exc_px = { ".." }
postfix = { postfix = {
field_px field_px
| call_px | call_px
@@ -514,8 +511,6 @@ postfix = {
| struct_px | struct_px
| index_px | index_px
| as_px | as_px
| range_end_inc_px
| range_end_exc_px
} }
// ------------------------------------------------------ // ------------------------------------------------------
@@ -528,8 +523,6 @@ ref_px = { "&" }
new_px = { "new" ~ generics? } new_px = { "new" ~ generics? }
not_px = { "!" } not_px = { "!" }
neg_px = { "-" } neg_px = { "-" }
range_start_inc_px = { "..=" }
range_start_exc_px = { ".." }
prefix = { prefix = {
deref_px deref_px
@@ -538,8 +531,6 @@ prefix = {
| new_px | new_px
| not_px | not_px
| neg_px | neg_px
| range_start_inc_px
| range_start_exc_px
} }
// ------------------------------------------------------ // ------------------------------------------------------
-5
View File
@@ -140,8 +140,6 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for Prefix {
), ),
Rule::not_px => Self::Not, Rule::not_px => Self::Not,
Rule::neg_px => Self::Neg, Rule::neg_px => Self::Neg,
Rule::range_start_inc_px => Self::RangeInclusive,
Rule::range_start_exc_px => Self::RangeExclusive,
_ => return AstError::bug_unimplemented(pair), _ => return AstError::bug_unimplemented(pair),
}) })
@@ -185,9 +183,6 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for Postfix {
ast_expr!(Postfix::As(inner.next().unwrap().try_into())) 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), _ => AstError::bug_unimplemented(pair),
} }
} }
-5
View File
@@ -206,8 +206,6 @@ impl GetRust for Prefix {
Self::Not => "!", Self::Not => "!",
Self::New(_) => "", Self::New(_) => "",
Self::Neg => "-", Self::Neg => "-",
Self::RangeInclusive => "..=",
Self::RangeExclusive => "..",
} }
.to_string() .to_string()
} }
@@ -304,9 +302,6 @@ impl GetRust for Postfix {
} }
Postfix::As(ty) => format!(" as {}", ty.get_rust()), Postfix::As(ty) => format!(" as {}", ty.get_rust()),
Postfix::RangeInclusive => String::from("..="),
Postfix::RangeExclusive => String::from(".."),
} }
} }
} }