diff --git a/doc/doctrees/environment.pickle b/doc/doctrees/environment.pickle index 4b69e2b..b8faa2b 100644 Binary files a/doc/doctrees/environment.pickle and b/doc/doctrees/environment.pickle differ diff --git a/doc/html/api/dyaml.resolver.html b/doc/html/api/dyaml.resolver.html index 4dc9533..60351b6 100644 --- a/doc/html/api/dyaml.resolver.html +++ b/doc/html/api/dyaml.resolver.html @@ -69,10 +69,11 @@
Add an implicit scalar resolver.
-If a scalar matches regexp and starts with one of the characters in first, - its tag is set to tag. If the scalar matches more than one resolver - regular expression, resolvers added first override those added later. - Default resolvers override any user specified resolvers. +
If a scalar matches regexp and starts with any character in first,
+ its tag is set to tag. If it matches more than one resolver regexp
+ resolvers added first override ones added later. Default resolvers
+ override any user specified resolvers, but they can be disabled in
+ Resolver constructor.
If a scalar is not resolved to anything, it is assigned the default
@@ -86,6 +87,26 @@
import std.regex; + + import yaml; + + void main() + { + auto loader = Loader("file.txt"); + auto resolver = new Resolver(); + resolver.addImplicitResolver("!tag", std.regex.regex("A*"), "A"); + loader.resolver = resolver; + + //Note that we have no constructor from tag "!tag", so we can't + //actually load anything that resolves to this tag. + //See Constructor API documentation and tutorial for more information. + + auto node = loader.load(); + } ++