Mike Gerwitz

Activist for User Freedom

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2014-05-15 12:42:42 -0400
committerMike Gerwitz <gerwitzm@lovullo.com>2014-05-15 12:42:42 -0400
commitc0f6242a48fbc3e1998966473db24b27f1b9c10e (patch)
tree761bd34cfb3790384e7c7425c2282c9a24dcc7d0
parenta581e59768c9a12f46f6e132bf5baf7c2541e357 (diff)
downloadlvspec-c0f6242a48fbc3e1998966473db24b27f1b9c10e.tar.gz
lvspec-c0f6242a48fbc3e1998966473db24b27f1b9c10e.tar.bz2
lvspec-c0f6242a48fbc3e1998966473db24b27f1b9c10e.zip
Added tenativeerr package
-rw-r--r--lvspec.cls1
-rw-r--r--raterspec/class.sty7
-rw-r--r--raterspec/param.sty15
-rw-r--r--tenativeerr.sty13
4 files changed, 26 insertions, 10 deletions
diff --git a/lvspec.cls b/lvspec.cls
index 3307db4..616e2df 100644
--- a/lvspec.cls
+++ b/lvspec.cls
@@ -21,6 +21,7 @@
\LoadClass[10pt]{scrreprt}
\RequirePackage{xparse}
+\RequirePackage{tenativeerr}
\RequirePackage[top=4.5cm,bottom=5cm,width=\textwidth]{geometry}
\RequirePackage{makeidx}
diff --git a/raterspec/class.sty b/raterspec/class.sty
index 8b69ab3..57250c7 100644
--- a/raterspec/class.sty
+++ b/raterspec/class.sty
@@ -74,7 +74,7 @@
\expandafter\let\expandafter\@@chk\csname classify@#1\endcsname
\ifx\@@chk\relax
% no known custom type (may be a normal ref)
- \PackageWarning{raterspec}{unknown magic ref `#1'}%
+ \PackageTenativeError{raterspec}{unknown magic ref `#1'}%
\else
\classifyref{#1}%
\fi
@@ -281,7 +281,7 @@
\def\@class@desc#1{{%
\expandafter\let\expandafter\@@chk\csname classify@#1\endcsname
\ifx\@@chk\relax
- \PackageWarning{raterspec}{unknown classification `#1'}%
+ \PackageTenativeError{raterspec}{unknown classification `#1'}%
\else
\@@chk
\fi
@@ -294,7 +294,8 @@
% fail if neither exists
\ifx\@@pchk\relax
\ifx\@@cchk\relax
- \PackageWarning{raterspec}{unknown identifier for classification match: #1}
+ \PackageTenativeError{raterspec}{%
+ unknown identifier for classification match: #1}
\else
% output
\@@cchk
diff --git a/raterspec/param.sty b/raterspec/param.sty
index 9857a78..4859e91 100644
--- a/raterspec/param.sty
+++ b/raterspec/param.sty
@@ -40,7 +40,8 @@
% ensure that the parent type actually exists
\ifx\@root\@coreptype\else%
\expandafter\ifx\csname ptype@\@type\endcsname\relax%
- \PackageWarning{raterspec}{unknown parent param type `\@type' for `#2'}
+ \PackageTenativeError{raterspec}{%
+ unknown parent param type `\@type' for `#2'}
\fi%
\fi%
% process any keywords
@@ -111,7 +112,7 @@
\def\unionv#1{%
% does this type exist?
\expandafter\ifx\csname ptype@#1\endcsname\relax%
- \PackageWarning{raterspec}{unknown param type `#1' for union}
+ \PackageTenativeError{raterspec}{unknown param type `#1' for union}
\fi%
\item{\typeref{#1}}
}
@@ -164,7 +165,7 @@
\def\@type@exists@err#1{{%
\expandafter\let\expandafter\@chk\csname ptype@#1\endcsname
\ifx\@chk\relax
- \PackageWarning{raterspec}{parameter `#1' is undefined}%
+ \PackageTenativeError{raterspec}{parameter `#1' is undefined}%
\fi
}}
\def\@const@exists@err#1{{%
@@ -172,7 +173,7 @@
\@ifnumeric{#1}\else
\expandafter\let\expandafter\@chk\csname const@#1\endcsname
\ifx\@chk\relax
- \PackageWarning{raterspec}{constant `#1' is undefined}%
+ \PackageTenativeError{raterspec}{constant `#1' is undefined}%
\fi
\fi
}}
@@ -217,7 +218,7 @@
% does the given type exist (note that this check assumes that the typedef
% appears before the param in the specs, as is currently the case)
\expandafter\ifx\csname ptype@\@type\endcsname\relax%
- \PackageWarning{raterspec}{unknown param type: \@type}
+ \PackageTenativeError{raterspec}{unknown param type: \@type}
\fi%
% typeset definition with link
\item[%
@@ -257,7 +258,7 @@
\endlinechar-1\relax
\expandafter\let\expandafter\@@chk\csname param@#1\endcsname
\ifx\@@chk\relax
- \PackageWarning{raterspec}{unknown param: #1}
+ \PackageTenativeError{raterspec}{unknown param: #1}
\fi
\index{parameter!#1@\texttt{#1}}%
\hyperlink{@param:#1}%
@@ -269,7 +270,7 @@
\def\paramrefd#1{%
\expandafter\let\expandafter\@@pchk\csname param@#1\endcsname
\ifx\@@pchk\empty
- \PackageWarning{raterspec}{Unknown parameter: #1}%
+ \PackageTenativeError{raterspec}{Unknown parameter: #1}%
\else
% output
\@@pchk
diff --git a/tenativeerr.sty b/tenativeerr.sty
new file mode 100644
index 0000000..668bcf8
--- /dev/null
+++ b/tenativeerr.sty
@@ -0,0 +1,13 @@
+% Provides warnings that are escalated to errors when a flag is set
+%%
+
+%%
+% Define \tenerr to escalate to errors
+%%
+
+\expandafter\ifx\csname tenerr\endcsname\relax
+ \let\PackageTenativeError\PackageWarning
+\else
+ \let\PackageTenativeError\PackageError
+\fi
+