cl-token: Move token definition into its own crate

This commit is contained in:
2024-02-29 19:36:06 -06:00
parent ee27095fb3
commit 6e1d5af134
14 changed files with 41 additions and 30 deletions

View File

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

View File

@@ -1,5 +1,6 @@
//! This example grabs input from stdin, lexes it, and prints which lexer rules matched
#![allow(unused_imports)]
use cl_token::Token;
use conlang::lexer::Lexer;
use std::{
error::Error,
@@ -57,7 +58,7 @@ fn lex_tokens(file: &str, path: Option<&Path>) -> Result<(), Box<dyn Error>> {
Ok(())
}
fn print_token(t: conlang::token::Token) {
fn print_token(t: Token) {
println!(
"{:02}:{:02}: {:#19}{}",
t.line(),

View File

@@ -194,7 +194,8 @@ pub mod cli {
program::{Parsable, Parsed, Program},
};
use cl_interpret::env::Environment;
use conlang::{resolver::Resolver, token::Token};
use cl_token::Token;
use conlang::resolver::Resolver;
use std::{
convert::Infallible,
error::Error,