mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-10 00:48:44 +00:00
operator prescendence added
This commit is contained in:
parent
93ac5f8e33
commit
e62144feac
11 changed files with 328 additions and 26 deletions
|
|
@ -872,6 +872,13 @@ void BuildVisitor::Visit(BinaryOperatorExpression* node) {
|
|||
|
||||
node->operator_name = parse_node.ChildByFieldName("operator_name").GetValue();
|
||||
|
||||
{ // remove operator prescendence markers
|
||||
size_t operator_size = 0;
|
||||
for (; operator_size < node->operator_name.size() && node->operator_name[operator_size] != '.'; ++operator_size) {}
|
||||
|
||||
node->operator_name = node->operator_name.substr(0, operator_size);
|
||||
}
|
||||
|
||||
current_node_ = parse_node.ChildByFieldName("right_expression");
|
||||
Visit(node->right_expression);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue