From 05270e5f6078a159566e2a970df5777c81696046 Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Sat, 21 Feb 2015 14:31:55 +0100 Subject: [PATCH] Doc fixes --- source/dyaml/constructor.d | 6 +++--- source/dyaml/dumper.d | 28 ++++++++++++++-------------- source/dyaml/hacks.d | 35 ++++++++++++++++++----------------- source/dyaml/loader.d | 14 +++++++------- source/dyaml/node.d | 6 +++--- source/dyaml/representer.d | 6 +++--- source/dyaml/resolver.d | 10 +++++----- source/dyaml/style.d | 4 ++-- 8 files changed, 55 insertions(+), 54 deletions(-) diff --git a/source/dyaml/constructor.d b/source/dyaml/constructor.d index 8af8343..56cee4c 100644 --- a/source/dyaml/constructor.d +++ b/source/dyaml/constructor.d @@ -66,11 +66,11 @@ private alias ConstructorException Error; final class Constructor { private: - /// Constructor functions from scalars. + // Constructor functions from scalars. Node.Value delegate(ref Node)[Tag] fromScalar_; - /// Constructor functions from sequences. + // Constructor functions from sequences. Node.Value delegate(ref Node)[Tag] fromSequence_; - /// Constructor functions from mappings. + // Constructor functions from mappings. Node.Value delegate(ref Node)[Tag] fromMapping_; public: diff --git a/source/dyaml/dumper.d b/source/dyaml/dumper.d index 1eb3abc..be7be95 100644 --- a/source/dyaml/dumper.d +++ b/source/dyaml/dumper.d @@ -5,7 +5,7 @@ // http://www.boost.org/LICENSE_1_0.txt) /** - * YAML _dumper. + * YAML dumper. * * Code based on $(LINK2 http://www.pyyaml.org, PyYAML). */ @@ -113,34 +113,34 @@ struct Dumper } private: - ///Resolver to resolve tags. + //Resolver to resolve tags. Resolver resolver_; - ///Representer to represent data types. + //Representer to represent data types. Representer representer_; - ///Stream to write to. + //Stream to write to. Stream stream_; - ///Write scalars in canonical form? + //Write scalars in canonical form? bool canonical_; - ///Indentation width. + //Indentation width. int indent_ = 2; - ///Preferred text width. + //Preferred text width. uint textWidth_ = 80; - ///Line break to use. + //Line break to use. LineBreak lineBreak_ = LineBreak.Unix; - ///Character encoding to use. + //Character encoding to use. Encoding encoding_ = Encoding.UTF_8; - ///YAML version string. + //YAML version string. string YAMLVersion_ = "1.1"; - ///Tag directives to use. + //Tag directives to use. TagDirective[] tags_ = null; - ///Always write document start? + //Always write document start? Flag!"explicitStart" explicitStart_ = No.explicitStart; - ///Always write document end? + //Always write document end? Flag!"explicitEnd" explicitEnd_ = No.explicitEnd; - ///Name of the output file or stream, used in error messages. + //Name of the output file or stream, used in error messages. string name_ = ""; public: diff --git a/source/dyaml/hacks.d b/source/dyaml/hacks.d index 1280a20..8ddbb8d 100644 --- a/source/dyaml/hacks.d +++ b/source/dyaml/hacks.d @@ -46,11 +46,12 @@ unittest assert(node.scalarStyleHack() == ScalarStyle.Invalid); } -/// Get the collection style a YAML node had in the file it was loaded from. -/// -/// May only be called on collection nodes (nodes where node.isScalar() != true). -/// -/// See_Also: scalarStyleHack +/** Get the collection style a YAML node had in the file it was loaded from. + * + * May only be called on collection nodes (nodes where node.isScalar() != true). + * + * See_Also: scalarStyleHack + */ CollectionStyle collectionStyleHack(ref const(Node) node) @safe nothrow { assert(!node.isScalar, "Trying to get collection style of a scalar node"); @@ -64,12 +65,12 @@ unittest } -/// Set the scalar style node should have when written to a file. -/// -/// Setting the style might be useful when generating YAML or reformatting existing -/// files. -/// -/// May only be called on scalar nodes (nodes where node.isScalar() == true). +/** Set the scalar style node should have when written to a file. + * + * Setting the style might be useful when generating YAML or reformatting existing files. + * + * May only be called on scalar nodes (nodes where node.isScalar() == true). + */ void scalarStyleHack(ref Node node, const ScalarStyle rhs) @safe nothrow { assert(node.isScalar, "Trying to set scalar style of a non-scalar node"); @@ -84,12 +85,12 @@ unittest assert(node.scalarStyleHack() == ScalarStyle.DoubleQuoted); } -/// Set the collection style node should have when written to a file. -/// -/// Setting the style might be useful when generating YAML or reformatting existing -/// files. -/// -/// May only be called on collection nodes (nodes where node.isScalar() != true). +/** Set the collection style node should have when written to a file. + * + * Setting the style might be useful when generating YAML or reformatting existing files. + * + * May only be called on collection nodes (nodes where node.isScalar() != true). + */ void collectionStyleHack(ref Node node, const CollectionStyle rhs) @safe nothrow { assert(!node.isScalar, "Trying to set collection style of a scalar node"); diff --git a/source/dyaml/loader.d b/source/dyaml/loader.d index a2ea7d3..4c1bf9d 100644 --- a/source/dyaml/loader.d +++ b/source/dyaml/loader.d @@ -100,19 +100,19 @@ import dyaml.token; struct Loader { private: - /// Reads character data from a stream. + // Reads character data from a stream. Reader reader_; - /// Processes character data to YAML tokens. + // Processes character data to YAML tokens. Scanner scanner_; - /// Processes tokens to YAML events. + // Processes tokens to YAML events. Parser parser_; - /// Resolves tags (data types). + // Resolves tags (data types). Resolver resolver_; - /// Constructs YAML data types. + // Constructs YAML data types. Constructor constructor_; - /// Name of the input file or stream, used in error messages. + // Name of the input file or stream, used in error messages. string name_ = ""; - /// Are we done loading? + // Are we done loading? bool done_ = false; public: diff --git a/source/dyaml/node.d b/source/dyaml/node.d index 730b763..0c96097 100644 --- a/source/dyaml/node.d +++ b/source/dyaml/node.d @@ -118,7 +118,7 @@ package class YAMLContainer(T) if (!Node.allowed!T): YAMLObject } -/// Key-value pair of YAML nodes, used in mappings. +// Key-value pair of YAML nodes, used in mappings. private struct Pair { public: @@ -204,9 +204,9 @@ struct Node } private: - /// Stored value. + // Stored value. Value value_; - /// Start position of the node. + // Start position of the node. Mark startMark_; package: diff --git a/source/dyaml/representer.d b/source/dyaml/representer.d index d8bafd3..a06c63a 100644 --- a/source/dyaml/representer.d +++ b/source/dyaml/representer.d @@ -48,11 +48,11 @@ class RepresenterException : YAMLException final class Representer { private: - ///Representer functions indexed by types. + // Representer functions indexed by types. Node function(ref Node, Representer)[TypeInfo] representers_; - ///Default style for scalar nodes. + // Default style for scalar nodes. ScalarStyle defaultScalarStyle_ = ScalarStyle.Invalid; - ///Default style for collection nodes. + // Default style for collection nodes. CollectionStyle defaultCollectionStyle_ = CollectionStyle.Invalid; public: diff --git a/source/dyaml/resolver.d b/source/dyaml/resolver.d index e89462c..fca505e 100644 --- a/source/dyaml/resolver.d +++ b/source/dyaml/resolver.d @@ -34,14 +34,14 @@ import dyaml.tag; final class Resolver { private: - ///Default tag to use for scalars. + // Default tag to use for scalars. Tag defaultScalarTag_; - ///Default tag to use for sequences. + // Default tag to use for sequences. Tag defaultSequenceTag_; - ///Default tag to use for mappings. + // Default tag to use for mappings. Tag defaultMappingTag_; - /** + /* * Arrays of scalar resolver tuples indexed by starting character of a scalar. * * Each tuple stores regular expression the scalar must match, @@ -222,7 +222,7 @@ final class Resolver @property Tag defaultMappingTag() const pure @safe nothrow {return defaultMappingTag_;} private: - ///Add default implicit resolvers. + // Add default implicit resolvers. void addImplicitResolvers() @safe { addImplicitResolver("tag:yaml.org,2002:bool", diff --git a/source/dyaml/style.d b/source/dyaml/style.d index 3e4fe24..14d8a8e 100644 --- a/source/dyaml/style.d +++ b/source/dyaml/style.d @@ -12,8 +12,8 @@ module dyaml.style; enum ScalarStyle : ubyte { Invalid = 0, /// Invalid (uninitialized) style - Literal, /// | (Literal block style) - Folded, /// > (Folded block style) + Literal, /// `|` (Literal block style) + Folded, /// `>` (Folded block style) Plain, /// Plain scalar SingleQuoted, /// Single quoted scalar DoubleQuoted /// Double quoted scalar