-
Notifications
You must be signed in to change notification settings - Fork 21
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
Showing
4 changed files
with
35 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use std::rc::Rc; | ||
|
||
/// Helper functions for macros | ||
#[derive(Debug)] | ||
pub struct Const { | ||
file: Rc<syn::File>, | ||
} | ||
|
||
impl Const { | ||
pub fn new(file: Rc<syn::File>) -> Self { | ||
Self { file } | ||
} | ||
|
||
pub fn constants(&self) -> Vec<syn::ItemConst> { | ||
self.file | ||
.items | ||
.iter() | ||
.filter_map(|item| match item { | ||
syn::Item::Const(item) => Some(item.clone()), | ||
_ => None, | ||
}) | ||
.collect() | ||
} | ||
} |
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,9 +1,13 @@ | ||
mod constants; | ||
mod func; | ||
mod mac; | ||
mod mutation; | ||
mod syn; | ||
mod syntest; | ||
mod var; | ||
|
||
pub use constants::Const; | ||
pub use mutation::Mutation; | ||
pub use syn::*; | ||
pub use syntest::Syntest; | ||
pub use var::{LocalVariable, Value}; |
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,2 @@ | ||
pub use syn::parse_quote; | ||
pub use syn::Type; |
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