Skip to content

Commit

Permalink
restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
lexa-diky committed May 9, 2024
1 parent 350a76f commit b4c6fdf
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use pest::Parser as PestParser;

use crate::resolver::resolve_cst;
use crate::{cst_legacy, render};
use crate::ast::{AstParser, AstParserError};
use crate::compiler::ast::{AstParser, AstParserError};
use crate::render::RenderError;

#[derive(Parser)]
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ast/parser.rs → src/compiler/ast/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use pest::iterators::Pair;
use pest::Parser;
use pest_derive::Parser;

use crate::ast::{AstNode, AstNodeType};
use crate::compiler::ast::{AstNode, AstNodeType};

#[derive(Debug)]
pub(crate) enum AstParserError {
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/compiler.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::ast::{AstParser, AstParserError};
use crate::compiler::ast::{AstParser, AstParserError};
use crate::compiler::{Compilation, CompilerSource, HexoCompilerContext};
use crate::cst::{CstParser, CstParserError};
use crate::compiler::cst::{CstParser, CstParserError};

#[derive(Debug)]
pub(crate) enum CompilerError {
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/cst/parser.rs → src/compiler/cst/parser.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::path::PathBuf;

use crate::ast::{AstNode, AstNodeType};
use crate::cst::{CstActualParameter, CstAtom, CstConstantStatement, CstEmitStatement, CstFunctionStatement};
use crate::cst::node::CstFile;
use crate::compiler::ast::{AstNode, AstNodeType};
use crate::compiler::cst::{CstActualParameter, CstAtom, CstConstantStatement, CstEmitStatement, CstFunctionStatement};
use crate::compiler::cst::node::CstFile;
use crate::encoding;

#[derive(Debug)]
Expand Down
4 changes: 4 additions & 0 deletions src/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ mod compiler;
mod compiler_source;
mod compilation_result;
mod source_finder;
mod cst;
mod rst;
mod util;
pub mod ast;

pub(crate) use compiler_context::HexoCompilerContext;
pub(crate) use compiler::{HexoCompiler, CompilerError};
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl ByteBuffer {
}

mod test {
use crate::util::ByteBuffer;
use crate::compiler::util::ByteBuffer;

#[test]
fn byte_push() {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cst_legacy.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::ast::{AstNode, AstNodeType};
use crate::compiler::ast::{AstNode, AstNodeType};
use crate::cst_legacy::CstParseError::NodeValueMissing;
use crate::encoding;
use crate::encoding::to_shrunk_bytes;
Expand Down
4 changes: 0 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ mod encoding;
mod render;
mod resolver;
mod compiler;
mod ast;
mod cst;
mod rst;
mod util;

fn main() {
let compiler = HexoCompiler::new(HexoCompilerContext::new());
Expand Down

0 comments on commit b4c6fdf

Please sign in to comment.