cl-lexer: Move lexer into its own crate
This commit is contained in:
@@ -9,6 +9,6 @@ publish.workspace = true
|
||||
|
||||
[dependencies]
|
||||
cl-ast = { path = "../cl-ast" }
|
||||
cl-lexer = { path = "../cl-lexer" }
|
||||
cl-token = { path = "../cl-token" }
|
||||
cl-structures = { path = "../cl-structures" }
|
||||
conlang = { path = "../libconlang" }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use super::*;
|
||||
|
||||
use conlang::lexer::error::{Error as LexError, Reason};
|
||||
use cl_lexer::error::{Error as LexError, Reason};
|
||||
use std::fmt::Display;
|
||||
pub type PResult<T> = Result<T, Error>;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::error::{
|
||||
PResult, Parsing,
|
||||
};
|
||||
use cl_ast::*;
|
||||
use conlang::lexer::Lexer;
|
||||
use cl_lexer::Lexer;
|
||||
|
||||
/// Parses a sequence of [Tokens](Token) into an [AST](cl_ast)
|
||||
pub struct Parser<'t> {
|
||||
@@ -905,11 +905,7 @@ impl<'t> Parser<'t> {
|
||||
/// [Block] = `{` [Stmt]* `}`
|
||||
pub fn block(&mut self) -> PResult<Block> {
|
||||
const PARSING: Parsing = Parsing::Block;
|
||||
Ok(
|
||||
Block {
|
||||
stmts: delim(rep(Self::stmt, CURLIES.1, PARSING), CURLIES, PARSING)(self)?,
|
||||
},
|
||||
)
|
||||
Ok(Block { stmts: delim(rep(Self::stmt, CURLIES.1, PARSING), CURLIES, PARSING)(self)? })
|
||||
}
|
||||
}
|
||||
/// ## Control flow subexpressions
|
||||
|
||||
Reference in New Issue
Block a user