From f33e9baf3401336f5ed64929d3e9c61d6d7e2bef Mon Sep 17 00:00:00 2001 From: Anton Zolotilin Date: Mon, 30 Mar 2020 21:35:27 +0300 Subject: [PATCH] fix some bugs in store functional --- lib/hafriedlander/Peg/Parser/Basic.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/hafriedlander/Peg/Parser/Basic.php b/lib/hafriedlander/Peg/Parser/Basic.php index 7b85703..db9fb9d 100644 --- a/lib/hafriedlander/Peg/Parser/Basic.php +++ b/lib/hafriedlander/Peg/Parser/Basic.php @@ -22,7 +22,7 @@ public function __construct($string) { protected function isCallable($name) { return $this->isCallableCache[$name] - ?? ($this->isCallableCache[$name] = \is_callable($this, $name)); + ?? ($this->isCallableCache[$name] = \is_callable([$this, $name])); } public function whitespace() { @@ -156,13 +156,13 @@ public function store(&$result, $subres, $storetag = \null) { $storecalled = \false; foreach ($this->typestack($result['_matchrule']) as $type) { - if ($method = $this->isCallable($storetag ? "{$type}_{$storetag}" : "{$type}_{$subres['name']}")) { + if ($this->isCallable($method = $storetag ? "{$type}_{$storetag}" : "{$type}_{$subres['name']}")) { $this->{$method}(...[&$result, $subres]); $storecalled = \true; break; } - if ($method = $this->isCallable("{$type}_STR")) { + if ($this->isCallable($method = "{$type}_STR")) { $this->{$method}(...[&$result, $subres]); $storecalled = \true; break;