if_diff/src/idfMatchAst.cxx
//============================================================================
// Ensure that a complete location matched to a location with no end
// is not at a higher level in the syntax tree.
//
// The nodes ast1 and ast2 are from different files. If ast1 overlaps any
// siblings of ast2 then they cannot match, because ast1 properly matches
// at a higher level in the AST containing ast2.
//============================================================================
Ensure that a complete location matched to a location with no end
is not at a higher level in the syntax tree.

The nodes ast1 and ast2 are from different files. If ast1 overlaps any
siblings of ast2 then they cannot match, because ast1 properly matches
at a higher level in the AST containing ast2.
Ensure that a complete location matched to a location with no end is not at a higher level in the syntax tree . The nodes ast1 and ast2 are from different files . If ast1 overlaps any siblings of ast2 then they cannot match because ast1 properly matches at a higher level in the AST containing ast2 .
static boolean too_high(idfAst &ast1, idfAst &ast2)
{
  idfAst *sib = &ast2;
  for (;;) {
    sib = sib->getNextSib();
    if (sib == NULL) {
      break;
    }
    if (sib->getLocation() != NULL) {
      break;
    }
  }
  if (sib == NULL) {
    return false;
  }
  locationStruct *comp1 = comparable(&ast1);
  locationStruct *comp2 = comparable(sib);
  return comp1 != NULL && comp2 != NULL && locations_overlap(*comp1, *comp2);
}
static boolean too_high ( idfAst & ast1 , idfAst & ast2 ) { idfAst * sib = & ast2 ; for ( ; ; ) { sib = sib -> getNextSib ( ) ; if ( sib == NULL ) { break ; } if ( sib -> getLocation ( ) != NULL ) { break ; } } if ( sib == NULL ) { return false ; } locationStruct * comp1 = comparable ( & ast1 ) ; locationStruct * comp2 = comparable ( sib ) ; return comp1 != NULL && comp2 != NULL && locations_overlap ( * comp1 , * comp2 ) ; }
Ensure that a complete location matched to a location with no end
is not at a higher level in the syntax tree.
Ensure that a complete location matched to a location with no end is not at a higher level in the syntax tree .