private function expect($filename, \Twig_Token $token, $type, $value = null)
{
if ($token->getType() !== $type) {
throw new \RuntimeException(sprintf('Parse error in %s at line %d. Expected %s%s, got %s.', $filename, $token->getLine(), \Twig_Token::typeToEnglish($type), $value !== null ? ' "' . $value . '"' : '', \Twig_Token::typeToEnglish($token->getType())));
}
}