From 9f5dda08decf03e97947166e51086daa530b25a3 Mon Sep 17 00:00:00 2001 From: Adam Pippin Date: Sun, 14 Feb 2021 17:29:00 -0800 Subject: [PATCH] Add compiler pass 2 - run remaining functions We're now back to where we started functionality-wise! --- app/Engine/Cfnpp/Compiler.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/Engine/Cfnpp/Compiler.php b/app/Engine/Cfnpp/Compiler.php index 2d5d2ca..87d7c10 100644 --- a/app/Engine/Cfnpp/Compiler.php +++ b/app/Engine/Cfnpp/Compiler.php @@ -91,6 +91,7 @@ class Compiler implements \App\Engine\ICompile $document = $this->pass_0($documents, $options); $this->pass_1($document, $options); + $this->pass_2($document, $options); return $document; @@ -239,6 +240,19 @@ class Compiler implements \App\Engine\ICompile return $variables; } + /** + * Compiler Pass 2 - Run all remaining functions in the resulting document, + * mutating the passed in document as required. + * + * @param Document $document + * @param IOptions $options + * @return void + */ + protected function pass_2(Document $document, IOptions $options): void + { + $this->runFunctions($document); + } + /** * Performs a basic recursive merge of two dom trees with target overwriting * original.