Looking at this diff, I can see it's a comprehensive documentation
update and code refactoring focused on:
1. Adding new documentation pages to the table of contents
2. Restructuring the bot templates documentation
3. Changing keyword syntax from underscore format to space format (e.g.,
`SET_BOT_MEMORY` → `SET BOT MEMORY`)
4. Updating compiler and keyword registration to support the new
space-based syntax
5. Adding new keyword modules (social media, lead scoring, templates,
etc.)
Refactor BASIC keywords to use spaces instead of underscores
Change keyword syntax from underscore format (SET_BOT_MEMORY) to more
natural space-separated format (SET BOT MEMORY) throughout the codebase.
Key changes:
- Update Rhai custom syntax registration to use space tokens
- Simplify compiler preprocessing (fewer replacements needed)
- Update all template .bas files to use new syntax
- Expand documentation with consolidated examples and new sections
- Add new keyword modules: social_media, lead_scoring, send_template,
core_functions, qrcode, sms, procedures, import_export, llm_macros,
on_form_submit
2025-11-30 10:53:59 -03:00
|
|
|
pub mod abs;
|
|
|
|
|
pub mod aggregate;
|
|
|
|
|
pub mod basic_math;
|
|
|
|
|
pub mod random;
|
|
|
|
|
pub mod round;
|
|
|
|
|
pub mod trig;
|
|
|
|
|
|
|
|
|
|
use crate::shared::models::UserSession;
|
|
|
|
|
use crate::shared::state::AppState;
|
|
|
|
|
use log::debug;
|
|
|
|
|
use rhai::Engine;
|
|
|
|
|
use std::sync::Arc;
|
|
|
|
|
|
2025-12-24 09:39:23 -03:00
|
|
|
pub fn register_math_functions(state: &Arc<AppState>, user: UserSession, engine: &mut Engine) {
|
2026-01-24 22:04:47 -03:00
|
|
|
abs::abs_keyword(state, user.clone(), engine);
|
|
|
|
|
round::round_keyword(state, user.clone(), engine);
|
|
|
|
|
basic_math::int_keyword(state, user.clone(), engine);
|
|
|
|
|
basic_math::floor_keyword(state, user.clone(), engine);
|
|
|
|
|
basic_math::ceil_keyword(state, user.clone(), engine);
|
|
|
|
|
basic_math::max_keyword(state, user.clone(), engine);
|
|
|
|
|
basic_math::min_keyword(state, user.clone(), engine);
|
|
|
|
|
basic_math::mod_keyword(state, user.clone(), engine);
|
|
|
|
|
basic_math::sgn_keyword(state, user.clone(), engine);
|
|
|
|
|
basic_math::sqrt_keyword(state, user.clone(), engine);
|
|
|
|
|
basic_math::pow_keyword(state, user.clone(), engine);
|
|
|
|
|
random::random_keyword(state, user.clone(), engine);
|
|
|
|
|
trig::sin_keyword(state, user.clone(), engine);
|
|
|
|
|
trig::cos_keyword(state, user.clone(), engine);
|
|
|
|
|
trig::tan_keyword(state, user.clone(), engine);
|
|
|
|
|
trig::log_keyword(state, user.clone(), engine);
|
|
|
|
|
trig::exp_keyword(state, user.clone(), engine);
|
|
|
|
|
trig::pi_keyword(state, user.clone(), engine);
|
|
|
|
|
aggregate::sum_keyword(state, user.clone(), engine);
|
|
|
|
|
aggregate::avg_keyword(state, user, engine);
|
Looking at this diff, I can see it's a comprehensive documentation
update and code refactoring focused on:
1. Adding new documentation pages to the table of contents
2. Restructuring the bot templates documentation
3. Changing keyword syntax from underscore format to space format (e.g.,
`SET_BOT_MEMORY` → `SET BOT MEMORY`)
4. Updating compiler and keyword registration to support the new
space-based syntax
5. Adding new keyword modules (social media, lead scoring, templates,
etc.)
Refactor BASIC keywords to use spaces instead of underscores
Change keyword syntax from underscore format (SET_BOT_MEMORY) to more
natural space-separated format (SET BOT MEMORY) throughout the codebase.
Key changes:
- Update Rhai custom syntax registration to use space tokens
- Simplify compiler preprocessing (fewer replacements needed)
- Update all template .bas files to use new syntax
- Expand documentation with consolidated examples and new sections
- Add new keyword modules: social_media, lead_scoring, send_template,
core_functions, qrcode, sms, procedures, import_export, llm_macros,
on_form_submit
2025-11-30 10:53:59 -03:00
|
|
|
|
|
|
|
|
debug!("Registered all math functions");
|
|
|
|
|
}
|