File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const _kMatcherGroupPrefix = '__mg__';
5
5
6
6
class Parser {
7
7
Parser ({
8
- required List <TextMatcher > matchers,
8
+ required Iterable <TextMatcher > matchers,
9
9
required this .multiLine,
10
10
required this .caseSensitive,
11
11
required this .unicode,
@@ -19,14 +19,14 @@ class Parser {
19
19
final bool unicode;
20
20
final bool dotAll;
21
21
22
- late List <TextMatcher > _matchers;
22
+ late Iterable <TextMatcher > _matchers;
23
23
final List <String > _matcherGroupNames = [];
24
24
final List <List <int >> _matcherGroupRanges = [];
25
25
late String _pattern;
26
26
27
27
List <TextMatcher > get matchers => List .unmodifiable (_matchers);
28
28
29
- void update (List <TextMatcher > matchers) {
29
+ void update (Iterable <TextMatcher > matchers) {
30
30
assert (
31
31
matchers.isNotEmpty,
32
32
'At least one matcher must not specified.' ,
@@ -43,7 +43,7 @@ class Parser {
43
43
final groupName = '$_kMatcherGroupPrefix $i ' ;
44
44
_matcherGroupNames.add (groupName);
45
45
46
- var pattern = matchers[i] .pattern;
46
+ var pattern = matchers. elementAt (i) .pattern;
47
47
if (pattern.isEmpty) {
48
48
// Expression that does not match anything.
49
49
pattern = '(?!)' ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class TextParser {
25
25
/// If [dotAll] is enabled, then the `.` pattern will match _all_
26
26
/// characters, including line terminators.
27
27
TextParser ({
28
- required List <TextMatcher > matchers,
28
+ required Iterable <TextMatcher > matchers,
29
29
bool multiLine = false ,
30
30
bool caseSensitive = true ,
31
31
bool unicode = false ,
You can’t perform that action at this time.
0 commit comments