protected function parseMethodBody(SourceStream $code, SourceBuffer $buffer, ParsedMethod $method = NULL) { $depth = $code->depth(); while (true) { if ($code->depth() == $depth && $code->peek(1) == '}') { return; } $tt = $code->next($buffer); if (is_array($tt)) { if ($tt[0] == T_FUNCTION) { $buffer->append($tt); $this->parseMethodBody($code, $buffer); continue; } if ($tt[0] == T_YIELD && $method !== NULL) { $method->setIsGenerator(true); } } $buffer->append($tt); } }