@@ -344,25 +344,25 @@ abstract class IdentifierContext {
344344bool looksLikeExpressionStart (Token next) =>
345345 next.isIdentifier ||
346346 next.isKeyword && ! looksLikeStatementStart (next) ||
347- next.isA2 (TokenType .DOUBLE ) ||
348- next.isA2 (TokenType .DOUBLE_WITH_SEPARATORS ) ||
349- next.isA2 (TokenType .HASH ) ||
350- next.isA2 (TokenType .HEXADECIMAL ) ||
351- next.isA2 (TokenType .HEXADECIMAL_WITH_SEPARATORS ) ||
352- next.isA2 (TokenType .IDENTIFIER ) ||
353- next.isA2 (TokenType .INT ) ||
354- next.isA2 (TokenType .INT_WITH_SEPARATORS ) ||
355- next.isA2 (TokenType .STRING ) ||
356- next.isA2 (TokenType .OPEN_CURLY_BRACKET ) ||
357- next.isA2 (TokenType .OPEN_PAREN ) ||
358- next.isA2 (TokenType .OPEN_SQUARE_BRACKET ) ||
359- next.isA2 (TokenType .INDEX ) ||
360- next.isA2 (TokenType .LT ) ||
361- next.isA2 (TokenType .BANG ) ||
362- next.isA2 (TokenType .MINUS ) ||
363- next.isA2 (TokenType .TILDE ) ||
364- next.isA2 (TokenType .PLUS_PLUS ) ||
365- next.isA2 (TokenType .MINUS_MINUS );
347+ next.isA (TokenType .DOUBLE ) ||
348+ next.isA (TokenType .DOUBLE_WITH_SEPARATORS ) ||
349+ next.isA (TokenType .HASH ) ||
350+ next.isA (TokenType .HEXADECIMAL ) ||
351+ next.isA (TokenType .HEXADECIMAL_WITH_SEPARATORS ) ||
352+ next.isA (TokenType .IDENTIFIER ) ||
353+ next.isA (TokenType .INT ) ||
354+ next.isA (TokenType .INT_WITH_SEPARATORS ) ||
355+ next.isA (TokenType .STRING ) ||
356+ next.isA (TokenType .OPEN_CURLY_BRACKET ) ||
357+ next.isA (TokenType .OPEN_PAREN ) ||
358+ next.isA (TokenType .OPEN_SQUARE_BRACKET ) ||
359+ next.isA (TokenType .INDEX ) ||
360+ next.isA (TokenType .LT ) ||
361+ next.isA (TokenType .BANG ) ||
362+ next.isA (TokenType .MINUS ) ||
363+ next.isA (TokenType .TILDE ) ||
364+ next.isA (TokenType .PLUS_PLUS ) ||
365+ next.isA (TokenType .MINUS_MINUS );
366366
367367/// Returns `true` if [next] should be treated like the start of a pattern for
368368/// the purposes of recovery.
@@ -371,59 +371,59 @@ bool looksLikeExpressionStart(Token next) =>
371371/// we mostly re-use [looksLikeExpressionStart] .
372372bool looksLikePatternStart (Token next) =>
373373 next.isIdentifier ||
374- next.isA2 (TokenType .DOUBLE ) ||
375- next.isA2 (TokenType .DOUBLE_WITH_SEPARATORS ) ||
376- next.isA2 (TokenType .HASH ) ||
377- next.isA2 (TokenType .HEXADECIMAL ) ||
378- next.isA2 (TokenType .HEXADECIMAL_WITH_SEPARATORS ) ||
379- next.isA2 (TokenType .IDENTIFIER ) ||
380- next.isA2 (TokenType .INT ) ||
381- next.isA2 (TokenType .INT_WITH_SEPARATORS ) ||
382- next.isA2 (TokenType .STRING ) ||
383- next.isA2 (Keyword .NULL ) ||
384- next.isA2 (Keyword .FALSE ) ||
385- next.isA2 (Keyword .TRUE ) ||
386- next.isA2 (TokenType .OPEN_CURLY_BRACKET ) ||
387- next.isA2 (TokenType .OPEN_PAREN ) ||
388- next.isA2 (TokenType .OPEN_SQUARE_BRACKET ) ||
389- next.isA2 (TokenType .INDEX ) ||
390- next.isA2 (TokenType .LT ) ||
391- next.isA2 (TokenType .LT_EQ ) ||
392- next.isA2 (TokenType .GT ) ||
393- next.isA2 (TokenType .GT_EQ ) ||
394- next.isA2 (TokenType .BANG_EQ ) ||
395- next.isA2 (TokenType .EQ_EQ ) ||
396- next.isA2 (Keyword .VAR ) ||
397- next.isA2 (Keyword .FINAL ) ||
398- next.isA2 (Keyword .CONST );
374+ next.isA (TokenType .DOUBLE ) ||
375+ next.isA (TokenType .DOUBLE_WITH_SEPARATORS ) ||
376+ next.isA (TokenType .HASH ) ||
377+ next.isA (TokenType .HEXADECIMAL ) ||
378+ next.isA (TokenType .HEXADECIMAL_WITH_SEPARATORS ) ||
379+ next.isA (TokenType .IDENTIFIER ) ||
380+ next.isA (TokenType .INT ) ||
381+ next.isA (TokenType .INT_WITH_SEPARATORS ) ||
382+ next.isA (TokenType .STRING ) ||
383+ next.isA (Keyword .NULL ) ||
384+ next.isA (Keyword .FALSE ) ||
385+ next.isA (Keyword .TRUE ) ||
386+ next.isA (TokenType .OPEN_CURLY_BRACKET ) ||
387+ next.isA (TokenType .OPEN_PAREN ) ||
388+ next.isA (TokenType .OPEN_SQUARE_BRACKET ) ||
389+ next.isA (TokenType .INDEX ) ||
390+ next.isA (TokenType .LT ) ||
391+ next.isA (TokenType .LT_EQ ) ||
392+ next.isA (TokenType .GT ) ||
393+ next.isA (TokenType .GT_EQ ) ||
394+ next.isA (TokenType .BANG_EQ ) ||
395+ next.isA (TokenType .EQ_EQ ) ||
396+ next.isA (Keyword .VAR ) ||
397+ next.isA (Keyword .FINAL ) ||
398+ next.isA (Keyword .CONST );
399399
400400/// Return `true` if the given [token] should be treated like the start of
401401/// a new statement for the purposes of recovery.
402402bool looksLikeStatementStart (Token token) =>
403- token.isA2 (TokenType .AT ) ||
404- token.isA2 (Keyword .ASSERT ) ||
405- token.isA2 (Keyword .BREAK ) ||
406- token.isA2 (Keyword .CONTINUE ) ||
407- token.isA2 (Keyword .DO ) ||
408- token.isA2 (Keyword .ELSE ) ||
409- token.isA2 (Keyword .FINAL ) ||
410- token.isA2 (Keyword .FOR ) ||
411- token.isA2 (Keyword .IF ) ||
412- token.isA2 (Keyword .RETURN ) ||
413- token.isA2 (Keyword .SWITCH ) ||
414- token.isA2 (Keyword .TRY ) ||
415- token.isA2 (Keyword .VAR ) ||
416- token.isA2 (Keyword .VOID ) ||
417- token.isA2 (Keyword .WHILE ) ||
418- token.isA2 (TokenType .EOF );
403+ token.isA (TokenType .AT ) ||
404+ token.isA (Keyword .ASSERT ) ||
405+ token.isA (Keyword .BREAK ) ||
406+ token.isA (Keyword .CONTINUE ) ||
407+ token.isA (Keyword .DO ) ||
408+ token.isA (Keyword .ELSE ) ||
409+ token.isA (Keyword .FINAL ) ||
410+ token.isA (Keyword .FOR ) ||
411+ token.isA (Keyword .IF ) ||
412+ token.isA (Keyword .RETURN ) ||
413+ token.isA (Keyword .SWITCH ) ||
414+ token.isA (Keyword .TRY ) ||
415+ token.isA (Keyword .VAR ) ||
416+ token.isA (Keyword .VOID ) ||
417+ token.isA (Keyword .WHILE ) ||
418+ token.isA (TokenType .EOF );
419419
420420bool isOkNextValueInFormalParameter (Token token) =>
421- token.isA2 (TokenType .EQ ) ||
422- token.isA2 (TokenType .COLON ) ||
423- token.isA2 (TokenType .COMMA ) ||
424- token.isA2 (TokenType .CLOSE_PAREN ) ||
425- token.isA2 (TokenType .CLOSE_SQUARE_BRACKET ) ||
426- token.isA2 (TokenType .CLOSE_CURLY_BRACKET );
421+ token.isA (TokenType .EQ ) ||
422+ token.isA (TokenType .COLON ) ||
423+ token.isA (TokenType .COMMA ) ||
424+ token.isA (TokenType .CLOSE_PAREN ) ||
425+ token.isA (TokenType .CLOSE_SQUARE_BRACKET ) ||
426+ token.isA (TokenType .CLOSE_CURLY_BRACKET );
427427
428428// TODO(ahe): Remove when analyzer supports generalized function syntax.
429429typedef _MessageWithArgument <T > = Message Function (T );
0 commit comments