@@ -26,7 +26,7 @@ const Map<String, String> operatorNames = {
2626 '|' : 'bitwise_or' ,
2727 '&' : 'bitwise_and' ,
2828 '~/' : 'truncate_divide' ,
29- '%' : 'modulo'
29+ '%' : 'modulo' ,
3030};
3131
3232class StringTrie {
@@ -132,8 +132,10 @@ class CommentReferenceParser {
132132 _TypeVariablesResultType .parsedTypeVariables) {
133133 children.add (typeVariablesResult.node! );
134134 } else {
135- assert (typeVariablesResult.type ==
136- _TypeVariablesResultType .notTypeVariables);
135+ assert (
136+ typeVariablesResult.type ==
137+ _TypeVariablesResultType .notTypeVariables,
138+ );
137139 }
138140 }
139141 if (_atEnd || _thisChar != $dot) {
@@ -169,8 +171,9 @@ class CommentReferenceParser {
169171 return _PrefixParseResult .endOfFile;
170172 }
171173 _walkPastWhitespace ();
172- if (_ignorePrefixes
173- .any ((p) => _tryMatchLiteral (p, requireTrailingNonidentifier: true ))) {
174+ if (_ignorePrefixes.any (
175+ (p) => _tryMatchLiteral (p, requireTrailingNonidentifier: true ),
176+ )) {
174177 return _PrefixParseResult .junk;
175178 }
176179
@@ -239,7 +242,8 @@ class CommentReferenceParser {
239242 _index++ ;
240243 }
241244 return _IdentifierParseResult .ok (
242- IdentifierNode (_codeRef.substring (startIndex, _index)));
245+ IdentifierNode (_codeRef.substring (startIndex, _index)),
246+ );
243247 }
244248
245249 /// Parses a list of type variables (arguments or parameters).
@@ -253,7 +257,8 @@ class CommentReferenceParser {
253257 var startIndex = _index;
254258 if (_matchBraces ($lt, $gt)) {
255259 return _TypeVariablesParseResult .ok (
256- TypeVariablesNode (_codeRef.substring (startIndex + 1 , _index - 1 )));
260+ TypeVariablesNode (_codeRef.substring (startIndex + 1 , _index - 1 )),
261+ );
257262 }
258263 return _TypeVariablesParseResult .notIdentifier;
259264 }
@@ -281,7 +286,8 @@ class CommentReferenceParser {
281286 if (_tryMatchLiteral (_callableHintSuffix)) {
282287 if (_atEnd) {
283288 return _SuffixParseResult .ok (
284- CallableHintEndNode (_codeRef.substring (startIndex, _index)));
289+ CallableHintEndNode (_codeRef.substring (startIndex, _index)),
290+ );
285291 }
286292 return _SuffixParseResult .notSuffix;
287293 }
@@ -301,14 +307,18 @@ class CommentReferenceParser {
301307 int get _thisChar => _codeRef.codeUnitAt (_index);
302308
303309 /// Advances [_index] on match, preserves on non-match.
304- bool _tryMatchLiteral (String characters,
305- {bool acceptTrailingWhitespace = true ,
306- bool requireTrailingNonidentifier = false }) {
310+ bool _tryMatchLiteral (
311+ String characters, {
312+ bool acceptTrailingWhitespace = true ,
313+ bool requireTrailingNonidentifier = false ,
314+ }) {
307315 if (characters.length + _index > _referenceLength) return false ;
308316 int startIndex;
309- for (startIndex = _index;
310- _index - startIndex < characters.length;
311- _index++ ) {
317+ for (
318+ startIndex = _index;
319+ _index - startIndex < characters.length;
320+ _index++
321+ ) {
312322 if (_codeRef.codeUnitAt (_index) !=
313323 characters.codeUnitAt (_index - startIndex)) {
314324 _index = startIndex;
@@ -377,14 +387,20 @@ class _PrefixParseResult {
377387
378388 const _PrefixParseResult ._(this .type, this .node);
379389
380- static const _PrefixParseResult endOfFile =
381- _PrefixParseResult ._(_PrefixResultType .endOfFile, null );
390+ static const _PrefixParseResult endOfFile = _PrefixParseResult ._(
391+ _PrefixResultType .endOfFile,
392+ null ,
393+ );
382394
383- static const _PrefixParseResult junk =
384- _PrefixParseResult ._(_PrefixResultType .junk, null );
395+ static const _PrefixParseResult junk = _PrefixParseResult ._(
396+ _PrefixResultType .junk,
397+ null ,
398+ );
385399
386- static const _PrefixParseResult missing =
387- _PrefixParseResult ._(_PrefixResultType .missing, null );
400+ static const _PrefixParseResult missing = _PrefixParseResult ._(
401+ _PrefixResultType .missing,
402+ null ,
403+ );
388404}
389405
390406enum _IdentifierResultType {
@@ -405,11 +421,15 @@ class _IdentifierParseResult {
405421 factory _IdentifierParseResult .ok (IdentifierNode node) =>
406422 _IdentifierParseResult ._(_IdentifierResultType .parsedIdentifier, node);
407423
408- static const _IdentifierParseResult endOfFile =
409- _IdentifierParseResult ._(_IdentifierResultType .endOfFile, null );
424+ static const _IdentifierParseResult endOfFile = _IdentifierParseResult ._(
425+ _IdentifierResultType .endOfFile,
426+ null ,
427+ );
410428
411- static const _IdentifierParseResult notIdentifier =
412- _IdentifierParseResult ._(_IdentifierResultType .notIdentifier, null );
429+ static const _IdentifierParseResult notIdentifier = _IdentifierParseResult ._(
430+ _IdentifierResultType .notIdentifier,
431+ null ,
432+ );
413433}
414434
415435enum _TypeVariablesResultType {
@@ -432,14 +452,18 @@ class _TypeVariablesParseResult {
432452
433453 factory _TypeVariablesParseResult .ok (TypeVariablesNode node) =>
434454 _TypeVariablesParseResult ._(
435- _TypeVariablesResultType .parsedTypeVariables, node);
455+ _TypeVariablesResultType .parsedTypeVariables,
456+ node,
457+ );
436458
437459 static const _TypeVariablesParseResult endOfFile =
438460 _TypeVariablesParseResult ._(_TypeVariablesResultType .endOfFile, null );
439461
440462 static const _TypeVariablesParseResult notIdentifier =
441463 _TypeVariablesParseResult ._(
442- _TypeVariablesResultType .notTypeVariables, null );
464+ _TypeVariablesResultType .notTypeVariables,
465+ null ,
466+ );
443467}
444468
445469enum _SuffixResultType {
@@ -460,14 +484,20 @@ class _SuffixParseResult {
460484 factory _SuffixParseResult .ok (CommentReferenceNode node) =>
461485 _SuffixParseResult ._(_SuffixResultType .parsedCallableHint, node);
462486
463- static const _SuffixParseResult junk =
464- _SuffixParseResult ._(_SuffixResultType .junk, null );
487+ static const _SuffixParseResult junk = _SuffixParseResult ._(
488+ _SuffixResultType .junk,
489+ null ,
490+ );
465491
466- static const _SuffixParseResult missing =
467- _SuffixParseResult ._(_SuffixResultType .missing, null );
492+ static const _SuffixParseResult missing = _SuffixParseResult ._(
493+ _SuffixResultType .missing,
494+ null ,
495+ );
468496
469- static const _SuffixParseResult notSuffix =
470- _SuffixParseResult ._(_SuffixResultType .notSuffix, null );
497+ static const _SuffixParseResult notSuffix = _SuffixParseResult ._(
498+ _SuffixResultType .notSuffix,
499+ null ,
500+ );
471501}
472502
473503// TODO(jcollins-g): add SourceSpans?
@@ -500,7 +530,6 @@ class IdentifierNode extends CommentReferenceNode {
500530/// comma separated.
501531class TypeVariablesNode extends CommentReferenceNode {
502532 @override
503-
504533 /// Note that this will contain commas, spaces, and other text, as
505534 /// generally type variables are a form of junk that comment references
506535 /// should ignore.
0 commit comments