Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Parser.php

function Parser::parseFunctionBody

Parses a function body

Return value

Node\BlockStatement[]|null

File

vendor/mck89/peast/lib/Peast/Syntax/Parser.php, line 1629

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function parseFunctionBody() {
    $body = $this->isolateContext(array(
        "allowReturn" => true,
    ), "parseStatementList", array(
        true,
    ));
    $node = $this->createNode("BlockStatement", $body ?: $this->scanner
        ->getPosition());
    if ($body) {
        $node->setBody($body);
    }
    return $this->completeNode($node);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal