diff --git a/lib/src/short/fast_hash.dart b/lib/src/fast_hash.dart similarity index 100% rename from lib/src/short/fast_hash.dart rename to lib/src/fast_hash.dart diff --git a/lib/src/piece/piece.dart b/lib/src/piece/piece.dart index 348bb43d..e44cac13 100644 --- a/lib/src/piece/piece.dart +++ b/lib/src/piece/piece.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import '../back_end/code_writer.dart'; +import '../fast_hash.dart'; import '../profile.dart'; typedef Constrain = void Function(Piece other, State constrainedState); @@ -14,7 +15,7 @@ typedef Constrain = void Function(Piece other, State constrainedState); /// roughly follows the AST but includes comments and is optimized for /// formatting and line splitting. The final output is then determined by /// deciding which pieces split and how. -abstract base class Piece { +abstract base class Piece with FastHash { /// The ordered list of all possible ways this piece could split. /// /// Piece subclasses should override this if they support being split in @@ -190,7 +191,7 @@ abstract base class Piece { String get debugName => runtimeType.toString().replaceAll('Piece', ''); @override - String toString() => '$debugName${_pinnedState ?? ''}'; + String toString() => '$debugName$id${_pinnedState ?? ''}'; } /// A state that a piece can be in. diff --git a/lib/src/short/chunk.dart b/lib/src/short/chunk.dart index c37ed110..9af7b879 100644 --- a/lib/src/short/chunk.dart +++ b/lib/src/short/chunk.dart @@ -1,8 +1,8 @@ // Copyright (c) 2014, 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 '../fast_hash.dart'; import '../profile.dart'; -import 'fast_hash.dart'; import 'marking_scheme.dart'; import 'nesting_level.dart'; import 'rule/rule.dart'; diff --git a/lib/src/short/nesting_level.dart b/lib/src/short/nesting_level.dart index 0040233f..6260b533 100644 --- a/lib/src/short/nesting_level.dart +++ b/lib/src/short/nesting_level.dart @@ -2,7 +2,7 @@ // 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 'fast_hash.dart'; +import '../fast_hash.dart'; import 'marking_scheme.dart'; /// A single level of expression nesting. diff --git a/lib/src/short/rule/rule.dart b/lib/src/short/rule/rule.dart index 393d48d7..62f48228 100644 --- a/lib/src/short/rule/rule.dart +++ b/lib/src/short/rule/rule.dart @@ -3,9 +3,9 @@ // BSD-style license that can be found in the LICENSE file. import '../../constants.dart'; +import '../../fast_hash.dart'; import '../../profile.dart'; import '../chunk.dart'; -import '../fast_hash.dart'; /// A constraint that determines the different ways a related set of chunks may /// be split.