| Index: pkg/front_end/lib/src/fasta/parser/parser_error.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/parser/parser_error.dart b/pkg/front_end/lib/src/fasta/parser/parser_error.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..366ce2426007b9cf6d0d9b519d78b5af021d6705
|
| --- /dev/null
|
| +++ b/pkg/front_end/lib/src/fasta/parser/parser_error.dart
|
| @@ -0,0 +1,26 @@
|
| +// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +library fasta.parser.parser_error;
|
| +
|
| +import '../fasta_codes.dart' show Message;
|
| +
|
| +import '../scanner.dart' show Token;
|
| +
|
| +class ParserError {
|
| + /// Character offset from the beginning of file where this error starts.
|
| + final int beginOffset;
|
| +
|
| + /// Character offset from the beginning of file where this error ends.
|
| + final int endOffset;
|
| +
|
| + final Message message;
|
| +
|
| + ParserError(this.beginOffset, this.endOffset, this.message);
|
| +
|
| + ParserError.fromTokens(Token begin, Token end, Message message)
|
| + : this(begin.charOffset, end.charOffset + end.charCount, message);
|
| +
|
| + String toString() => "@${beginOffset}: ${message.message}\n${message.tip}";
|
| +}
|
|
|