Skip to content

Commit

Permalink
Merge pull request #2 from superjobru/master
Browse files Browse the repository at this point in the history
fix some bugs in store functional
  • Loading branch information
smuuf authored Apr 1, 2020
2 parents 134e20a + f33e9ba commit c95d217
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/hafriedlander/Peg/Parser/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c95d217

Please sign in to comment.