| OLD | NEW |
| 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 library fletchc.driver_main; | 5 library fletchc.driver_main; |
| 6 | 6 |
| 7 import 'dart:collection' show | 7 import 'dart:collection' show |
| 8 Queue; | 8 Queue; |
| 9 | 9 |
| 10 import 'dart:io' hide | 10 import 'dart:io' hide |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 commandSender.sendExitCode(exitCode); | 451 commandSender.sendExitCode(exitCode); |
| 452 endClientSession(); | 452 endClientSession(); |
| 453 } | 453 } |
| 454 | 454 |
| 455 AnalyzedSentence parseArguments(List<String> arguments) { | 455 AnalyzedSentence parseArguments(List<String> arguments) { |
| 456 Options options = Options.parse(arguments); | 456 Options options = Options.parse(arguments); |
| 457 Sentence sentence = | 457 Sentence sentence = |
| 458 parseSentence(options.nonOptionArguments, includesProgramName: true); | 458 parseSentence(options.nonOptionArguments, includesProgramName: true); |
| 459 /// [programName] is the canonicalized absolute path to the fletch | 459 // [programName] is the canonicalized absolute path to the fletch |
| 460 /// executable (the C++ program). | 460 // executable (the C++ program). |
| 461 String programName = sentence.programName; | 461 String programName = sentence.programName; |
| 462 String fletchVm = "$programName-vm"; | 462 String fletchVm = "$programName-vm"; |
| 463 this.sentence = analyzeSentence(sentence, options); | 463 this.sentence = analyzeSentence(sentence, options); |
| 464 this.fletchVm = fletchVm; | 464 this.fletchVm = fletchVm; |
| 465 return this.sentence; | 465 return this.sentence; |
| 466 } | 466 } |
| 467 | 467 |
| 468 int reportErrorToClient(InputError error, StackTrace stackTrace) { | 468 int reportErrorToClient(InputError error, StackTrace stackTrace) { |
| 469 bool isInternalError = error.kind == DiagnosticKind.internalError; | 469 bool isInternalError = error.kind == DiagnosticKind.internalError; |
| 470 if (isInternalError && !crashReportRequested) { | 470 if (isInternalError && !crashReportRequested) { |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 | 797 |
| 798 void error(error, StackTrace stackTrace) { | 798 void error(error, StackTrace stackTrace) { |
| 799 // TODO(ahe): Modify quit verb to report these errors. | 799 // TODO(ahe): Modify quit verb to report these errors. |
| 800 erroneousClients.add(this); | 800 erroneousClients.add(this); |
| 801 note("Crash (${arguments.join(' ')}).\n" | 801 note("Crash (${arguments.join(' ')}).\n" |
| 802 "${stringifyError(error, stackTrace)}"); | 802 "${stringifyError(error, stackTrace)}"); |
| 803 } | 803 } |
| 804 | 804 |
| 805 String toString() => "$id"; | 805 String toString() => "$id"; |
| 806 } | 806 } |
| OLD | NEW |