| OLD | NEW |
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 import 'package:kernel/kernel.dart'; | 6 import 'package:kernel/kernel.dart'; |
| 7 import 'package:kernel/interpreter/interpreter.dart'; | 7 import 'package:kernel/interpreter/interpreter.dart'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 fail(String message) { | 10 fail(String message) { |
| 11 stderr.writeln(message); | 11 stderr.writeln(message); |
| 12 exit(1); | 12 exit(1); |
| 13 } | 13 } |
| 14 | 14 |
| 15 main(List<String> args) { | 15 main(List<String> args) { |
| 16 if (args.length == 1 && args[0].endsWith('.dill')) { | 16 if (args.length == 1 && args[0].endsWith('.dill')) { |
| 17 var program = loadProgramFromBinary(args[0]); | 17 var program = loadProgramFromBinary(args[0]); |
| 18 new Interpreter(program).evalProgram(); | 18 new Interpreter(program).run(); |
| 19 } else { | 19 } else { |
| 20 return fail('One input binary file should be specified.'); | 20 return fail('One input binary file should be specified.'); |
| 21 } | 21 } |
| 22 } | 22 } |
| OLD | NEW |