public function addExtension(ExtensionInterface $extension)
    {
        if (!in_array($extension, $this->extensions)) {
            $this->extensions[] = $extension;
            $options = Phug::getExtensionsOptions([$extension]);
            foreach ([$this, $this->getCompiler()] as $instance) {
                $instance->setOptionsRecursive($options);
            }

            $this->initCompiler();
        }
    }