Skip to content

Commit

Permalink
enable -preview=in, fix dlang#2617
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Mar 9, 2023
1 parent 29ec75a commit e8d3824
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions dub.sdl
Expand Up @@ -4,6 +4,7 @@ authors "Sönke Ludwig" "Martin Nowak" "Matthias Dondorff" "Sebastian Wilzbach"
"more than 80 contributors total"
copyright "Copyright © 2012-2016 rejectedsoftware e.K., Copyright © 2012-2014 Matthias Dondorff"
license "MIT"
dflags "-preview=in"

targetPath "bin"

Expand Down
30 changes: 19 additions & 11 deletions source/dub/internal/dyaml/node.d
Expand Up @@ -2511,19 +2511,27 @@ struct Node
const scope @safe
{
this.value_.match!(
(const bool v) => formattedWrite(sink, v ? "true" : "false"),
(const long v) => formattedWrite(sink, "%s", v),
(const Node[] v) => formattedWrite(sink, "[%(%s, %)]", v),
(const ubyte[] v) => formattedWrite(sink, "%s", v),
(const string v) => formattedWrite(sink, `"%s"`, v),
(const Node.Pair[] v) => formattedWrite(sink, "{%(%s, %)}", v),
(const SysTime v) => formattedWrite(sink, "%s", v),
(const YAMLNull v) => formattedWrite(sink, "%s", v),
(const YAMLMerge v) => formattedWrite(sink, "%s", v),
(const real v) => formattedWrite(sink, "%s", v),
(const YAMLInvalid v) => formattedWrite(sink, "%s", v),
(scope const bool v) => formattedWrite(sink, v ? "true" : "false"),
(scope const long v) => formattedWrite(sink, "%s", v),
(scope const Node[] v) => formattedWrite(sink, "[%(%s, %)]", v),
(scope const ubyte[] v) => formattedWrite(sink, "%s", v),
(scope const string v) => formattedWrite(sink, `"%s"`, v),
(scope const Node.Pair[] v) => formattedWrite(sink, "{%(%s, %)}", v),
(scope const SysTime v) => formattedWrite(sink, "%s", v),
(scope const YAMLNull v) => formattedWrite(sink, "%s", v),
(scope const YAMLMerge v) => formattedWrite(sink, "%s", v),
(scope const real v) => formattedWrite(sink, "%s", v),
(scope const YAMLInvalid v) => formattedWrite(sink, "%s", v),
);
}

/// ditto
public string toString() const scope @safe
{
auto ret = appender!string;
toString(ret);
return ret.data;
}
}

package:
Expand Down

0 comments on commit e8d3824

Please sign in to comment.