diff options
author | Karl Berry <karl@freefriends.org> | 2021-11-06 20:34:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-11-06 20:34:49 +0000 |
commit | ac65c6f4efd32bedb3d08ad3fb1be79b48d337cb (patch) | |
tree | 2e3cd7ed54fb0dea5be9c6242c934052656d10bd /Master/texmf-dist/tex/luatex | |
parent | bf7388665ea358da056548125d48636fc73f045d (diff) |
luakeys (6nov21)
git-svn-id: svn://tug.org/texlive/trunk@60972 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luakeys/luakeys.lua | 19 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luakeys/luakeys.sty | 21 |
3 files changed, 35 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty b/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty index a96d2d51c60..ca800bfad7f 100644 --- a/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty +++ b/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty @@ -13,10 +13,10 @@ % % The Current Maintainer of this work is Josef Friedrich. % -% This work consists of the files luakeys.lua, luakeys-debug.sty -% and luakeys-debug.tex. +% This work consists of the files luakeys.lua, luakeys.sty, luakeys.tex +% luakeys-debug.sty and luakeys-debug.tex. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luakeys-debug}[2021/09/19 Debug package for luakeys.] +\ProvidesPackage{luakeys-debug}[2021/11/05 v0.3 Debug package for luakeys.] \input luakeys-debug.tex diff --git a/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua b/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua index b0264138003..05b3d94e1ff 100644 --- a/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua +++ b/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua @@ -1,4 +1,4 @@ --- luakeys-debug.tex +-- luakeys.lua -- Copyright 2021 Josef Friedrich -- -- This work may be distributed and/or modified under the @@ -13,8 +13,8 @@ -- -- The Current Maintainer of this work is Josef Friedrich. -- --- This work consists of the files luakeys.lua, luakeys-debug.sty --- and luakeys-debug.tex. +-- This work consists of the files luakeys.lua, luakeys.sty, luakeys.tex +-- luakeys-debug.sty and luakeys-debug.tex. --- A key-value parser written with Lpeg. -- @@ -167,7 +167,11 @@ local function generate_parser(options) lpeg.V('dimension') + lpeg.V('number') + lpeg.V('string_quoted') + - lpeg.V('string_unquoted'), + lpeg.V('string_unquoted') + + lpeg.V('array'), + + array = + ws('{') * lpeg.Ct((lpeg.V('value') * ws(',')^-1)^0) * ws('}'), boolean = boolean_true * lpeg.Cc(true) + @@ -175,6 +179,9 @@ local function generate_parser(options) dimension = build_dimension_pattern(), + number = + white_space^0 * (number / tonumber) * white_space^0, + string_quoted = white_space^0 * lpeg.P('"') * lpeg.C((lpeg.P('\\"') + 1 - lpeg.P('"'))^0) * @@ -188,10 +195,6 @@ local function generate_parser(options) white_space^0, word_unquoted = (1 - white_space - lpeg.S('{},='))^1; - - number = - white_space^0 * (number / tonumber) * white_space^0, - }) end diff --git a/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty b/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty new file mode 100644 index 00000000000..6717b85b57f --- /dev/null +++ b/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty @@ -0,0 +1,21 @@ +%% luakeys.sty +%% Copyright 2021 Josef Friedrich +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3c +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions of LaTeX +% version 2008/05/04 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Josef Friedrich. +% +% This work consists of the files luakeys.lua, luakeys.sty, luakeys.tex +% luakeys-debug.sty and luakeys-debug.tex. + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{luakeys}[2021/11/05 v0.3 Parsing key-value options using Lua.] +\directlua{luakeys = require('luakeys')} |