From 481e0bfd9b672921ab8e1e429d740c156bc21976 Mon Sep 17 00:00:00 2001 From: Geod24 Date: Wed, 19 Feb 2020 20:18:37 +0900 Subject: [PATCH 1/3] Make assert_writeln_magic executable So that the shebang can be used. --- ddoc/source/assert_writeln_magic.d | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ddoc/source/assert_writeln_magic.d diff --git a/ddoc/source/assert_writeln_magic.d b/ddoc/source/assert_writeln_magic.d old mode 100644 new mode 100755 From f2af9197d2d72ec578a4bde90c470864dcb4d237 Mon Sep 17 00:00:00 2001 From: Geod24 Date: Wed, 19 Feb 2020 20:33:36 +0900 Subject: [PATCH 2/3] Update assert_writeln_magic & dpl-docs to the latest libdparse I noticed on the CI that this was throwing a lot of errors. Turns out it was using a libdparse from late 2017, which didn't knew about a lot of syntax changes, such as 'body' -> 'do', new contract syntax, extern(C++, string)... The two small changes required were introduced by: - https://github.com/dlang-community/libdparse/commit/daa93a520786fcdebbcca0c858c4e00d61b574a4#diff-277d73641e4843decd9c9a41c6c23046L820 - https://github.com/dlang-community/libdparse/commit/e625d2bb695107478d3c6feebf2199ebb18dc8ee#diff-ad149e8970c93d472185f0fb76ffcaeaR86 --- ddoc/dub.sdl | 2 +- ddoc/dub.selections.json | 4 ++-- ddoc/source/assert_writeln_magic.d | 9 +++++---- dpl-docs/dub.selections.json | 26 +++++++++++++------------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/ddoc/dub.sdl b/ddoc/dub.sdl index 16e1800dee..87d9220564 100644 --- a/ddoc/dub.sdl +++ b/ddoc/dub.sdl @@ -1,6 +1,6 @@ name "ddoc_preprocessor" description "Preprocesses source code before running Ddoc over it" -dependency "libdparse" version="~>0.8.7" +dependency "libdparse" version="~>0.15.1" dependency "dmd" path="../../dmd" versions "DdocOptions" buildRequirements "disallowDeprecations" diff --git a/ddoc/dub.selections.json b/ddoc/dub.selections.json index 86b245c64c..9af3e89189 100644 --- a/ddoc/dub.selections.json +++ b/ddoc/dub.selections.json @@ -2,7 +2,7 @@ "fileVersion": 1, "versions": { "dmd": {"path":"../../dmd"}, - "libdparse": "0.8.7", - "stdx-allocator": "2.77.2" + "libdparse": "0.15.4", + "stdx-allocator": "2.77.5" } } diff --git a/ddoc/source/assert_writeln_magic.d b/ddoc/source/assert_writeln_magic.d index 649952ba00..bd110e4a10 100755 --- a/ddoc/source/assert_writeln_magic.d +++ b/ddoc/source/assert_writeln_magic.d @@ -1,6 +1,6 @@ #!/usr/bin/env dub /++ dub.sdl: -dependency "libdparse" version="0.7.2-alpha.4" +dependency "libdparse" version="0.15.1" name "assert_writeln_magic" +/ /* @@ -76,7 +76,8 @@ class TestVisitor(Out) : ASTVisitor return; // only look at `a == b` within the AssertExpression - if (typeid(expr.assertion) != typeid(CmpExpression)) + if (!expr.assertArguments || + typeid(expr.assertArguments.assertion) != typeid(CmpExpression)) return; lastAssert = expr; @@ -180,7 +181,7 @@ private: void parseString(Visitor)(ubyte[] sourceCode, Visitor visitor) { import dparse.lexer; - import dparse.parser : parseModule; + import dparse.parser : parseModule, ParserConfig; import dparse.rollback_allocator : RollbackAllocator; LexerConfig config; @@ -188,7 +189,7 @@ void parseString(Visitor)(ubyte[] sourceCode, Visitor visitor) const(Token)[] tokens = getTokensForParser(sourceCode, config, &cache).array; RollbackAllocator rba; - auto m = parseModule(tokens, "magic.d", &rba); + auto m = parseModule(ParserConfig(tokens, "magic.d", &rba)); visitor.visit(m); } diff --git a/dpl-docs/dub.selections.json b/dpl-docs/dub.selections.json index dea152c312..c1add86ae5 100644 --- a/dpl-docs/dub.selections.json +++ b/dpl-docs/dub.selections.json @@ -1,23 +1,23 @@ { "fileVersion": 1, "versions": { - "botan": "1.12.10", + "botan": "1.12.18", "botan-math": "1.0.3", "ddoc_preprocessor": {"path":"../ddoc"}, - "ddox": "0.16.11", - "diet-ng": "1.5.0", + "ddox": "0.16.15", + "diet-ng": "1.7.2", "dmd": {"path":"../../dmd"}, - "eventcore": "0.8.35", - "hyphenate": "1.1.1", - "libasync": "0.8.3", - "libdparse": "0.8.7", + "eventcore": "0.9.7", + "hyphenate": "1.1.2", + "libasync": "0.8.6", + "libdparse": "0.15.4", "libevent": "2.0.2+2.0.16", - "memutils": "0.4.11", - "mir-linux-kernel": "1.0.0", + "memutils": "1.0.4", + "mir-linux-kernel": "1.0.1", "openssl": "1.1.6+1.0.1g", - "stdx-allocator": "2.77.2", - "taggedalgebraic": "0.10.11", - "vibe-core": "1.4.0", - "vibe-d": "0.8.4" + "stdx-allocator": "2.77.5", + "taggedalgebraic": "0.11.16", + "vibe-core": "1.9.3", + "vibe-d": "0.9.0" } } From 65d3d8cb4a1ca49689ee2fd8fbc4dc3965985666 Mon Sep 17 00:00:00 2001 From: Geod24 Date: Wed, 19 Feb 2020 21:12:46 +0900 Subject: [PATCH 3/3] Magic: Print the content of the buffer on failure --- ddoc/source/preprocessor.d | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ddoc/source/preprocessor.d b/ddoc/source/preprocessor.d index 59fa2913e2..265f2569d8 100644 --- a/ddoc/source/preprocessor.d +++ b/ddoc/source/preprocessor.d @@ -114,7 +114,12 @@ auto compile(R)(R buffer, string[] arguments, string inputFile, string[string] m import std.process : execute; auto ret = execute(args); if (ret.status != 0) + { + stderr.writeln("File content:"); + stderr.writeln(buffer); + stderr.writeln("----------------------------------------"); stderr.writeln(ret.output); + } return ret.status; }