summaryrefslogtreecommitdiff
path: root/macros/luatex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-11-18 03:04:57 +0000
committerNorbert Preining <norbert@preining.info>2022-11-18 03:04:57 +0000
commit8141bb63ac908014fe5b6bc7ebed4d2889c014d4 (patch)
treed3edba26deeb1d57bb2414e11ed566181a8f1dcb /macros/luatex
parent3692808268baf9f2c56b28f61c266ef0efbb0fe6 (diff)
CTAN sync 202211180304
Diffstat (limited to 'macros/luatex')
-rw-r--r--macros/luatex/generic/luakeys/README.md18
-rw-r--r--macros/luatex/generic/luakeys/luakeys-debug.sty2
-rw-r--r--macros/luatex/generic/luakeys/luakeys-doc.pdfbin276812 -> 283942 bytes
-rw-r--r--macros/luatex/generic/luakeys/luakeys-doc.tex130
-rw-r--r--macros/luatex/generic/luakeys/luakeys.lua118
-rw-r--r--macros/luatex/generic/luakeys/luakeys.sty2
-rw-r--r--macros/luatex/latex/luacas/README.md11
-rw-r--r--macros/luatex/latex/luacas/doc/appendix/luacas.dat2
-rw-r--r--macros/luatex/latex/luacas/doc/appendix/versionhistory.tex22
-rw-r--r--macros/luatex/latex/luacas/doc/luacas.pdfbin758211 -> 760471 bytes
-rw-r--r--macros/luatex/latex/luacas/doc/luacas.tex10
-rw-r--r--macros/luatex/latex/luacas/tex/_lib/luacas-inspect.lua (renamed from macros/luatex/latex/luacas/tex/_lib/inspect.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/_lib/luacas-pepperfish.lua (renamed from macros/luatex/latex/luacas/tex/_lib/pepperfish.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/_lib/luacas-table.lua (renamed from macros/luatex/latex/luacas/tex/_lib/table.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/_init.lua24
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-absexpression.lua (renamed from macros/luatex/latex/luacas/tex/algebra/absexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-algebra_init.lua24
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-equation.lua (renamed from macros/luatex/latex/luacas/tex/algebra/equation.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-euclideandomain.lua (renamed from macros/luatex/latex/luacas/tex/algebra/euclideandomain.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-factorialexpression.lua (renamed from macros/luatex/latex/luacas/tex/algebra/factorialexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-field.lua (renamed from macros/luatex/latex/luacas/tex/algebra/field.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-integer.lua (renamed from macros/luatex/latex/luacas/tex/algebra/integer.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-integerquotientring.lua (renamed from macros/luatex/latex/luacas/tex/algebra/integerquotientring.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-logarithm.lua (renamed from macros/luatex/latex/luacas/tex/algebra/logarithm.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-polynomialring.lua (renamed from macros/luatex/latex/luacas/tex/algebra/polynomialring.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-rational.lua (renamed from macros/luatex/latex/luacas/tex/algebra/rational.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-ring.lua (renamed from macros/luatex/latex/luacas/tex/algebra/ring.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-rootexpression.lua (renamed from macros/luatex/latex/luacas/tex/algebra/rootexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-sqrtexpression.lua (renamed from macros/luatex/latex/luacas/tex/algebra/sqrtexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/luacas-trigexpression.lua (renamed from macros/luatex/latex/luacas/tex/algebra/trigexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/polynomialring/luacas-berlekampfactoring.lua (renamed from macros/luatex/latex/luacas/tex/algebra/polynomialring/berlekampfactoring.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/polynomialring/luacas-decomposition.lua (renamed from macros/luatex/latex/luacas/tex/algebra/polynomialring/decomposition.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/algebra/polynomialring/luacas-zassenhausfactoring.lua (renamed from macros/luatex/latex/luacas/tex/algebra/polynomialring/zassenhausfactoring.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/calculus/_init.lua6
-rw-r--r--macros/luatex/latex/luacas/tex/calculus/luacas-calculus_init.lua6
-rw-r--r--macros/luatex/latex/luacas/tex/calculus/luacas-derivativeexpression.lua (renamed from macros/luatex/latex/luacas/tex/calculus/derivativeexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/calculus/luacas-diffexpression.lua (renamed from macros/luatex/latex/luacas/tex/calculus/diffexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/calculus/luacas-integralexpression.lua (renamed from macros/luatex/latex/luacas/tex/calculus/integralexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/_init.lua16
-rw-r--r--macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-difference.lua (renamed from macros/luatex/latex/luacas/tex/core/binaryoperation/difference.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-power.lua (renamed from macros/luatex/latex/luacas/tex/core/binaryoperation/power.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-product.lua (renamed from macros/luatex/latex/luacas/tex/core/binaryoperation/product.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-quotient.lua (renamed from macros/luatex/latex/luacas/tex/core/binaryoperation/quotient.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-sum.lua (renamed from macros/luatex/latex/luacas/tex/core/binaryoperation/sum.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/luacas-atomicexpression.lua (renamed from macros/luatex/latex/luacas/tex/core/atomicexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/luacas-binaryoperation.lua (renamed from macros/luatex/latex/luacas/tex/core/binaryoperation.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/luacas-compoundexpression.lua (renamed from macros/luatex/latex/luacas/tex/core/compoundexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/luacas-constantexpression.lua (renamed from macros/luatex/latex/luacas/tex/core/constantexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/luacas-core_init.lua16
-rw-r--r--macros/luatex/latex/luacas/tex/core/luacas-expression.lua (renamed from macros/luatex/latex/luacas/tex/core/expression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/luacas-functionexpression.lua (renamed from macros/luatex/latex/luacas/tex/core/functionexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/core/luacas-symbolexpression.lua (renamed from macros/luatex/latex/luacas/tex/core/symbolexpression.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/luacas.sty6
-rw-r--r--macros/luatex/latex/luacas/tex/test/calculus/luacas-derivatives.lua (renamed from macros/luatex/latex/luacas/tex/test/calculus/derivatives.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/calculus/luacas-integrals.lua (renamed from macros/luatex/latex/luacas/tex/test/calculus/integrals.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/expressions/luacas-autosimplify.lua (renamed from macros/luatex/latex/luacas/tex/test/expressions/autosimplify.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/expressions/luacas-collect.lua (renamed from macros/luatex/latex/luacas/tex/test/expressions/collect.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/expressions/luacas-equations.lua (renamed from macros/luatex/latex/luacas/tex/test/expressions/equations.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/expressions/luacas-functions.lua (renamed from macros/luatex/latex/luacas/tex/test/expressions/functions.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/expressions/luacas-logarithms.lua (renamed from macros/luatex/latex/luacas/tex/test/expressions/logarithms.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/expressions/luacas-rationalexponent.lua (renamed from macros/luatex/latex/luacas/tex/test/expressions/rationalexponent.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/expressions/luacas-simplify.lua (renamed from macros/luatex/latex/luacas/tex/test/expressions/simplify.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/expressions/luacas-substitute.lua (renamed from macros/luatex/latex/luacas/tex/test/expressions/substitute.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/luacas-helper.lua (renamed from macros/luatex/latex/luacas/tex/test/helper.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/luacas-main.lua (renamed from macros/luatex/latex/luacas/tex/test/main.lua)44
-rw-r--r--macros/luatex/latex/luacas/tex/test/luacas-parser.lua (renamed from macros/luatex/latex/luacas/tex/test/parser.lua)2
-rw-r--r--macros/luatex/latex/luacas/tex/test/polynomials/luacas-partialfractions.lua (renamed from macros/luatex/latex/luacas/tex/test/polynomials/partialfractions.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/polynomials/luacas-polynomial.lua (renamed from macros/luatex/latex/luacas/tex/test/polynomials/polynomial.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/polynomials/luacas-polynomialmod.lua (renamed from macros/luatex/latex/luacas/tex/test/polynomials/polynomialmod.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/polynomials/luacas-roots.lua (renamed from macros/luatex/latex/luacas/tex/test/polynomials/roots.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/rings/luacas-conversion.lua (renamed from macros/luatex/latex/luacas/tex/test/rings/conversion.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/rings/luacas-modulararithmetic.lua (renamed from macros/luatex/latex/luacas/tex/test/rings/modulararithmetic.lua)0
-rw-r--r--macros/luatex/latex/luacas/tex/test/rings/luacas-number.lua (renamed from macros/luatex/latex/luacas/tex/test/rings/number.lua)0
73 files changed, 321 insertions, 138 deletions
diff --git a/macros/luatex/generic/luakeys/README.md b/macros/luatex/generic/luakeys/README.md
index 2bff44088b..bd30edb066 100644
--- a/macros/luatex/generic/luakeys/README.md
+++ b/macros/luatex/generic/luakeys/README.md
@@ -78,6 +78,9 @@ local defs = {
```lua
local opts = {
+ -- Configure the delimiter that assigns a value to a key.
+ assignment_operator = '=',
+
-- Automatically convert dimensions into scaled points (1cm -> 1864679).
convert_dimensions = false,
@@ -97,6 +100,12 @@ local opts = {
-- lower, snake, upper
format_keys = { 'snake' },
+ -- Configure the delimiter that marks the beginning of a group.
+ group_begin = '{',
+
+ -- Configure the delimiter that marks the end of a group.
+ group_end = '}',
+
-- Listed in the order of execution
hooks = {
kv_string = function(kv_string)
@@ -131,6 +140,9 @@ local opts = {
end,
},
+ -- Configure the delimiter that separates list items from each other.
+ list_separator = ',',
+
-- If true, naked keys are converted to values:
-- { one = true, two = true, three = true } -> { 'one', 'two', 'three' }
naked_as_value = false,
@@ -138,6 +150,12 @@ local opts = {
-- Throw no error if there are unknown keys.
no_error = false,
+ -- Configure the delimiter that marks the beginning of a string.
+ quotation_begin = '"',
+
+ -- Configure the delimiter that marks the end of a string.
+ quotation_end = '"',
+
-- { key = { 'value' } } -> { key = 'value' }
unpack = false,
}
diff --git a/macros/luatex/generic/luakeys/luakeys-debug.sty b/macros/luatex/generic/luakeys/luakeys-debug.sty
index 1a26a66450..5f8cc808f5 100644
--- a/macros/luatex/generic/luakeys/luakeys-debug.sty
+++ b/macros/luatex/generic/luakeys/luakeys-debug.sty
@@ -17,6 +17,6 @@
% luakeys-debug.sty and luakeys-debug.tex.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luakeys-debug}[2022/07/06 0.7.0 Debug package for luakeys.]
+\ProvidesPackage{luakeys-debug}[2022/11/17 0.8.0 Debug package for luakeys.]
\input luakeys-debug.tex
diff --git a/macros/luatex/generic/luakeys/luakeys-doc.pdf b/macros/luatex/generic/luakeys/luakeys-doc.pdf
index ee0f3411f6..04e307a84d 100644
--- a/macros/luatex/generic/luakeys/luakeys-doc.pdf
+++ b/macros/luatex/generic/luakeys/luakeys-doc.pdf
Binary files differ
diff --git a/macros/luatex/generic/luakeys/luakeys-doc.tex b/macros/luatex/generic/luakeys/luakeys-doc.tex
index dd6fcc0973..f7d2940f66 100644
--- a/macros/luatex/generic/luakeys/luakeys-doc.tex
+++ b/macros/luatex/generic/luakeys/luakeys-doc.tex
@@ -58,7 +58,7 @@ The default value of the option “\texttt{#1}” is:
\href{https://github.com/Josef-Friedrich/luakeys}
{github.com/Josef-Friedrich/luakeys}%
}
-\date{0.7.0 from 2022/07/06}
+\date{0.8.0 from 2022/11/17}
\maketitle
@@ -357,7 +357,7 @@ The \lua{parse} function can be called with an options table. This
options are supported: \catcode`_=12
\directlua{luakeys.print_names('opts')}
-\InputLua[firstline=5,lastline=69]{opts/all-opts.lua}
+\InputLua[firstline=5,lastline=86]{opts/all-opts.lua}
\noindent
The options can also be set globally using the exported table
@@ -371,6 +371,32 @@ The options can also be set globally using the exported table
%
%%
+\subsubsection{Option “\texttt{assignment_operator}”}
+\label{option:assignment-operator}
+\label{options-delimiter}
+
+The option \lua{assignment_operator} configures the delimiter that
+assigns a value to a key. The default value of this option is
+\texttt{"="}.
+
+The code example below demonstrates all six delimiter related options.
+
+\InputLua[firstline=4,lastline=13]{opts/delimiters.lua}
+
+\begin{tabular}{ll}
+\textbf{Delimiter options} & \textbf{Section} \\
+assignment_operator & \ref{option:assignment-operator}\\
+group_begin & \ref{option:group-begin}\\
+group_end & \ref{option:group-end}\\
+list_separator & \ref{option:list-separator}\\
+quotation_begin & \ref{option:quotation-begin}\\
+quotation_end & \ref{option:quotation-end}\\
+\end{tabular}
+
+%%
+%
+%%
+
\subsubsection{Option “\texttt{convert_dimensions}”}
% Wenn Sie die Option \lua{convert_dimensions} auf \lua{true} setzen,
@@ -515,26 +541,76 @@ we can write ...
\subsubsection{Option “\texttt{format_keys}”}
+% Mit Hilfe der Option \lua{format_keys} können die Schlüssel formatiert
+% werden.
+With the help of the option \lua{format_keys} the keys can be formatted.
+% Die Werte dieser Option müssen in einer Tabelle angegeben werden.
+The values of this option must be specified in a table.
+
\begin{description}
-\item[lower] \strut
+\item[lower]
+
+% Um alle Schlüssel in \emph{Kleinbuchstaben} umzuwandeln, geben sie in
+% der Optionentabelle \lua{lower} an.
+To convert all keys to \emph{lowercase}, specify \lua{lower} in the
+options table.
\InputLua[firstline=4,lastline=5]{opts/format-keys.lua}
-\item[snake] \strut
+\item[snake]
+
+% Um alle Schlüssel in \emph{snake case} (Die Wörter sind durch
+% Unterstriche getrennt) umzuwandeln, geben sie in der Optionentabelle
+% \lua{snake} an.
+To make all keys \emph{snake case} (The words are separated by
+underscores), specify \lua{snake} in the options
+table.
\InputLua[firstline=11,lastline=12]{opts/format-keys.lua}
-\item[upper] \strut
+\item[upper]
+
+% Um alle Schlüssel in \emph{Grossbuchstaben} umzuwandeln, geben sie in der
+% Optionentabelle \lua{upper} an.
+To convert all keys to \emph{uppercase}, specify \lua{upper} in the
+options table.
\InputLua[firstline=18,lastline=19]{opts/format-keys.lua}
\end{description}
+% Sie können auch mehrere Formatierungsarten kombinieren.
+You can also combine several types of formatting.
+
+\InputLua[firstline=25,lastline=26]{opts/format-keys.lua}
+
\DefaultOptDescription{format_keys}
%%
%
%%
+\subsubsection{Option “\texttt{group_begin}”}
+\label{option:group-begin}
+
+The option \lua{group_begin} configures the delimiter that marks the
+beginning of a group. The default value of this option is \texttt{"\{"}.
+A code example can be found in section \ref{options-delimiter}.
+
+%%
+%
+%%
+
+\subsubsection{Option “\texttt{group_end}”}
+\label{option:group-end}
+
+The option \lua{group_end} configures the delimiter that marks the end
+of a group. The default value of this option is \texttt{"\}"}. A code
+example can be found in section \ref{options-delimiter}.
+
+%%
+%
+%%
+
\subsubsection{Option “\texttt{hooks}”}
% Die folgenden Hooks bzw. Callback-Funktionen ermöglichen es in den
@@ -623,6 +699,18 @@ as a parameter.
%
%%
+\subsubsection{Option “\texttt{list_separator}”}
+\label{option:list-separator}
+
+The option \lua{list_separator} configures the delimiter that separates
+list items from each other. The default value of this option is
+\texttt{","}. A code example can be found in section
+\ref{options-delimiter}.
+
+%%
+%
+%%
+
\subsubsection{Option “\texttt{naked_as_value}”}
% Mit Hilfe der Option \lua{naked_as_value} werden nackte Schlüssel
@@ -665,13 +753,37 @@ If we set the option \lua{no_error} to \lua{true}:
%
%%
+\subsubsection{Option “\texttt{quotation_begin}”}
+\label{option:quotation-begin}
+
+The option \lua{quotation_begin} configures the delimiter that marks the
+beginning of a string. The default value of this option is
+\texttt{'"'} (double quotes). A code example can be found in section
+\ref{options-delimiter}.
+
+%%
+%
+%%
+
+\subsubsection{Option “\texttt{quotation_end}”}
+\label{option:quotation-end}
+
+The option \lua{quotation_end} configures the delimiter that marks the
+end of a string. The default value of this option is \texttt{'"'}
+(double quotes). A code example can be found in section
+\ref{options-delimiter}.
+
+%%
+%
+%%
+
\subsubsection{Option “\texttt{unpack}”}
% Mit Hilfe der Option \lua{unpack} werden alle Tabellen, die nur aus
% einem einzigen nackten Schlüssel bzw. einen einzigen alleinstehenden
% Wert bestehen, aufgelöst.
With the help of the option \lua{unpack}, all tables that consist of
-only one a single naked key or a single standalone value are unpacked.
+only a single naked key or a single standalone value are unpacked.
\InputLua[firstline=4,lastline=5]{opts/unpack.lua}
@@ -1816,6 +1928,12 @@ An example of how to use the command in \LaTeX:
that means scan for tokens that are enclosed in square brackets
* extend and improve documentation
}
+\changes{0.8.0}{2022/11/17}{
+* Add 6 new options to change the delimiters: “assignment_operator”,
+ “group_begin”, “group_end”, “list_separator”, “quotation_begin”,
+ “quotation_end”.
+* Extend the documentation about the option “format_keys”.
+}
\pagebreak
\PrintChanges
\pagebreak
diff --git a/macros/luatex/generic/luakeys/luakeys.lua b/macros/luatex/generic/luakeys/luakeys.lua
index 3221fc3efd..8b065289de 100644
--- a/macros/luatex/generic/luakeys/luakeys.lua
+++ b/macros/luatex/generic/luakeys/luakeys.lua
@@ -172,15 +172,21 @@ local utils = {
local namespace = {
opts = {
+ assignment_operator = '=',
convert_dimensions = false,
debug = false,
default = true,
defaults = false,
defs = false,
format_keys = false,
+ group_begin = '{',
+ group_end = '}',
hooks = {},
+ list_separator = ',',
naked_as_value = false,
no_error = false,
+ quotation_begin = '"',
+ quotation_end = '"',
unpack = true,
},
@@ -224,6 +230,38 @@ local function throw_error(message)
end
end
+--- Normalize the parse options.
+---
+---@param opts? table # Options in a raw format. The table may be empty or some keys are not set.
+---
+---@return table
+local function normalize_opts(opts)
+ if type(opts) ~= 'table' then
+ opts = {}
+ end
+ for key, _ in pairs(opts) do
+ if namespace.opts[key] == nil then
+ throw_error('Unknown parse option: ' .. tostring(key) .. '!')
+ end
+ end
+ local old_opts = opts
+ opts = {}
+ for name, _ in pairs(namespace.opts) do
+ if old_opts[name] ~= nil then
+ opts[name] = old_opts[name]
+ else
+ opts[name] = default_options[name]
+ end
+ end
+
+ for hook in pairs(opts.hooks) do
+ if namespace.hooks[hook] == nil then
+ throw_error('Unknown hook: ' .. tostring(hook) .. '!')
+ end
+ end
+ return opts
+end
+
local l3_code_cctab = 10
--- Convert back to strings
@@ -375,13 +413,12 @@ end
--- * [TUGboat article: Parsing complex data formats in LuaTEX with LPEG](https://tug.or-g/TUGboat/tb40-2/tb125menke-Patterndf)
---
---@param initial_rule string # The name of the first rule of the grammar table passed to the `lpeg.P(attern)` function (e. g. `list`, `number`).
----@param convert_dimensions? boolean # Whether the dimensions should be converted to scaled points (by default `false`).
+---@param opts? table # Whether the dimensions should be converted to scaled points (by default `false`).
---
---@return userdata # The parser.
-local function generate_parser(initial_rule,
- convert_dimensions)
- if convert_dimensions == nil then
- convert_dimensions = false
+local function generate_parser(initial_rule, opts)
+ if type(opts) ~= 'table' then
+ opts = normalize_opts(opts)
end
local Variable = lpeg.V
@@ -413,7 +450,7 @@ local function generate_parser(initial_rule,
input = input:gsub('%s+', '')
-- Convert the unit string into lowercase.
input = input:lower()
- if convert_dimensions then
+ if opts.convert_dimensions then
return tex.sp(input)
else
return input
@@ -458,7 +495,7 @@ local function generate_parser(initial_rule,
-- '{' list '}'
list_container =
- ws('{') * Variable('list') * ws('}'),
+ ws(opts.group_begin) * Variable('list') * ws(opts.group_end),
-- ( list_container / key_value_pair / value ) ','?
list_item =
@@ -466,11 +503,11 @@ local function generate_parser(initial_rule,
Variable('list_container') +
Variable('key_value_pair') +
Variable('value')
- ) * ws(',')^-1,
+ ) * ws(opts.list_separator)^-1,
-- key '=' (list_container / value)
key_value_pair =
- (Variable('key') * ws('=')) * (Variable('list_container') + Variable('value')),
+ (Variable('key') * ws(opts.assignment_operator)) * (Variable('list_container') + Variable('value')),
-- number / string_quoted / string_unquoted
key =
@@ -555,9 +592,9 @@ local function generate_parser(initial_rule,
-- '"' ('\"' / !'"')* '"'
string_quoted =
- white_space^0 * Pattern('"') *
- CaptureSimple((Pattern('\\"') + 1 - Pattern('"'))^0) *
- Pattern('"') * white_space^0,
+ white_space^0 * Pattern(opts.quotation_begin) *
+ CaptureSimple((Pattern('\\' .. opts.quotation_end) + 1 - Pattern(opts.quotation_end))^0) *
+ Pattern(opts.quotation_end) * white_space^0,
string_unquoted =
white_space^0 *
@@ -566,7 +603,11 @@ local function generate_parser(initial_rule,
(Set(' \t')^1 * Variable('word_unquoted')^1)^0) *
white_space^0,
- word_unquoted = (1 - white_space - Set('{},='))^1
+ word_unquoted = (1 - white_space - Set(
+ opts.group_begin ..
+ opts.group_end ..
+ opts.assignment_operator ..
+ opts.list_separator))^1
})
-- LuaFormatter on
end
@@ -614,7 +655,7 @@ local is = {
if type(value) == 'boolean' then
return true
end
- local parser = generate_parser('boolean_only', false)
+ local parser = generate_parser('boolean_only')
local result = parser:match(tostring(value))
return result ~= nil
end,
@@ -623,7 +664,7 @@ local is = {
if value == nil then
return false
end
- local parser = generate_parser('dimension_only', false)
+ local parser = generate_parser('dimension_only')
local result = parser:match(tostring(value))
return result ~= nil
end,
@@ -643,7 +684,7 @@ local is = {
if type(value) == 'number' then
return true
end
- local parser = generate_parser('number_only', false)
+ local parser = generate_parser('number_only')
local result = parser:match(tostring(value))
return result ~= nil
end,
@@ -778,7 +819,10 @@ local function apply_definitions(defs,
-- integer
elseif def.data_type == 'integer' then
if is.number(value) then
- converted = math.floor(tonumber(value))
+ local n = tonumber(value)
+ if type(n) == 'number' and n ~= nil then
+ converted = math.floor(n)
+ end
end
-- number
elseif def.data_type == 'number' then
@@ -1038,7 +1082,7 @@ end
--- Parse a LaTeX/TeX style key-value string into a Lua table.
---
---@param kv_string string # A string in the TeX/LaTeX style key-value format as described above.
----@param opts table # A table containing the settings:
+---@param opts? table # A table containing the settings:
--- `convert_dimensions`, `unpack`, `naked_as_value`, `converter`,
--- `debug`, `preprocess`, `postprocess`.
--
@@ -1047,48 +1091,16 @@ end
---@return table raw # The unprocessed, raw result of the LPeg parser.
local function parse(kv_string, opts)
if kv_string == nil then
- return {}
+ return {}, {}, {}
end
- --- Normalize the parse options.
- ---
- ---@param opts table # Options in a raw format. The table may be empty or some keys are not set.
- ---
- ---@return table
- local function normalize_opts(opts)
- if type(opts) ~= 'table' then
- opts = {}
- end
- for key, _ in pairs(opts) do
- if namespace.opts[key] == nil then
- throw_error('Unknown parse option: ' .. tostring(key) .. '!')
- end
- end
- local old_opts = opts
- opts = {}
- for name, _ in pairs(namespace.opts) do
- if old_opts[name] ~= nil then
- opts[name] = old_opts[name]
- else
- opts[name] = default_options[name]
- end
- end
-
- for hook in pairs(opts.hooks) do
- if namespace.hooks[hook] == nil then
- throw_error('Unknown hook: ' .. tostring(hook) .. '!')
- end
- end
- return opts
- end
opts = normalize_opts(opts)
if type(opts.hooks.kv_string) == 'function' then
kv_string = opts.hooks.kv_string(kv_string)
end
- local result = generate_parser('list', opts.convert_dimensions):match(
- kv_string)
+ local result = generate_parser('list', opts):match(kv_string)
local raw = clone_table(result)
local function apply_hook(name)
@@ -1218,7 +1230,7 @@ local result_store = {}
-- @section
local export = {
- version = { 0, 7, 0 },
+ version = { 0, 8, 0 },
namespace = namespace,
diff --git a/macros/luatex/generic/luakeys/luakeys.sty b/macros/luatex/generic/luakeys/luakeys.sty
index d0917f1d9d..68c3892ee4 100644
--- a/macros/luatex/generic/luakeys/luakeys.sty
+++ b/macros/luatex/generic/luakeys/luakeys.sty
@@ -17,5 +17,5 @@
% luakeys-debug.sty and luakeys-debug.tex.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luakeys}[2022/07/06 0.7.0 Parsing key-value options using Lua.]
+\ProvidesPackage{luakeys}[2022/11/17 0.8.0 Parsing key-value options using Lua.]
\directlua{luakeys = require('luakeys')}
diff --git a/macros/luatex/latex/luacas/README.md b/macros/luatex/latex/luacas/README.md
index 8e757dfea9..0d04c2ba04 100644
--- a/macros/luatex/latex/luacas/README.md
+++ b/macros/luatex/latex/luacas/README.md
@@ -10,10 +10,21 @@ The Lua CAS itself can be downloaded or cloned from [https://github.com/cochraef
The package manager for your local TeX distribution ought to work just fine. Alternatively, download luacas.tds.zip and unzip the file in the root of one of your TDS trees. You may need to update some filename database after this (this may vary depending on your TeX distribution).
+To run the LuaCAS tests, navigate to the luacas directory in either repository, and run the command
+`lua test\main.lua`. You will need Lua version 5.3 or later.
+
+# Documentation
+
+Documentation for any version is included with the release.
+
# Authors
This package is authored and maintained by Evan Cochrane and Timothy All.
+# Bug Reporting
+
+Bug reports with the documentation or bugs related to the LaTeX end should go in this repository, while bug reports related to the CAS should go in [https://github.com/cochraef/LuaCAS](https://github.com/cochraef/LuaCAS). There is no required format for bugs, but it should be clear how to replicate the bug and what you think the intended functionality should be.
+
# License
Permission is granted to copy, distribute and/or modify this
diff --git a/macros/luatex/latex/luacas/doc/appendix/luacas.dat b/macros/luatex/latex/luacas/doc/appendix/luacas.dat
index 60866bae05..7f2efd0a10 100644
--- a/macros/luatex/latex/luacas/doc/appendix/luacas.dat
+++ b/macros/luatex/latex/luacas/doc/appendix/luacas.dat
@@ -11,7 +11,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luacas}
- [2022/05/07 v1.0 CAS written in Lua for LaTeX]
+ [2022/11/15 v1.0.1 CAS written in Lua for LaTeX]
\RequirePackage{iftex}
\ifluatex
diff --git a/macros/luatex/latex/luacas/doc/appendix/versionhistory.tex b/macros/luatex/latex/luacas/doc/appendix/versionhistory.tex
new file mode 100644
index 0000000000..26754b3c7d
--- /dev/null
+++ b/macros/luatex/latex/luacas/doc/appendix/versionhistory.tex
@@ -0,0 +1,22 @@
+\documentclass{article}
+
+\usepackage[margin=1in]{geometry}
+\usepackage[shortlabels]{enumitem}
+
+\begin{document}
+
+\section{Version History}
+
+\subsection*{v1.0.1}
+
+\begin{itemize}
+ \item Update CAS file names for \TeX{}Live
+\end{itemize}
+
+\subsection*{v1.0.0}
+
+\begin{itemize}
+ \item Intial release
+\end{itemize}
+
+\end{document} \ No newline at end of file
diff --git a/macros/luatex/latex/luacas/doc/luacas.pdf b/macros/luatex/latex/luacas/doc/luacas.pdf
index d3ea07adf3..667791efb6 100644
--- a/macros/luatex/latex/luacas/doc/luacas.pdf
+++ b/macros/luatex/latex/luacas/doc/luacas.pdf
Binary files differ
diff --git a/macros/luatex/latex/luacas/doc/luacas.tex b/macros/luatex/latex/luacas/doc/luacas.tex
index b5aad9c9f9..3d0c51a343 100644
--- a/macros/luatex/latex/luacas/doc/luacas.tex
+++ b/macros/luatex/latex/luacas/doc/luacas.tex
@@ -160,9 +160,9 @@ style=numeric,
\begin{document}
\title{The {\ttfamily luacas} package}
\author{Evan Cochrane\thanks{\href{mailto:cochraef@rose-hulman.edu}{\ttfamily cochraef@rose-hulman.edu}} , Timothy All\thanks{\href{mailto:timothy.all@rose-hulman.edu}{\ttfamily timothy.all@rose-hulman.edu}}}
-\date{v1.0.0 \\ \today}
+\date{v1.0.1 \\ \today}
-\maketitle
+\maketitle
\begin{abstract}
The {\ttfamily luacas} package is a portable Computer Algebra System capable of symbolic computation, written entirely in Lua, designed for use in Lua\LaTeX{}.
@@ -186,9 +186,9 @@ style=numeric,
\include{reference/ref_core/ref_core.tex}
-\include{reference/ref_core/ref_core_classes/ref_core_classes.tex}
+\include{reference/ref_core/ref_core_classes/ref_core_classes.tex}
-\include{reference/ref_core/ref_core_methods/ref_core_methods.tex}
+\include{reference/ref_core/ref_core_methods/ref_core_methods.tex}
\include{reference/ref_algebra/ref_algebra.tex}
@@ -206,6 +206,8 @@ style=numeric,
\include{appendix/latexcode.tex}
+\include{appendix/versionhistory.tex}
+
\newpage
\printindex
diff --git a/macros/luatex/latex/luacas/tex/_lib/inspect.lua b/macros/luatex/latex/luacas/tex/_lib/luacas-inspect.lua
index dedd91f248..dedd91f248 100644
--- a/macros/luatex/latex/luacas/tex/_lib/inspect.lua
+++ b/macros/luatex/latex/luacas/tex/_lib/luacas-inspect.lua
diff --git a/macros/luatex/latex/luacas/tex/_lib/pepperfish.lua b/macros/luatex/latex/luacas/tex/_lib/luacas-pepperfish.lua
index 4717543c4b..4717543c4b 100644
--- a/macros/luatex/latex/luacas/tex/_lib/pepperfish.lua
+++ b/macros/luatex/latex/luacas/tex/_lib/luacas-pepperfish.lua
diff --git a/macros/luatex/latex/luacas/tex/_lib/table.lua b/macros/luatex/latex/luacas/tex/_lib/luacas-table.lua
index 70495d1479..70495d1479 100644
--- a/macros/luatex/latex/luacas/tex/_lib/table.lua
+++ b/macros/luatex/latex/luacas/tex/_lib/luacas-table.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/_init.lua b/macros/luatex/latex/luacas/tex/algebra/_init.lua
deleted file mode 100644
index 0a9b114cb9..0000000000
--- a/macros/luatex/latex/luacas/tex/algebra/_init.lua
+++ /dev/null
@@ -1,24 +0,0 @@
--- Loads algebra files in the correct order.
-require("_lib.table")
-
-require("core._init")
-
-require("algebra.ring")
-require("algebra.euclideandomain")
-require("algebra.field")
-require("algebra.polynomialring")
-require("algebra.integer")
-require("algebra.rational")
-require("algebra.integerquotientring")
-require("algebra.sqrtexpression")
-
-require("algebra.absexpression")
-require("algebra.equation")
-require("algebra.factorialexpression")
-require("algebra.logarithm")
-require("algebra.rootexpression")
-require("algebra.trigexpression")
-
-require("algebra.polynomialring.berlekampfactoring")
-require("algebra.polynomialring.zassenhausfactoring")
-require("algebra.polynomialring.decomposition") \ No newline at end of file
diff --git a/macros/luatex/latex/luacas/tex/algebra/absexpression.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-absexpression.lua
index 2bf0b6a7ef..2bf0b6a7ef 100644
--- a/macros/luatex/latex/luacas/tex/algebra/absexpression.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-absexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/luacas-algebra_init.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-algebra_init.lua
new file mode 100644
index 0000000000..ac37c56a5b
--- /dev/null
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-algebra_init.lua
@@ -0,0 +1,24 @@
+-- Loads algebra files in the correct order.
+require("_lib.luacas-table")
+
+require("core.luacas-core_init")
+
+require("algebra.luacas-ring")
+require("algebra.luacas-euclideandomain")
+require("algebra.luacas-field")
+require("algebra.luacas-polynomialring")
+require("algebra.luacas-integer")
+require("algebra.luacas-rational")
+require("algebra.luacas-integerquotientring")
+require("algebra.luacas-sqrtexpression")
+
+require("algebra.luacas-absexpression")
+require("algebra.luacas-equation")
+require("algebra.luacas-factorialexpression")
+require("algebra.luacas-logarithm")
+require("algebra.luacas-rootexpression")
+require("algebra.luacas-trigexpression")
+
+require("algebra.polynomialring.luacas-berlekampfactoring")
+require("algebra.polynomialring.luacas-zassenhausfactoring")
+require("algebra.polynomialring.luacas-decomposition") \ No newline at end of file
diff --git a/macros/luatex/latex/luacas/tex/algebra/equation.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-equation.lua
index 4e81d5ca95..4e81d5ca95 100644
--- a/macros/luatex/latex/luacas/tex/algebra/equation.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-equation.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/euclideandomain.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-euclideandomain.lua
index fab2c5c7c2..fab2c5c7c2 100644
--- a/macros/luatex/latex/luacas/tex/algebra/euclideandomain.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-euclideandomain.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/factorialexpression.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-factorialexpression.lua
index 1c5b824ff7..1c5b824ff7 100644
--- a/macros/luatex/latex/luacas/tex/algebra/factorialexpression.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-factorialexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/field.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-field.lua
index c845e94c55..c845e94c55 100644
--- a/macros/luatex/latex/luacas/tex/algebra/field.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-field.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/integer.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-integer.lua
index a3c54f498c..a3c54f498c 100644
--- a/macros/luatex/latex/luacas/tex/algebra/integer.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-integer.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/integerquotientring.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-integerquotientring.lua
index 4c2188c9e5..4c2188c9e5 100644
--- a/macros/luatex/latex/luacas/tex/algebra/integerquotientring.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-integerquotientring.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/logarithm.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-logarithm.lua
index 07a9db84d1..07a9db84d1 100644
--- a/macros/luatex/latex/luacas/tex/algebra/logarithm.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-logarithm.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/polynomialring.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-polynomialring.lua
index 568c21c921..568c21c921 100644
--- a/macros/luatex/latex/luacas/tex/algebra/polynomialring.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-polynomialring.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/rational.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-rational.lua
index 811909a948..811909a948 100644
--- a/macros/luatex/latex/luacas/tex/algebra/rational.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-rational.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/ring.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-ring.lua
index 4903b9c912..4903b9c912 100644
--- a/macros/luatex/latex/luacas/tex/algebra/ring.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-ring.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/rootexpression.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-rootexpression.lua
index a66182579a..a66182579a 100644
--- a/macros/luatex/latex/luacas/tex/algebra/rootexpression.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-rootexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/sqrtexpression.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-sqrtexpression.lua
index bc96f4e1d8..bc96f4e1d8 100644
--- a/macros/luatex/latex/luacas/tex/algebra/sqrtexpression.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-sqrtexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/trigexpression.lua b/macros/luatex/latex/luacas/tex/algebra/luacas-trigexpression.lua
index 307bfe1737..307bfe1737 100644
--- a/macros/luatex/latex/luacas/tex/algebra/trigexpression.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/luacas-trigexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/polynomialring/berlekampfactoring.lua b/macros/luatex/latex/luacas/tex/algebra/polynomialring/luacas-berlekampfactoring.lua
index feabb61a3f..feabb61a3f 100644
--- a/macros/luatex/latex/luacas/tex/algebra/polynomialring/berlekampfactoring.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/polynomialring/luacas-berlekampfactoring.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/polynomialring/decomposition.lua b/macros/luatex/latex/luacas/tex/algebra/polynomialring/luacas-decomposition.lua
index 84f2af1efc..84f2af1efc 100644
--- a/macros/luatex/latex/luacas/tex/algebra/polynomialring/decomposition.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/polynomialring/luacas-decomposition.lua
diff --git a/macros/luatex/latex/luacas/tex/algebra/polynomialring/zassenhausfactoring.lua b/macros/luatex/latex/luacas/tex/algebra/polynomialring/luacas-zassenhausfactoring.lua
index be19298e64..be19298e64 100644
--- a/macros/luatex/latex/luacas/tex/algebra/polynomialring/zassenhausfactoring.lua
+++ b/macros/luatex/latex/luacas/tex/algebra/polynomialring/luacas-zassenhausfactoring.lua
diff --git a/macros/luatex/latex/luacas/tex/calculus/_init.lua b/macros/luatex/latex/luacas/tex/calculus/_init.lua
deleted file mode 100644
index 59ba1bbcc8..0000000000
--- a/macros/luatex/latex/luacas/tex/calculus/_init.lua
+++ /dev/null
@@ -1,6 +0,0 @@
--- Loads calculus files in the correct order.
-require("algebra._init")
-
-require("calculus.derivativeexpression")
-require("calculus.integralexpression")
-require("calculus.diffexpression")
diff --git a/macros/luatex/latex/luacas/tex/calculus/luacas-calculus_init.lua b/macros/luatex/latex/luacas/tex/calculus/luacas-calculus_init.lua
new file mode 100644
index 0000000000..89b38b650e
--- /dev/null
+++ b/macros/luatex/latex/luacas/tex/calculus/luacas-calculus_init.lua
@@ -0,0 +1,6 @@
+-- Loads calculus files in the correct order.
+require("algebra.luacas-algebra_init")
+
+require("calculus.luacas-derivativeexpression")
+require("calculus.luacas-integralexpression")
+require("calculus.luacas-diffexpression")
diff --git a/macros/luatex/latex/luacas/tex/calculus/derivativeexpression.lua b/macros/luatex/latex/luacas/tex/calculus/luacas-derivativeexpression.lua
index b757759c4c..b757759c4c 100644
--- a/macros/luatex/latex/luacas/tex/calculus/derivativeexpression.lua
+++ b/macros/luatex/latex/luacas/tex/calculus/luacas-derivativeexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/calculus/diffexpression.lua b/macros/luatex/latex/luacas/tex/calculus/luacas-diffexpression.lua
index df1dc90f33..df1dc90f33 100644
--- a/macros/luatex/latex/luacas/tex/calculus/diffexpression.lua
+++ b/macros/luatex/latex/luacas/tex/calculus/luacas-diffexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/calculus/integralexpression.lua b/macros/luatex/latex/luacas/tex/calculus/luacas-integralexpression.lua
index 5267127264..5267127264 100644
--- a/macros/luatex/latex/luacas/tex/calculus/integralexpression.lua
+++ b/macros/luatex/latex/luacas/tex/calculus/luacas-integralexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/core/_init.lua b/macros/luatex/latex/luacas/tex/core/_init.lua
deleted file mode 100644
index cfd640a214..0000000000
--- a/macros/luatex/latex/luacas/tex/core/_init.lua
+++ /dev/null
@@ -1,16 +0,0 @@
--- Loads core files in the correct order.
-
-require("core.expression")
-require("core.atomicexpression")
-require("core.compoundexpression")
-require("core.constantexpression")
-require("core.symbolexpression")
-require("core.binaryoperation")
-require("core.functionexpression")
-
-
-require("core.binaryoperation.power")
-require("core.binaryoperation.product")
-require("core.binaryoperation.sum")
-require("core.binaryoperation.quotient")
-require("core.binaryoperation.difference") \ No newline at end of file
diff --git a/macros/luatex/latex/luacas/tex/core/binaryoperation/difference.lua b/macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-difference.lua
index 2cc56b6600..2cc56b6600 100644
--- a/macros/luatex/latex/luacas/tex/core/binaryoperation/difference.lua
+++ b/macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-difference.lua
diff --git a/macros/luatex/latex/luacas/tex/core/binaryoperation/power.lua b/macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-power.lua
index 35df72c440..35df72c440 100644
--- a/macros/luatex/latex/luacas/tex/core/binaryoperation/power.lua
+++ b/macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-power.lua
diff --git a/macros/luatex/latex/luacas/tex/core/binaryoperation/product.lua b/macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-product.lua
index b104cb5e8a..b104cb5e8a 100644
--- a/macros/luatex/latex/luacas/tex/core/binaryoperation/product.lua
+++ b/macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-product.lua
diff --git a/macros/luatex/latex/luacas/tex/core/binaryoperation/quotient.lua b/macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-quotient.lua
index 4dac489bf5..4dac489bf5 100644
--- a/macros/luatex/latex/luacas/tex/core/binaryoperation/quotient.lua
+++ b/macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-quotient.lua
diff --git a/macros/luatex/latex/luacas/tex/core/binaryoperation/sum.lua b/macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-sum.lua
index 5bb204066f..5bb204066f 100644
--- a/macros/luatex/latex/luacas/tex/core/binaryoperation/sum.lua
+++ b/macros/luatex/latex/luacas/tex/core/binaryoperation/luacas-sum.lua
diff --git a/macros/luatex/latex/luacas/tex/core/atomicexpression.lua b/macros/luatex/latex/luacas/tex/core/luacas-atomicexpression.lua
index 6cc6e4f58e..6cc6e4f58e 100644
--- a/macros/luatex/latex/luacas/tex/core/atomicexpression.lua
+++ b/macros/luatex/latex/luacas/tex/core/luacas-atomicexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/core/binaryoperation.lua b/macros/luatex/latex/luacas/tex/core/luacas-binaryoperation.lua
index 708a6c1540..708a6c1540 100644
--- a/macros/luatex/latex/luacas/tex/core/binaryoperation.lua
+++ b/macros/luatex/latex/luacas/tex/core/luacas-binaryoperation.lua
diff --git a/macros/luatex/latex/luacas/tex/core/compoundexpression.lua b/macros/luatex/latex/luacas/tex/core/luacas-compoundexpression.lua
index 792c36cfc2..792c36cfc2 100644
--- a/macros/luatex/latex/luacas/tex/core/compoundexpression.lua
+++ b/macros/luatex/latex/luacas/tex/core/luacas-compoundexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/core/constantexpression.lua b/macros/luatex/latex/luacas/tex/core/luacas-constantexpression.lua
index 0f91a037a9..0f91a037a9 100644
--- a/macros/luatex/latex/luacas/tex/core/constantexpression.lua
+++ b/macros/luatex/latex/luacas/tex/core/luacas-constantexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/core/luacas-core_init.lua b/macros/luatex/latex/luacas/tex/core/luacas-core_init.lua
new file mode 100644
index 0000000000..c9c3b89126
--- /dev/null
+++ b/macros/luatex/latex/luacas/tex/core/luacas-core_init.lua
@@ -0,0 +1,16 @@
+-- Loads core files in the correct order.
+
+require("core.luacas-expression")
+require("core.luacas-atomicexpression")
+require("core.luacas-compoundexpression")
+require("core.luacas-constantexpression")
+require("core.luacas-symbolexpression")
+require("core.luacas-binaryoperation")
+require("core.luacas-functionexpression")
+
+
+require("core.binaryoperation.luacas-power")
+require("core.binaryoperation.luacas-product")
+require("core.binaryoperation.luacas-sum")
+require("core.binaryoperation.luacas-quotient")
+require("core.binaryoperation.luacas-difference") \ No newline at end of file
diff --git a/macros/luatex/latex/luacas/tex/core/expression.lua b/macros/luatex/latex/luacas/tex/core/luacas-expression.lua
index 8ff4659f79..8ff4659f79 100644
--- a/macros/luatex/latex/luacas/tex/core/expression.lua
+++ b/macros/luatex/latex/luacas/tex/core/luacas-expression.lua
diff --git a/macros/luatex/latex/luacas/tex/core/functionexpression.lua b/macros/luatex/latex/luacas/tex/core/luacas-functionexpression.lua
index dc94790b81..dc94790b81 100644
--- a/macros/luatex/latex/luacas/tex/core/functionexpression.lua
+++ b/macros/luatex/latex/luacas/tex/core/luacas-functionexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/core/symbolexpression.lua b/macros/luatex/latex/luacas/tex/core/luacas-symbolexpression.lua
index 0d9192c084..0d9192c084 100644
--- a/macros/luatex/latex/luacas/tex/core/symbolexpression.lua
+++ b/macros/luatex/latex/luacas/tex/core/luacas-symbolexpression.lua
diff --git a/macros/luatex/latex/luacas/tex/luacas.sty b/macros/luatex/latex/luacas/tex/luacas.sty
index 461fae6efa..d46ee847fc 100644
--- a/macros/luatex/latex/luacas/tex/luacas.sty
+++ b/macros/luatex/latex/luacas/tex/luacas.sty
@@ -9,7 +9,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luacas}
- [2022/05/07 v1.0 CAS written in Lua for LaTeX]
+ [2022/11/15 v1.0.1 CAS written in Lua for LaTeX]
\RequirePackage{iftex}
\ifluatex
@@ -30,8 +30,8 @@
\RequirePackage{mathtools}
%These files contain Lua code for parsing luacas output; they also initialize the CAS itself
-\directlua{require('test.parser')
- require('test.helper')
+\directlua{require('test.luacas-parser')
+ require('test.luacas-helper')
}
\NewDocumentEnvironment{CAS}%
diff --git a/macros/luatex/latex/luacas/tex/test/calculus/derivatives.lua b/macros/luatex/latex/luacas/tex/test/calculus/luacas-derivatives.lua
index 5d5429f59b..5d5429f59b 100644
--- a/macros/luatex/latex/luacas/tex/test/calculus/derivatives.lua
+++ b/macros/luatex/latex/luacas/tex/test/calculus/luacas-derivatives.lua
diff --git a/macros/luatex/latex/luacas/tex/test/calculus/integrals.lua b/macros/luatex/latex/luacas/tex/test/calculus/luacas-integrals.lua
index 0c12f7a787..0c12f7a787 100644
--- a/macros/luatex/latex/luacas/tex/test/calculus/integrals.lua
+++ b/macros/luatex/latex/luacas/tex/test/calculus/luacas-integrals.lua
diff --git a/macros/luatex/latex/luacas/tex/test/expressions/autosimplify.lua b/macros/luatex/latex/luacas/tex/test/expressions/luacas-autosimplify.lua
index 09ad9874cd..09ad9874cd 100644
--- a/macros/luatex/latex/luacas/tex/test/expressions/autosimplify.lua
+++ b/macros/luatex/latex/luacas/tex/test/expressions/luacas-autosimplify.lua
diff --git a/macros/luatex/latex/luacas/tex/test/expressions/collect.lua b/macros/luatex/latex/luacas/tex/test/expressions/luacas-collect.lua
index b40e8e3d09..b40e8e3d09 100644
--- a/macros/luatex/latex/luacas/tex/test/expressions/collect.lua
+++ b/macros/luatex/latex/luacas/tex/test/expressions/luacas-collect.lua
diff --git a/macros/luatex/latex/luacas/tex/test/expressions/equations.lua b/macros/luatex/latex/luacas/tex/test/expressions/luacas-equations.lua
index 3d6aa131fc..3d6aa131fc 100644
--- a/macros/luatex/latex/luacas/tex/test/expressions/equations.lua
+++ b/macros/luatex/latex/luacas/tex/test/expressions/luacas-equations.lua
diff --git a/macros/luatex/latex/luacas/tex/test/expressions/functions.lua b/macros/luatex/latex/luacas/tex/test/expressions/luacas-functions.lua
index e2c15096d6..e2c15096d6 100644
--- a/macros/luatex/latex/luacas/tex/test/expressions/functions.lua
+++ b/macros/luatex/latex/luacas/tex/test/expressions/luacas-functions.lua
diff --git a/macros/luatex/latex/luacas/tex/test/expressions/logarithms.lua b/macros/luatex/latex/luacas/tex/test/expressions/luacas-logarithms.lua
index 2813a6b8f5..2813a6b8f5 100644
--- a/macros/luatex/latex/luacas/tex/test/expressions/logarithms.lua
+++ b/macros/luatex/latex/luacas/tex/test/expressions/luacas-logarithms.lua
diff --git a/macros/luatex/latex/luacas/tex/test/expressions/rationalexponent.lua b/macros/luatex/latex/luacas/tex/test/expressions/luacas-rationalexponent.lua
index 85690f8c66..85690f8c66 100644
--- a/macros/luatex/latex/luacas/tex/test/expressions/rationalexponent.lua
+++ b/macros/luatex/latex/luacas/tex/test/expressions/luacas-rationalexponent.lua
diff --git a/macros/luatex/latex/luacas/tex/test/expressions/simplify.lua b/macros/luatex/latex/luacas/tex/test/expressions/luacas-simplify.lua
index ac5582901d..ac5582901d 100644
--- a/macros/luatex/latex/luacas/tex/test/expressions/simplify.lua
+++ b/macros/luatex/latex/luacas/tex/test/expressions/luacas-simplify.lua
diff --git a/macros/luatex/latex/luacas/tex/test/expressions/substitute.lua b/macros/luatex/latex/luacas/tex/test/expressions/luacas-substitute.lua
index 4d1f3496bf..4d1f3496bf 100644
--- a/macros/luatex/latex/luacas/tex/test/expressions/substitute.lua
+++ b/macros/luatex/latex/luacas/tex/test/expressions/luacas-substitute.lua
diff --git a/macros/luatex/latex/luacas/tex/test/helper.lua b/macros/luatex/latex/luacas/tex/test/luacas-helper.lua
index b550967da9..b550967da9 100644
--- a/macros/luatex/latex/luacas/tex/test/helper.lua
+++ b/macros/luatex/latex/luacas/tex/test/luacas-helper.lua
diff --git a/macros/luatex/latex/luacas/tex/test/main.lua b/macros/luatex/latex/luacas/tex/test/luacas-main.lua
index 638f7734b5..95f77885e4 100644
--- a/macros/luatex/latex/luacas/tex/test/main.lua
+++ b/macros/luatex/latex/luacas/tex/test/luacas-main.lua
@@ -1,8 +1,8 @@
---@diagnostic disable: lowercase-global
-- Runs test code from test files.
-require("calculus._init")
-require("_lib.pepperfish")
+require("calculus.luacas-calculus_init")
+require("_lib.luacas-pepperfish")
-- Stuff required for the basic parser.
local constants = {e="E", pi = "PI", ln = "LN", log = "LOG", Integer = "Integer", DD = "DD", int = "INT", abs = "ABS", fact="FACT"}
@@ -124,26 +124,26 @@ end
-- profiler = newProfiler()
-- profiler:start()
-require("test.calculus.derivatives")
-require("test.calculus.integrals")
-
-require("test.expressions.autosimplify")
-require("test.expressions.collect")
-require("test.expressions.equations")
-require("test.expressions.simplify")
-require("test.expressions.functions")
-require("test.expressions.logarithms")
--- require("test.expressions.rationalexponent")
-require("test.expressions.substitute")
-
-require("test.polynomials.polynomial")
-require("test.polynomials.partialfractions")
-require("test.polynomials.polynomialmod")
-require("test.polynomials.roots")
-
-require("test.rings.conversion")
-require("test.rings.modulararithmetic")
-require("test.rings.number")
+require("test.calculus.luacas-derivatives")
+require("test.calculus.luacas-integrals")
+
+require("test.expressions.luacas-autosimplify")
+require("test.expressions.luacas-collect")
+require("test.expressions.luacas-equations")
+require("test.expressions.luacas-simplify")
+require("test.expressions.luacas-functions")
+require("test.expressions.luacas-logarithms")
+-- require("test.expressions.luacas-rationalexponent")
+require("test.expressions.luacas-substitute")
+
+require("test.polynomials.luacas-polynomial")
+require("test.polynomials.luacas-partialfractions")
+require("test.polynomials.luacas-polynomialmod")
+require("test.polynomials.luacas-roots")
+
+require("test.rings.luacas-conversion")
+require("test.rings.luacas-modulararithmetic")
+require("test.rings.luacas-number")
endall()
diff --git a/macros/luatex/latex/luacas/tex/test/parser.lua b/macros/luatex/latex/luacas/tex/test/luacas-parser.lua
index 6cb22a1bdb..3380549620 100644
--- a/macros/luatex/latex/luacas/tex/test/parser.lua
+++ b/macros/luatex/latex/luacas/tex/test/luacas-parser.lua
@@ -2,7 +2,7 @@
-require("calculus._init")
+require("calculus.luacas-calculus_init")
-- Splits a string on a seperator.
function split(str, sep)
diff --git a/macros/luatex/latex/luacas/tex/test/polynomials/partialfractions.lua b/macros/luatex/latex/luacas/tex/test/polynomials/luacas-partialfractions.lua
index 280d4d56f3..280d4d56f3 100644
--- a/macros/luatex/latex/luacas/tex/test/polynomials/partialfractions.lua
+++ b/macros/luatex/latex/luacas/tex/test/polynomials/luacas-partialfractions.lua
diff --git a/macros/luatex/latex/luacas/tex/test/polynomials/polynomial.lua b/macros/luatex/latex/luacas/tex/test/polynomials/luacas-polynomial.lua
index 545538c764..545538c764 100644
--- a/macros/luatex/latex/luacas/tex/test/polynomials/polynomial.lua
+++ b/macros/luatex/latex/luacas/tex/test/polynomials/luacas-polynomial.lua
diff --git a/macros/luatex/latex/luacas/tex/test/polynomials/polynomialmod.lua b/macros/luatex/latex/luacas/tex/test/polynomials/luacas-polynomialmod.lua
index 1906ad2d72..1906ad2d72 100644
--- a/macros/luatex/latex/luacas/tex/test/polynomials/polynomialmod.lua
+++ b/macros/luatex/latex/luacas/tex/test/polynomials/luacas-polynomialmod.lua
diff --git a/macros/luatex/latex/luacas/tex/test/polynomials/roots.lua b/macros/luatex/latex/luacas/tex/test/polynomials/luacas-roots.lua
index 01975ab1ec..01975ab1ec 100644
--- a/macros/luatex/latex/luacas/tex/test/polynomials/roots.lua
+++ b/macros/luatex/latex/luacas/tex/test/polynomials/luacas-roots.lua
diff --git a/macros/luatex/latex/luacas/tex/test/rings/conversion.lua b/macros/luatex/latex/luacas/tex/test/rings/luacas-conversion.lua
index b9eb523c7a..b9eb523c7a 100644
--- a/macros/luatex/latex/luacas/tex/test/rings/conversion.lua
+++ b/macros/luatex/latex/luacas/tex/test/rings/luacas-conversion.lua
diff --git a/macros/luatex/latex/luacas/tex/test/rings/modulararithmetic.lua b/macros/luatex/latex/luacas/tex/test/rings/luacas-modulararithmetic.lua
index 1bd315595a..1bd315595a 100644
--- a/macros/luatex/latex/luacas/tex/test/rings/modulararithmetic.lua
+++ b/macros/luatex/latex/luacas/tex/test/rings/luacas-modulararithmetic.lua
diff --git a/macros/luatex/latex/luacas/tex/test/rings/number.lua b/macros/luatex/latex/luacas/tex/test/rings/luacas-number.lua
index 9afea0d364..9afea0d364 100644
--- a/macros/luatex/latex/luacas/tex/test/rings/number.lua
+++ b/macros/luatex/latex/luacas/tex/test/rings/luacas-number.lua