original_string: public function allowsElement($name)
      {
          if (!empty($this->currentNesting)) {
              $parent_token = array_pop($this->currentNesting);
              $this->currentNesting[] = $parent_token;
              $parent = $this->htmlDefinition->info[$parent_token->name];
          } else {
              $parent = $this->htmlDefinition->info_parent_def;
          }
          if (!isset($parent->child->elements[$name]) || isset($parent->excludes[$name])) {
              return false;
          }
          // check for exclusion
          for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) {
              $node = $this->currentNesting[$i];
              $def  = $this->htmlDefinition->info[$node->name];
              if (isset($def->excludes[$name])) {
                  return false;
              }
          }
          return true;
      }
code: public function allowsElement($name)
      {
          if (!empty($this->currentNesting)) {
              $parent_token = array_pop($this->currentNesting);
              $this->currentNesting[] = $parent_token;
              $parent = $this->htmlDefinition->info[$parent_token->name];
          } else {
              $parent = $this->htmlDefinition->info_parent_def;
          }
          if (!isset($parent->child->elements[$name]) || isset($parent->excludes[$name])) {
              return false;
          }
          // check for exclusion
          for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) {
              $node = $this->currentNesting[$i];
              $def  = $this->htmlDefinition->info[$node->name];
              if (isset($def->excludes[$name])) {
                  return false;
              }
          }
          return true;
      }
code_tokens: public function allowsElement ( $ name ) { if ( ! empty ( $ this -> currentNesting ) ) { $ parent_token = array_pop ( $ this -> currentNesting ) ; $ this -> currentNesting [ ] = $ parent_token ; $ parent = $ this -> htmlDefinition -> info [ $ parent_token -> name ] ; } else { $ parent = $ this -> htmlDefinition -> info_parent_def ; } if ( ! isset ( $ parent -> child -> elements [ $ name ] ) || isset ( $ parent -> excludes [ $ name ] ) ) { return false ; } // check for exclusion for ( $ i = count ( $ this -> currentNesting ) - 2 ; $ i >= 0 ; $ i -- ) { $ node = $ this -> currentNesting [ $ i ] ; $ def = $ this -> htmlDefinition -> info [ $ node -> name ] ; if ( isset ( $ def -> excludes [ $ name ] ) ) { return false ; } } return true ; }
docstring: Tests if the context node allows a certain element
  @param string $name Name of element to test for
  @return bool True if element is allowed, false if it is not
docstring_tokens: Tests if the context node allows a certain element