From e9f42d3c61751cd4d6834c9f8a0ead2f72df1634 Mon Sep 17 00:00:00 2001 From: otya128 Date: Tue, 27 Dec 2016 17:18:49 +0900 Subject: [PATCH] Delete otya.smilebasic.petitcomputer.Slot --- SMILEBASIC/petitcomputer.d | 40 -------------------------------------- 1 file changed, 40 deletions(-) diff --git a/SMILEBASIC/petitcomputer.d b/SMILEBASIC/petitcomputer.d index 76e9040..0bafe0f 100644 --- a/SMILEBASIC/petitcomputer.d +++ b/SMILEBASIC/petitcomputer.d @@ -169,46 +169,6 @@ version(Windows) alias extern (Windows) int function(int) ImmDisableIME; } 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 { int width, height;