diff options
author | Greg Brown <gmb60@cam.ac.uk> | 2021-01-14 14:37:27 +0000 |
---|---|---|
committer | Greg Brown <gmb60@cam.ac.uk> | 2021-01-14 14:37:27 +0000 |
commit | 24ff5f311f6c797681be1cff0fb2d0b75c0f848f (patch) | |
tree | e4cc216813f2a9c40dc496148dbd4eeed83fb87c /src/nibble/mod.rs | |
parent | 3d13ff5a0f40b750f754898ab4568d4afc0f1a9e (diff) |
Finish AutoChomp
Diffstat (limited to 'src/nibble/mod.rs')
-rw-r--r-- | src/nibble/mod.rs | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/nibble/mod.rs b/src/nibble/mod.rs index 14791fd..41e895c 100644 --- a/src/nibble/mod.rs +++ b/src/nibble/mod.rs @@ -1,50 +1,2 @@ pub mod convert; pub mod cst; -// impl File { -// /// Returns function list and the goal. The function list consists of an -// /// [`Ident`], the converted [`ast::Expression`] and the number of arguments. -// pub fn convert(self) -> (Vec<(Ident, ast::Expression, usize)>, ast::Expression) { -// let mut context = Context::new(); -// let map = self -// .lets -// .into_iter() -// .map(|stmt| { -// let count = stmt.args.as_ref().map(ArgList::len).unwrap_or_default(); -// context.set_variables( -// stmt.args -// .into_iter() -// .flat_map(|args| args.into_iter().map(|arg| arg.to_string())), -// ); -// (stmt.name, stmt.expr.convert(&mut context), count) -// }) -// .collect(); -// let goal = self.goal.expr.convert(&mut context); -// (map, goal) -// } -// } - -// #[cfg(test)] -// mod tests { -// use super::{Epsilon, Ident, Literal}; -// use syn::parse_str; - -// #[test] -// fn parse_epsilon() { -// assert!(parse_str::<Epsilon>("_").is_ok()); -// } - -// #[test] -// fn parse_ident() { -// assert_eq!(parse_str::<Ident>("x").unwrap().to_string(), "x"); -// assert_eq!(parse_str::<Ident>("x_yz").unwrap().to_string(), "x_yz"); -// assert_eq!(parse_str::<Ident>("a123").unwrap().to_string(), "a123"); -// assert_eq!(parse_str::<Ident>("𝒢𝒢").unwrap().to_string(), "𝒢𝒢"); -// assert!(parse_str::<Ident>("1").is_err()); -// assert!(parse_str::<Ident>("_").is_err()); -// } - -// #[test] -// fn parse_literal() { -// assert_eq!(parse_str::<Literal>(r#""hello""#).unwrap().value(), "hello") -// } -// } |