aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast-full-test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-ast-full-test.cc')
-rw-r--r--gcc/rust/ast/rust-ast-full-test.cc63
1 files changed, 32 insertions, 31 deletions
diff --git a/gcc/rust/ast/rust-ast-full-test.cc b/gcc/rust/ast/rust-ast-full-test.cc
index 2c196a0..69d1e6e 100644
--- a/gcc/rust/ast/rust-ast-full-test.cc
+++ b/gcc/rust/ast/rust-ast-full-test.cc
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#include "rust-diagnostics.h"
#include "rust-ast-visitor.h"
#include "rust-session-manager.h"
+#include "operator.h"
/* Compilation unit used for various AST-related functions that would make
* the headers too long if they were defined inline and don't receive any
@@ -1602,12 +1603,12 @@ NegationExpr::as_string () const
// TODO: rewrite formula to allow outer attributes
std::string str;
- switch (negation_type)
+ switch (expr_type)
{
- case NEGATE:
+ case NegationOperator::NEGATE:
str = "-";
break;
- case NOT:
+ case NegationOperator::NOT:
str = "!";
break;
default:
@@ -1682,22 +1683,22 @@ ComparisonExpr::as_string () const
switch (expr_type)
{
- case EQUAL:
+ case ComparisonOperator::EQUAL:
str += " == ";
break;
- case NOT_EQUAL:
+ case ComparisonOperator::NOT_EQUAL:
str += " != ";
break;
- case GREATER_THAN:
+ case ComparisonOperator::GREATER_THAN:
str += " > ";
break;
- case LESS_THAN:
+ case ComparisonOperator::LESS_THAN:
str += " < ";
break;
- case GREATER_OR_EQUAL:
+ case ComparisonOperator::GREATER_OR_EQUAL:
str += " >= ";
break;
- case LESS_OR_EQUAL:
+ case ComparisonOperator::LESS_OR_EQUAL:
str += " <= ";
break;
default:
@@ -1770,10 +1771,10 @@ LazyBooleanExpr::as_string () const
switch (expr_type)
{
- case LOGICAL_OR:
+ case LazyBooleanOperator::LOGICAL_OR:
str += " || ";
break;
- case LOGICAL_AND:
+ case LazyBooleanOperator::LOGICAL_AND:
str += " && ";
break;
default:
@@ -1944,34 +1945,34 @@ CompoundAssignmentExpr::as_string () const
// get operator string
switch (expr_type)
{
- case ADD:
+ case CompoundAssignmentOperator::ADD:
operator_str = "+";
break;
- case SUBTRACT:
+ case CompoundAssignmentOperator::SUBTRACT:
operator_str = "-";
break;
- case MULTIPLY:
+ case CompoundAssignmentOperator::MULTIPLY:
operator_str = "*";
break;
- case DIVIDE:
+ case CompoundAssignmentOperator::DIVIDE:
operator_str = "/";
break;
- case MODULUS:
+ case CompoundAssignmentOperator::MODULUS:
operator_str = "%";
break;
- case BITWISE_AND:
+ case CompoundAssignmentOperator::BITWISE_AND:
operator_str = "&";
break;
- case BITWISE_OR:
+ case CompoundAssignmentOperator::BITWISE_OR:
operator_str = "|";
break;
- case BITWISE_XOR:
+ case CompoundAssignmentOperator::BITWISE_XOR:
operator_str = "^";
break;
- case LEFT_SHIFT:
+ case CompoundAssignmentOperator::LEFT_SHIFT:
operator_str = "<<";
break;
- case RIGHT_SHIFT:
+ case CompoundAssignmentOperator::RIGHT_SHIFT:
operator_str = ">>";
break;
default:
@@ -2005,34 +2006,34 @@ ArithmeticOrLogicalExpr::as_string () const
// get operator string
switch (expr_type)
{
- case ADD:
+ case ArithmeticOrLogicalOperator::ADD:
operator_str = "+";
break;
- case SUBTRACT:
+ case ArithmeticOrLogicalOperator::SUBTRACT:
operator_str = "-";
break;
- case MULTIPLY:
+ case ArithmeticOrLogicalOperator::MULTIPLY:
operator_str = "*";
break;
- case DIVIDE:
+ case ArithmeticOrLogicalOperator::DIVIDE:
operator_str = "/";
break;
- case MODULUS:
+ case ArithmeticOrLogicalOperator::MODULUS:
operator_str = "%";
break;
- case BITWISE_AND:
+ case ArithmeticOrLogicalOperator::BITWISE_AND:
operator_str = "&";
break;
- case BITWISE_OR:
+ case ArithmeticOrLogicalOperator::BITWISE_OR:
operator_str = "|";
break;
- case BITWISE_XOR:
+ case ArithmeticOrLogicalOperator::BITWISE_XOR:
operator_str = "^";
break;
- case LEFT_SHIFT:
+ case ArithmeticOrLogicalOperator::LEFT_SHIFT:
operator_str = "<<";
break;
- case RIGHT_SHIFT:
+ case ArithmeticOrLogicalOperator::RIGHT_SHIFT:
operator_str = ">>";
break;
default: