Skip to content

Commit d1f34dc

Browse files
committed
AST: Add isBitwiseOperator() and isShiftOperator() methods to Identifier
1 parent 0c7e7f3 commit d1f34dc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/swift/AST/Identifier.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ class Identifier {
118118
return is("+") || is("-") || is("*") || is("/") || is("%");
119119
}
120120

121+
bool isBitwiseOperator() const {
122+
return is("~") || is("&") || is("|") || is("^");
123+
}
124+
125+
bool isShiftOperator() const {
126+
return is("<<") || is(">>");
127+
}
128+
121129
// Returns whether this is a standard comparison operator,
122130
// such as '==', '>=' or '!=='.
123131
bool isStandardComparisonOperator() const {

0 commit comments

Comments
 (0)