MCPcopy Create free account
hub / github.com/aiscript-dev/aiscript / _runSync

Method _runSync

src/interpreter/index.ts:1570–1593  ·  view source on GitHub ↗
(program: Ast.Node[], scope: Scope, callStack: readonly CallInfo[])

Source from the content-addressed store, hash-verified

1568
1569 @autobind
1570 private _runSync(program: Ast.Node[], scope: Scope, callStack: readonly CallInfo[]): Value | Control {
1571 this.log('block:enter', { scope: scope.name });
1572
1573 let v: Value | Control = NULL;
1574
1575 for (let i = 0; i < program.length; i++) {
1576 const node = program[i]!;
1577
1578 v = this._evalSync(node, scope, callStack);
1579 if (v.type === 'return') {
1580 this.log('block:return', { scope: scope.name, val: v.value });
1581 return v;
1582 } else if (v.type === 'break') {
1583 this.log('block:break', { scope: scope.name });
1584 return v;
1585 } else if (v.type === 'continue') {
1586 this.log('block:continue', { scope: scope.name });
1587 return v;
1588 }
1589 }
1590
1591 this.log('block:leave', { scope: scope.name, val: v });
1592 return v;
1593 }
1594
1595 @autobind
1596 public registerAbortHandler(handler: () => void): void {

Callers 3

execSyncMethod · 0.95
_fnSyncMethod · 0.95
__evalSyncMethod · 0.95

Calls 2

logMethod · 0.95
_evalSyncMethod · 0.95

Tested by

no test coverage detected