Remove all uses of std.metastrings.Format.

This commit is contained in:
jmdavis 2013-02-24 18:42:46 -08:00
parent 895550649f
commit 2735d30f4e
7 changed files with 17 additions and 19 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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;

View file

@ -3162,8 +3162,6 @@ unittest
unittest
{
import std.metastrings;
string genInput()
{
return "@property bool empty() { return _arr.empty; }" ~
@ -3241,20 +3239,20 @@ 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);",
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);",
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));
}

View file

@ -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

View file

@ -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,

View file

@ -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));
}