diff options
author | Karl Berry <karl@freefriends.org> | 2011-11-25 00:12:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-11-25 00:12:36 +0000 |
commit | 5d91a4309dbff9d6757412edf6618f731fef9809 (patch) | |
tree | d181a66a46502d2d9c58145a3e5b96663f359654 /Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty | |
parent | 0ad65f7beaddd4e930a52720af50fa3aa6ba5958 (diff) |
ltxkeys 0.0.2 (20nov11)
git-svn-id: svn://tug.org/texlive/trunk@24653 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty | 615 |
1 files changed, 615 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty b/Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty new file mode 100644 index 00000000000..d047ec0b90e --- /dev/null +++ b/Master/texmf-dist/tex/latex/ltxkeys/pathkeys.sty @@ -0,0 +1,615 @@ +%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% +% % +% This is file 'pathkeys.sty', version 0.0.2, October 2011. % +% % +% This package and accompanying files may be distributed and/or % +% modified under the conditions of the LaTeX Project Public License, % +% either version 1.3 of this license or any later version. The latest % +% version of this license is in http://www.latex-project.org/lppl.txt % +% and version 1.3 or later is part of all distributions of LaTeX % +% version 2005/12/01 or later. % +% % +% The LPPL maintenance status of this software is 'author-maintained'. % +% % +% This software is provided 'as it is', without warranty of any kind, % +% either expressed or implied, including, but not limited to, the % +% implied warranties of merchantability and fitness for a particular % +% purpose. % +% % +% Copyright (c) 2011 Ahmed Musa (amusa22@gmail.com). % +% % +%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% + +\@ifpackageloaded{ltxkeys}{% + \@ifpackagelater{ltxkeys}{2011/10/22}{}{% + \@latex@error{Loaded version of ltxkeys package is + not current}\@ehc + }% +}{% + \RequirePackage{ltxkeys}[2011/10/22]% +} +\UseNormalCatcodes +\StyleFilePurpose{A robust and fast key-value parser (AM)} +\StyleFileRCSInfo +$Id: pathkeys.sty,v 0.0.2 2011/10/22 09:00:00 Ahmed Musa Exp $ +\ProvidesPackage{pathkeys}[\StyleFileInfo] +\NeedsTeXFormat{LaTeX2e}[2005/12/01] +\SetStyleFileMessages[pathkeys@]{info}{warn}{err} +\newvariables{count}[pathkeys@]{cnta}[\z@pt] +\newvariables{if}[pathkeys@]{chfd}[false] +\newletcs\pathkeys@relax\relax +\new@def\pathkeys@gobbletorelax#1\pathkeys@relax{} +\robust@def*\pathkeys@getkeypath#1{% + \xifinsetTF{:}{\detokenize{#1}}{}{% + \pathkeys@err{I can't find ':' in argument of + \string\pathkeys}\ltxkeys@ehc + }% + \def\reserved@a##1:##2\ltxkeys@nil{% + \iflacus##1\dolacus + \pathkeys@err{Nil flag in argument of + \string\pathkeys}\ltxkeys@ehc + \fi + \ltxkeys@trimspaces{##1}\key@path + \ltxkeys@trimspaces{##2}\key@list + \csv@@normalize*[/]\key@path + \s@expandarg\pathkeys@getkeyflag\key@path + \csv@@normalize*[/]\key@path + \cptsafeactivesedef\key@path\key@path + \xifstrcmpTF\key@flag{ifkeyonpath}{% + \pathkeys@gobbletorelax + }{% + \pathkeys@listadd*![;]\pathkeys@pathhistory\key@path + }% + }% + \reserved@a#1\ltxkeys@nil +} +\robust@def*\pathkeys@getkeyflag#1{% + \def\do##1,##2\ltxkeys@nil{% + \xifinsetTF{\detokenize{##1}\relax}{\detokenize{#1}\relax}{% + \def\reserved@a####1##1\relax{% + \ltxkeys@trimspaces{##1}\key@flag + \ltxkeys@trimspaces{####1}\key@path + }% + \reserved@a#1\relax + }{% + \ifnullTF{##2}{% + \pathkeys@err{Unknown flag in argument of + \string\pathkeys}\ltxkeys@ehc + }{% + \do##2\ltxkeys@nil + }% + }% + }% + \do define,define*,declareoptions,declareoptions*,set,% + executeoptions,processoptions,processoptions*,launch,% + key handler,option handler,ifbool,add value,store value,% + print value,disable,disable*,fdef,ifkeyonpath,\ltxkeys@nil +} +\robust@def*\pathkeys@splitpath#1{% + \def\main@path{}\def\sub@path{}% + \@tempcnta\z@pt + \def\do##1/{% + \defifxTF{##1}\ltxkeys@nnil{}{% + \advance\@tempcnta\@ne + \ifnum\@tempcnta=\@ne + \def\main@path{##1}% + \else + \edef\sub@path{\csliststack{/}\sub@path##1}% + \fi + \do + }% + }% + \do#1/\ltxkeys@nil/% +} +\robust@def*\pathkeys@checkpath#1{% + \iflacus#1\dolacus + \ltxkeys@debug{==}{Empty key path in \string\pathkeys: default used}% + \let\key@path\pathkeys@c@rrentpath + \else + \def\reserved@a##1/##2/##3/##4\ltxkeys@nil{% + \iflacus##2\dolacus + \pathkeys@err{Empty key <sub> in \string\pathkeys}\ltxkeys@ehc + \fi + }% + \reserved@a#1///\ltxkeys@nil + \fi +} +\robust@def*\pathkeys@getkeyname#1{% + \def\reserved@a##1/##2\ltxkeys@nil{% + \ltxkeys@trimspaces{##1}\key@type + }% + \reserved@a#1\ltxkeys@nil + \xifstrcmpTF{\detokenize{choice}}{\cptoxdetok\key@type}{% + \def\reserved@a##1/##2.##3\ltxkeys@nil{% + \ltxkeys@trimspaces{##2}\key@name + }% + \reserved@a#1\ltxkeys@nil + }{% + \def\reserved@a##1/##2/##3\ltxkeys@nil{% + \ltxkeys@trimspaces{##2}\key@name + \ltxkeys@ifrejname{% + \pathkeys@err{^^JI can't find key name in attributes of + key in^^J||\detokenize{#1}||^^J}\ltxkeys@ehc + }% + }% + \reserved@a#1/^?/\ltxkeys@nil + }% +} +\robust@def*\pathkeys@checkifdef{% + \xifinsetTF{,\key@flag,}{,define*,declareoptions*,}{% + \def\ltxkeys@resa{}% + \def\ltxkeys@do##1{% + \pathkeys@getkeyname{##1}% + \ifcsndefTF{pathkeys/curr/\ltxkeys@iffirstnull\main@path/% + \ltxkeys@iffirstnull\sub@path/\key@name + }{% + \edef\ltxkeys@resa{\csliststack,\ltxkeys@resa\key@name}% + }{}% + }% + \cptexpandsecond{\ltxkeys@parse*1}{[\ltxkeys@keyparser]}\key@list + \ifx\ltxkeys@resa\@empty\else + \pathkeys@err{^^JKey names^^J||\ltxkeys@resa||^^J% + in argument of \noexpand\pathkeys are already in + use on path '\key@path'}\ltxkeys@ehc + \fi + }{}% +} +\cpt@setupsafeactivesedef +\robust@def*\pathkeys#1{% + \begintoksgroup + \pathkeys@getkeypath{#1}% + \s@expandarg\pathkeys@checkpath\key@path + \s@expandarg\pathkeys@splitpath\key@path + \pathkeys@checkifdef + \pathkeys@relax + \let\xp\expandcsonce + \let\elt\ltxkeys@iffirstnull + \def\reserved@a##1{% + \def\reserved@a####1##1####2####3\ltxkeys@nil{% + \defifxTF{####2}\ltxkeys@nil{% + \pathkeys@err{Unknown flag '####1' in argument of + \string\pathkeys}\ltxkeys@ehc + }{% + \cptexpanded{\toks@{####2}}% + }% + }% + \expandafter\reserved@a\pathkeys@actions##1{\ltxkeys@nil}\ltxkeys@nil + }% + \s@expandarg\reserved@a\key@flag + \endtoksgroup +} +\robust@def*\pathkeys@actions{% + define{\pathkeys@defkey\ltxkeys@declarekeys{{\sub@path}}}% + define*{\pathkeys@defkey{\ltxkeys@declarekeys*}{{\sub@path}}}% + declareoptions{\pathkeys@defkey + \ltxkeys@declaremultitypeoptions{<\sub@path>}}% + declareoptions*{\pathkeys@defkey + {\ltxkeys@declaremultitypeoptions*}{<\sub@path>}}% + set{\pathkeys@setkeys{\main@path}{\sub@path}{\xp\key@list}}% + executeoptions{\pathkeys@executeoptions{\main@path}% + {\sub@path}{\xp\key@list}}% + processoptions{\pathkeys@processoptions{\main@path}% + {\sub@path}{\xp\key@list}}% + processoptions*{\pathkeys@processoptions*{\main@path}% + {\sub@path}{\xp\key@list}}% + launch{\ltxkeys@launchkeys[\main@path]{\sub@path}{\xp\key@list}}% + handler{\ltxkeys@unknownkeyhandler[\main@path]% + {\sub@path}{\xp\key@list}}% + key handler{\ltxkeys@unknownkeyhandler[\main@path]% + {\sub@path}{\xp\key@list}}% + option handler{\ltxkeys@unknownoptionhandler[\main@path]% + <\sub@path>{\xp\key@list}}% + ifbool{\noexpand\ifp@thkeys@keyvalTF{\key@list}% + {pathkeys/curr/\elt\main@path/\elt\sub@path/\key@list}}% + add value{\p@thkeys@addtovalue{\xp\key@list}% + {pathkeys/curr/\elt\main@path/\elt\sub@path/}}% + store value{\p@thkeys@storevalue{\xp\key@list}% + {pathkeys/curr/\elt\main@path/\elt\sub@path/}}% + print value{\noexpand\p@thkeys@keyval{\key@list}% + {pathkeys/curr/\elt\main@path/\elt\sub@path/\key@list}}% + disable{\ltxkeys@disablekeys[\main@path]{\sub@path}{\key@list}}% + disable*{\ltxkeys@disablekeys*[\main@path]{\sub@path}{\key@list}}% + ifdef{\noexpand\ifp@thkeys@keydef{\main@path}{\sub@path}{\key@list}}% + ifkeyonpath{\noexpand\ifp@thkeys@onpath{\key@path}{\key@list}}% +} +\robust@def*\pathkeys@setkeys#1#2#3{% + \xifinsetTF{\relax[}{\relax\detokenize{#3}}{% + \def\reserved@a[##1]##2\ltxkeys@nil{% + \ltxkeys@setkeys[#1]{#2}[##1]{##2}% + }% + \reserved@a#3\ltxkeys@nil + }{% + \xifinsetTF{]\relax}{\detokenize{#3}\relax}{% + \def\reserved@a##1[##2]\ltxkeys@nil{% + \ltxkeys@setkeys[#1]{#2}[##2]{##1}% + }% + \reserved@a#3\ltxkeys@nil + }{% + \ltxkeys@setkeys[#1]{#2}{#3}% + }% + }% +} +\robust@def*\pathkeys@executeoptions#1#2#3{% + \xifinsetTF{\relax[}{\relax\detokenize{#3}}{% + \def\reserved@a[##1]##2\ltxkeys@nil{% + \ltxkeys@executeoptions[#1]<#2>[##1]{##2}% + }% + \reserved@a#3\ltxkeys@nil + }{% + \xifinsetTF{]\relax}{\detokenize{#3}\relax}{% + \def\reserved@a##1[##2]\ltxkeys@nil{% + \ltxkeys@executeoptions[#1]<#2>[##2]{##1}% + }% + \reserved@a#3\ltxkeys@nil + }{% + \ltxkeys@executeoptions[#1]<#2>{#3}% + }% + }% +} +\robust@def*\pathkeys@processoptions{% + \ltxkeys@testst\pathkeys@pr@cessoptions +} +\robust@def*\pathkeys@pr@cessoptions#1#2#3{% + \edef\reserved@e{\ifltxkeys@st*\fi}% + \xifinsetTF{\relax[}{\relax\detokenize{#3}}{% + \def\reserved@a[##1]##2\ltxkeys@nil{% + \iflacus##2\dolacus\else + \pathkeys@err{Wrong use of 'processoptions' flag in + \string\pathkeys}{The invalid part is '\detokenize{##2}'}% + \fi + \expandafter\ltxkeys@processoptions\reserved@e[#1]<#2>[##1]% + }% + \reserved@a#3\ltxkeys@nil + }{% + \xifinsetTF{]\relax}{\detokenize{#3}\relax}{% + \def\reserved@a##1[##2]\ltxkeys@nil{% + \iflacus##1\dolacus\else + \pathkeys@err{Wrong use of 'processoptions' flag in + \string\pathkeys}{The invalid part is '\detokenize{##1}'}% + \fi + \expandafter\ltxkeys@processoptions\reserved@e[#1]<#2>[##2]% + }% + \reserved@a#3\ltxkeys@nil + }{% + \expandafter\ltxkeys@processoptions\reserved@e[#1]<#2>% + }% + }% +} +\new@def*\pathkeys@defkey#1#2{% + \noexpand\ltxkeys@inkeycmdtrue + #1[\main@path]#2[pathkeys/curr/\elt\main@path/\elt\sub@path/]% + {\expandcsonce\key@list}% + \noexpand\ltxkeys@inkeycmdfalse +} +\robust@def*\p@thkeys@storevalue#1#2{% + \ltxkeys@getlasttoken{#1}% + \ltxkeys@trimspacesincs\ltxkeys@lasttoken + \ltxkeys@trimspacesincs\ltxkeys@resttokens + \ifcsndefTF{#2\ltxkeys@resttokens}{% + \expandafter\edef\ltxkeys@lasttoken + {\expandcsnonce{#2\ltxkeys@resttokens}}% + }{% + \pathkeys@err{Key '\ltxkeys@resttokens' not defined}\ltxkeys@ehc + }% +} +\robust@def*\p@thkeys@addtovalue#1#2{% + \begingroup + \ltxkeys@splitkeyval#1\ltxkeys@nil\ltxkeys@tempa\ltxkeys@tempb + \ifcsndefTF{#2\ltxkeys@tempa}{% + \csn@edef{#2\ltxkeys@tempa}{% + \expandcsnonce{#2\ltxkeys@tempa}% + \expandcsonce\ltxkeys@tempb + }% + \postgroupcsndef{#2\ltxkeys@tempa}\endgroup + }{% + \pathkeys@err{Key '\ltxkeys@tempa' not defined}\ltxkeys@ehc + \endgroup + }% +} +\new@def*\p@thkeys@keyval#1#2{% + \ifcsndefTF{#2}{% + \expandcsnonce{#2}% + }{% + \pathkeys@err{Key '#1' not defined on the given path}\ltxkeys@ehc + }% +} +\new@def*\ifp@thkeys@keyval#1#2\then{% + \ifcsndefTF{if#2}{% + \usename{if#2}% + }{% + \pathkeys@err{Key '#1' not defined or not a boolean}\ltxkeys@ehc + }% +} +\new@def*\ifp@thkeys@keyvalTF#1#2{% + \ifp@thkeys@keyval{#1}{#2}\then\expandafter\iofii\else + \expandafter\iiofii\fi +} +\new@def*\ifp@thkeys@keydef#1#2#3{% + \begingroup + \pathkeys@chfdfalse + \ifcsndefTF{pathkeys/curr/#1/#2/#3}{% + \pathkeys@chfdtrue + }{% + \ifcsndefTF{#1@#2@#3}{% + \pathkeys@chfdtrue + }{}% + }% + \expandafter\endgroup\ifpathkeys@chfd + \expandafter\iofii\else\expandafter\iiofii\fi +} +\robust@def*\ifp@thkeys@onpath#1#2{% + \begingroup + \pathkeys@chfdfalse + \def\ltxkeys@do##1{% + \pathkeys@checkpath{##1}% + \pathkeys@splitpath{##1}% + \let\elt\ltxkeys@iffirstnull + \ifcsndefTF{pathkeys/curr/\elt\main@path/\elt\sub@path/#2}{% + \pathkeys@chfdtrue\loopbreak + }{% + \ifcsndefTF{\main@path @\sub@path @#2}{% + \pathkeys@chfdtrue\loopbreak + }{}% + }% + }% + \ltxkeys@parse1[,]{#1}% + \expandafter\endgroup\ifpathkeys@chfd + \expandafter\iofii\else\expandafter\iiofii\fi +} + +\begingroup +\uccode`\~=`\/% +\uppercase{\endgroup + \def\pathkeys@normalizeslash#1{% + \unexpanded\expandafter{\romannumeral-`\q + \pathkeys@activeslash/#1/~\ltxkeys@nil}% + }% + \def\pathkeys@activeslash#1~#2\ltxkeys@nil{% + \ifblankTF{#2} + {\pathkeys@spaceslash#1 /\ltxkeys@nil} + {\pathkeys@activeslash#1/#2\ltxkeys@nil}% + }% +} +\def\pathkeys@spaceslash#1 /#2\ltxkeys@nil{% + \ifblankTF{#2} + {\pathkeys@slashspace#1/ \ltxkeys@nil} + {\pathkeys@spaceslash#1/#2\ltxkeys@nil}% +} +\def\pathkeys@slashspace#1/ #2\ltxkeys@nil{% + \ifblankTF{#2} + {\pathkeys@doubleslash#1//\ltxkeys@nil} + {\pathkeys@slashspace#1/#2\ltxkeys@nil}% +} +\def\pathkeys@doubleslash#1//#2\ltxkeys@nil{% + \ifblankTF{#2}{% + \ifblankTF{#1}{}{\@gobble#1}% + }{% + \pathkeys@doubleslash#1/#2\ltxkeys@nil + }% +} +\new@def*\pathkeys@n@rmalizeslash#1{% + \pathkeys@ifnopath{#1}{% + \expandafter\pathkeys@normalizeslash\expandafter + {\pathkeys@c@rrentpath/#1}% + }{% + \pathkeys@normalizeslash{#1}% + }% +} +\def\pathkeys@replaceslash#1/#2\ltxkeys@nil{% + \ifblankTF{#2}{% + #1% + }{% + \pathkeys@replaceslash#1@#2\ltxkeys@nil + }% +} +\newletcs\pathkeys@addcons\@empty +\robust@def*\pathkeys@listadd{% + \cpt@testst{\cpt@testcl{\cpt@testopt\pathkeys@l@stadd,}}% +} +\robust@def*\pathkeys@l@stadd[#1]#2#3{% + \ifcpt@st + \let\pathkeys@addcons\@space + \fi + \ifcpt@cl\global\fi + \edef#2{\csliststack{#1\pathkeys@addcons}#2\expandcsonce{#3}}% + \let\pathkeys@addcons\@empty +} +\robust@def*\newpath#1#2{% + \ifcsndefTF{pathkeys@path@\cpttrimspace{#1}}{% + \pathkeys@err{Path '#1' already in use}\@ehc + }{% + \csn@edef{pathkeys@path@\cpttrimspace{#1}}{\cpttrimspace{#2}}% + \pathkeys@listadd*![;]\pathkeys@pathhistory{#2}% + }% +} +\robust@def*\defpath#1#2{% + \csn@edef{pathkeys@path@\cpttrimspace{#1}}{\cpttrimspace{#2}}% + \pathkeys@listadd*![;]\pathkeys@pathhistory{#2}% +} +\newletcs\changepath\defpath +\robust@def*\undefpath#1{% + \edef\ltxkeys@tempa{\usename{pathkeys@path@\cpttrimspace{#1}}}% + \pathkeys@undefpath + \undefcsn{pathkeys@path@\cpttrimspace{#1}}% +} +\robust@def*\pathkeys@undefpath{% + \xifinsetTF\ltxkeys@tempa\pathkeys@pathhistory{% + \def\reserved@a##1{% + \def\reserved@a####1##1####2\ltxkeys@nil{% + \def\pathkeys@pathhistory{####1####2}% + \xifinsetTF{; ;}\pathkeys@pathhistory{% + \def\reserved@a########1; ;########2\ltxkeys@nil{% + \def\pathkeys@pathhistory{########1;########2}% + }% + \expandafter\reserved@a\pathkeys@pathhistory\ltxkeys@nil + }{}% + \pathkeys@undefpath + }% + \expandafter\reserved@a\pathkeys@pathhistory\ltxkeys@nil + }% + \s@expandarg\reserved@a\ltxkeys@tempa + }{}% +} +\new@def*\usepath#1{% + \expandafter\pathkeys@usepath\romannumeral + -`\q\cptcommanormalize{#1},\ltxkeys@nil,\ltxkeys@nnil{}% +} +\new@def*\pathkeys@usepath#1,#2\ltxkeys@nnil#3{% + \ifstrcmpTF{#1}\ltxkeys@nil{% + \@gobble#3% + }{% + \ifcsndefTF{pathkeys@path@#1}{% + \pathkeys@usepath#2\ltxkeys@nnil{#3,\usename{pathkeys@path@#1}}% + }{% + \pathkeys@usepath#2\ltxkeys@nnil{#3,\usename{#1=undefinedpath}}% + }% + }% +} +\new@def*\pathkeys@defaultpath{dft@main/dft@sub} +\newletcs\pathkeys@c@rrentpath\pathkeys@defaultpath +\robust@def*\pathkeys@addtodefaultpath#1{% + \edef\pathkeys@defaultpath + {\expandcsonce\pathkeys@defaultpath/\expandcsonce{#1}}% + \csv@@normalize*[/]\pathkeys@defaultpath + \pathkeys@listadd*![;]\pathkeys@pathhistory\pathkeys@defaultpath +} +\robust@def*\pathkeys@changedefaultpath#1{% + \edef\pathkeys@defaultpath{\expandcsonce{#1}}% + \csv@@normalize*[/]\pathkeys@defaultpath + \pathkeys@listadd*![;]\pathkeys@pathhistory\pathkeys@defaultpath +} +\robust@def*\pathkeys@currentpath#1{% + \edef\pathkeys@c@rrentpath{\expandcsonce{#1}}% + \csv@@normalize*[/]\pathkeys@c@rrentpath + \pathkeys@listadd*![;]\pathkeys@pathhistory\pathkeys@c@rrentpath +} +\robust@def*\pathkeys@usedefaultpath{% + \let\pathkeys@c@rrentpath\pathkeys@defaultpath + \pathkeys@listadd*![;]\pathkeys@pathhistory\pathkeys@c@rrentpath +} +\new@def*\pathkeys@currentpathstack{} +\robust@def*\pathkeys@pushcurrentpath{% + \xdef\pathkeys@currentpathstack{% + \gdef\noexpand\pathkeys@c@rrentpath + {\expandcsonce\pathkeys@c@rrentpath}% + \ltxkeys@nil{\expandcsonce\pathkeys@currentpathstack}% + }% +} +\robust@def*\pathkeys@popcurrentpath{% + \begingroup + \def\reserved@a##1\ltxkeys@nil{\endgroup + ##1\gdef\pathkeys@currentpathstack + }% + \expandafter\reserved@a\pathkeys@currentpathstack + \pathkeys@listadd*![;]\pathkeys@pathhistory\pathkeys@c@rrentpath +} +\new@def*\pathkeys@ifnop@th#1/{} +\new@def*\pathkeys@ifnopath#1{% + \ifcat$\cptoxdetok{\pathkeys@ifnop@th#1{}/}$% + \expandafter\iofii\else\expandafter\iiofii\fi +} +\new@def*\pathkeys@getkeyval#1{% + \ifcsndefTF{pathkeys/curr/\pathkeys@n@rmalizeslash{#1}}{% + \expandcsnonce{pathkeys/curr/\pathkeys@n@rmalizeslash{#1}}% + }{% + \pathkeys@err{Key '\cpttrimspace{#1}' not defined}\ltxkeys@ehc + }% +} +\newletcs\pathkeyskeyval\pathkeys@getkeyval +\new@def*\pathkeys@storevalue#1#2{% + \ifescapedTF{#2}{% + \edef#2{\unexpanded\expandafter + {\romannumeral-`\q\pathkeys@getkeyval{#1}}}% + }{% + \cpt@notescapederr{#2}% + }% +} +\new@def*\ifpathkeyskeyval#1\then{% + \usename{if\pathkeys@getkeyval{#1}}% +} +\new@def*\ifpathkeyskeyvalTF#1{% + \ifpathkeyskeyval#1\then\expandafter\iofii\else + \expandafter\iiofii\fi +} +\new@def*\pathkeys@getval#1{% + \ifcsndefTF{pathkeys/curr/\pathkeys@n@rmalizeslash{#1}}{% + \expandcsnonce{pathkeys/curr/\pathkeys@n@rmalizeslash{#1}}% + }{% + undefinedpathkey% + }% +} +\newletcs\pathkeysval\pathkeys@getval +\new@def*\ifundefinedpathkey{undefinedpathkey\iffalse} +\new@def*\ifpathkeysval#1\then{\usename{if\pathkeys@getval{#1}}} +\new@def*\ifpathkeysvalTF#1{% + \ifpathkeysval#1\then\expandafter\iofii\else + \expandafter\iiofii\fi +} +\robust@def*\pathkeys@useshortcmds{% + \let\pathkeys@useshortcmds\relax + \pathkeys@makeshortcmds{% + \pkv=\pathkeysval,\ifpkv=\ifpathkeysval,\ifpkvTF=\ifpathkeysvalTF, + \pkkv=\pathkeyskeyval,\ifpkkv=\ifpathkeyskeyval, + \ifpkkvTF=\ifpathkeyskeyvalTF + }% +} +\robust@def*\pathkeys@makeshortcmds#1{% + \def\ltxkeys@do##1{% + \ifinsetTF{=}{##1}{% + \def\reserved@a####1=####2\@nil{% + \ifdefTF{####1}{% + \ifx####1####2\else + \pathkeys@err{Command '\string####1' already exists: + \MsgBrk it can't be redefined by + \string\pathkeys@makeshortcmds}\@ehc + \fi + }{% + \let####1=####2% + }% + }% + \reserved@a##1\@nil + }{% + \pathkeys@err{No '=' in short command assignment}\ltxkeys@ehc + }% + }% + \ltxkeys@parse3[,]{#1}% +} +\robust@def*\pathkeys@defineoptions#1{% + \begintoksgroup + \def\do##1/##2/##3\ltxkeys@nil{% + \toks@\expandafter{\the\toks@ + \ifstrcmpTF{##2}{pathkeys}{% + \usename{ltxkeys@declare##1option}% + [KV]<pathkeys>[pathkeys@]{##2}[##3]{}% + }{% + \usename{ltxkeys@declare##1option}% + [KV]<pathkeys>[pathkeys@]{##2}[##3]{% + \ltxkeys@options{##2=####1}% + }% + }% + }% + }% + \def\ltxkeys@do##1{\do##1\ltxkeys@nil}% + \ltxkeys@parse1[;]{#1}% + \endtoksgroup +} +\pathkeys@defineoptions{% + cmd/keyparser/{;}; + cmd/keydepthlimit/4; + cmd/keystacklimit/4; + bool/tracingkeys/true; + bool/reservenopath/true; + bool/allowemptypath/true; + bool/pathkeys/false; +} +\ltxkeys@declareoption*[KV]<pathkeys>{% + \pathkeys@warn{Unknown option '\CurrentKey' with + value '\InnocentVal' ignored.}% +} +%\ltxkeys@executeoptions[KV]<pathkeys>{}\relax +\ltxkeys@processoptions*[KV]<pathkeys>\relax +\cpt@optioncleanup\ltxkeys@processedoptions + +\endinput + +%% End of file pathkeys.sty %% |