@@ -14,14 +14,14 @@ extern "C" {
1414void check_call_node (const char *type, bool &is_parent_call) {
1515 // types of function nodes: call, call_expression, binary_expression (eg:
1616 // std::cout << "hello")
17- if (!strcmp (" call" , type) || !strcmp (" call_expression" , type) || !strcmp (" binary_expression" , type)) {
17+ if (!strcmp (" call" , type) || !strcmp (" call_expression" , type) || !strcmp (" binary_expression" , type) || ! strcmp ( " method_invocation " , type) ) {
1818 is_parent_call = true ;
1919 }
2020}
2121
2222// check if the cur node is a function definition node
2323void check_func_def_node (const char *type, bool &is_parent_func_def) {
24- if (!strcmp (" function_definition" , type)) {
24+ if (!strcmp (" function_definition" , type) || ! strcmp ( " method_declaration " , type) ) {
2525 is_parent_func_def = true ;
2626 }
2727}
@@ -61,7 +61,7 @@ int count_feature(Parser *parser, const Countable &countable, const std::string
6161 const char *type = ts_node_type (cur);
6262 // check if cur node is a identifier; used when counting
6363 // identifiers, functions or calls
64- if (!strcmp (" identifier" , type) || !strcmp (" field_identifier" , type)) {
64+ if (!strcmp (" identifier" , type) || !strcmp (" field_identifier" , type) || ! strcmp ( " type_identifier " , type) ) {
6565 int start = ts_node_start_byte (cur);
6666 int end = ts_node_end_byte (cur);
6767 // retrieve identifier name
0 commit comments