cl-parser: Move parser into its own crate

This commit is contained in:
2024-02-29 20:41:07 -06:00
parent 1afde9ce35
commit cc281fc6ab
11 changed files with 44 additions and 20 deletions

View File

@@ -12,8 +12,9 @@ publish.workspace = true
[dependencies]
conlang = { path = "../libconlang" }
cl-ast = { path = "../cl-ast" }
cl-interpret = { path = "../cl-interpret" }
cl-token = { path = "../cl-token" }
cl-parser = { path = "../cl-parser" }
cl-interpret = { path = "../cl-interpret" }
crossterm = "0.27.0"
[dev-dependencies]

View File

@@ -1,8 +1,9 @@
//! Collects identifiers into a list
use cl_parser::Parser;
use cl_repl::repline::Repline;
use cl_structures::span::Loc;
use conlang::{lexer::Lexer, parser::Parser};
use conlang::lexer::Lexer;
use std::{
collections::HashMap,
error::Error,

View File

@@ -74,10 +74,10 @@ pub mod program {
};
use cl_ast::{self as ast, ast_impl::format::Pretty};
use cl_parser::{error::PResult, Parser};
use conlang::{
// pretty_printer::{PrettyPrintable, Printer},
lexer::Lexer,
parser::{error::PResult, Parser},
resolver::{error::TyResult, Resolver},
};
use std::{fmt::Display, io::Write};
@@ -228,7 +228,7 @@ pub mod cli {
match (repl, path) {
(true, Some(path)) => {
let prog = std::fs::read_to_string(path).unwrap();
let code = conlang::parser::Parser::new(conlang::lexer::Lexer::new(&prog))
let code = cl_parser::Parser::new(conlang::lexer::Lexer::new(&prog))
.file()
.unwrap();
let mut env = cl_interpret::env::Environment::new();