Skip to content

Commit

Permalink
Fix some imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
renggli committed Jan 2, 2025
1 parent 517c63b commit 8098305
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
2 changes: 0 additions & 2 deletions lib/parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ export 'src/parser/predicate/character.dart';
export 'src/parser/predicate/converter.dart';
export 'src/parser/predicate/pattern.dart';
export 'src/parser/predicate/predicate.dart';
export 'src/parser/predicate/single_character.dart';
export 'src/parser/predicate/string.dart';
export 'src/parser/predicate/unicode_character.dart';
export 'src/parser/repeater/character.dart';
export 'src/parser/repeater/greedy.dart';
export 'src/parser/repeater/lazy.dart';
Expand Down
5 changes: 4 additions & 1 deletion lib/src/parser/predicate/character.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import 'package:meta/meta.dart';

import '../../../parser.dart';
import '../../core/parser.dart';
import '../character/predicate.dart';
import 'single_character.dart';
import 'unicode_character.dart';

/// Abstract parser for character classes.
abstract class CharacterParser extends Parser<String> {
Expand Down
21 changes: 20 additions & 1 deletion lib/src/reflection/internal/linter_rules.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
import '../../../parser.dart';
import '../../core/parser.dart';
import '../../parser/action/cast.dart';
import '../../parser/action/cast_list.dart';
import '../../parser/action/flatten.dart';
import '../../parser/action/map.dart';
import '../../parser/action/permute.dart';
import '../../parser/action/pick.dart';
import '../../parser/action/token.dart';
import '../../parser/action/where.dart';
import '../../parser/combinator/choice.dart';
import '../../parser/combinator/settable.dart';
import '../../parser/misc/failure.dart';
import '../../parser/misc/newline.dart';
import '../../parser/predicate/character.dart';
import '../../parser/predicate/predicate.dart';
import '../../parser/predicate/single_character.dart';
import '../../parser/repeater/character.dart';
import '../../parser/repeater/possessive.dart';
import '../../parser/repeater/repeating.dart';
import '../../parser/utils/resolvable.dart';
import '../../parser/utils/sequential.dart';
import '../analyzer.dart';
import '../linter.dart';
Expand Down
13 changes: 11 additions & 2 deletions lib/src/reflection/internal/optimize_rules.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import '../../../parser.dart';
import '../../../reflection.dart';
import '../../core/parser.dart';
import '../../parser/action/flatten.dart';
import '../../parser/combinator/choice.dart';
import '../../parser/combinator/delegate.dart';
import '../../parser/combinator/settable.dart';
import '../../parser/misc/label.dart';
import '../../parser/predicate/single_character.dart';
import '../../parser/repeater/character.dart';
import '../../parser/repeater/possessive.dart';
import '../analyzer.dart';
import '../optimize.dart';

class CharacterRepeater extends OptimizeRule {
const CharacterRepeater();
Expand Down
3 changes: 1 addition & 2 deletions test/reflection_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1033,8 +1033,7 @@ void main() {
test('child replacement performed', () {
final input = char('a') | char('b'), replacement = char('c');
final rule = PluggableOptimizeRule(<R>(rule, analyzer, parser, replace) {
if (parser is SingleCharacterParser &&
(parser as SingleCharacterParser).message == '"b" expected') {
if (parser case CharacterParser(message: '"b" expected')) {
replace(parser, replacement as Parser<R>);
}
});
Expand Down

0 comments on commit 8098305

Please sign in to comment.