diff options
author | Huxley <framlog@gmail.com> | 2017-03-07 20:00:33 +0800 |
---|---|---|
committer | framlog <framlog@gmail.com> | 2017-03-08 08:44:01 +0800 |
commit | e0ca63263c144ef41975c5440812c9c6cde2be91 (patch) | |
tree | cf21dad42ac8ca4a9fa887ba479940b9c8c0e190 /src/codegen/helpers.rs | |
parent | 5982cd3dc3a4f356131f6c10939d3890f0c05e22 (diff) |
automatically allow non rust naming conventions
Diffstat (limited to 'src/codegen/helpers.rs')
-rw-r--r-- | src/codegen/helpers.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/codegen/helpers.rs b/src/codegen/helpers.rs index 06dadab0..811d87c5 100644 --- a/src/codegen/helpers.rs +++ b/src/codegen/helpers.rs @@ -10,6 +10,10 @@ pub mod attributes { use aster; use syntax::ast; + pub fn allow(which_ones: &[&str]) -> ast::Attribute { + aster::AstBuilder::new().attr().list("allow").words(which_ones).build() + } + pub fn repr(which: &str) -> ast::Attribute { aster::AstBuilder::new().attr().list("repr").words(&[which]).build() } |