Example #1
0
 private function lookupContext(Token $token, Context $context, string $error)
 {
     $symbol = (string) $token;
     if (null === ($result = $context->get($symbol))) {
         $this->fail($error, $symbol, $token->line(), json_encode($context->symbols(), self::PRETTY_PRINT));
     }
     return $result;
 }