xbasic 0.3.2

A library that allows adding a scripting language onto your project with ease. This lets your users write their own arbitrary logic.
Documentation
use crate::basic_io::BasicIO;
use crate::expr::ExprValue;
use crate::xbasic::XBasicBuilder;

pub(crate) struct Std {}

impl Std {
	pub fn attach<T>(xbb: &mut XBasicBuilder<T>)
	where
		T: BasicIO,
	{
		xbb.define_function("typeof".to_string(), 1, |args, _| {
			ExprValue::String(
				match args[0] {
					ExprValue::String(_) => "String",
					ExprValue::Boolean(_) => "Boolean",
					ExprValue::Decimal(_) => "Decimal",
					ExprValue::Integer(_) => "Integer",
				}
				.to_string(),
			)
		})
		.unwrap();
	}
}