-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
40f60dd
commit 88547f6
Showing
4 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
mod assignment; | ||
mod closure; | ||
mod fn_decl; | ||
mod function_call; | ||
mod ident; | ||
mod operator; | ||
mod statement; | ||
mod r#struct; | ||
mod task; | ||
mod test_decl; | ||
mod toplevel; | ||
mod r#type; | ||
mod visibility; | ||
mod closure; |
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,13 @@ | ||
use crate::context::Context; | ||
use crate::macros::transpile; | ||
use crate::Transpile; | ||
use galvan_ast::TestDecl; | ||
use std::borrow::Cow; | ||
|
||
impl Transpile for &(Cow<'_, str>, &TestDecl) { | ||
fn transpile(&self, ctx: &Context) -> String { | ||
let (name, test_decl) = self; | ||
let name = name.as_ref(); | ||
transpile!(ctx, "#[test]\nfn {}() {{\n{}\n}}", name, test_decl.body) | ||
} | ||
} |