tree-sitter-cpp icon indicating copy to clipboard operation
tree-sitter-cpp copied to clipboard

Comparison is Parsed as Template Method

Open berchn opened this issue 3 years ago • 0 comments

The following is the C++ code I am using:

int a = (x->y < u && z >= w);

I am expecting several binary operations for the comparison, but I am getting a template method inside an assignment expression instead.

translation_unit [0, 1] - [1, 0]
  declaration [0, 1] - [0, 30]
    type: primitive_type [0, 1] - [0, 4]
    declarator: init_declarator [0, 5] - [0, 29]
      declarator: identifier [0, 5] - [0, 6]
      value: parenthesized_expression [0, 9] - [0, 29]
        assignment_expression [0, 10] - [0, 28]
          left: field_expression [0, 10] - [0, 25]
            argument: identifier [0, 10] - [0, 11]
            field: template_method [0, 13] - [0, 25]
              name: field_identifier [0, 13] - [0, 14]
              arguments: template_argument_list [0, 15] - [0, 25]
                binary_expression [0, 17] - [0, 23]
                  left: identifier [0, 17] - [0, 18]
                  right: identifier [0, 22] - [0, 23]
          right: identifier [0, 27] - [0, 28]

berchn avatar Jul 07 '21 15:07 berchn