From 07eadc9403d36d9b5c02804aaedefca95f8c3618 Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Mon, 23 Jan 2012 01:19:49 +0100 Subject: [PATCH] Fixed a bug with parsing null values caused by std.regex changes, and a minor ZeroString fix. --- dyaml/resolver.d | 3 +-- dyaml/zerostring.d | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dyaml/resolver.d b/dyaml/resolver.d index d83807a..17da8f2 100644 --- a/dyaml/resolver.d +++ b/dyaml/resolver.d @@ -242,9 +242,8 @@ final class Resolver "|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$"), "-+0123456789"); addImplicitResolver("tag:yaml.org,2002:merge", regex(r"^<<$"), "<"); - addImplicitResolver("tag:yaml.org,2002:null", - regex(r"^(?:~|null|Null|NULL|\0)?$"), "~nN\0"); + regex(r"^$|^(?:~|null|Null|NULL)$"), "~nN\0"); addImplicitResolver("tag:yaml.org,2002:timestamp", regex(r"^[0-9][0-9][0-9][0-9]-[0-9][0-9]-" "[0-9][0-9]|[0-9][0-9][0-9][0-9]-[0-9]" diff --git a/dyaml/zerostring.d b/dyaml/zerostring.d index c3716cf..cee2cba 100644 --- a/dyaml/zerostring.d +++ b/dyaml/zerostring.d @@ -55,9 +55,8 @@ struct ZeroString(string TypeName) in{assert(!isNull);} body { - static type = typeid(string); auto str = get(); - return type.getHash(&str); + return typeid(string).getHash(&str); } ///Compare with another string.