File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -517,16 +517,16 @@ class Parser {
517
517
// / Add a camel-cased option if it is different than the first option.
518
518
void diagnoseConsecutiveIDs (StringRef First, SourceLoc FirstLoc,
519
519
StringRef DeclKindName);
520
-
521
- // / \brief Check whether the current token starts with '<'.
522
- bool startsWithLess (Token Tok) {
523
- return Tok. isAnyOperator () && Tok.getText ()[0 ] == ' < ' ;
520
+
521
+ bool startsWithSymbol (Token Tok, char symbol) {
522
+ return (Tok. isAnyOperator () || Tok. isPunctuation ()) &&
523
+ Tok.getText ()[0 ] == symbol ;
524
524
}
525
+ // / \brief Check whether the current token starts with '<'.
526
+ bool startsWithLess (Token Tok) { return startsWithSymbol (Tok, ' <' ); }
525
527
526
528
// / \brief Check whether the current token starts with '>'.
527
- bool startsWithGreater (Token Tok) {
528
- return Tok.isAnyOperator () && Tok.getText ()[0 ] == ' >' ;
529
- }
529
+ bool startsWithGreater (Token Tok) { return startsWithSymbol (Tok, ' >' ); }
530
530
531
531
// / \brief Consume the starting '<' of the current token, which may either
532
532
// / be a complete '<' token or some kind of operator token starting with '<',
You can’t perform that action at this time.
0 commit comments