| 81 | } |
| 82 | |
| 83 | NodeParameterValue replaceBehaviorTag(NodeParameterValue const& parameter, StringMap<NodeParameterValue> const& treeParameters) { |
| 84 | Maybe<String> strVal = parameter.maybe<String>(); |
| 85 | if (!strVal && parameter.get<Json>().isType(Json::Type::String)) |
| 86 | strVal = parameter.get<Json>().toString(); |
| 87 | if (strVal) { |
| 88 | String key = *strVal; |
| 89 | if (key.beginsWith('<') && key.endsWith('>')) { |
| 90 | String treeKey = key.substr(1, key.size() - 2); |
| 91 | |
| 92 | if (auto replace = treeParameters.maybe(treeKey)) { |
| 93 | return *replace; |
| 94 | } else { |
| 95 | throw StarException(strf("No parameter specified for tag '{}'", key)); |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | return parameter; |
| 100 | } |
| 101 | |
| 102 | Maybe<String> replaceOutputBehaviorTag(Maybe<String> const& output, StringMap<NodeParameterValue> const& treeParameters) { |
| 103 | if (auto out = output) { |
no test coverage detected