original_string: protected function isAncestor($tagname) {
          $candidate = $this->current;
          while ($candidate->nodeType === XML_ELEMENT_NODE) {
              if ($candidate->tagName == $tagname) {
                  return true;
              }
              $candidate = $candidate->parentNode;
          }
  
          return false;
      }
code: protected function isAncestor($tagname) {
          $candidate = $this->current;
          while ($candidate->nodeType === XML_ELEMENT_NODE) {
              if ($candidate->tagName == $tagname) {
                  return true;
              }
              $candidate = $candidate->parentNode;
          }
  
          return false;
      }
code_tokens: protected function isAncestor ( $ tagname ) { $ candidate = $ this -> current ; while ( $ candidate -> nodeType === XML_ELEMENT_NODE ) { if ( $ candidate -> tagName == $ tagname ) { return true ; } $ candidate = $ candidate -> parentNode ; } return false ; }
docstring: Checks if the given tagname is an ancestor of the present candidate.
  
  If $this->current or anything above $this->current matches the given tag
  name, this returns true.
docstring_tokens: Checks if the given tagname is an ancestor of the present candidate .