From 2735d30f4e55dff49becd23ddc2c36124feafb1d Mon Sep 17 00:00:00 2001 From: jmdavis Date: Sun, 24 Feb 2013 18:42:46 -0800 Subject: [PATCH] Remove all uses of std.metastrings.Format. --- std/algorithm.d | 2 +- std/datetime.d | 1 - std/functional.d | 2 +- std/range.d | 18 ++++++++---------- std/string.d | 2 +- std/typecons.d | 8 +++++--- std/utf.d | 3 +-- 7 files changed, 17 insertions(+), 19 deletions(-) diff --git a/std/algorithm.d b/std/algorithm.d index f08a8bb36..263d362c2 100644 --- a/std/algorithm.d +++ b/std/algorithm.d @@ -326,7 +326,7 @@ module std.algorithm; import std.c.string, core.bitop; import std.array, std.ascii, std.container, std.conv, std.exception, - std.functional, std.math, std.metastrings, std.range, std.string, + std.functional, std.math, std.range, std.string, std.traits, std.typecons, std.typetuple, std.uni, std.utf; version(unittest) diff --git a/std/datetime.d b/std/datetime.d index aa6b4c242..8b1e3a074 100644 --- a/std/datetime.d +++ b/std/datetime.d @@ -115,7 +115,6 @@ import std.exception; import std.file; import std.functional; import std.math; -import std.metastrings; import std.path; import std.range; import std.stdio; diff --git a/std/functional.d b/std/functional.d index 52e9497fc..d336b8c09 100644 --- a/std/functional.d +++ b/std/functional.d @@ -20,7 +20,7 @@ Distributed under the Boost Software License, Version 1.0. */ module std.functional; -import std.metastrings, std.traits, std.typecons, std.typetuple; +import std.traits, std.typecons, std.typetuple; // for making various functions visible in *naryFun import std.algorithm, std.conv, std.exception, std.math, std.range, std.string; diff --git a/std/range.d b/std/range.d index c638f245d..a8a2a9947 100644 --- a/std/range.d +++ b/std/range.d @@ -3162,8 +3162,6 @@ unittest unittest { - import std.metastrings; - string genInput() { return "@property bool empty() { return _arr.empty; }" ~ @@ -3241,21 +3239,21 @@ unittest //`InitStruct([1, 2, 3])`, `TakeNoneStruct([1, 2, 3])`)) { - mixin(Format!("enum a = takeNone(%s).empty;", range)); + mixin(format("enum a = takeNone(%s).empty;", range)); assert(a, typeof(range).stringof); - mixin(Format!("assert(takeNone(%s).empty);", range)); - mixin(Format!("static assert(is(typeof(%s) == typeof(takeNone(%s))), typeof(%s).stringof);", - range, range, range)); + mixin(format("assert(takeNone(%s).empty);", range)); + mixin(format("static assert(is(typeof(%s) == typeof(takeNone(%s))), typeof(%s).stringof);", + range, range, range)); } foreach(range; TypeTuple!(`NormalStruct([1, 2, 3])`, `InitStruct([1, 2, 3])`)) { - mixin(Format!("enum a = takeNone(%s).empty;", range)); + mixin(format("enum a = takeNone(%s).empty;", range)); assert(a, typeof(range).stringof); - mixin(Format!("assert(takeNone(%s).empty);", range)); - mixin(Format!("static assert(is(typeof(takeExactly(%s, 0)) == typeof(takeNone(%s))), typeof(%s).stringof);", - range, range, range)); + mixin(format("assert(takeNone(%s).empty);", range)); + mixin(format("static assert(is(typeof(takeExactly(%s, 0)) == typeof(takeNone(%s))), typeof(%s).stringof);", + range, range, range)); } //Don't work in CTFE. diff --git a/std/string.d b/std/string.d index db22b96f1..816069857 100644 --- a/std/string.d +++ b/std/string.d @@ -28,7 +28,7 @@ module std.string; import core.exception : RangeError, onRangeError; import core.vararg, core.stdc.stdlib, core.stdc.string, std.algorithm, std.ascii, std.conv, std.exception, std.format, std.functional, - std.metastrings, std.range, std.regex, std.traits, + std.range, std.regex, std.traits, std.typecons, std.typetuple, std.uni, std.utf; //Remove when repeat is finally removed. They're only here as part of the diff --git a/std/typecons.d b/std/typecons.d index f2e3b219f..238190000 100644 --- a/std/typecons.d +++ b/std/typecons.d @@ -45,7 +45,7 @@ Authors: $(WEB erdani.org, Andrei Alexandrescu), module std.typecons; import core.memory, core.stdc.stdlib; import std.algorithm, std.array, std.conv, std.exception, std.format, - std.metastrings, std.string, std.traits, std.typetuple, std.range; + std.string, std.traits, std.typetuple, std.range; debug(Unique) import std.stdio; @@ -2368,7 +2368,7 @@ private static: // The generated function declarations may hide existing ones // in the base class (cf. HiddenFuncError), so we put an alias // declaration here to reveal possible hidden functions. - code ~= Format!("alias %s.%s %s;\n", + code ~= format("alias %s.%s %s;\n", Policy.BASE_CLASS_ID, // [BUG 2540] super. oset.name, oset.name ); } @@ -2410,6 +2410,8 @@ private static: enum atts = functionAttributes!(func); enum realName = isCtor ? "this" : name; + // FIXME?? Make it so that these aren't CTFE funcs any more, since + // Format is deprecated, and format works at compile time? /* Made them CTFE funcs just for the sake of Format!(...) */ // return type with optional "ref" @@ -2453,7 +2455,7 @@ private static: // if (isAbstractFunction!func) code ~= "override "; - code ~= Format!("extern(%s) %s %s(%s) %s %s\n", + code ~= format("extern(%s) %s %s(%s) %s %s\n", functionLinkage!(func), returnType, realName, diff --git a/std/utf.d b/std/utf.d index 8d16937a7..5adced784 100644 --- a/std/utf.d +++ b/std/utf.d @@ -2240,7 +2240,6 @@ unittest { import core.exception; import std.algorithm; - import std.metastrings; import std.typetuple; size_t zeroLen(C)(const(C)* ptr) @@ -2285,7 +2284,7 @@ unittest auto p = toUTFz!P(s); immutable len = zeroLen(p); enforce(cmp(s, p[0 .. len]) == 0, - new AssertError(Format!("Unit test failed: %s %s", P.stringof, S.stringof), + new AssertError(format("Unit test failed: %s %s", P.stringof, S.stringof), __FILE__, line)); }