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
import std.conv; | |
struct CppMangler | |
{ | |
CppMangler namespace(string name) | |
{ | |
return nested(name); | |
} | |
CppMangler klass(string name) |
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
/** | |
* | |
*/ | |
extern (C) void rt_finalize(void* p, bool det = true) | |
{ | |
debug(PRINTF) printf("rt_finalize(p = %p)\n", p); | |
static void zeromem(void *dst, size_t size) | |
{ | |
immutable n = size / size_t.sizeof; |
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
import core.atomic; | |
import core.thread; | |
// debug = VERBOSE; | |
debug = PRINTF; | |
debug (VERBOSE) debug = PRINTF; | |
debug(PRINTF) extern(C) int printf(const char*, ...); | |
@property shared(SyncClass) sync() | |
{ |
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
;;; d-mode.el --- D Programming Language mode for (X)Emacs | |
;;; Requires a cc-mode of version 5.30 or greater | |
;; Author: 2007 William Baxter | |
;; Contributors: Andrei Alexandrescu | |
;; Maintainer: William Baxter | |
;; Created: March 2007 | |
;; Version: 2.0.4 (February 2008) | |
;; Keywords: D programming language emacs cc-mode |
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
import std.traits; | |
import core.memory; | |
struct Ptr(T) | |
{ | |
static if (is(T == class)) | |
alias T RefT; | |
else | |
alias T* RefT; |
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
import core.bitop, core.stdc.stdlib; | |
import std.algorithm, std.array, std.conv, std.traits; | |
import std.stdio; | |
struct TrieMap(Key, Value) if(isUnsigned!Key) | |
{ | |
@disable this(this); | |
~this() | |
{ |
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 lexer; | |
import std.algorithm, std.conv, std.exception, std.functional, std.range, std.string, std.traits, std.typetuple; | |
/* | |
* TokenDeclaration | |
* name - used to define enum member | |
* pattern - used as lexer pattern | |
* action - expression to evaluate when pattern is matched | |
*/ |
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
import std.algorithm, std.range, std.stdio; | |
import core.bitop; | |
enum PAGESIZE = 4096; | |
struct BufferedInputRange(R) if(isInputRange!R) | |
{ | |
alias ElementType!R E; | |
this(R input) |
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
import std.algorithm, std.exception, std.file, std.json, std.path, std.range, std.zip, std.net.curl; | |
static import std.stdio; | |
void main(string[] args) | |
{ | |
bool isSnapshot; | |
foreach(arg; args[1 .. $]) | |
{ | |
auto outdir = arg.replace("/", "_"); | |
enforce(!outdir.exists, fmt("output folder '%s' already exists", outdir)); |
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
import core.atomic, core.memory; | |
struct WeakRef(T) if(is(T : Object)) | |
{ | |
this(T obj) | |
{ | |
_ptr = ~cast(size_t)cast(void*)obj; | |
} | |
T get() |