cl-ast: Move AST definition into its own crate

This commit is contained in:
2024-02-29 19:49:50 -06:00
parent 6e1d5af134
commit 1afde9ce35
15 changed files with 29 additions and 19 deletions

View File

@@ -6,7 +6,7 @@
//! one in any situation.
use super::*;
use conlang::ast::*;
use cl_ast::*;
/// A work-in-progress tree walk interpreter for Conlang
pub trait Interpret {
/// Interprets this thing in the given [`Environment`].

View File

@@ -297,7 +297,7 @@ pub mod interpret;
pub mod function {
//! Represents a block of code which lives inside the Interpreter
use super::{Callable, ConValue, Environment, Error, IResult, Interpret};
use conlang::ast::{Function as FnDecl, Identifier, Param};
use cl_ast::{Function as FnDecl, Identifier, Param};
/// Represents a block of code which persists inside the Interpreter
#[derive(Clone, Debug)]
pub struct Function {
@@ -354,7 +354,7 @@ pub mod env {
temp_type_impl::ConValue,
BuiltIn, Callable, Interpret,
};
use conlang::ast::{Function as FnDecl, Identifier};
use cl_ast::{Function as FnDecl, Identifier};
use std::{
collections::HashMap,
fmt::Display,

View File

@@ -1,6 +1,7 @@
#![allow(unused_imports)]
use crate::{env::Environment, temp_type_impl::ConValue, Interpret};
use conlang::{ast::*, lexer::Lexer, parser::Parser};
use cl_ast::*;
use conlang::{lexer::Lexer, parser::Parser};
pub use macros::*;
mod macros {
@@ -208,7 +209,7 @@ mod fn_declarations {
}
mod operators {
use conlang::ast::Tuple;
use cl_ast::Tuple;
use super::*;
#[test]