Implement EXEC
This commit is contained in:
@@ -164,6 +164,20 @@ struct Slot
|
||||
program.insertBack(l ~ '\n');
|
||||
}
|
||||
}
|
||||
wchar[] text()
|
||||
{
|
||||
import std.algorithm.iteration, std.outbuffer;
|
||||
auto buffer = new OutBuffer();
|
||||
buffer.reserve(program.opSlice.map!"(a.length + 1) * 2".sum);
|
||||
|
||||
foreach(line; program)
|
||||
{
|
||||
buffer.write(line);
|
||||
}
|
||||
ubyte[] progbuff = buffer.toBytes;
|
||||
wchar[] progbuff2 = (cast(wchar*)progbuff.ptr)[0..progbuff.length / 2];
|
||||
return progbuff2;
|
||||
}
|
||||
}
|
||||
struct Size
|
||||
{
|
||||
@@ -1046,17 +1060,7 @@ class PetitComputer
|
||||
int oldpc;
|
||||
void runSlot(int lot)
|
||||
{
|
||||
import std.algorithm.iteration, std.outbuffer;
|
||||
auto buffer = new OutBuffer();
|
||||
buffer.reserve(slot[lot].program.opSlice.map!"(a.length + 1) * 2".sum);
|
||||
|
||||
foreach(line; slot[lot].program)
|
||||
{
|
||||
buffer.write(line);
|
||||
}
|
||||
ubyte[] progbuff = buffer.toBytes;
|
||||
wchar[] progbuff2 = (cast(wchar*)progbuff.ptr)[0..progbuff.length / 2];
|
||||
parser = new Parser(cast(wstring)progbuff2);
|
||||
parser = new Parser(cast(wstring)slot[lot].text);
|
||||
try
|
||||
{
|
||||
vm = parser.compile();
|
||||
|
||||
Reference in New Issue
Block a user