Skip to content

Commit

Permalink
Fix ref within a macro
Browse files Browse the repository at this point in the history
  • Loading branch information
adoy committed Jan 14, 2022
1 parent b23467d commit 14e04fa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/MacroNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,11 @@ private function resolve()
);
$this->isResolved = true;
}

public function setParent(Node $parent)
{
if ($this->param instanceof Node) {
$this->param->setParent($parent);
}
}
}
5 changes: 5 additions & 0 deletions tests/nacl/ref2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
foo1 .testMacro .testMacro FOO1;
bar1 .ref "foo1";

foo2 .testMacro FOO2;
bar2 .testMacro .ref "foo2";
6 changes: 6 additions & 0 deletions tests/nacl/ref2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"foo1": "FOO1",
"bar1": "FOO1",
"foo2": "FOO2",
"bar2": "FOO2"
}

0 comments on commit 14e04fa

Please sign in to comment.