summaryrefslogtreecommitdiffhomepage
path: root/cpp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp.cpp')
-rw-r--r--cpp.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/cpp.cpp b/cpp.cpp
index cefd5fd..15dfc87 100644
--- a/cpp.cpp
+++ b/cpp.cpp
@@ -390,6 +390,8 @@ std::unordered_map<std::string, FlowGraph::BinaryOperationType> binaryOperations
{"*", FlowGraph::BinaryOperationType::Multiply},
{"/", FlowGraph::BinaryOperationType::Divide},
{"%", FlowGraph::BinaryOperationType::Modulo},
+ {"<<", FlowGraph::BinaryOperationType::ShiftLeft},
+ {">>", FlowGraph::BinaryOperationType::ShiftRight},
};
} // namespace
@@ -492,6 +494,9 @@ std::unordered_map<std::string, std::function<std::any(index_t)>> CPP::getNodeEv
},
{ "shift-expression", [&](index_t index) -> std::any
{
+ if (childTypesOfNodeMatch(index, {"shift-expression", "", "additive-expression"})) {
+ return BinaryOperation(index);
+ }
if (childTypesOfNodeMatch(index, {"additive-expression"}))
return getValue(index, 0);
throw std::runtime_error("ICE: Unsupported childs: "s + ruleString(index)); // TODO