From 3c1f0c8027f8f63aad6b4549f9c91bfee8e81d23 Mon Sep 17 00:00:00 2001 From: Martin Nowak Date: Fri, 11 Oct 2013 19:37:47 +0200 Subject: [PATCH] Update DustMite Commits: * 9abec53 dustmite: Use std.digest.md * 135b7d5 dsplit: Parse directives (#-lines) --- DustMite/dsplit.d | 4 ++-- DustMite/dustmite.d | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/DustMite/dsplit.d b/DustMite/dsplit.d index 8651481..2ea7623 100644 --- a/DustMite/dsplit.d +++ b/DustMite/dsplit.d @@ -259,9 +259,9 @@ Entity[] parseD(string s) { // Here be dragons. - enum MAX_SPLITTER_LEVELS = 5; + enum MAX_SPLITTER_LEVELS = 6; struct DSplitter { char open, close, sep; } - static const DSplitter[MAX_SPLITTER_LEVELS] splitters = [{'{','}',';'}, {'(',')'}, {'[',']'}, {sep:','}, {sep:' '}]; + static const DSplitter[MAX_SPLITTER_LEVELS] splitters = [{'#','\n'}, {'{','}',';'}, {'(',')'}, {'[',']'}, {sep:','}, {sep:' '}]; Entity[][MAX_SPLITTER_LEVELS] splitterQueue; diff --git a/DustMite/dustmite.d b/DustMite/dustmite.d index 7b7311d..c96e02e 100644 --- a/DustMite/dustmite.d +++ b/DustMite/dustmite.d @@ -855,22 +855,21 @@ version(HAVE_AE) } else { - import std.md5; + import std.digest.md; alias ubyte[16] HASH; HASH hash(Reduction reduction) { ubyte[16] digest; - MD5_CTX context; + MD5 context; context.start(); - auto writer = cast(void delegate(string))&context.update; + auto writer = cast(void delegate(string))&context.put; dump(root, reduction, writer, writer); - context.finish(digest); - return digest; + return context.finish(); } - alias digestToString formatHash; + alias toHexString formatHash; } bool[HASH] cache;