pub fn lower(
    protocol: &crate::syntax::Protocol,
) -> Result<CompilationUnit, Diagnostics> {
    let mut analyser = Analyser::new();

    for (name, ty) in &protocol.types {
        let type_id = analyser.visit_type(ty);
        analyser.register_name(name, type_id);
    }

    analyser.finalise()
}
/// Analyse the `protocol.json` file's AST and convert it to the corresponding
/// Rust types.
Analyse the `protocol.json` file's AST and convert it to the corresponding
Rust types.
Analyse the ` protocol . json ` file ' s AST and convert it to the corresponding Rust types .
pub fn lower(
    protocol: &crate::syntax::Protocol,
) -> Result<CompilationUnit, Diagnostics> {
    let mut analyser = Analyser::new();
    for (name, ty) in &protocol.types {
        let type_id = analyser.visit_type(ty);
        analyser.register_name(name, type_id);
    }
    analyser.finalise()
}
pub fn lower ( protocol : & crate :: syntax :: Protocol , ) -> Result < CompilationUnit , Diagnostics > { let mut analyser = Analyser :: new ( ) ; for ( name , ty ) in & protocol . types { let type_id = analyser . visit_type ( ty ) ; analyser . register_name ( name , type_id ) ; } analyser . finalise ( ) }
Analyse the `protocol.json` file's AST and convert it to the corresponding
Rust types.
Analyse the ` protocol . json ` file ' s AST and convert it to the corresponding Rust types .
protocol
&crate::syntax::Protocol