summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-02-25 22:14:36 +0000
committerKarl Berry <karl@freefriends.org>2022-02-25 22:14:36 +0000
commit7ad11d496d8b859868ec23586cb099b6b48eb9b4 (patch)
treef485d67181de27b62d5fcbc5cd30ca9d16b2c473 /Master/texmf-dist/tex
parent75eb24771faf3783171e71e4f9e84ccdf553cc2a (diff)
yamlvars (25feb22)
git-svn-id: svn://tug.org/texlive/trunk@62176 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.lua (renamed from Master/texmf-dist/tex/lualatex/yamlvars/YAMLvars.lua)12
-rw-r--r--Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.sty (renamed from Master/texmf-dist/tex/lualatex/yamlvars/YAMLvars.sty)5
2 files changed, 12 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/lualatex/yamlvars/YAMLvars.lua b/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.lua
index 93234e5d596..1f95a50f250 100644
--- a/Master/texmf-dist/tex/lualatex/yamlvars/YAMLvars.lua
+++ b/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.lua
@@ -1,5 +1,5 @@
--% Kale Ewasiuk (kalekje@gmail.com)
---% 2022-01-18
+--% 2022-02-25
--% Copyright (C) 2021-2022 Kale Ewasiuk
--%
--% Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -56,9 +56,9 @@ YAMLvars.dec = {} -- table of declare function
YAMLvars.varsvals = {}
YAMLvars.varspecs = {}
+YAMLvars.xfmDefault = {}
YAMLvars.prcDefault = 'gdef'
YAMLvars.dftDefault = nil
-YAMLvars.xfmDefault = {}
YAMLvars.allowUndeclared = false
YAMLvars.overwritedefs = false
@@ -83,7 +83,7 @@ end
-- xfm functions (transforms) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function YAMLvars.xfm.addxspace(var, val)
- return val .. '\\xspace{}'
+ return val .. '\\xspace'
end
function YAMLvars.xfm.tab2arr(var, val)
@@ -348,6 +348,11 @@ end
local _YV_invalid_expression = '\1 invalid expression'
local _YV_no_return = '\2 no return val'
+
+local function expr_err(var, val)
+ tex.print('\\PackageError{YAMLvars}{xfm with "= or /" error on var "'..var..'"}{}') -- todo make program stop
+end
+
local function eval_expr(func, var, val)
local s, c = func:gsub('^[=/]', {['/'] = '\2', ['='] = 'YAMLvars.valTemp = '}, 1) -- / is run code, = sets val = code
if c == 0 then
@@ -367,6 +372,7 @@ local function eval_expr(func, var, val)
tex.print('\\PackageError{YAMLvars}{xfm with "= or /" error on var "'..var..'"}{}') --
end
if c > 0 then
+ expr_err(var)
return _YV_no_return
end
return YAMLvars.valTemp
diff --git a/Master/texmf-dist/tex/lualatex/yamlvars/YAMLvars.sty b/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.sty
index 73c40ba6931..8e295988fbf 100644
--- a/Master/texmf-dist/tex/lualatex/yamlvars/YAMLvars.sty
+++ b/Master/texmf-dist/tex/lualatex/yamlvars/yamlvars.sty
@@ -1,5 +1,5 @@
% Kale Ewasiuk (kalekje@gmail.com)
-% 2022-01-18
+% 2022-02-25
% Copyright (C) 2021-2022 Kale Ewasiuk
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -25,7 +25,7 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{YAMLvars}[2022-01-18]
+\ProvidesPackage{YAMLvars}[2022-02-25]
\IfFileExists{markdown-tinyyaml.lua}{}{\PackageError{YAMLvars}{This package requires installation of the 'markdown' package, please install it and try again}{}}
@@ -72,3 +72,4 @@
\newcommand{\resetYAMLvarsspec}{\luadirect{YAMLvars.varspec = {}}}
\newcommand{\AllowUndeclaredYV}{\luadirect{YAMLvars.allowUndeclared = true}}
+\newcommand{\ForbidUndeclaredYV}{\luadirect{YAMLvars.allowUndeclared = false}}