diff options
Diffstat (limited to 'cpp.cpp')
-rw-r--r-- | cpp.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |