opy-rs 0.3.8

Standalone OverPy-compatible .opy implementation with parsing, tooling, and bounded Workshop compilation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use workshop_rs::Value;

pub(super) fn for_each_child(value: &mut Value, mut visit: impl FnMut(&mut Value)) {
    match value {
        Value::Array(children) | Value::Call { args: children, .. } => {
            for child in children {
                visit(child);
            }
        }
        Value::Vector { x, y, z } => {
            visit(x);
            visit(y);
            visit(z);
        }
        Value::PlayerVariable { player, .. } => visit(player),
        _ => {}
    }
}