aplang_lib/
lib.rs

1#![allow(dead_code, unused_variables, clippy::module_inception)]
2
3//! # Hello
4//! if you are looking to use the interpreter
5//! please install it as a binary.
6//! for more information please see [aplang.org](https://aplang.org).
7//! ---
8//! this for if you want to run ApLang as a library.
9//! although this is not officially supported
10//! i still provide it as an option.
11//! everything is public because of that.
12//! use with care
13//! ---
14//! <3
15
16pub mod aplang;
17pub mod interpreter;
18pub mod lexer;
19pub mod parser;
20pub mod standard_library;
21pub mod output;
22#[cfg(feature = "wasm")]
23pub mod wasm;
24pub use aplang::*;
25
26#[test]
27pub fn test() {
28    let aplang = ApLang::new_from_stdin("3 + 3");
29    let lexed = aplang.lex().unwrap();
30    let parsed = lexed.parse().unwrap();
31    let result = parsed.execute_with_debug().unwrap();
32
33    let mut buf = String::new();
34    result.debug_output(&mut buf).unwrap();
35    println!("{buf}");
36}