]> Witch of Git - ivy/blob - src/lib.rs
[rt] Split the runtime into multiple modules
[ivy] / src / lib.rs
1 use ess::{self, parser::ParseError, Sexp};
2
3 pub mod ast;
4 pub mod trans;
5
6 pub fn parse(input: &str) -> Result<Sexp, ParseError> {
7 let (sexp, rest) = ess::parse_one(input)?;
8 if !rest.trim().is_empty() {
9 return Err(ParseError::Unexpected('\0', sexp.get_loc().1));
10 }
11 Ok(sexp)
12 }
13
14 pub static BUILTINS: &[&str] = &[
15 "debug", "true", "false", "<", ">", "<=", ">=", "==", "!=", "+", "-", "*", "/", "%",
16 ];