_map-else_ error when _map_/@default@ already provided
parent
08d6c812d1
commit
0989895ea6
28
core/map.xml
28
core/map.xml
|
@ -52,20 +52,25 @@
|
||||||
<text></text>
|
<text></text>
|
||||||
</param>
|
</param>
|
||||||
|
|
||||||
<param name="@default@" desc="Default value" />
|
<!-- used in param-meta for _map-else_, so let's make the default
|
||||||
|
clear -->
|
||||||
|
<param name="@default@" desc="Default value">
|
||||||
|
<text></text>
|
||||||
|
</param>
|
||||||
|
|
||||||
|
|
||||||
<c:cases label="@label@">
|
<c:cases label="@label@">
|
||||||
<param-copy name="@values@">
|
<param-copy name="@values@">
|
||||||
<param-meta name="map_param" value="@name@" />
|
<param-meta name="map_param" value="@name@" />
|
||||||
<param-meta name="map_index" value="@index@" />
|
<param-meta name="map_index" value="@index@" />
|
||||||
|
<param-meta name="map_default" value="@default@" />
|
||||||
</param-copy>
|
</param-copy>
|
||||||
|
|
||||||
<if name="@default@">
|
<unless name="@default@" eq="">
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
<c:const value="@default@" type="integer" desc="No mapping" />
|
<c:const value="@default@" type="integer" desc="No mapping" />
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</if>
|
</unless>
|
||||||
</c:cases>
|
</c:cases>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -156,6 +161,19 @@
|
||||||
<text></text>
|
<text></text>
|
||||||
</param>
|
</param>
|
||||||
|
|
||||||
|
<param name="@_map-default@" desc="_map_-specified default">
|
||||||
|
<param-inherit meta="map_default" />
|
||||||
|
</param>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- provide a more friendly error; otherwise, they'd get an error
|
||||||
|
from having two c:otherwise nodes, which would be confusing -->
|
||||||
|
<unless name="@_map-default@" eq="">
|
||||||
|
<error>
|
||||||
|
A default value was already provided by _map-set_/@default@
|
||||||
|
</error>
|
||||||
|
</unless>
|
||||||
|
|
||||||
|
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
<if name="@value@">
|
<if name="@value@">
|
||||||
|
|
Loading…
Reference in New Issue