function Parser::initContext
Initializes parser context
Return value
void
Overrides ParserAbstract::initContext
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php, line 136
Class
- Parser
- Parser class
Namespace
Peast\SyntaxCode
protected function initContext() {
$context = array(
"allowReturn" => false,
"allowIn" => false,
"allowYield" => false,
"allowAwait" => false,
);
//If async/await is not enabled remove the
//relative context properties
if (!$this->features->asyncAwait) {
unset($context["allowAwait"]);
unset($this->contextKeywords["await"]);
}
$this->context = (object) $context;
}