Skip to content

Commit 785d523

Browse files
driusanircmaxell
authored andcommitted
Add include support to VM
1 parent 79d365a commit 785d523

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/VM.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ public function run(Block $block): int {
279279
$dst = $frame->scope[$op->arg1];
280280
$dst->bool($value);
281281
break;
282+
case OpCode::TYPE_INCLUDE:
283+
$file = $frame->scope[$op->arg1]->toString();
284+
$parsed = $this->context->runtime->parseAndCompileFile($file);
285+
$this->context->runtime->run($parsed);
286+
break;
282287
default:
283288
throw new \LogicException("VM OpCode Not Implemented: " . $op->getType());
284289
}

0 commit comments

Comments
 (0)