Support for length unary operator
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -362,6 +362,7 @@ namespace Porygon::Parser {
|
||||
switch (kind) {
|
||||
case TokenKind::PlusToken:
|
||||
case TokenKind::MinusToken:
|
||||
case TokenKind::HashToken:
|
||||
case TokenKind::NotKeyword:
|
||||
return OperatorPrecedence::Unary;
|
||||
default:
|
||||
@@ -375,6 +376,8 @@ namespace Porygon::Parser {
|
||||
return UnaryOperatorKind::Identity;
|
||||
case TokenKind::MinusToken:
|
||||
return UnaryOperatorKind::Negation;
|
||||
case TokenKind::HashToken :
|
||||
return UnaryOperatorKind::Count;
|
||||
case TokenKind::NotKeyword:
|
||||
return UnaryOperatorKind::LogicalNegation;
|
||||
default: // This should never trigger, so throw.
|
||||
|
||||
Reference in New Issue
Block a user