From 91b6ab6d1a2f9fd4130100b9bdd5a8e65369f848 Mon Sep 17 00:00:00 2001 From: MorphanOne Date: Tue, 17 Sep 2013 18:13:57 -0400 Subject: [PATCH] Stop incorrectly throwing Yaml tag errors --- .../denizen/scripts/commands/core/YamlCommand.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/core/YamlCommand.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/core/YamlCommand.java index 2967df63f5..92dadb17c2 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/commands/core/YamlCommand.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/core/YamlCommand.java @@ -208,13 +208,16 @@ public void yaml(ReplaceableTagEvent event) { event.setReplaced(new Element("null").getAttribute(attribute.fulfill(1))); return; - } else + } + else { event.setReplaced(new Element(value).getAttribute(attribute.fulfill(1))); + return; + } } // <--[tag] // @attribute ].list_keys[]> - // @returns Element + // @returns dList // @description // Returns a dList of all the keys at the path. // --> @@ -228,19 +231,17 @@ public void yaml(ReplaceableTagEvent event) { Set keys = section.getKeys(false); if (keys == null) { dB.echoDebug("YAML tag '" + event.raw_tag + "' has returned null."); - event.setReplaced("null"); + event.setReplaced(new Element("null").getAttribute(attribute.fulfill(1))); return; } else { ArrayList list = new ArrayList(); list.addAll(keys); event.setReplaced(new dList(list).getAttribute(attribute.fulfill(1))); + return; } } - // Got this far? Invalid attribute. - dB.echoError("YAML tag '" + event.raw_tag + "' has an invalid attribute. Tag replacement aborted."); - } }