1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Plug and play configuration language.
//!
//! Provides a simple API to insert this configuration language into your project. The
//! language is easy to learn and checks for many common errors, including unknown
//! variables and malformed statements, at (Avid's) compile time.
//!
//! The available APIs and other settings can be tweaked or modified easily by using the
//! different methods on the [Builder] struct.
//!
//! # Examples
//! ```
//! use avid::{Builder, Stack};
//!
//! let src = "1 2 + print \"Hello, World!\" print-to-log";
//! let mut log = String::new();
//!
//! let avid = Builder::new(src)
//! // Add a new function that pops one item from the top of the stack
//! // and prints it to the log
//! .register_fn("print-to-log", |stack: &mut Stack| {
//! let [to_print] = stack.pop()?;
//! log.push_str(&to_print.to_string());
//! Ok(())
//! })
//! .build().unwrap();
//!
//! // Prints `3` to standard output
//! avid.run(None).unwrap();
//!
//! assert_eq!(&log, "Hello, World!");
//! ```
//!
//! You can use any function with the correct signature, including closures.
//!
//!
pub use Ast;
pub use Builder;
pub use ;
pub use ;
pub use ;
pub use ;