Skip to content

Commit

Permalink
Don't complain when YAML tags have fallbacks
Browse files Browse the repository at this point in the history
Maybe we intentionally specified nonsense so the fallback would show.
  • Loading branch information
mcmonkey4eva committed Dec 8, 2014
1 parent 6e5a467 commit 455fb32
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -440,7 +440,8 @@ public void yaml(ReplaceableTagEvent event) {
}

// YAML tag requires name context and type context.
if (!event.hasNameContext() || !(event.hasTypeContext() || attribute.getAttribute(2).equalsIgnoreCase("to_json"))) {
if ((!event.hasNameContext() || !(event.hasTypeContext() || attribute.getAttribute(2).equalsIgnoreCase("to_json")))
&& !attribute.hasAlternative()) {
dB.echoError("YAML tag '" + event.raw_tag + "' is missing required context. Tag replacement aborted.");
return;
}
Expand All @@ -450,7 +451,8 @@ public void yaml(ReplaceableTagEvent event) {
String path = event.getTypeContext();

// Check if there is a yaml file loaded with the specified id
if (!yamls.containsKey(id.toUpperCase())) {
if (!yamls.containsKey(id.toUpperCase())
&& !attribute.hasAlternative()) {
dB.echoError("YAML tag '" + event.raw_tag + "' has specified an invalid ID, or the specified id has already" +
" been closed. Tag replacement aborted. ID given: '" + id + "'.");
return;
Expand Down

0 comments on commit 455fb32

Please sign in to comment.