%PDF- %PDF-
| Direktori : /proc/self/root/data/old/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/ |
| Current File : //proc/self/root/data/old/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase-cctb.sty |
%%
%% This is file `luatexbase-cctb.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% luatexbase-cctb.dtx (with options: `texpackage')
%%
%% Written in 2009, 2010 by Manuel Pegourie-Gonnard and Elie Roux.
%%
%% This work is under the CC0 license.
%% See source file 'luatexbase-cctb.dtx' for details.
%%
\csname lltxb@cctb@loaded\endcsname
\expandafter\let\csname lltxb@cctb@loaded\endcsname\endinput
\begingroup
\catcode123 1 % {
\catcode125 2 % }
\catcode 35 6 % #
\toks0{}%
\def\x{}%
\def\y#1 #2 {%
\toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
\edef\x{\x \catcode#1 #2}}%
\y 123 1 % {
\y 125 2 % }
\y 35 6 % #
\y 10 12 % ^^J
\y 34 12 % "
\y 36 3 % $ $
\y 39 12 % '
\y 40 12 % (
\y 41 12 % )
\y 42 12 % *
\y 43 12 % +
\y 44 12 % ,
\y 45 12 % -
\y 46 12 % .
\y 47 12 % /
\y 60 12 % <
\y 61 12 % =
\y 64 11 % @ (letter)
\y 62 12 % >
\y 95 12 % _ (other)
\y 96 12 % `
\edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
\expandafter\y\csname lltxb@cctb@AtEnd\endcsname
\begingroup
\expandafter\ifx\csname ProvidesPackage\endcsname\relax
\def\x#1[#2]{\immediate\write16{Package: #1 #2}}
\else
\let\x\ProvidesPackage
\fi
\expandafter\endgroup
\x{luatexbase-cctb}[2010/10/10 v0.3 Catcodetable allocation for LuaTeX]
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname RequirePackage\endcsname\relax
\input ifluatex.sty
\else
\RequirePackage{ifluatex}
\fi
\ifluatex\else
\begingroup
\expandafter\ifx\csname PackageError\endcsname\relax
\def\x#1#2#3{\begingroup \newlinechar10
\errhelp{#3}\errmessage{Package #1 error: #2}\endgroup}
\else
\let\x\PackageError
\fi
\expandafter\endgroup
\x{luatexbase-attr}{LuaTeX is required for this package. Aborting.}{%
This package can only be used with the LuaTeX engine^^J%
(command `lualatex' or `luatex').^^J%
Package loading has been stopped to prevent additional errors.}
\lltxb@cctb@AtEnd
\expandafter\endinput
\fi
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname RequirePackage\endcsname\relax
\input luatexbase-loader.sty
\else
\RequirePackage{luatexbase-loader}
\fi
\luatexbase@directlua{require('luatexbase.cctb')}
\luatexbase@ensure@primitive{luaescapestring}
\luatexbase@ensure@primitive{catcodetable}
\luatexbase@ensure@primitive{initcatcodetable}
\luatexbase@ensure@primitive{savecatcodetable}
\newcount\lltxb@catcodetable@alloc
\lltxb@catcodetable@alloc\m@ne
\def\newluatexcatcodetable#1{%
\ifnum\lltxb@catcodetable@alloc<65535\relax
\global\advance\lltxb@catcodetable@alloc\tw@
\allocationnumber\lltxb@catcodetable@alloc
\global\chardef#1\allocationnumber
\luatexinitcatcodetable\allocationnumber
\begingroup\escapechar\m@ne
\luatexbase@directlua{luatexbase.catcodetabledef_from_tex(
'\luatexluaescapestring{\string#1}', '\number\allocationnumber')}%
\endgroup
\wlog{\string#1=\string\luatexcatcodetable\the\allocationnumber}%
\else
\errmessage{No room for a new \string\luatexcatcodetable}%
\fi}
\expandafter\ifx\csname @tempcnta\endcsname\relax
\csname newcount\endcsname\@tempcnta
\fi
\expandafter\ifx\csname @tempcntb\endcsname\relax
\csname newcount\endcsname\@tempcntb
\fi
\def\setcatcoderange#1#2#3{%
\edef\luaSCR@temp{%
\noexpand\@tempcnta=\the\@tempcnta
\noexpand\@tempcntb=\the\@tempcntb
\noexpand\count@=\the\count@
\relax}%
\@tempcnta=#1\relax
\@tempcntb=#2\relax
\count@=#3\relax
\loop\unless\ifnum\@tempcnta>\@tempcntb
\catcode\@tempcnta=\count@
\advance\@tempcnta\@ne
\repeat
\luaSCR@temp}
\def\setluatexcatcodetable#1#2{%
\begingroup
#2%
\luatexsavecatcodetable#1%
\endgroup}
\newluatexcatcodetable\CatcodeTableIniTeX
\newluatexcatcodetable\CatcodeTableString
\setluatexcatcodetable\CatcodeTableString{%
\luatexcatcodetable\CatcodeTableIniTeX
\catcode0 12 % nul
\catcode13 12 % carriage return
\catcode37 12 % percent
\setcatcoderange{65}{90}{12}% A-Z
\setcatcoderange{97}{122}{12}% a-z
\catcode92 12 % backslash
\catcode127 12 }
\newluatexcatcodetable\CatcodeTableOther
\setluatexcatcodetable\CatcodeTableOther{%
\luatexcatcodetable\CatcodeTableString
\catcode32 12 }
\newluatexcatcodetable\CatcodeTableLaTeX
\setluatexcatcodetable\CatcodeTableLaTeX{%
\luatexcatcodetable\CatcodeTableIniTeX
\setcatcoderange{0}{31}{15}%
\catcode9 10 % tab
\catcode12 13 % form feed
\catcode13 5 % carriage return
\catcode35 6 % hash
\catcode36 3 % dollar
\catcode38 4 % ampersand
\catcode94 7 % circumflex
\catcode95 8 % underscore
\catcode123 1 % brace left
\catcode125 2 % brace right
\catcode126 13 % tilde
\catcode127 15 }
\newluatexcatcodetable\CatcodeTableLaTeXAtLetter
\setluatexcatcodetable\CatcodeTableLaTeXAtLetter{%
\luatexcatcodetable\CatcodeTableLaTeX
\catcode64=11 }
\newluatexcatcodetable\CatcodeTableExpl
\setluatexcatcodetable\CatcodeTableExpl{%
\luatexcatcodetable\CatcodeTableLaTeX
\catcode126 10 % tilde is a space char
\catcode32 9 % space is ignored
\catcode9 9 % tab also ignored
\catcode95 11 % underscore letter
\catcode58 11 % colon letter
}
\luatexbase@directlua{luatexbase.catcodetable_do_shortcuts()}
\lltxb@cctb@AtEnd
\endinput
%%
%% End of file `luatexbase-cctb.sty'.