summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/luacode
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-05-24 23:30:42 +0000
committerKarl Berry <karl@freefriends.org>2011-05-24 23:30:42 +0000
commit326e706a1aab60c8759d18732d105d26d3879352 (patch)
tree51043e1582d04678ad5e8786d3fef644c29f23d2 /Master/texmf-dist/tex/lualatex/luacode
parentc2e2309fda3600a470a0026ef17f98b44dfb3f40 (diff)
luacode (24may11)
git-svn-id: svn://tug.org/texlive/trunk@22605 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/luacode')
-rw-r--r--Master/texmf-dist/tex/lualatex/luacode/luacode.sty55
1 files changed, 30 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/lualatex/luacode/luacode.sty b/Master/texmf-dist/tex/lualatex/luacode/luacode.sty
index 8f513dd56ee..68f281f425f 100644
--- a/Master/texmf-dist/tex/lualatex/luacode/luacode.sty
+++ b/Master/texmf-dist/tex/lualatex/luacode/luacode.sty
@@ -8,50 +8,50 @@
%%
%% See the source file for author and licensing information.
%%
-\begingroup
+\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
\catcode123 1 % {
\catcode125 2 % }
\catcode 35 6 % #
- \toks0{}%
- \def\x{}%
+ \toks0{\endlinechar\the\endlinechar}%
+ \edef\x{\endlinechar13}%
\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 13 5 % carriage return
+ \y 61 12 % =
+ \y 32 10 % space
+ \y 123 1 % {
+ \y 125 2 % }
+ \y 35 6 % #
+ \y 64 11 % @ (letter)
\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 91 12 % [
+ \y 93 12 % ]
+ \y 94 7 % ^
\y 96 12 % `
- \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
-\expandafter\y\csname luacode@AtEnd\endcsname
-\ProvidesPackage{luacode}[2010/11/08 v1.0 lua-in-tex helpers (mpg)]
+ \y 126 13 % ~
+ \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
+ \edef\y#1{\noexpand\expandafter\endgroup%
+ \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
+ \noexpand\else \noexpand\expandafter\noexpand\endinput%
+ \noexpand\fi}%
+\expandafter\y\csname luacode@sty@endinput\endcsname%
+\ProvidesPackage{luacode}[2011/05/24 v1.0 lua-in-tex helpers (mpg)]
\RequirePackage{ifluatex}
\ifluatex\else
\PackageError{luacode}{LuaTeX is required for this package. Aborting.}{%
This package can only be used with the LuaTeX engine\MessageBreak
(command `lualatex'). Package loading has been stopped\MessageBreak
to prevent additional errors.}
- \lltxb@core@AtEnd
- \expandafter\endinput
+ \expandafter\luacode@sty@endinput
\fi
\RequirePackage{luatexbase}
-\luatexbase@ensure@primitive{scantextokens}%
\begingroup \catcode`\~\active \expandafter\endgroup
\@firstofone{%
\newcommand*\luacode@execute [1] {%
@@ -120,21 +120,26 @@
\def \luacode@strip@sp@def #1\@nil{%
\def\luacode@curr{#1}}
\newluatexcatcodetable \luacode@table@soft
+\begingroup
+\ifdefined\SetCatcodeRange \else
+ \let\SetCatcodeRange\setcatcoderange
+\fi
\setluatexcatcodetable \luacode@table@soft {%
\luatexcatcodetable\CatcodeTableOther
\catcode 92 0
\catcode 123 1
\catcode 125 2
- \setcatcoderange {65}{90} {11}
- \setcatcoderange {97}{122}{11}
+ \SetCatcodeRange {65}{90} {11}
+ \SetCatcodeRange {97}{122}{11}
}
+\endgroup
\@ifdefinable\luadirect {\let\luadirect\luatexbase@directlua}
\newcommand*\luaexec [1] {\luacode@execute{#1}}
\newenvironment {luacode} {\luacode@begin\luacode@table@soft} {}
\newenvironment {luacode*} {\luacode@begin\CatcodeTableOther} {}
\newcommand \luacodestar {\@nameuse{luacode*}}
\def \endluacodestar {\@nameuse{endluacode*}}
-\luacode@AtEnd
+\luacode@sty@endinput
\endinput
%%
%% End of file `luacode.sty'.