Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-01-31 16:47:38 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-09-11 09:30:53 -0400
commiteb7c29bd9f2cdbda123294a3b13efbf718711dcf (patch)
treed45393bd00c94413149e51c9214e7070d16270c6
parent500fe170d49c2c96cd1dcc8b550e116bf4748a60 (diff)
downloadtame-eb7c29bd9f2cdbda123294a3b13efbf718711dcf.tar.gz
tame-eb7c29bd9f2cdbda123294a3b13efbf718711dcf.tar.bz2
tame-eb7c29bd9f2cdbda123294a3b13efbf718711dcf.zip
convention: New package with _naming-convention_
-rw-r--r--core/convention.xml59
1 files changed, 59 insertions, 0 deletions
diff --git a/core/convention.xml b/core/convention.xml
new file mode 100644
index 0000000..7661888
--- /dev/null
+++ b/core/convention.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<!--
+ Copyright (C) 2018 R-T Specialty, LLC.
+
+ This file is part of tame-core.
+
+ tame-core is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as
+ 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"
+ xmlns:t="http://www.lovullo.com/rater/apply-template"
+ core="true"
+ title="Definition Conventions">
+
+
+ \ref{_naming-convention_} defines a naming convention for a parameter that
+ is enforced at compile-time.
+ Conventions may have prefixes, suffixes, or both.
+ If violated,
+ the compiler will abort in error.
+
+ <template name="_naming-convention_"
+ desc="Error about naming convention violation">
+ <param name="@name@" desc="Given name" />
+ <param name="@prefix@" desc="Required prefix" />
+ <param name="@suffix@" desc="Required suffix" />
+
+ <if name="@prefix@">
+ <unless name="@name@" prefix="@prefix@">
+ <error>
+ naming convention violation:
+ `<param-value name="@name@" />' must be prefixed with
+ `<param-value name="@prefix@" />'.
+ </error>
+ </unless>
+ </if>
+
+ <if name="@suffix@">
+ <unless name="@name@" suffix="@suffix@">
+ <error>
+ naming convention violation:
+ `<param-value name="@name@" />' must be suffixed with
+ `<param-value name="@suffix@" />'.
+ </error>
+ </unless>
+ </if>
+ </template>
+</package>