| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #library('frog_leg'); | 5 #library('frog_leg'); |
| 6 | 6 |
| 7 #import('../../lib/uri/uri.dart'); | 7 #import('../../lib/uri/uri.dart'); |
| 8 #import('../lang.dart', prefix: 'frog'); | 8 #import('../lang.dart', prefix: 'frog'); |
| 9 #import('elements/elements.dart'); | 9 #import('elements/elements.dart'); |
| 10 #import('io/io.dart', prefix: 'io'); | 10 #import('io/io.dart', prefix: 'io'); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 final end = node.getEndToken(); | 52 final end = node.getEndToken(); |
| 53 if (begin === null || end === null) { | 53 if (begin === null || end === null) { |
| 54 cancel('cannot find tokens to produce error message for $node.'); | 54 cancel('cannot find tokens to produce error message for $node.'); |
| 55 } | 55 } |
| 56 final startOffset = begin.charOffset; | 56 final startOffset = begin.charOffset; |
| 57 final endOffset = end.charOffset + end.toString().length; | 57 final endOffset = end.charOffset + end.toString().length; |
| 58 return new frog.SourceSpan(current.file, startOffset, endOffset); | 58 return new frog.SourceSpan(current.file, startOffset, endOffset); |
| 59 } | 59 } |
| 60 | 60 |
| 61 currentScript() { | 61 currentScript() { |
| 62 if (currentElement === null) return null; |
| 62 CompilationUnitElement compilationUnit = | 63 CompilationUnitElement compilationUnit = |
| 63 currentElement.getCompilationUnit(); | 64 currentElement.getCompilationUnit(); |
| 64 if (compilationUnit === null) return null; | 65 if (compilationUnit === null) return null; |
| 65 return compilationUnit.script; | 66 return compilationUnit.script; |
| 66 } | 67 } |
| 67 | 68 |
| 68 reportWarning(Node node, var message) { | 69 reportWarning(Node node, var message) { |
| 69 frog.SourceSpan span; | 70 frog.SourceSpan span; |
| 70 Script current = currentScript(); | 71 Script current = currentScript(); |
| 71 if (current === null) { | 72 if (current === null) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 116 } |
| 116 super.cancel(reason, node, token, instruction); | 117 super.cancel(reason, node, token, instruction); |
| 117 } | 118 } |
| 118 } | 119 } |
| 119 | 120 |
| 120 class AbortLeg { | 121 class AbortLeg { |
| 121 final message; | 122 final message; |
| 122 AbortLeg(this.message); | 123 AbortLeg(this.message); |
| 123 toString() => 'Aborted due to --throw-on-error: $message'; | 124 toString() => 'Aborted due to --throw-on-error: $message'; |
| 124 } | 125 } |
| OLD | NEW |