2017-12-20 14:16:50 -05:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<!--
|
2022-05-03 14:14:29 -04:00
|
|
|
Copyright (C) 2014-2022 Ryan Specialty Group, LLC.
|
2017-12-20 14:16:50 -05:00
|
|
|
|
|
|
|
This file is part of tame-core.
|
|
|
|
|
|
|
|
tame-core is free software: you can redistribute it and/or modify it
|
2018-01-26 11:13:33 -05:00
|
|
|
under the terms of the GNU General Public License as
|
2017-12-20 14:16:50 -05:00
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
-->
|
|
|
|
<package xmlns="http://www.lovullo.com/rater"
|
|
|
|
xmlns:c="http://www.lovullo.com/calc"
|
2022-08-22 15:29:40 -04:00
|
|
|
xmlns:t="http://www.lovullo.com/rater/apply-template"
|
2017-12-20 14:16:50 -05:00
|
|
|
core="true"
|
|
|
|
desc="Aliasing Values">
|
|
|
|
|
|
|
|
These alias templates allow giving a new name to existing values.
|
|
|
|
They are most useful for avoiding too many template-generated variables.
|
|
|
|
|
2018-03-20 15:32:46 -04:00
|
|
|
If an alias name matches the name of the source,
|
|
|
|
then no alias will be generated;
|
|
|
|
this behavior is useful when generating aliases in templates where the
|
|
|
|
caller may or may not choose a name that would otherwise conflict with
|
|
|
|
its internal representation.
|
|
|
|
|
2017-12-21 10:56:26 -05:00
|
|
|
If no description is provided,
|
|
|
|
aliases will inherit the description from the source symbol.
|
|
|
|
|
2017-12-20 14:16:50 -05:00
|
|
|
<template name="_classify-alias_"
|
|
|
|
desc="Alias classification">
|
|
|
|
<param name="@as@" desc="Classification alias name" />
|
|
|
|
<param name="@from@" desc="Source classification" />
|
|
|
|
|
|
|
|
<param name="@desc@" desc="Classification alias description">
|
2017-12-21 10:56:26 -05:00
|
|
|
<param-sym-value prefix=":class:" name="@from@" value="desc" />
|
2017-12-20 14:16:50 -05:00
|
|
|
</param>
|
|
|
|
|
|
|
|
<param name="@yields@" desc="Classification alias yield">
|
|
|
|
<text></text>
|
|
|
|
</param>
|
|
|
|
|
|
|
|
<param name="@__src_yields@" desc="Source classification yield">
|
|
|
|
<param-class-to-yields name="@from@" />
|
|
|
|
</param>
|
|
|
|
|
|
|
|
|
2018-03-20 15:32:46 -04:00
|
|
|
<unless name="@as@" eq="@from@">
|
|
|
|
<classify as="@as@" desc="@desc@" yields="@yields@">
|
|
|
|
<match on="@__src_yields@" />
|
|
|
|
</classify>
|
|
|
|
</unless>
|
2017-12-20 14:16:50 -05:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template name="_rate-alias_"
|
|
|
|
desc="Alias calculation">
|
|
|
|
<param name="@yields@" desc="Alias name" />
|
|
|
|
<param name="@from@" desc="Source name" />
|
|
|
|
|
|
|
|
|
2018-03-20 15:32:46 -04:00
|
|
|
<unless name="@from@" eq="@yields@">
|
|
|
|
<rate yields="@yields@">
|
|
|
|
<c:value-of name="@from@" />
|
|
|
|
</rate>
|
|
|
|
</unless>
|
2017-12-20 14:16:50 -05:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template name="_rate-each-alias_"
|
|
|
|
desc="Alias generator">
|
|
|
|
<param name="@generates@" desc="Generator alias name" />
|
|
|
|
<param name="@from@" desc="Source generator" />
|
|
|
|
|
2017-12-21 10:56:26 -05:00
|
|
|
<param name="@desc@" desc="Generator alias description">
|
2018-03-20 15:32:46 -04:00
|
|
|
<param-sym-value name="@from@" value="desc" />
|
2017-12-21 10:56:26 -05:00
|
|
|
</param>
|
|
|
|
|
2017-12-20 14:16:50 -05:00
|
|
|
<param name="@yields@" desc="Yield alias name">
|
|
|
|
<text>_</text>
|
|
|
|
<param-value name="@generates@" />
|
|
|
|
</param>
|
|
|
|
|
|
|
|
|
2018-03-20 15:32:46 -04:00
|
|
|
<unless name="@generates@" eq="@from@">
|
|
|
|
<rate yields="@yields@">
|
|
|
|
<c:sum of="@from@" desc="@desc@" generates="@generates@" index="k">
|
|
|
|
<c:value-of name="@from@" index="k" />
|
|
|
|
</c:sum>
|
|
|
|
</rate>
|
|
|
|
</unless>
|
2017-12-20 14:16:50 -05:00
|
|
|
</template>
|
|
|
|
</package>
|