Skip to content

Commit 4f2b952

Browse files
committed
Merge remote-tracking branch 'upstream/master' into stable
2 parents 90a170e + 51923ca commit 4f2b952

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2273
-1496
lines changed

.htaccess

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,12 @@ Redirect 301 /dips/1031 https://github.com/dlang/DIPs/tree/master/DIPs/other/DIP
224224
Redirect 301 /dips/1032 https://github.com/dlang/DIPs/tree/master/DIPs/other/DIP1032.md
225225
Redirect 301 /dips/1033 https://github.com/dlang/DIPs/tree/master/DIPs/other/DIP1033.md
226226
Redirect 301 /dips/1034 https://github.com/dlang/DIPs/tree/master/DIPs/accepted/DIP1034.md
227-
Redirect 301 /dips/1035 https://github.com/dlang/DIPs/blob/master/DIPs/DIP1035.md
227+
Redirect 301 /dips/1035 https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1035.md
228228
Redirect 301 /dips/1036 https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1036.md
229-
Redirect 301 /dips/1037 https://github.com/dlang/DIPs/blob/master/DIPs/DIP1037.md
229+
Redirect 301 /dips/1037 https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1037.md
230230
Redirect 301 /dips/1038 https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1038.md
231231
Redirect 301 /dips/1039 https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1039.md
232232
Redirect 301 /dips/1040 https://github.com/dlang/DIPs/blob/master/DIPs/DIP1040.md
233233
Redirect 301 /dips/1041 https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1041.md
234234
Redirect 301 /dips/1042 https://github.com/dlang/DIPs/blob/master/DIPs/DIP1042.md
235+
Redirect 301 /dips/1043 https://github.com/dlang/DIPs/blob/master/DIPs/DIP1043.md

articles/cppcontracts.dd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ $(HEADERNAV_TOC)
2121
$(H2 $(LNAME2 contract-programming-d, Contract Programming in D))
2222

2323
This is more fully documented in the D
24-
<a href="contracts.html">Contract Programming</a> document.
24+
$(DDLINK spec/contracts, Contract Programming, Contract Programming)
25+
document.
2526
To sum up, Contract Programming in D has the following characteristics:
2627

2728
$(OL

articles/ctarguments.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ string
146146
void()
147147
)
148148

149-
$(P $(B Note:) $(DDSUBLINK version, staticforeach, Static foreach)
149+
$(P $(B Note:) $(DDSUBLINK spec/version, staticforeach, Static foreach)
150150
should be preferred in new code.)
151151

152152
$(H2 $(LNAME2 auto-expansion, Auto-expansion))

book/build.d

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import std.file;
66
import std.stdio;
77
import std.exception;
88
import std.path;
9-
void compileToPath(string compileThis, string outputPath, bool loud = false)
9+
10+
void compileToPath(string compileThis, string outputPath, string extraFiles, bool loud = false)
1011
{
1112
import std.compiler;
1213
import core.stdc.stdlib;
@@ -27,7 +28,8 @@ void compileToPath(string compileThis, string outputPath, bool loud = false)
2728
macroOut.writefln!"%s = %s"(key, value);
2829
}
2930
macroOut.flush();
30-
const compileString = format!"dmd -D contextMacros.ddoc macros.ddoc html.ddoc dlang.org.ddoc doc.ddoc aliBook.ddoc %s -Df%s "(compileThis, outputPath);
31+
32+
const compileString = format!"dmd -D contextMacros.ddoc macros.ddoc html.ddoc dlang.org.ddoc doc.ddoc aliBook.ddoc %s %s -Df%s "(extraFiles, compileThis, outputPath);
3133
if(loud)
3234
writefln!"%s:%s |> %s"(compileThis, outputPath, compileString);
3335
const res = executeShell(compileString);
@@ -52,11 +54,15 @@ int main(string[] args)
5254
if(outDir.exists) {
5355
executeShell("rm -rf " ~ outDir);
5456
}
57+
58+
const diffable = environment.get("DIFFABLE", "0") == "1";
59+
const noTimestamp = diffable ? "../nodatetime.ddoc" : "";
60+
5561
dirEntries("d.en", "*.d", SpanMode.shallow)
5662
.map!(dFile => tuple(dFile.name, buildPath(outDir, baseName(dFile).setExtension("html"))))
5763
//.parallel(jobs)
58-
.each!(elem => compileToPath(elem.tupleof));
64+
.each!(elem => compileToPath(elem.tupleof, noTimestamp));
5965
dirEntries("d.en", "*.png", SpanMode.shallow)
6066
.each!(p => copy(p, buildPath(outDir, baseName(p).setExtension("png"))));
6167
return 0;
62-
}
68+
}

changelog/2.098.0.dd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $(LI $(RELATIVE_LINK2 improve_posix_imports,Improve POSIX imports))
3737

3838
$(BUGSTITLE_TEXT_HEADER Library changes,
3939

40-
$(LI $(RELATIVE_LINK2 add_isValidCharacter,New function `isValidCharacter` in `std.utf`))
40+
$(LI $(RELATIVE_LINK2 add_isValidCharacter,New function `isValidCodepoint` in `std.utf`))
4141

4242
)
4343

@@ -1067,19 +1067,19 @@ The `O_CLOEXEC` symbol was added to `core/sys/posix/fcntl.d`.
10671067

