-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from m3m0r7/fix-callinfo
Fix callinfo cannot call on instantiated class
- Loading branch information
Showing
16 changed files
with
182 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace RubyVM\VM\Core\Runtime\Executor\Accessor; | ||
|
||
use RubyVM\VM\Core\Runtime\Essential\RubyClassInterface; | ||
use RubyVM\VM\Core\YARV\Criterion\InstructionSequence\CallDataInterface; | ||
use RubyVM\VM\Core\YARV\Essential\ID; | ||
use RubyVM\VM\Core\YARV\Essential\Symbol\StringSymbol; | ||
|
||
class BridgeCallData implements CallDataInterface | ||
{ | ||
/** | ||
* @param RubyClassInterface[] $arguments | ||
*/ | ||
public function __construct(private readonly string $name, private readonly array $arguments) {} | ||
|
||
public function flag(): int | ||
{ | ||
// Always public | ||
return 0; | ||
} | ||
|
||
public function mid(): ID | ||
{ | ||
return new ID(new StringSymbol($this->name)); | ||
} | ||
|
||
public function argumentsCount(): int | ||
{ | ||
return count($this->arguments); | ||
} | ||
|
||
public function keywords(): ?array | ||
{ | ||
// TODO: we must implement accepting keywords arguments on PHP | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace RubyVM\VM\Core\Runtime\Executor\Accessor; | ||
|
||
use RubyVM\VM\Core\Runtime\Essential\RubyClassInterface; | ||
use RubyVM\VM\Core\YARV\Criterion\InstructionSequence\CallDataInterface; | ||
use RubyVM\VM\Core\YARV\Criterion\InstructionSequence\CallInfoInterface; | ||
|
||
class BridgeCallInfo implements CallInfoInterface | ||
{ | ||
/** | ||
* @param RubyClassInterface[] $arguments | ||
*/ | ||
public function __construct(private readonly string $name, private readonly array $arguments) {} | ||
|
||
public function callData(): CallDataInterface | ||
{ | ||
return new BridgeCallData( | ||
$this->name, | ||
$this->arguments, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.