aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLToken.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sksl/SkSLToken.h')
-rw-r--r--src/sksl/SkSLToken.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/sksl/SkSLToken.h b/src/sksl/SkSLToken.h
index 5c8c2bd215..197781f2a0 100644
--- a/src/sksl/SkSLToken.h
+++ b/src/sksl/SkSLToken.h
@@ -160,6 +160,28 @@ struct Token {
, fKind(kind)
, fText(std::move(text)) {}
+ static bool IsAssignment(Token::Kind op) {
+ switch (op) {
+ case Token::EQ: // fall through
+ case Token::PLUSEQ: // fall through
+ case Token::MINUSEQ: // fall through
+ case Token::STAREQ: // fall through
+ case Token::SLASHEQ: // fall through
+ case Token::PERCENTEQ: // fall through
+ case Token::SHLEQ: // fall through
+ case Token::SHREQ: // fall through
+ case Token::BITWISEOREQ: // fall through
+ case Token::BITWISEXOREQ: // fall through
+ case Token::BITWISEANDEQ: // fall through
+ case Token::LOGICALOREQ: // fall through
+ case Token::LOGICALXOREQ: // fall through
+ case Token::LOGICALANDEQ:
+ return true;
+ default:
+ return false;
+ }
+ }
+
Position fPosition;
Kind fKind;
// will be the empty string unless the token has variable text content (identifiers, numeric