@@ -13,10 +13,11 @@ extern crate linear_map;
13
13
14
14
extern crate hyper;
15
15
16
+ #[ cfg( feature = "llvm-backend" ) ]
16
17
extern crate llvm_sys;
17
-
18
+ # [ cfg ( feature = "llvm-backend" ) ]
18
19
extern crate itertools;
19
-
20
+ # [ cfg ( feature = "llvm-backend" ) ]
20
21
extern crate libc;
21
22
22
23
// include output of rust-peg given grammar.rustpeg
@@ -28,6 +29,7 @@ mod parser {
28
29
mod ast;
29
30
mod runtime;
30
31
mod ast_walk_interpreter;
32
+ #[ cfg( feature = "llvm-backend" ) ]
31
33
mod llvm_interpreter;
32
34
mod value;
33
35
mod operations;
@@ -47,17 +49,21 @@ mod file_test {
47
49
48
50
use runtime:: * ;
49
51
use ast_walk_interpreter:: AstWalkInterpreter ;
52
+ #[ cfg( feature = "llvm-backend" ) ]
50
53
use llvm_interpreter:: LLVMInterpreter ;
51
54
52
55
use error:: * ;
53
56
54
57
// FIXME: How do you represent the usage style in POSIX notation?
55
58
fn print_usage ( ) {
56
- println ! ( "usage: balloon [--repl-llvm | [MODE] FILE ]
57
-
58
-
59
- --repl-llvm launches the experimental REPL
59
+ if cfg ! ( feature = "llvm-backend" ) {
60
+ println ! ( "usage: balloon [--repl-llvm | [MODE] FILE ]
60
61
62
+ --repl-llvm launches the experimental REPL" ) ;
63
+ } else {
64
+ println ! ( "usage: balloon [MODE] FILE" ) ;
65
+ }
66
+ println ! ( "
61
67
where MODE is one of:
62
68
--run (default) runs the file [FILE]
63
69
--check type check the file [FILE]
@@ -71,6 +77,7 @@ fn main() {
71
77
1 => repl:: run_repl ( AstWalkInterpreter :: new ( ) ) ,
72
78
2 => {
73
79
match args[ 1 ] . as_str ( ) {
80
+ #[ cfg( feature = "llvm-backend" ) ]
74
81
"--repl-llvm" => repl:: run_repl ( LLVMInterpreter :: new ( ) ) ,
75
82
filepath => run_file ( filepath, AstWalkInterpreter :: new ( ) ) ,
76
83
}
0 commit comments