File tree Expand file tree Collapse file tree 2 files changed +3
-27
lines changed Expand file tree Collapse file tree 2 files changed +3
-27
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ edition = "2021"
11
11
[build-dependencies ]
12
12
tiny-keccak = { version = " 2" , features = [" sha3" ] }
13
13
phf_codegen = " 0.10"
14
- lalrpop = { version = " 0.19.8" , optional = true }
14
+ lalrpop = { version = " 0.19.8" }
15
15
anyhow = " 1.0.45"
16
16
17
17
[dependencies ]
Original file line number Diff line number Diff line change @@ -70,36 +70,12 @@ fn try_lalrpop(source: &str, target: &str) -> anyhow::Result<()> {
70
70
return Ok ( ( ) ) ;
71
71
}
72
72
73
- #[ cfg( feature = "lalrpop" ) ]
74
- lalrpop_dependency ( ) ;
75
- #[ cfg( not( feature = "lalrpop" ) ) ]
76
- lalrpop_command ( source) ?;
73
+ lalrpop ( ) ;
77
74
78
75
Ok ( ( ) )
79
76
}
80
77
81
- #[ cfg( not( feature = "lalrpop" ) ) ]
82
- fn lalrpop_command ( source : & str ) -> anyhow:: Result < ( ) > {
83
- match std:: process:: Command :: new ( "lalrpop" ) . arg ( source) . status ( ) {
84
- Ok ( stat) if stat. success ( ) => Ok ( ( ) ) ,
85
- Ok ( stat) => {
86
- eprintln ! ( "failed to execute lalrpop; exited with {stat}" ) ;
87
- let exit_code = stat. code ( ) . map ( |v| ( v % 256 ) as u8 ) . unwrap_or ( 1 ) ;
88
- Err ( anyhow:: anyhow!( "lalrpop error status: {}" , exit_code) )
89
- }
90
- Err ( e) if e. kind ( ) == std:: io:: ErrorKind :: NotFound => {
91
- eprintln ! ( "please install lalrpop with `cargo install lalrpop` or\n `cargo build --manifest-path=parser/Cargo.toml --features=lalrpop`" ) ;
92
- Err ( anyhow:: anyhow!(
93
- "the lalrpop executable is not installed and parser/{} has been changed" ,
94
- source
95
- ) )
96
- }
97
- Err ( e) => Err ( anyhow:: Error :: new ( e) ) ,
98
- }
99
- }
100
-
101
- #[ cfg( feature = "lalrpop" ) ]
102
- fn lalrpop_dependency ( ) {
78
+ fn lalrpop ( ) {
103
79
lalrpop:: process_root ( ) . unwrap ( )
104
80
}
105
81
You can’t perform that action at this time.
0 commit comments