From d3eec0db1f8a0c3c58a8423c5c448e1e35510d67 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Thu, 15 May 2025 17:05:53 +0300 Subject: [PATCH] Adding services partials info --- metagen.inc.php | 9 ++++++++- parser1.inc.php | 2 +- parser2.inc.php | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/metagen.inc.php b/metagen.inc.php index 76970a3..5a2a708 100644 --- a/metagen.inc.php +++ b/metagen.inc.php @@ -607,6 +607,7 @@ class mtgMetaService extends mtgMetaUnit implements mtgScope private $rpcs = array(); private $events = array(); private $user_types = array(); + private $partials = array(); function __construct(string $name, mtgScope $parent_scope, array $tokens = array()) { @@ -623,10 +624,16 @@ class mtgMetaService extends mtgMetaUnit implements mtgScope function validate(mtgMetaInfo $meta) {} - function addPartial(mtgMetaService $service) + function addPartial(mtgMetaParsedModule $module, mtgMetaService $service) { $this->setTokens(array_merge($this->getTokens(), $service->getTokens())); $this->parent_scope->addScope($service->getParentScope()); + $this->partials[$module->file] = $service; + } + + function getPartials() : array + { + return $this->partials; } function getName() : string diff --git a/parser1.inc.php b/parser1.inc.php index 00b6c37..e363e3e 100644 --- a/parser1.inc.php +++ b/parser1.inc.php @@ -719,7 +719,7 @@ class mtgMetaInfoParser implements mtgIMetaInfoParser $this->_error("Not a service instance '{$name}'"); else { - $existing->object->addPartial($service); + $existing->object->addPartial($this->module, $service); //let's replace service with the existing one $service = $existing->object; $this->_popScope(); diff --git a/parser2.inc.php b/parser2.inc.php index 24b3c49..5ccf2a4 100644 --- a/parser2.inc.php +++ b/parser2.inc.php @@ -755,7 +755,7 @@ class mtgMetaInfoParser2 implements mtgIMetaInfoParser $this->_error("Not a service instance '{$name}'"); else { - $existing->object->addPartial($service); + $existing->object->addPartial($this->module, $service); //let's replace service with the existing one $service = $existing->object; $this->_popScope();