diff --git a/src/Compiler.php b/src/Compiler.php index 95e1f183b..eb652c61a 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -46,7 +46,7 @@ class Compiler /** * @return $this */ - public function compile(Node $node, int $indentation = 0) + public function reset(int $indentation = 0) { $this->lastLine = null; $this->source = ''; @@ -57,6 +57,15 @@ class Compiler $this->indentation = $indentation; $this->varNameSalt = 0; + return $this; + } + + /** + * @return $this + */ + public function compile(Node $node, int $indentation = 0) + { + $this->reset($indentation); $node->compile($this); return $this;