neo-decompiler 0.11.0

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
use super::super::super::HighLevelEmitter;

impl HighLevelEmitter {
    /// Strips VM-level stack operation comments that add noise to the output.
    pub(crate) fn strip_stack_comments(statements: &mut [String]) {
        for stmt in statements.iter_mut() {
            let trimmed = stmt.trim();
            if trimmed.starts_with("// drop ")
                || trimmed.starts_with("// remove second")
                || trimmed.starts_with("// swapped top")
                || trimmed.starts_with("// xdrop stack")
                || trimmed.starts_with("// rotate top")
                || trimmed.starts_with("// tuck top")
                || trimmed.starts_with("// reverse top")
                || trimmed == "// clear stack"
            {
                stmt.clear();
                continue;
            }
            for suffix in [" // duplicate top of stack", " // copy second stack value"] {
                if let Some(pos) = stmt.find(suffix) {
                    stmt.truncate(pos);
                }
            }
        }
    }
}