-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from kb10uy/dedicate-transformer
Compiler v2
- Loading branch information
Showing
34 changed files
with
2,781 additions
and
3,296 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
pub mod data; | ||
pub mod error; | ||
|
||
mod transformer; | ||
|
||
pub use self::transformer::LogLevel; | ||
|
||
use crate::{ | ||
avatar::{ | ||
data::Avatar, | ||
transformer::{compile_avatar, Context}, | ||
}, | ||
decl::data::Avatar as DeclAvatar, | ||
}; | ||
|
||
pub struct TransformResult { | ||
pub avatar: Option<Avatar>, | ||
pub logs: Vec<(LogLevel, String)>, | ||
} | ||
|
||
pub fn transform_avatar(avatar: DeclAvatar) -> TransformResult { | ||
let mut ctx = Context::new(); | ||
let avatar = compile_avatar(&mut ctx, avatar); | ||
let logs = ctx.into_logs(); | ||
|
||
TransformResult { avatar, logs } | ||
} |
Oops, something went wrong.