Skip to content

Commit

Permalink
More space management
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Jun 7, 2022
1 parent 10a2264 commit 6ca9cca
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
7 changes: 4 additions & 3 deletions base/lttemplate.dtx
Expand Up @@ -716,10 +716,11 @@
\cs_set_protected:Npn \@@_split_keytype_arg_aux:w
####1 ##1 ####2 \s_@@_stop
{
\tl_if_empty:nT {####1}
\tl_if_blank:nT {####1}
{
\tl_set:Nn \l_@@_keytype_tl {##1}
\tl_set:Nn \l_@@_keytype_arg_tl {####2}
\tl_set:Nx \l_@@_keytype_tl
{ \tl_trim_spaces:n {##1} }
\tl_set:Nx \l_@@_keytype_arg_tl { \use:n ####2 }
\seq_map_break:
}
}
Expand Down
15 changes: 14 additions & 1 deletion base/testfiles-lttemplate/lttemplate001.lvt
Expand Up @@ -19,6 +19,7 @@
\DeclareObjectType { test-zero } 0
\DeclareObjectType { test-one } 1
\DeclareObjectType { test-two } 2
\DeclareObjectType { test-three } 3
\TIMO
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST{Making~object~types}{
Expand Down Expand Up @@ -46,7 +47,19 @@
\DeclareTemplateInterface { undeclared } { template } 1 { }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ExplSyntaxOff
\TEST{Template~interfaces: spaces}{
\DeclareTemplateInterface{test-three}{template} 3 {
key-one : tokenlist = default ,
key-two : tokenlist ,
key-three : integer = 4 ,
key-four : choice { one, two, three },
key-five : code = {#1}
}
\ShowTemplateKeytypes{test-three}{template}
\ShowTemplateDefaults{test-three}{template}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\END
27 changes: 24 additions & 3 deletions base/testfiles-lttemplate/lttemplate001.tlg
Expand Up @@ -5,11 +5,11 @@ Author: Joseph Wright
TEST 1: Making object types
============================================================
Package template Info: Declaring object type 'test' taking 0 argument(s) on
(template) line 28.
(template) line 29.
Package template Info: Declaring object type 'test' taking 1 argument(s) on
(template) line 28.
(template) line 29.
Package template Info: Declaring object type 'test' taking 2 argument(s) on
(template) line 28.
(template) line 29.
============================================================
============================================================
TEST 2: Template interfaces: correct
Expand Down Expand Up @@ -62,3 +62,24 @@ For immediate help type H <return>.
l. ...}
An object type needs to be declared with \DeclareObjectType prior to using it.
============================================================
============================================================
TEST 4: Template~interfaces: spaces
============================================================
Defining \template defaults > test-three/template on line ...
Defining \template key types > test-three/template on line ...
Defining \template key order > test-three/template on line ...
The template 'template' of object type 'test-three' has interface:
> key-one => tokenlist
> key-two => tokenlist
> key-three => integer
> key-four => choice{ one, two, three }
> key-five => code.
<recently read> }
l. ...}
The template 'template' of object type 'test-three' has default values:
> key-one => default
> key-three => 4
> key-five => ##1.
<recently read> }
l. ...}
============================================================

0 comments on commit 6ca9cca

Please sign in to comment.