summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/luatex/luaintro/DEoptions.sty
blob: d625f6c5ef5133037b9e892f7471b78a6cfcd94b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
% $Id: DEoptions.sty 574 2011-09-05 08:17:17Z herbert $
% Copyright 2011 by Herbert Voss
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/licenses/LICENSE for more details.

\RequirePackage{keyval}[1997/11/10]

\def\ProcessOptionsExa{%
  \let\@tempa\@empty
  \ifx\@currext\@clsextension%
  \else
  \@for\CurrentOption:=\@classoptionslist\do{%
    \@ifundefined{KV@\@currname @\CurrentOption}%
    {}{\edef\@tempa{\@tempa,\CurrentOption,}}}%
  \fi
  \edef\@tempa{%
    \noexpand\setkeys{\@currname}{\@tempa\@ptionlist{\@currname.\@currext}}}%
  \let\exa@origkverr\KV@err%
  \ifx\@currext\@clsextension\let\KV@errx=\@gobble\fi% never mind
  \@tempa%
  \let\KV@err\exa@origkverr%
  \AtEndOfPackage{\let\@unprocessedoptions\relax}}

\def\ExecuteOptionsExa#1{\setkeys{\@currname}{#1}}
\def\DeclareOptionExa#1{\@ifnextchar[{\exa@dokv{#1}}{\exa@dokv{#1}[]}}
\long\def\exa@dokv#1[#2]#3{\define@key{\@currname}{#1}[{#2}]{#3}}

\def\exa@filterclassoptions{%
  \def\exa@filteredclassoptionslist{}
  \@for\CurrentOption:=\@classoptionslist\do{%
    \ifx\CurrentOption\@empty\else
    \@expandtwoargs\in@{=}{\CurrentOption}%
    \ifin@
    \else
    \edef\exa@filteredclassoptionslist{%
      \exa@filteredclassoptionslist,\CurrentOption}
    \fi
    \fi
  }%
  \let\@classoptionslist=\exa@filteredclassoptionslist%
}

\newcommand\defexaoption{\define@key{exa@option}}
\newcommand\setexaoption{\setkeys{exa@option}}

\endinput