mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 07:00:37 +03:00
Remove all uses of std.metastrings.Format.
This commit is contained in:
parent
895550649f
commit
2735d30f4e
7 changed files with 17 additions and 19 deletions
|
@ -326,7 +326,7 @@ module std.algorithm;
|
||||||
|
|
||||||
import std.c.string, core.bitop;
|
import std.c.string, core.bitop;
|
||||||
import std.array, std.ascii, std.container, std.conv, std.exception,
|
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;
|
std.traits, std.typecons, std.typetuple, std.uni, std.utf;
|
||||||
|
|
||||||
version(unittest)
|
version(unittest)
|
||||||
|
|
|
@ -115,7 +115,6 @@ import std.exception;
|
||||||
import std.file;
|
import std.file;
|
||||||
import std.functional;
|
import std.functional;
|
||||||
import std.math;
|
import std.math;
|
||||||
import std.metastrings;
|
|
||||||
import std.path;
|
import std.path;
|
||||||
import std.range;
|
import std.range;
|
||||||
import std.stdio;
|
import std.stdio;
|
||||||
|
|
|
@ -20,7 +20,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||||
*/
|
*/
|
||||||
module std.functional;
|
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
|
// for making various functions visible in *naryFun
|
||||||
import std.algorithm, std.conv, std.exception, std.math, std.range, std.string;
|
import std.algorithm, std.conv, std.exception, std.math, std.range, std.string;
|
||||||
|
|
||||||
|
|
14
std/range.d
14
std/range.d
|
@ -3162,8 +3162,6 @@ unittest
|
||||||
|
|
||||||
unittest
|
unittest
|
||||||
{
|
{
|
||||||
import std.metastrings;
|
|
||||||
|
|
||||||
string genInput()
|
string genInput()
|
||||||
{
|
{
|
||||||
return "@property bool empty() { return _arr.empty; }" ~
|
return "@property bool empty() { return _arr.empty; }" ~
|
||||||
|
@ -3241,20 +3239,20 @@ unittest
|
||||||
//`InitStruct([1, 2, 3])`,
|
//`InitStruct([1, 2, 3])`,
|
||||||
`TakeNoneStruct([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);
|
assert(a, typeof(range).stringof);
|
||||||
mixin(Format!("assert(takeNone(%s).empty);", range));
|
mixin(format("assert(takeNone(%s).empty);", range));
|
||||||
mixin(Format!("static assert(is(typeof(%s) == typeof(takeNone(%s))), typeof(%s).stringof);",
|
mixin(format("static assert(is(typeof(%s) == typeof(takeNone(%s))), typeof(%s).stringof);",
|
||||||
range, range, range));
|
range, range, range));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(range; TypeTuple!(`NormalStruct([1, 2, 3])`,
|
foreach(range; TypeTuple!(`NormalStruct([1, 2, 3])`,
|
||||||
`InitStruct([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);
|
assert(a, typeof(range).stringof);
|
||||||
mixin(Format!("assert(takeNone(%s).empty);", range));
|
mixin(format("assert(takeNone(%s).empty);", range));
|
||||||
mixin(Format!("static assert(is(typeof(takeExactly(%s, 0)) == typeof(takeNone(%s))), typeof(%s).stringof);",
|
mixin(format("static assert(is(typeof(takeExactly(%s, 0)) == typeof(takeNone(%s))), typeof(%s).stringof);",
|
||||||
range, range, range));
|
range, range, range));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ module std.string;
|
||||||
import core.exception : RangeError, onRangeError;
|
import core.exception : RangeError, onRangeError;
|
||||||
import core.vararg, core.stdc.stdlib, core.stdc.string,
|
import core.vararg, core.stdc.stdlib, core.stdc.string,
|
||||||
std.algorithm, std.ascii, std.conv, std.exception, std.format, std.functional,
|
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;
|
std.typecons, std.typetuple, std.uni, std.utf;
|
||||||
|
|
||||||
//Remove when repeat is finally removed. They're only here as part of the
|
//Remove when repeat is finally removed. They're only here as part of the
|
||||||
|
|
|
@ -45,7 +45,7 @@ Authors: $(WEB erdani.org, Andrei Alexandrescu),
|
||||||
module std.typecons;
|
module std.typecons;
|
||||||
import core.memory, core.stdc.stdlib;
|
import core.memory, core.stdc.stdlib;
|
||||||
import std.algorithm, std.array, std.conv, std.exception, std.format,
|
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;
|
debug(Unique) import std.stdio;
|
||||||
|
|
||||||
|
@ -2368,7 +2368,7 @@ private static:
|
||||||
// The generated function declarations may hide existing ones
|
// The generated function declarations may hide existing ones
|
||||||
// in the base class (cf. HiddenFuncError), so we put an alias
|
// in the base class (cf. HiddenFuncError), so we put an alias
|
||||||
// declaration here to reveal possible hidden functions.
|
// 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.
|
Policy.BASE_CLASS_ID, // [BUG 2540] super.
|
||||||
oset.name, oset.name );
|
oset.name, oset.name );
|
||||||
}
|
}
|
||||||
|
@ -2410,6 +2410,8 @@ private static:
|
||||||
enum atts = functionAttributes!(func);
|
enum atts = functionAttributes!(func);
|
||||||
enum realName = isCtor ? "this" : name;
|
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!(...) */
|
/* Made them CTFE funcs just for the sake of Format!(...) */
|
||||||
|
|
||||||
// return type with optional "ref"
|
// return type with optional "ref"
|
||||||
|
@ -2453,7 +2455,7 @@ private static:
|
||||||
//
|
//
|
||||||
if (isAbstractFunction!func)
|
if (isAbstractFunction!func)
|
||||||
code ~= "override ";
|
code ~= "override ";
|
||||||
code ~= Format!("extern(%s) %s %s(%s) %s %s\n",
|
code ~= format("extern(%s) %s %s(%s) %s %s\n",
|
||||||
functionLinkage!(func),
|
functionLinkage!(func),
|
||||||
returnType,
|
returnType,
|
||||||
realName,
|
realName,
|
||||||
|
|
|
@ -2240,7 +2240,6 @@ unittest
|
||||||
{
|
{
|
||||||
import core.exception;
|
import core.exception;
|
||||||
import std.algorithm;
|
import std.algorithm;
|
||||||
import std.metastrings;
|
|
||||||
import std.typetuple;
|
import std.typetuple;
|
||||||
|
|
||||||
size_t zeroLen(C)(const(C)* ptr)
|
size_t zeroLen(C)(const(C)* ptr)
|
||||||
|
@ -2285,7 +2284,7 @@ unittest
|
||||||
auto p = toUTFz!P(s);
|
auto p = toUTFz!P(s);
|
||||||
immutable len = zeroLen(p);
|
immutable len = zeroLen(p);
|
||||||
enforce(cmp(s, p[0 .. len]) == 0,
|
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));
|
__FILE__, line));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue