neo-decompiler 0.10.2

Neo N3 NEF decompiler: parse, disassemble, lift bytecode to high-level pseudocode and C# skeletons, with a CLI, JSON reports, and optional WebAssembly bindings.
Documentation
//! Collapse verbose Neo C# compiler overflow-check patterns into clean expressions.
//!
//! The Neo C# compiler emits checked/unchecked overflow handling as nested
//! range checks plus masking/sign-extension logic. This pass recognises those
//! lifted statement patterns and collapses them back to the original operation,
//! wrapping checked forms in `checked(...)`.

use super::super::HighLevelEmitter;

mod apply;
mod braces;
mod matcher;
mod model;
mod parse;
mod scan;

#[cfg(test)]
mod tests;

impl HighLevelEmitter {
    /// Collapse overflow-check wrappers emitted by the Neo C# compiler.
    ///
    /// Must run after `rewrite_else_if_chains` and before
    /// `rewrite_compound_assignments`.
    pub(crate) fn collapse_overflow_checks(statements: &mut [String]) {
        let mut index = 0;
        while index < statements.len() {
            if let Some(collapse) = matcher::try_match_overflow(statements, index) {
                apply::apply_collapse(statements, &collapse);
                continue;
            }
            index += 1;
        }
    }
}