neo-decompiler 0.10.1

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
/// Parse `<var> = <rhs>;` (bare assignment, no `let`) and return `(var, rhs)`.
pub(super) fn parse_bare_assignment(line: &str) -> Option<(String, String)> {
    let semi_pos = line.find(';')?;
    let body = &line[..semi_pos];
    let eq_pos = body.find(" = ")?;
    let lhs = body[..eq_pos].trim();
    if lhs.starts_with("let ") {
        return None;
    }
    let rhs = body[eq_pos + 3..].trim();
    Some((lhs.to_string(), rhs.to_string()))
}

/// Check if a string looks like a compiler-generated temp variable.
pub(super) fn is_temp_identifier(s: &str) -> bool {
    s.starts_with('t') && s.len() > 1 && s[1..].chars().all(|c| c.is_ascii_digit())
}

/// Extract leading whitespace from a string.
pub(super) fn leading_whitespace(s: &str) -> &str {
    let trimmed = s.trim_start();
    &s[..s.len() - trimmed.len()]
}

/// Parse `let <var> = <rhs>;` and return `(var, rhs)`.
pub(super) fn parse_let_assignment(line: &str) -> Option<(String, String)> {
    let rest = line.strip_prefix("let ")?;
    let semi_pos = rest.find(';')?;
    let rest = &rest[..semi_pos];
    let eq_pos = rest.find(" = ")?;
    let var = rest[..eq_pos].trim().to_string();
    let rhs = rest[eq_pos + 3..].trim().to_string();
    Some((var, rhs))
}