cl-token: Move token definition into its own crate
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user