10681068
$(BUGSTITLE_TEXT_BODY Library changes,
10691069

1070-
$(LI $(LNAME2 add_isValidCharacter,New function `isValidCharacter` in `std.utf`)
1070+
$(LI $(LNAME2 add_isValidCharacter,New function `isValidCodepoint` in `std.utf`)
10711071
$(CHANGELOG_SOURCE_FILE phobos, changelog/add_isValidCharacter.dd)
10721072
$(P
1073-
A new function `isValidCharacter` has been added to `std.utf`. It can
1073+
A new function `isValidCodepoint` has been added to `std.utf`. It can
10741074
be used to check if a single character forms a valid code point. For
10751075
example the `char` `0x80` is not a valid code point, because it can
10761076
only be used in trailing characters of UTF8 sequences, whereas the
10771077
wchar `ä` is a valid character:
10781078
)
10791079

10801080
```
1081-
assert(!isValidCharacter(cast(char) 0x80));
1082-
assert(isValidCharacter('ä'));
1081+
assert(!isValidCodepoint(cast(char) 0x80));
1082+
assert(isValidCodepoint('ä'));
10831083
```
10841084
)
10851085

css/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,11 @@ h4
894894
{
895895
font-size: 1.15em;
896896
}
897+
898+
h5
899+
{
900+
font-size: 1em;
901+
}
897902
/*This is to support the "Programming in D" book*/
898903
h6 {
899904
font-size: 1em;

d-keyring.gpg

2.85 KB
Binary file not shown.

d-keyring.gpg.sig

-447 Bytes
Binary file not shown.

ddoc/source/assert_writeln_magic.d

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env dub
22
/++ dub.sdl:
3-
dependency "libdparse" version="0.15.1"
3+
dependency "libdparse" version="0.19.0"
44
name "assert_writeln_magic"
55
+/
66
/*
@@ -178,7 +178,7 @@ private:
178178
Out fl;
179179
}
180180

181-
void parseString(Visitor)(ubyte[] sourceCode, Visitor visitor)
181+
void parseString(Visitor)(const string filepath, ubyte[] sourceCode, Visitor visitor)
182182
{
183183
import dparse.lexer;
184184
import dparse.parser : parseModule, ParserConfig;
@@ -189,28 +189,28 @@ void parseString(Visitor)(ubyte[] sourceCode, Visitor visitor)
189189
const(Token)[] tokens = getTokensForParser(sourceCode, config, &cache).array;
190190

191191
RollbackAllocator rba;
192-
auto m = parseModule(ParserConfig(tokens, "magic.d", &rba));
192+
auto m = parseModule(ParserConfig(tokens, filepath, &rba));
193193
visitor.visit(m);
194194
}
195195

196-
private auto assertWritelnModuleImpl(string fileText)
196+
private auto assertWritelnModuleImpl(const string filepath, string fileText)
197197
{
198198
import std.string : representation;
199199
auto fl = FileLines(fileText);
200200
scope visitor = new TestVisitor!(typeof(fl))(fl);
201201
// libdparse doesn't allow to work on immutable source code
202-
parseString(cast(ubyte[]) fileText.representation, visitor);
202+
parseString(filepath, cast(ubyte[]) fileText.representation, visitor);
203203
return fl;
204204
}
205205

206-
auto assertWritelnModule(string fileText)
206+
auto assertWritelnModule(const string filepath, string fileText)
207207
{
208-
return assertWritelnModuleImpl(fileText).buildLines;
208+
return assertWritelnModuleImpl(filepath, fileText).buildLines;
209209
}
210-
auto assertWritelnBlock(string fileText)
210+
auto assertWritelnBlock(const string filepath, string fileText)
211211
{
212212
auto source = "unittest{\n" ~ fileText ~ "}\n";
213-
auto fl = assertWritelnModuleImpl(source);
213+
auto fl = assertWritelnModuleImpl(filepath, source);
214214
auto app = appender!string;
215215
foreach (line; fl.lines[1 .. $ - 2])
216216
{
@@ -275,7 +275,7 @@ version(unittest)
275275
import std.string : representation;
276276
auto mock = FileLinesMock(sourceCode.split("\n"));
277277
scope visitor = new TestVisitor!(typeof(mock))(mock);
278-
parseString(sourceCode.representation.dup, visitor);
278+
parseString("unittest.d", sourceCode.representation.dup, visitor);
279279
return mock;
280280
}
281281
}

ddoc/source/preprocessor.d

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ All unknown options are passed to the compiler.
6666

6767
// Phobos index.d should have been named index.dd
6868
if (inputFile.endsWith(".d") && !inputFile.endsWith("index.d"))
69-
text = assertWritelnModule(text);
69+
text = assertWritelnModule(inputFile, text);
7070

7171
string[string] macros;
7272
macros["SRC_FILENAME"] = "%s\n".format(inputFile.buildNormalizedPath);
@@ -114,10 +114,13 @@ auto compile(R)(R buffer, string[] arguments, string inputFile, string[string] m
114114
auto ret = execute(args);
115115
if (ret.status != 0)
116116
{
117-
stderr.writeln("File content:");
118-
stderr.writeln(buffer);
119-
stderr.writeln("----------------------------------------");
120-
stderr.writeln(ret.output);
117+
stderr.writeln(
118+
"\n------------- File content -------------\n",
119+
buffer,
120+
"\n------------ Compiler output -----------\n",
121+
ret.output,
122+
"\n----------------------------------------\n",
123+
);
121124
}
122125
return ret.status;
123126
}

0 commit comments

Comments
 (0)