| Index: pkg/front_end/lib/src/fasta/kernel/utils.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/kernel/utils.dart b/pkg/front_end/lib/src/fasta/kernel/utils.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0b5f3f497bf45bd31854ea3e07f32c69432e94d1
|
| --- /dev/null
|
| +++ b/pkg/front_end/lib/src/fasta/kernel/utils.dart
|
| @@ -0,0 +1,11 @@
|
| +// 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.
|
| +
|
| +import 'package:front_end/src/fasta/scanner/token.dart';
|
| +import 'package:kernel/ast.dart';
|
| +
|
| +/// A null-aware alternative to `token.offset`. If [token] is `null`, returns
|
| +/// `TreeNode.noOffset`.
|
| +int offsetForToken(Token token) =>
|
| + token == null ? TreeNode.noOffset : token.offset;
|
|
|