Created
October 10, 2017 14:52
-
-
Save MrSmith33/29125fa3538bb03637d0aebab6ccff7c to your computer and use it in GitHub Desktop.
unresolved external symbol internal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module chunkedrange; | |
struct ChunkedRange(T) { size_t itemsLeft; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dmd -m64 -lib -of="lib.lib" -debug -g -w -I="./" chunkedrange.d textbuffer.d texteditor.d | |
// dmd -m64 -of="app.exe" -debug -g -w -I="./" lib.lib main.d | |
import texteditor; | |
void main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module textbuffer; | |
private struct Piece { size_t bufferOffset; } | |
struct PieceRestoreRange {} | |
private struct PieceStorage | |
{ | |
Piece* sentinel = new Piece; | |
PieceRestoreRange insertAt(Piece* newPiece, size_t insertPos) | |
{ | |
return PieceRestoreRange(); | |
} | |
} | |
struct PieceTable | |
{ | |
PieceStorage pieces; | |
Range!char opSlice(size_t x, size_t y) { return Range!char(); } | |
size_t length() @property { return 0; } | |
} | |
private struct Range(T) | |
{ | |
import chunkedrange; | |
ChunkedRange!char toChunkedRange() { return ChunkedRange!char(); } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module texteditor; | |
import chunkedrange; | |
import textbuffer; | |
class EditorTextModel | |
{ | |
TextEditor* editor; | |
ChunkedRange!char opSlice(ulong from, ulong to) { return editor.textData[from..to].toChunkedRange; } | |
void replaceSelection(const(char)[] str) { editor.replaceSelection(str); } | |
} | |
struct TextEditor | |
{ | |
private PieceTable textData; | |
mixin ReadHelpers!(); | |
mixin WriteHelpers!(); | |
} | |
mixin template ReadHelpers() | |
{ | |
import std.datetime : MonoTime; | |
} | |
mixin template WriteHelpers() | |
{ | |
void replaceSelection(const(char)[] str) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment