Adds support for parenthesized expressions
This commit is contained in:
@@ -16,6 +16,7 @@ enum class ParsedExpressionKind{
|
||||
|
||||
Unary,
|
||||
Binary,
|
||||
Parenthesized,
|
||||
};
|
||||
|
||||
class ParsedExpression {
|
||||
@@ -96,6 +97,23 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class ParenthesizedExpression : public ParsedExpression{
|
||||
ParsedExpression* _expression;
|
||||
public:
|
||||
ParsedExpressionKind GetKind() final{
|
||||
return ParsedExpressionKind::Parenthesized;
|
||||
}
|
||||
|
||||
explicit ParenthesizedExpression(ParsedExpression* innerExpression, unsigned int start, unsigned int length)
|
||||
: ParsedExpression(start, length){
|
||||
_expression = innerExpression;
|
||||
}
|
||||
|
||||
ParsedExpression* GetInnerExpression(){
|
||||
return _expression;
|
||||
}
|
||||
};
|
||||
|
||||
class UnaryExpression : public ParsedExpression{
|
||||
UnaryOperatorKind _kind;
|
||||
ParsedExpression* _operand;
|
||||
|
||||
Reference in New Issue
Block a user