Minor documentation and API fixes.

This commit is contained in:
Ferdinand Majerech 2011-11-18 12:28:29 +01:00
parent fbc962623d
commit 10dbb55ed8
11 changed files with 16 additions and 26 deletions

Binary file not shown.

View file

@ -92,16 +92,6 @@
</dd>
</dl>
</dd>
<dt class="d_decl">package ScalarStyle <a name="scalarStyle"></a><span class="ddoc_psymbol">scalarStyle</span>;
</dt>
<dd><p>Node scalar style. Used to remember style this node was loaded with.</p>
</dd>
<dt class="d_decl">package CollectionStyle <a name="collectionStyle"></a><span class="ddoc_psymbol">collectionStyle</span>;
</dt>
<dd><p>Node collection style. Used to remember style this node was loaded with.</p>
</dd>
<dt class="d_decl">this(T)(T <b>value</b>, in string <b>tag</b> = null);
</dt>

View file

@ -53,7 +53,7 @@
</p>
<p>Can be used to implicitly resolve custom data types of scalar values.</p>
<dl><dt class="d_decl">this(in const(bool) <b>defaultImplicitResolvers</b> = true);
<dl><dt class="d_decl">this(bool <b>defaultImplicitResolvers</b> = true);
</dt>
<dd><p>Construct a Resolver.
</p>
@ -61,12 +61,12 @@
you can use <b>defaultImplicitResolvers</b> to disable default resolvers.
</p>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>const(bool) <b>defaultImplicitResolvers</b></td>
<b>Parameters:</b><div class="pbr"><table class=parms><tr><td valign=top>bool <b>defaultImplicitResolvers</b></td>
<td valign=top>Use default YAML implicit resolvers?</td></tr>
</table></div>
</dd>
<dt class="d_decl">void <a name="addImplicitResolver"></a><span class="ddoc_psymbol">addImplicitResolver</span>(string <b>tag</b>, Regex!(char) <b>regexp</b>, in string <b>first</b>);
<dt class="d_decl">void <a name="addImplicitResolver"></a><span class="ddoc_psymbol">addImplicitResolver</span>(string <b>tag</b>, Regex!(char) <b>regexp</b>, string <b>first</b>);
</dt>
<dd><p>Add an implicit scalar resolver.
</p>
@ -97,7 +97,7 @@
{
<span class="d_keyword">auto</span> loader = Loader(<span class="d_string">"file.txt"</span>);
<span class="d_keyword">auto</span> resolver = <span class="d_keyword">new</span> Resolver();
resolver.<span class="d_psymbol">addImplicitResolver</span>(<span class="d_string">"!tag"</span>, std.regex.regex(<span class="d_string">"A*"</span>), <span class="d_string">"A"</span>);
resolver.<span class="d_psymbol">addImplicitResolver</span>(<span class="d_string">"!tag"</span>, std.regex.regex(<span class="d_string">"A.*"</span>), <span class="d_string">"A"</span>);
loader.resolver = resolver;
<span class="d_comment">//Note that we have no constructor from tag "!tag", so we can't

View file

@ -138,7 +138,7 @@ struct appears in Phobos.</p>
</div>
<div class="footer">
&copy; Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on Nov 17, 2011.
Last updated on Nov 18, 2011.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>

View file

@ -104,7 +104,7 @@
</div>
<div class="footer">
&copy; Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on Nov 17, 2011.
Last updated on Nov 18, 2011.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>

View file

@ -87,7 +87,7 @@
</div>
<div class="footer">
&copy; Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on Nov 17, 2011.
Last updated on Nov 18, 2011.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>

View file

@ -364,7 +364,7 @@ directory of the D:YAML package.</p>
</div>
<div class="footer">
&copy; Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on Nov 17, 2011.
Last updated on Nov 18, 2011.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>

View file

@ -237,7 +237,7 @@ example in the <tt class="docutils literal"><span class="pre">example/getting_st
</div>
<div class="footer">
&copy; Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on Nov 17, 2011.
Last updated on Nov 18, 2011.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>

View file

@ -330,7 +330,7 @@ Some of these might change in the future (especially !!map and !!set).</p>
</div>
<div class="footer">
&copy; Copyright 2011, Ferdinand Majerech. Based on PyYAML http://www.pyyaml.org by Kirill Simonov.
Last updated on Nov 17, 2011.
Last updated on Nov 18, 2011.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>

View file

@ -180,9 +180,9 @@ struct Node
package:
//Tag of the node.
Tag tag_;
///Node scalar style. Used to remember style this node was loaded with.
//Node scalar style. Used to remember style this node was loaded with.
ScalarStyle scalarStyle = ScalarStyle.Invalid;
///Node collection style. Used to remember style this node was loaded with.
//Node collection style. Used to remember style this node was loaded with.
CollectionStyle collectionStyle = CollectionStyle.Invalid;
public:

View file

@ -61,7 +61,7 @@ final class Resolver
*
* Params: defaultImplicitResolvers = Use default YAML implicit resolvers?
*/
this(in bool defaultImplicitResolvers = true)
this(bool defaultImplicitResolvers = true)
{
defaultScalarTag_ = Tag("tag:yaml.org,2002:str");
defaultSequenceTag_ = Tag("tag:yaml.org,2002:seq");
@ -104,7 +104,7 @@ final class Resolver
* {
* auto loader = Loader("file.txt");
* auto resolver = new Resolver();
* resolver.addImplicitResolver("!tag", std.regex.regex("A*"), "A");
* resolver.addImplicitResolver("!tag", std.regex.regex("A.*"), "A");
* loader.resolver = resolver;
*
* //Note that we have no constructor from tag "!tag", so we can't
@ -115,7 +115,7 @@ final class Resolver
* }
* --------------------
*/
void addImplicitResolver(string tag, Regex!char regexp, in string first)
void addImplicitResolver(string tag, Regex!char regexp, string first)
{
foreach(const dchar c; first)
{
@ -141,7 +141,7 @@ final class Resolver
*
* Returns: Resolved tag.
*/
Tag resolve(in NodeID kind, Tag tag, string value, in bool implicit)
Tag resolve(NodeID kind, Tag tag, string value, bool implicit)
{
if(!tag.isNull() && tag.get() != "!"){return tag;}