fn gen_output(
    opt: &Opt,
    ctx: &ast::Context,
    root: NodePtr,
    _source_map: &Option<SourceMap>,
) -> anyhow::Result<bool> {
    if opt.gen.ast {
        ast::dump_json(
            std::io::stdout(),
            ctx,
            root,
            if opt.no_pretty {
                ast::Pretty::No
            } else {
                ast::Pretty::Yes
            },
        )?;
        Ok(true)
    } else if opt.gen.js {
        gen_js::generate(
            std::io::stdout(),
            ctx,
            root,
            if opt.no_pretty {
                gen_js::Pretty::No
            } else {
                gen_js::Pretty::Yes
            },
        )?;
        Ok(true)
    } else {
        Ok(false)
    }
}
/// Generate the specified output, if any.
/// Returns whether any output was generated.
Generate the specified output, if any.
Returns whether any output was generated.
Generate the specified output if any . Returns whether any output was generated .
fn gen_output(
    opt: &Opt,
    ctx: &ast::Context,
    root: NodePtr,
    _source_map: &Option<SourceMap>,
) -> anyhow::Result<bool> {
    if opt.gen.ast {
        ast::dump_json(
            std::io::stdout(),
            ctx,
            root,
            if opt.no_pretty {
                ast::Pretty::No
            } else {
                ast::Pretty::Yes
            },
        )?;
        Ok(true)
    } else if opt.gen.js {
        gen_js::generate(
            std::io::stdout(),
            ctx,
            root,
            if opt.no_pretty {
                gen_js::Pretty::No
            } else {
                gen_js::Pretty::Yes
            },
        )?;
        Ok(true)
    } else {
        Ok(false)
    }
}
fn gen_output ( opt : & Opt , ctx : & ast :: Context , root : NodePtr , _source_map : & Option < SourceMap > , ) -> anyhow :: Result < bool > { if opt . gen . ast { ast :: dump_json ( std :: io :: stdout ( ) , ctx , root , if opt . no_pretty { ast :: Pretty :: No } else { ast :: Pretty :: Yes } , ) ? ; Ok ( true ) } else if opt . gen . js { gen_js :: generate ( std :: io :: stdout ( ) , ctx , root , if opt . no_pretty { gen_js :: Pretty :: No } else { gen_js :: Pretty :: Yes } , ) ? ; Ok ( true ) } else { Ok ( false ) } }
Generate the specified output, if any.
Generate the specified output if any .
opt
&Opt
ctx
&ast::Context
root
NodePtr
_source_map
&Option<SourceMap>
opt
&Opt
ctx
&ast::Context
root
NodePtr
_source_map
&Option<SourceMap>