/**
 * Simple static CSML bot linter.
 * Does not check for possible runtime errors, only for build-time errors
 * (missing steps or flows, syntax errors, etc.)
 */
Simple static CSML bot linter.
Does not check for possible runtime errors, only for build-time errors
(missing steps or flows, syntax errors, etc.)
Simple static CSML bot linter . Does not check for possible runtime errors only for build - time errors ( missing steps or flows syntax errors etc . )
pub fn validate_bot(mut bot: CsmlBot) -> CsmlResult {
    // load native components into the bot
    bot.native_components = match load_components() {
        Ok(components) => Some(components),
        Err(err) => {
            return CsmlResult {
                errors: Some(vec![err]),
                warnings: None,
                flows: None,
                extern_flows: None,
            }
        }
    };
    // search for modules to download
    if let Err(err) = search_for_modules(&mut bot) {
        return CsmlResult {
            errors: Some(vec![ErrorInfo::new(Position::default(), err)]),
            warnings: None,
            flows: None,
            extern_flows: None,
        };
    }
    csml_interpreter::validate_bot(&bot)
}
pub fn validate_bot ( mut bot : CsmlBot ) -> CsmlResult { // load native components into the bot bot . native_components = match load_components ( ) { Ok ( components ) => Some ( components ) , Err ( err ) => { return CsmlResult { errors : Some ( vec ! [ err ] ) , warnings : None , flows : None , extern_flows : None , } } } ; // search for modules to download if let Err ( err ) = search_for_modules ( & mut bot ) { return CsmlResult { errors : Some ( vec ! [ ErrorInfo new ( Position default ( ) err ) ] ) , warnings : None , flows : None , extern_flows : None , } ; } csml_interpreter :: validate_bot ( & bot ) }
Simple static CSML bot linter.
Simple static CSML bot linter .
bot
CsmlBot