tinyscript 0.6.1

Tiny, C-like scripting language.
Documentation
// Copyright © 2025 Stephan Kunz
#![no_std]
#![doc = include_str!("../README.md")]

#[cfg(doctest)]
doc_comment::doctest!("../README.md");

#[doc(hidden)]
extern crate alloc;

pub mod compilation;
pub mod environment;
pub mod error;
pub mod execution;
pub mod prelude;
pub mod runtime;
pub mod scripting_value;

// flatten
pub use environment::{DefaultEnvironment, Environment};
pub use error::Error;
pub use execution::Chunk;
pub use runtime::{Runtime, SharedRuntime};
pub use scripting_value::ScriptingValue;

// reexport
pub use tinyscript_derive::ScriptEnum;

use alloc::vec::Vec;

// define Arc, Mutex, RwLock & Guards
type Arc<T> = portable_atomic_util::Arc<T>;
#[allow(unused)]
type Mutex<T> = spin::Mutex<T>;
type RwLock<T> = spin::RwLock<T>;
#[allow(unused)]
type RwLockReadGuard<'a, T> = spin::RwLockReadGuard<'a, T>;
#[allow(unused)]
type RwLockWriteGuard<'a, T> = spin::RwLockWriteGuard<'a, T>;

// region		--- types
/// An immutable thread safe `String` type.
/// see: [Logan Smith](https://www.youtube.com/watch?v=A4cKi7PTJSs).
type ConstString = Arc<str>;

// region		--- ScriptEnum
/// The trait for script enums.
pub trait ScriptEnum {
	/// Function to get key-value tuples for registering.
	fn key_value_tuples<'a>() -> Vec<(&'a str, i8)>;
}