private function constructPathNameLexer()
    {
        if ($this->originalTwigLexer == null) {
            $this->originalTwigLexer = $this->templateRenderer->getStringEnvironment()->getLexer();
        }

        if ($this->pathLexer == null) {
            $this->pathLexer = new \Twig_Lexer($this->templateRenderer->getStringEnvironment(), [
                'tag_comment'  => ['{#', '#}'],
                'tag_block'    => ['{%', '%}'],
                'tag_variable' => ['{', '}']
            ]);
        }

        // Set the lexer.
        $this->templateRenderer->getStringEnvironment()->setLexer($this->pathLexer);
    }