Chromium Code Reviews| Index: dart/frog/leg/frog_leg.dart |
| diff --git a/dart/frog/leg/frog_leg.dart b/dart/frog/leg/frog_leg.dart |
| index f1febacfc067cfc7fe6d885bedb1b329c4ae296a..3dbfce1a2c4b8261a01acd30426323ad8cd5494c 100644 |
| --- a/dart/frog/leg/frog_leg.dart |
| +++ b/dart/frog/leg/frog_leg.dart |
| @@ -91,16 +91,23 @@ class WorldCompiler extends Compiler { |
| String get legDirectory() => io.join([frog.options.libDir, '..', 'leg']); |
| - void cancel([String reason, Node node, token, instruction]) { |
| + void cancel([String reason, Node node, token, instruction, element]) { |
| Script script = currentScript(); |
| if (node !== null) { |
| print(spanFromNode(node, script).toMessageString("cancel leg: $reason")); |
| - } else if (token !== null) { |
| - String tokenString = token.toString(); |
| - int begin = token.charOffset; |
| - int end = begin + tokenString.length; |
| - print(script.file.getLocationMessage("cancel leg: $reason", |
| - begin, end, true)); |
| + } else { |
| + if (token === null && element !== null) { |
|
ahe
2012/01/24 16:01:35
This is way too complicated. I have made a better
|
| + currentElement = element; |
| + script = currentScript(); |
| + token = element.position(); |
| + } |
| + if (token !== null) { |
| + String tokenString = token.toString(); |
| + int begin = token.charOffset; |
| + int end = begin + tokenString.length; |
| + print(script.file.getLocationMessage("cancel leg: $reason", |
| + begin, end, true)); |
| + } |
| } |
| if (throwOnError) { |
| throw new AbortLeg(reason); |