luaur-analysis 0.1.0

Luau type checker and type inference (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::records::generalize_step_snapshot::GeneralizeStepSnapshot;
use crate::records::json_emitter::JsonEmitter;
use crate::records::object_emitter::ObjectEmitter;

pub fn write_json_emitter_generalize_step_snapshot(
    emitter: &mut JsonEmitter,
    eg: &GeneralizeStepSnapshot,
) {
    let mut o = emitter.write_object();
    o.write_pair("type", "generalize");
    o.write_pair("before", &eg.before);
    o.write_pair("after", &eg.after);
    o.write_pair("unsolvedConstraints", &eg.unsolved_constraints);
    o.write_pair("rootScope", &eg.root_scope);
    o.write_pair("typeStrings", &eg.type_strings);
    o.finish();
}