File tree Expand file tree Collapse file tree 8 files changed +17
-0
lines changed
Expand file tree Collapse file tree 8 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 88 - uses : actions/checkout@v4
99 - run : cargo build
1010 - run : cargo test
11+ - run : cargo test -F unstable-attr-regex
Original file line number Diff line number Diff line change @@ -16,3 +16,9 @@ repository = "https://github.com/2kai2kai2/ere"
1616[dependencies ]
1717ere-core = { version = " 0.2.0" , path = " ./ere-core" }
1818ere-macros = { version = " 0.2.0" , path = " ./ere-macros" }
19+
20+ [features ]
21+ unstable-attr-regex = [
22+ " ere-core/unstable-attr-regex" ,
23+ " ere-macros/unstable-attr-regex" ,
24+ ]
Original file line number Diff line number Diff line change @@ -12,3 +12,6 @@ proc-macro2 = "1.0.95"
1212quote = " 1.0.38"
1313syn = { version = " 2.0.96" , features = [" parsing" ] }
1414thiserror = " 2.0.11"
15+
16+ [features ]
17+ unstable-attr-regex = []
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ pub fn __compile_regex(stream: TokenStream) -> TokenStream {
9494 } ;
9595}
9696
97+ #[ cfg( feature = "unstable-attr-regex" ) ]
9798pub fn __compile_regex_attr ( attr : TokenStream , input : TokenStream ) -> TokenStream {
9899 let ere: parse_tree:: ERE = syn:: parse_macro_input!( attr) ;
99100 let tree = simplified_tree:: SimplifiedTreeNode :: from ( ere) ;
Original file line number Diff line number Diff line change @@ -14,3 +14,6 @@ proc-macro = true
1414ere-core = { version = " 0.2.0" , path = " ../ere-core" }
1515quote = " 1.0.38"
1616syn = { version = " 2.0.96" , features = [" parsing" ] }
17+
18+ [features ]
19+ unstable-attr-regex = [" ere-core/unstable-attr-regex" ]
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ pub fn compile_regex(stream: TokenStream) -> TokenStream {
2626 return ere_core:: __compile_regex ( stream) ;
2727}
2828
29+ #[ cfg( feature = "unstable-attr-regex" ) ]
2930#[ proc_macro_attribute]
3031pub fn regex ( attr : TokenStream , input : TokenStream ) -> TokenStream {
3132 return ere_core:: __compile_regex_attr ( attr, input) ;
Original file line number Diff line number Diff line change @@ -16,5 +16,6 @@ pub use ::ere_macros::*;
1616pub mod prelude {
1717 pub use :: ere_core:: Regex ;
1818 pub use :: ere_macros:: compile_regex;
19+ #[ cfg( feature = "unstable-attr-regex" ) ]
1920 pub use :: ere_macros:: regex;
2021}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ fn phone_number() {
1616 assert ! ( !PHONE_REGEX . test( "1 555-555-5555" ) ) ;
1717}
1818
19+ #[ cfg( feature = "unstable-attr-regex" ) ]
1920#[ test]
2021fn phone_number_struct ( ) {
2122 #[ derive( PartialEq , Eq , Debug ) ]
You can’t perform that action at this time.
0 commit comments