Arrange parsing into modules
diff --git a/src/common.rs b/src/common.rs
index b24e9ee..a5173d7 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -7,22 +7,24 @@
}
#[cfg(feature = "parsing")]
-fn ident_ch(ch: char) -> bool {
- ch.is_alphanumeric() || ch == '_'
+pub mod parsing {
+ use super::*;
+
+ fn ident_ch(ch: char) -> bool {
+ ch.is_alphanumeric() || ch == '_'
+ }
+
+ named!(pub word<&str, Ident>, preceded!(
+ opt!(call!(::nom::multispace)),
+ map!(take_while1_s!(ident_ch), String::from)
+ ));
+
+ named!(pub visibility<&str, Visibility>, preceded!(
+ opt!(call!(::nom::multispace)),
+ alt!(
+ terminated!(tag_s!("pub"), call!(::nom::multispace)) => { |_| Visibility::Public }
+ |
+ epsilon!() => { |_| Visibility::Inherited }
+ )
+ ));
}
-
-#[cfg(feature = "parsing")]
-named!(pub word<&str, Ident>, preceded!(
- opt!(call!(::nom::multispace)),
- map!(take_while1_s!(ident_ch), String::from)
-));
-
-#[cfg(feature = "parsing")]
-named!(pub visibility<&str, Visibility>, preceded!(
- opt!(call!(::nom::multispace)),
- alt!(
- terminated!(tag_s!("pub"), call!(::nom::multispace)) => { |_| Visibility::Public }
- |
- epsilon!() => { |_| Visibility::Inherited }
- )
-));