Delete otya.smilebasic.petitcomputer.Slot
This commit is contained in:
@@ -169,46 +169,6 @@ version(Windows)
|
|||||||
alias extern (Windows) int function(int) ImmDisableIME;
|
alias extern (Windows) int function(int) ImmDisableIME;
|
||||||
}
|
}
|
||||||
import std.container;
|
import std.container;
|
||||||
struct Slot
|
|
||||||
{
|
|
||||||
DList!wstring program;
|
|
||||||
void load(wstring data)
|
|
||||||
{
|
|
||||||
import std.algorithm;
|
|
||||||
program.clear();
|
|
||||||
foreach(l; splitter(data, "\n"))
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
import otya.smilebasic.token;
|
|
||||||
wstring getLine(SourceLocation loc)
|
|
||||||
{
|
|
||||||
import std.string;
|
|
||||||
int i;
|
|
||||||
foreach (line; program)
|
|
||||||
{
|
|
||||||
i++;
|
|
||||||
if (i == loc.line)
|
|
||||||
return line;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
struct Size
|
struct Size
|
||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
|
|||||||
Reference in New Issue
Block a user