summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile11
-rw-r--r--TODO8
-rw-r--r--luatexbase-attr.dtx39
-rw-r--r--luatexbase-regs.dtx2
4 files changed, 48 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 06c51d4..6206fec 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,9 @@ DTXSTY = lltxb-dtxstyle.tex
UNPACKED_MCB = test-luamcallbacks.tex luamcallbacks.lua
UNPACKED_REGS = luatexbase-regs.sty \
test-regs-plain.tex test-regs-latex.tex
-UNPACKED = $(UNPACKED_MCB) $(UNPACKED_REGS)
+UNPACKED_ATTR = luatexbase-attr.sty luatexbase.attr.lua \
+ test-attr-plain.tex test-attr-latex.tex
+UNPACKED = $(UNPACKED_MCB) $(UNPACKED_REGS) $(UNPACKED_ATTR)
COMPILED = $(DOC)
GENERATED = $(COMPILED) $(UNPACKED)
SOURCE = $(DTX) $(DTXSTY) README TODO Changes Makefile
@@ -59,10 +61,17 @@ $(UNPACKED_MCB): luamcallbacks.dtx
$(UNPACKED_REGS): luatexbase-regs.dtx
$(DO_TEX)
+$(UNPACKED_ATTR): luatexbase-attr.dtx
+ $(DO_TEX)
+
check-regs: $(UNPACKED_REGS)
luatex --interaction=batchmode test-regs-plain.tex >/dev/null
lualatex --interaction=batchmode test-regs-latex.tex >/dev/null
+check-attr: $(UNPACKED_ATTR)
+ luatex --interaction=batchmode test-attr-plain.tex >/dev/null
+ lualatex --interaction=batchmode test-attr-latex.tex >/dev/null
+
$(CTAN_ZIP): $(SOURCE) $(COMPILED) $(TDS_ZIP)
@echo "Making $@ for CTAN upload."
@$(RM) -- $@
diff --git a/TODO b/TODO
index 1c8d40e..ed9c0d3 100644
--- a/TODO
+++ b/TODO
@@ -1,14 +1,14 @@
general
-------
+- write test files
- change prefix for internal TeX macros
- check for lua name conflicts ('module' used in mods)
- check for macros starting with \luatex
-- write test files
-- reload check, declaration, luatex test
-- handle catcodes for Plain (more comprensive defenses to be added later)
-- import/update doc
- make TeX tests cleaner: \begingroup\expandafter\ETC.
+- reload check, declaration, luatex test, catcodes for plain
+- import/update doc
+- date & changes entry
Later
diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx
index 8f68efc..4af129c 100644
--- a/luatexbase-attr.dtx
+++ b/luatexbase-attr.dtx
@@ -11,7 +11,8 @@
%
% This work consists of the main source file luatexbase-attr.dtx
% and the derived files
-% luatexbase-attr.sty luatexbase.attr.lua ...
+% luatexbase-attr.sty luatexbase.attr.lua
+% test-regs-plain.tex test-regs-latex.tex
%
% Unpacking:
% tex luatexbase-attr.dtx
@@ -57,6 +58,12 @@ and the derived files
\file{luatexbase-attr.sty}{\from{luatexbase-attr.dtx}{texpackage}}%
}
+\generate{%
+ \usedir{doc/luatex/luatexbase}%
+ \file{test-attr-plain.tex}{\from{luatexbase-attr.dtx}{testplain}}%
+ \file{test-attr-latex.tex}{\from{luatexbase-attr.dtx}{testlatex}}%
+}
+
\def\MetaPrefix{-- }
\def\luapostamble{%
@@ -107,7 +114,7 @@ and the derived files
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
- Minus \- Point \. Solidus \/
+% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
@@ -115,8 +122,6 @@ and the derived files
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
-% \GetFileInfo{luatexbase-attr.drv}
-%
% \title{The \pk{luatexbase-attr} package}
% \date{DATE}
% \author{%
@@ -153,10 +158,11 @@ and the derived files
\ifluatex
\global\luatexattributedef#1=\allocationnumber
\fi
- \wlog{\string#1=\string\luatexattribute\the\allocationnumber}%
+ \unsetluatexattribute#1%
\begingroup\escapechar\m@ne \expandafter\endgroup
\directlua{luatextra.attributedef_from_tex(
'\luatexluaescapestring{\string#1}', '\number\allocationnumber')}%
+ \wlog{\string#1=\string\luatexattribute\the\allocationnumber}%
\else
\errmessage{No room for a new \string\attribute}%
\fi}
@@ -218,5 +224,28 @@ end
%</luamodule>
% \end{macrocode}
%
+% \section{Test files}
+%
+% The tests done are very basic: we just make sure that the package loads
+% correctly and the macros don't generate any error, under both LaTeX en
+% Plain TeX.
+%
+% \begin{macrocode}
+%<testplain>\input luatexbase-attr.sty
+%<testlatex>\RequirePackage{luatexbase-attr}
+%<*testplain,testlatex>
+\newluatexattribute\testattr
+\setluatexattribute\testattr{1}
+\unsetluatexattribute\testattr
+\begingroup
+\newluatexattribute\anotherattr
+\endgroup
+\setluatexattribute\anotherattr{1}
+%</testplain,testlatex>
+%<testplain>\bye
+%<testlatex>\stop
+% \end{macrocode}
+%
+%
% \Finale
\endinput
diff --git a/luatexbase-regs.dtx b/luatexbase-regs.dtx
index 1322103..11b7013 100644
--- a/luatexbase-regs.dtx
+++ b/luatexbase-regs.dtx
@@ -110,8 +110,6 @@ and the derived files
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
-% \GetFileInfo{luatexbase-regs.drv}
-%
% \title{The \pk{luatexbase-regs} package}
% \date{2010/01/21 v0.1}
% \author{%