Adding increment

This commit is contained in:
2026-05-17 04:44:38 +02:00
parent 9b632fcc0e
commit c7529412f4
3 changed files with 14 additions and 2 deletions
+2
View File
@@ -7,6 +7,8 @@ pub mod event;
void main() {
var mut app_instance = new app::Application("mist-app");
i++;
// greeting::register(&mut app_instance);
// statistics::register(&mut app_instance);
+5
View File
@@ -497,8 +497,13 @@ as_px = {
range_end_inc_px = { "..=" }
range_end_exc_px = { ".." }
increment_px = { "++" }
decrement_px = { "++" }
postfix = {
field_px
| increment_px
| decrement_px
| call_px
| macro_call_px
| struct_px
+7 -2
View File
@@ -79,7 +79,6 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for Expression {
let mut primary_pair = None;
let mut postfix_pairs = Vec::new();
// Sort out flat layout components
for p in inner {
match p.as_rule() {
Rule::prefix => prefix_pairs.push(p),
@@ -95,7 +94,6 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for Expression {
);
let postfixes = collect_recovered::<Postfix, Postfix>(postfix_pairs.into_iter());
// Employs your exact original logic using the GetLength trait
if postfixes.len() > 0 || prefixes.len() > 0 {
ast_expr!(Expression::Fix {
initial: exp.map(Box::new),
@@ -183,6 +181,13 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for Postfix {
Rule::macro_call_px => Ok(Postfix::MacroCall(inner.as_str().to_string())),
Rule::as_px => {
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),
}
}