mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
remove Atom. almost there
This commit is contained in:
parent
dc7b713108
commit
cf1fd5b45a
20 changed files with 539 additions and 739 deletions
|
|
@ -1,12 +1,14 @@
|
|||
#![feature(adt_const_params)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(impl_trait_in_fn_trait_return)]
|
||||
mod error; pub use self::error::*;
|
||||
mod token; pub use self::token::*;
|
||||
mod atom; pub use self::atom::*;
|
||||
mod atom_ref; pub use self::atom_ref::*;
|
||||
mod atom_arc; pub use self::atom_arc::*;
|
||||
mod context; pub use self::context::*;
|
||||
mod error; pub use self::error::*;
|
||||
mod token; pub use self::token::*;
|
||||
mod iter; pub use self::iter::*;
|
||||
mod context; pub use self::context::*;
|
||||
//mod atom; pub use self::atom::*;
|
||||
//mod atom_ref; pub use self::atom_ref::*;
|
||||
//mod atom_arc; pub use self::atom_arc::*;
|
||||
pub(crate) use self::Value::*;
|
||||
pub(crate) use self::ParseError::*;
|
||||
//pub(crate) use self::TokenKind::*;
|
||||
pub(crate) use std::sync::Arc;
|
||||
|
|
@ -40,6 +42,17 @@ pub(crate) use std::fmt::{Debug, Display, Formatter, Result as FormatResult, Err
|
|||
}
|
||||
}
|
||||
}
|
||||
#[cfg(test)] #[test] fn test_token () -> Result<(), Box<dyn std::error::Error>> {
|
||||
use Token::*;
|
||||
assert_eq!(Nil, Token::chomp_one("")?);
|
||||
assert_eq!(Nil, Token::chomp_one(" \n \r \t ")?);
|
||||
assert_eq!(Num("8", 0, 1), Token::chomp_one("8")?);
|
||||
assert_eq!(Num(" 8 ", 3, 1), Token::chomp_one(" 8 ")?);
|
||||
assert_eq!(Sym(":foo", 0, 4), Token::chomp_one(":foo")?);
|
||||
assert_eq!(Sym("@bar", 0, 4), Token::chomp_one("@bar")?);
|
||||
assert_eq!(Key("foo/bar", 0, 7), Token::chomp_one("foo/bar")?);
|
||||
Ok(())
|
||||
}
|
||||
#[cfg(test)] #[test] fn test_lang () -> Result<(), ParseError> {
|
||||
use Atom::*;
|
||||
assert_eq!(Atom::read_all("")?,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue