Restructure project

Signed-off-by: trivernis <trivernis@protonmail.com>
develop
trivernis 4 years ago
parent e5dac6bdba
commit 1eb5897e4e
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -1,8 +1,9 @@
pub mod error;
pub mod input_reader;
pub mod lexer;
pub mod token;
pub mod token_reader;
pub mod matching;
pub mod tokenizing;
mod utils;
pub use utils::error::*;
pub use utils::input_reader::InputReader;
#[cfg(test)]
mod tests;

@ -1,5 +1,5 @@
use crate::error::{TapeError, TapeResult};
use crate::input_reader::InputReader;
use crate::InputReader;
use crate::{TapeError, TapeResult};
use std::io::Cursor;
fn get_reader() -> InputReader {

@ -1,7 +1,7 @@
use crate::error::TapeResult;
use crate::input_reader::InputReader;
use crate::lexer::Lexer;
use crate::token::{Token, TokenCheckerFn, UnknownToken};
use crate::tokenizing::Lexer;
use crate::tokenizing::{Token, TokenCheckerFn, UnknownToken};
use crate::InputReader;
use crate::TapeResult;
use std::io::Cursor;
use std::sync::Arc;

@ -1,6 +1,6 @@
use crate::error::TapeResult;
use crate::input_reader::InputReader;
use crate::token::Token;
use crate::tokenizing::Token;
use crate::InputReader;
use crate::TapeResult;
use std::io::Cursor;
#[derive(Debug)]

@ -1,5 +1,5 @@
use crate::token::{EOFToken, Token};
use crate::token_reader::TokenReader;
use crate::tokenizing::TokenReader;
use crate::tokenizing::{EOFToken, Token};
struct AToken;
struct BToken;

@ -1,6 +1,6 @@
use crate::error::TapeResult;
use crate::input_reader::InputReader;
use crate::token::{EOFToken, Token, TokenCheckerFn, UnknownToken};
use crate::tokenizing::{EOFToken, Token, TokenCheckerFn, UnknownToken};
use crate::InputReader;
use crate::TapeResult;
pub struct Lexer {
reader: InputReader,
@ -13,7 +13,7 @@ impl Lexer {
Self { reader, checkers }
}
/// Scans for tokens
/// Scans for tokenizing
pub async fn scan(&mut self) -> TapeResult<Vec<Token>> {
let mut tokens = Vec::new();

@ -0,0 +1,7 @@
mod lexer;
mod token;
mod token_reader;
pub use lexer::Lexer;
pub use token::*;
pub use token_reader::TokenReader;

@ -1,5 +1,5 @@
use crate::error::TapeResult;
use crate::input_reader::InputReader;
use crate::InputReader;
use crate::TapeResult;
use std::any::{Any, TypeId};
use std::future::Future;
use std::pin::Pin;

@ -1,4 +1,4 @@
use crate::token::{EOFToken, Token};
use crate::tokenizing::{EOFToken, Token};
pub struct TokenReader {
tokens: Vec<Token>,

@ -1,4 +1,4 @@
use crate::error::{TapeError, TapeResult};
use crate::{TapeError, TapeResult};
use std::io::ErrorKind;
use tokio::io::{AsyncBufRead, AsyncBufReadExt};

@ -0,0 +1,2 @@
pub mod error;
pub mod input_reader;
Loading…
Cancel
Save