texlive[73897] branches/branch2024.final/Master/texmf-dist: jsonparse

commits+karl at tug.org commits+karl at tug.org
Tue Feb 11 21:55:33 CET 2025


Revision: 73897
          https://tug.org/svn/texlive?view=revision&revision=73897
Author:   karl
Date:     2025-02-11 21:55:33 +0100 (Tue, 11 Feb 2025)
Log Message:
-----------
jsonparse (branch) (11feb25)

Modified Paths:
--------------
    branches/branch2024.final/Master/texmf-dist/doc/latex/jsonparse/README.md
    branches/branch2024.final/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.pdf
    branches/branch2024.final/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.tex
    branches/branch2024.final/Master/texmf-dist/tex/latex/jsonparse/jsonparse.sty

Modified: branches/branch2024.final/Master/texmf-dist/doc/latex/jsonparse/README.md
===================================================================
--- branches/branch2024.final/Master/texmf-dist/doc/latex/jsonparse/README.md	2025-02-11 20:55:25 UTC (rev 73896)
+++ branches/branch2024.final/Master/texmf-dist/doc/latex/jsonparse/README.md	2025-02-11 20:55:33 UTC (rev 73897)
@@ -1,18 +1,24 @@
-![Version 1.1.1](https://img.shields.io/badge/version-1.1.1-blue)
+![Version 1.1.2](https://img.shields.io/badge/version-1.1.2-blue)
 
 ![Jason, the JSON parsing horse](https://github.com/jasperhabicht/jsonparse/assets/6378801/ddfddc70-bf5f-4121-ba45-4b9128875d85)
 
 # The `jsonparse` package
 
-The `jsonparse` package provides a handy way to read in JSON data from files or strings in LaTeX documents, parse the data and store it in a user-defined token variable. The package allows accessing the stored data via a JavaScript-flavored syntax.
+The `jsonparse` package provides a handy way to read in JSON data from files 
+or strings in LaTeX documents, parse the data and store it in a user-defined 
+token variable. The package allows accessing the stored data via a 
+JavaScript-flavored syntax.
 
-Using the commands `\JSONParseFromFile` or `\JSONParse`, JSON data can be stored in a token variable. Using the command `\JSONParseValue`, entries can be extracted from the stored data.
+Using the commands `\JSONParseFromFile` or `\JSONParse`, JSON data can be 
+stored in a token variable. Using the command `\JSONParseValue`, entries can 
+be extracted from the stored data.
 
 ---
 
-Let's assume a file with the name `example.json` is stored in the working directory with the following contents:
+Let's assume a file with the name `example.json` is stored in the working 
+directory with the following contents:
 
-```
+```json
 {
   "givenName": "Joe",
   "familyName": "Public",
@@ -42,14 +48,38 @@
 }
 ```
 
-We can store it in the token variable `\myJSONdata` using the command `\JSONParseFromFile{\myJSONdata}{example.json}`. Calling the command `\JSONParseValue{\myJSONdata}{contactPoint[0].telephone}` would then result in the output `+1 (555) 555-1234` (indices are zero-based per default). 
+We can store it in the token variable `\myJSONdata` using the command 
+`\JSONParseFromFile{\myJSONdata}{example.json}`. Calling the command 
+`\JSONParseValue{\myJSONdata}{contactPoint[0].telephone}` would then result in 
+the output `+1 (555) 555-1234` (indices are zero-based per default). The 
+package allows for parsing JSON data inline as well.
 
-The package also offers several commands for looping through arrays and accessing individual elements, for example to typeset them in tabular form. 
+The package also offers several commands for looping through arrays and 
+accessing individual elements, for example to typeset them in tabular form or 
+to plot their values using packages such as PGFPlots.
 
-The package also provides a few helper commands such as to validate a JSON number or to convert Unicode surrogate pairs to the relevant Unicode codepoint.
+Adding commas between the items of the children array can be done with:
+```tex
+\JSONParseArrayValues{\myJSONdata}{children}{, }
+```
 
+A tabular listing the contact points of above JSON file can be created with:
+```tex
+\begin{tabular}{cc}
+\textbf{Contact Type} & \textbf{Telephone} \\
+\JSONParseArrayMapInline{\myJSONdata}{contactPoint}{%
+  \JSONParseValue{\myJSONdata}{contactPoint[#1].contactType} & 
+  \JSONParseValue{\myJSONdata}{contactPoint[#1].telephone} \\
+}
+\end{tabular}
+```
+
+The package also provides a few helper commands such as to validate a JSON 
+number or to convert Unicode surrogate pairs to the relevant Unicode codepoint.
+
 ---
 
-This package including all files is subject to the LPPL 1.3c license. Copyright 2024–2025 Jasper Habicht (mail(at)jasperhabicht.de).
+This package including all files is subject to the LPPL 1.3c license. 
+Copyright 2024–2025 Jasper Habicht (mail(at)jasperhabicht.de).
 
 Jason, the JSON parsing horse: Copyright 2024–2025 Hannah Klöber.

Modified: branches/branch2024.final/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.pdf
===================================================================
(Binary files differ)

Modified: branches/branch2024.final/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.tex
===================================================================
--- branches/branch2024.final/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.tex	2025-02-11 20:55:25 UTC (rev 73896)
+++ branches/branch2024.final/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.tex	2025-02-11 20:55:33 UTC (rev 73897)
@@ -11,8 +11,8 @@
 % This work has the LPPL maintenance status `maintained'.
 %
 \documentclass[a4paper]{article}
-\def\jsonparsefileversion{1.1.1}
-\def\jsonparsefiledate{3 February 2025}
+\def\jsonparsefileversion{1.1.2}
+\def\jsonparsefiledate{8 February 2025}
 
 \usepackage[T1]{fontenc}
 \usepackage{Alegreya}
@@ -47,6 +47,7 @@
         {>}{{{\color{black!50}\guilsinglright}}}1,
     keywords={},
     moredelim=[is][\bfseries]{|}{|},
+    moredelim=[is][\bfseries\itshape]{?}{?},
     moredelim=[is][\color{black!50}]{!}{!},
 }
 \lstdefinestyle{jsonparsedoccodeexample}{
@@ -127,10 +128,13 @@
     outer arc=2.5pt,
     colframe=black!10,
     colback=black!10,
-    title style hook/.style={}
+    title style hook/.style={},
+    optional hypertarget/.code={
+      \IfValueT{#1}{\pgfkeysalso{hypertarget=#1}}
+    }
 }
 
-\NewTCBListing{macrodef}{ s }{
+\NewTCBListing{macrodef}{ s o }{
     listing only,
     listing style={jsonparsedocmacro},
     grow to left by=2cm,
@@ -137,6 +141,7 @@
     boxrule=0pt,
     after={\par\smallskip\noindent},
     enhanced,
+    optional hypertarget={#2},
     overlay={
       \IfBooleanT{#1}{
         \fill[black!50, shift={([xshift={-10pt}, yshift={-10pt-0.5em}]frame.north east)}]
@@ -233,6 +238,7 @@
 \changes{v1.0.3}{2025/01/26}{Test for valid JSON numbers expandable.}
 \changes{v1.1.0}{2025/01/30}{Unified names of user functions; renaming key for keywords.}
 \changes{v1.1.1}{2025/02/03}{Added option to store result of mapped inline function.}
+\changes{v1.1.2}{2025/02/08}{Added option to store result of array function.}
 
 \begin{document}
 \vspace*{-1cm}
@@ -267,7 +273,7 @@
 
 In general, the package will read and store the JSON source and data as string, which means that all characters have category code 12 (``other''), except for spaces and (horizontal) tabs which have category code 10 (``space''). The \macro{\endlinechar} value is set to $-1$ which means that linefeeds and carriage returns are ignored by TeX. These settings are in line with the JSON specification of handling whitespace. Furthermore, if PDFLaTeX is used, the upper-half of the 8-bit range is set to ``active''. Additionally, JSON defines a small set of escape sequences and in order to be able to process these, the category code of the backslash is set to 0 (``escape'').
 
-During parsing, the package identifies JSON objects, arrays, strings, numbers, boolean values and null values from the JSON data. It stores all these values together with the relevant keys in a property list. Once the parsing process is done, every value can be retrieved from the property list by calling the relevant key. The package ignores whitespace in the JSON data. The JSON data should be an object or an array. In general, the package accepts any valid JSON data.
+During parsing, the package identifies JSON objects, arrays, strings, numbers, boolean values and null values from the JSON data. It stores all these values together with the relevant keys in a property list. Once the parsing process is done, every value can be retrieved from the property list by calling the relevant key. The package ignores whitespace in the JSON data. The JSON data should be an object or an array. In general, the package accepts any valid JSON data. If a key is defined multiple times, the latter definition will silently overwrite the former.
 
 \section{Escaping and special treatment of the input}\label{sec:escaping}
 
@@ -327,6 +333,10 @@
 
 \section{Main user commands}
 
+The first part of this section describes the basic commands for parsing JSON data and retrieving values from parsed JSON data. The second part of this section describes the various commands for handling arrays provided by this package.
+
+\subsection{Basic parsing commands}
+
 \begin{macrodef}
 |\JSONParse|[<options>]{<token variable>}{<JSON string>}
 \end{macrodef}
@@ -401,6 +411,15 @@
 \end{macrodef}
 The command \macro{\JSONParseFilter} is used to select a part (such as an object or an array) of a JSON object or JSON array and parse this into a token variable (a property list). The first argument denotes the token variable where the value should be stored into. The second argument of the command takes the token variable that holds the parsed JSON data. The third argument takes the key to select the relevant entry from the parsed JSON data using JavaScript syntax.
 
+\subsection{Commands for handling arrays}
+
+The package offers a variety of commands that can be used to process JSON arrays. Three commands are provided to loop through arrays, \macro{\JSONParseArrayUse}, \macro{\JSONParseArrayMapFunction} and \macro{\JSONParseArrayMapInline} which offer different functionality for different use cases. All three commands are implemented in a unique way and it should not be expected that what works with one of these commands also works with another. The commands differ in various respects, for example:
+
+\begin{itemize}
+  \item With \macro{\JSONParseArrayUse} and \macro{\JSONParseArrayMapInline}, it is possible to store the result in a token list for later use via the option key \macro{store in}, but such is not possible with \macro{\JSONParseArrayMapFunction}.
+  \item It is possible to store non-expandable commands (such as \macro{\emph} or \macro{\textbf}) in a token list using \macro{\JSONParseArrayUse}, but not using \macro{\JSONParseArrayMapInline}.
+\end{itemize}
+
 \begin{macrodef}
 |\JSONParseArrayCount|{<token variable>}{<key>}
 \end{macrodef}
@@ -411,7 +430,7 @@
 \end{macrodef}
 The command \macro{\JSONParseSetArrayCount} takes as second argument a token variable holding a parsed JSON string or JSON file and as third argument a key to select an array in the JSON data. It stores the number of items contained in the selected array in the token variable given in the first argument of the command.
 
-\begin{macrodef}
+\begin{macrodef}[macro:arrayuse]
 |\JSONParseArrayUse|[<options>]{<token variable>}{<key>}[<subkey>]{<string>}
 \end{macrodef}
 The command \macro{\JSONParseArrayUse} is used to select all values from an array from a parsed JSON string or JSON file. The second argument takes the token variable that holds the parsed JSON data. The first argument takes the key to select the relevant entry from the parsed JSON data using JavaScript syntax. The third argument is optional and can be used to pass a subkey, i.\,e.\ a key that is used to select a value for every item. The last argument takes a string that is inserted between all values when they are typeset.
@@ -441,6 +460,24 @@
 For reasons of backward compatibility , the command \macro{\JSONParseArrayValues} is defined as alias of \macro{\JSONParseArrayUse}.
 
 \begin{macrodef}
+|store in|={<token variable>}
+\end{macrodef}
+
+The command \macro{\JSONParseArrayUse} accepts as option set in the optional argument the key \macro{store in} which takes a token variable into which the result of the command should be stored. Storing the result of the mapped inline function can be helpful if JSON data should be reformatted for use in another function.
+
+\begin{codeexamplecolumns}
+\JSONParseArrayUse[store in=\myJSONitems]
+  {\myJSONdata}{array}[key_a]{,}
+
+\begin{tikzpicture}
+  \foreach \x [count=\i] in \myJSONitems {
+    \fill[blue] (\i,0) circle[radius=2pt]
+      node[above=5pt, black] {\x};
+  }
+\end{tikzpicture}
+\end{codeexamplecolumns}
+
+\begin{macrodef}[macro:arraymapfunction]
 |\JSONParseArrayMapFunction|[<options>]{<token variable>}{<key>}[<subkey>]
   {<command>}
 \end{macrodef}
@@ -548,12 +585,8 @@
 
 Note that the underscores in the names of the keys can be printed without changing to math mode in the above example because all JSON data is stored as string where all characters (except for spaces and tabs) have category code 12 (``other'').
 
-\begin{macrodef}
-|store in|={<token variable>}
-\end{macrodef}
+The command \macro{\JSONParseArrayMapInline} accepts as option set in the optional argument the key \macro{store in} which takes a token variable into which the result of the mapped inline function should be stored. Refer to the relevant explanations to command \macro{\JSONParseArrayUse} \hyperlink{macro:arrayuse}{above} for more information. It is important to note that the inline function needs to be fully expandable. For example, it is not possible to use \macro{\JSONParseValue} in the code of the inline function while \macro{\JSONParseExpandableValue} is allowed.
 
-The command \macro{\JSONParseArrayMapInline} accepts as option set in the optional argument the key \macro{store in} which takes a token variable into which the result of the mapped inline function should be stored. It is important to note that the inline function needs to be fully expandable. For example, it is not possible to use \macro{\JSONParseValue} in the code of the inline function while \macro{\JSONParseExpandableValue} is allowed.
-
 Storing the result of the mapped inline function can be helpful if JSON data should be reformatted for use in a plotting functions. An example for a use case with PGFplots is shown below. In this example, the parsed JSON string \macro{{ "data": [ [0,0], [1,-1], [2,1] ] }} was stored in the token variable \macro{\myJSONplotdata}.
 
 \JSONParse{\myJSONplotdata}{ { "data": [ [0,0], [1,-1], [2,1] ] } }
@@ -561,7 +594,7 @@
 
 \begin{codeexamplecolumns}
 \JSONParseArrayMapInline
-[store in={\myJSONplotcoords}]
+  [store in={\myJSONplotcoords}]
   {\myJSONplotdata}{data}{
     (
     \JSONParseExpandableValue
@@ -574,13 +607,13 @@
 
 \begin{tikzpicture}
   \begin{axis}
-    \addplot coordinates 
+    \addplot coordinates
       {\myJSONplotcoords};
   \end{axis}
 \end{tikzpicture}
 \end{codeexamplecolumns}
 
-\subsection{Externalizing parsed JSON data}\label{sec:externalizing}
+\section{Externalizing parsed JSON data}\label{sec:externalizing}
 
 Parsing large and complex JSON files can take quite a while. In order to speed up follow-up compilation runs, this package provides a way to store parsed JSON data for future use. Once a file for externalization has been created, the package will try to load the data from this file instead of parsing the JSON data again.
 
@@ -618,7 +651,7 @@
 \end{macrodef}
 The command \macro{\JSONParsePut} is used by the externalization procedure to re-read already parsed JSON data to the main file. It just adds a key-value pair to the property list (where the value part is read as string). Hence, it can also be used to append more entries to an already existing property list containing parsed JSON data.
 
-\subsection{Changing separators, output and other options}\label{sec:options}
+\section{Changing parsing and typesetting behavior via option keys}\label{sec:options}
 
 The package provides a set of keys that can be set to change the separators used to select the relevant value in the JSON structure, the output that is generated from the JSON data as well as other things.
 
@@ -625,11 +658,11 @@
 \begin{macrodef}
 |\JSONParseSet|{<options>}
 \end{macrodef}
-The command \macro{\JSONParseSet} can be used to specify options via key-value pairs (separated by commas). Keys that are presented here as a subkey (i.\,e.\ preceded by another key and a slash such as \macro{key/subkey}) can also be set using the syntax \macro{key={subkey}} and multiple subkeys belonging to one key can be combined using commas as separator. Several user commands allow to pass keys directly which are then applied locally. 
+The command \macro{\JSONParseSet} can be used to specify options via key-value pairs (separated by commas). Keys that are presented here as a subkey (i.\,e.\ preceded by another key and a slash such as \macro{key/subkey}) can also be set using the syntax \macro{key={subkey}} and multiple subkeys belonging to one key can be combined using commas as separator. Several user commands allow to pass keys directly which are then applied locally.
 
 Not every key takes effect in every situation. Some keys affect the parsing procedure and thus need to be set before parsing. Some keys affect the typeset result and some keys only affect the typeset result when used in combination with specific commands.
 
-\subsubsection{Keys affecting the parsing procedure}
+\subsection{Keys affecting the parsing procedure}
 
 Information about the key \macro{externalize} as well as about the related keys \macro{externalize prefix} and \macro{externalize file name} can be found above in section \ref{sec:externalizing}.
 
@@ -638,7 +671,7 @@
 separator/|array left|={<string>}
 separator/|array right|={<string>}
 \end{macrodef}
-With the key \macro{separator/child}, the separator for child objects that is used in the key to select a specific value in the JSON data structure can be changed. Per default, the child separator is a dot (\macro{.}). 
+With the key \macro{separator/child}, the separator for child objects that is used in the key to select a specific value in the JSON data structure can be changed. Per default, the child separator is a dot (\macro{.}).
 
 With the keys \macro{separator/array left} and \macro{separator/array right}, the separators for arrays that are used in the key to select a specific value in the JSON data structure can be changed. Per default, the separators are square brackets (\macro{[} and \macro{]}). Changing these separators to curly braces (\macro{{}}) is not supported due to their grouping function in TeX.
 
@@ -650,7 +683,7 @@
 |zero-based|
 |zero-based|={<boolean>}
 \end{macrodef}
-If the key \macro{zero-based} is set (or explicitly set to \macro{true}), the index of array items starts with zero. If set to false, the indexing starts with one instead. Per default, the package uses zero-based indexing to match JavaScript notation. This setting affects indexing already during parsing. 
+If the key \macro{zero-based} is set (or explicitly set to \macro{true}), the index of array items starts with zero. If set to false, the indexing starts with one instead. Per default, the package uses zero-based indexing to match JavaScript notation. This setting affects indexing already during parsing.
 
 This key can be set using \macro{\JSONParseSet}. It can also be set locally as option to the commands \macro{\JSONParse} and \macro{\JSONParseFromFile}. When set using \macro{\JSONParseSet}, this key only takes effect when set before parsing.
 
@@ -662,10 +695,16 @@
 
 This key can be set using \macro{\JSONParseSet}. It can also be set locally as option to the commands \macro{\JSONParse} and \macro{\JSONParseFromFile}.
 
-\subsubsection{Keys affecting the typesetting}
+\subsection{Keys affecting the typesetting}
 
-Information about the keys \macro{escape} and \macro{rescan} can be found above in section \ref{sec:escaping}. Information about the keys \macro{code before} and \macro{code after} can be found above in the description to the command \macro{\JSONParseArrayMapFunction}. Information about the key \macro{store in} can be found above in the description to the command \macro{\JSONParseArrayMapInline}.
+Some keys that change the typesetting behavior are explained in other parts of this documentation.
 
+\begin{itemize}
+\item Information about the keys \macro{escape} and \macro{rescan} can be found above in section \ref{sec:escaping}.
+\item Information about the key \macro{store in} can be found above in the description to the commands \macro{\JSONParseArrayUse} and \macro{\JSONParseArrayMapInline} \hyperlink{macro:arrayuse}{above}.
+\item Information about the keys \macro{code before} and \macro{code after} can be found above in the description to the command \macro{\JSONParseArrayMapFunction} \hyperlink{macro:arraymapfunction}{above}.
+\end{itemize}
+
 \begin{macrodef}
 keyword/|true|={<string>}
 keyword/|false|={<string>}
@@ -686,17 +725,20 @@
 
 These keys can be set using \macro{\JSONParseSet}. They can also be set locally as option to the commands \macro{\JSONParseValue}, \macro{\JSONParseArrayUse} and \macro{\JSONParseArrayMapFunction}.
 
-\subsection{L3 commands}
+\section{L3 commands}
 
-The following commands are provided for defining user functions by package authors.
+The following commands are provided for defining user functions by package authors. For the conditional functions described above, apart from the variant that provides a true and a false branch, the and variants that only provide an argument for the true or for the false branch respectively are defined as well which is indicated by the letters {\itshape\macro{TF}} printed in italics.
 
 \begin{macrodef}
 |\jsonparse_parse:n| {<JSON string>}
+|\jsonparse_parse:o| {<JSON string>}
+|\jsonparse_parse:e| {<JSON string>}
 \end{macrodef}
 The command \macro{\jsonparse_parse:n} takes as argument a JSON string and populates the token variable (property list) \macro{\g_jsonparse_entries_prop} with key-value pairs representing all elements of the JSON data structure represented by this string. This command does not escape the input in any way.
 
 \begin{macrodef}
 |\jsonparse_parse_to_prop:Nn| <token variable> {<JSON string>}
+|\jsonparse_parse_to_prop:Ne| <token variable> {<JSON string>}
 \end{macrodef}
 The command \macro{\jsonparse_parse_to_prop:Nn} creates the token variable given as the first arguments as property list and, after having called \macro{\jsonparse_parse:n} using the second argument, sets this newly created property list equal to \macro{\g_jsonparse_entries_prop}. If escaping is activated, this command will pre-process the input according to the selected escaping mode before forwarding it to \macro{\jsonparse_parse:n}. See more on escaping above in section \ref{sec:escaping}.
 
@@ -706,6 +748,36 @@
 The command \macro{\jsonparse_parse_keys:NN} processes the token variable given as the first arguments as property list and selects all top-level keys which are then stored in the string variable as JSON array. The pseudo key \macro{.} (or the string defined using the key \macro{child sep}) to select the complete JSON data is ignored. If the JSON data is an array, the indices (wrapped into the separators defined by \macro{separator/array left} and \macro{separator/array right}) of the items are used as keys.
 
 \begin{macrodef}
+|\jsonparse_rescan:n| {<JSON value>}
+|\jsonparse_rescan:e| {<JSON value>}
+\end{macrodef}
+The command \macro{\jsonparse_rescan:n} rescans the JSON value given in the argument. Rescanning converts all tokens to their default category codes and TeX control sequences are expanded. Further, during the rescanning process, JSON escape sequences are replaced and characters that don't require escaping in JSON but in TeX are replaced by the relevant TeX escape sequences.
+
+\begin{macrodef}
+|\jsonparse_set_rescan:Nn| <token variable> {<JSON value>}
+|\jsonparse_set_rescan:Ne| <token variable> {<JSON value>}
+\end{macrodef}
+The command \macro{\jsonparse_set_rescan:Nn} rescans the JSON value given in the second argument and stores the result in the token variable specified in the second argument.
+
+\begin{macrodef}
+|\jsonparse_gset_rescan:Nn| <token variable> {<JSON value>}
+|\jsonparse_gset_rescan:Ne| <token variable> {<JSON value>}
+\end{macrodef}
+The command \macro{\jsonparse_set_rescan:Nn} rescans the JSON value given in the second argument and stores the result globally in the token variable specified in the second argument.
+
+\begin{macrodef}
+|\jsonparse_put_right_rescan:Nn| <token variable> {<JSON value>}
+|\jsonparse_put_right_rescan:Ne| <token variable> {<JSON value>}
+\end{macrodef}
+The command \macro{\jsonparse_put_right_rescan:Nn} rescans the JSON value given in the second argument and adds the result to the end of the token variable specified in the second argument.
+
+\begin{macrodef}
+|\jsonparse_gput_right_rescan:Nn| <token variable> {<JSON value>}
+|\jsonparse_gput_right_rescan:Ne| <token variable> {<JSON value>}
+\end{macrodef}
+The command \macro{\jsonparse_gput_right_rescan:Nn} rescans the JSON value given in the second argument and adds the result globally to the end of the token variable specified in the second argument.
+
+\begin{macrodef}
 |\jsonparse_filter:Nn| <token variable> {<key>}
 \end{macrodef}
 The command \macro{\jsonparse_filter:Nn} processes the token variable given as the first arguments as property list and filters it according to the key given as second argument. Filtering means that for every entry in the property list, the key of this entry is compared against the key given to the command. If the key in the property list starts with the given key, the matching part is removed from the key in the property list. If the keys do not match, the entry is completely removed from the property list. If the second argument matches the pseudo key \macro{.} (or the string defined using the key \macro{child sep}) excactly, the complete property list except for this key is returned.
@@ -716,42 +788,37 @@
 The command \macro{\jsonparse_array_count:NN} processes the token variable given as the first arguments as property list and, assuming that it is an array, counts its items and stores the result in the integer variable. If the token variable does not expand to a key that represents an array item, that is if the key does not start with the character defined by \macro{separator/array left}, the command will return an error. The command \macro{\JSONParseArrayCount} serves as a wrapper of this command.
 
 \begin{macrodef}*
-|\jsonparse_if_num:nTF| {<string>} {<true code>} {<false code>}
-|\jsonparse_if_num:nT| {<string>} {<true code>}
-|\jsonparse_if_num:nF| {<string>} {<false code>}
+|\jsonparse_if_num:n|?TF? {<string>} {<true code>} {<false code>}
 |\jsonparse_if_num_p:n| {<string>}
 \end{macrodef}
 The expandable conditional function \macro{\jsonparse_if_num:nTF} checks whether a string is a valid JSON number according the relevant specification. It executes the true code if the string is a valid JSON number and the false code if not. The variants that only provide an argument for the true or false case work accordingly. The command \macro{\jsonparse_if_num_p:n} returns a boolean true or false (i.\,e.\ \macro{\c_true_bool} or \macro{\c_false_bool}).
 
 \begin{macrodef}*
-|\jsonparse_unicode_if_high_surrogate:nTF| {<codepoint>}
+|\jsonparse_unicode_if_high_surrogate:n|?TF? {<codepoint>}
   {<true code>} {<false code>}
-|\jsonparse_unicode_if_high_surrogate:nT| {<codepoint>} {<true code>}
-|\jsonparse_unicode_if_high_surrogate:nF| {<codepoint>} {<false code>}
+|\jsonparse_unicode_if_high_surrogate:e|?TF? {<codepoint>}
+  {<true code>} {<false code>}
 |\jsonparse_unicode_if_high_surrogate_p:n| {<codepoint>}
+|\jsonparse_unicode_if_high_surrogate_p:e| {<codepoint>}
 \end{macrodef}
-The expandable conditional function \macro{\jsonparse_unicode_if_high_surrogate:nTF} checks whether the codepoint entered as argument (an integer that can be hexadecimal if preceded by \macro{"}) is in the range of \macro{"D800} and \macro{"DBFF} which means that it is the first part of a surrogate pair (a high surrogate). The variants that only provide an argument for the true or false case work accordingly. The command \macro{\jsonparse_unicode_if_high_surrogate_p:n} returns a boolean true or false (i.\,e.\ \macro{\c_true_bool} or \macro{\c_false_bool}).
+The expandable conditional function \macro{\jsonparse_unicode_if_high_surrogate:nTF} checks whether the codepoint entered as argument (an integer that can be hexadecimal if preceded by \macro{"}) is in the range of \macro{"D800} and \macro{"DBFF} which means that it is the first part of a surrogate pair (a high surrogate). The conditional function executes the true or false code depending on the evaluation. The variants that only provide an argument for the true or false case work accordingly. The command \macro{\jsonparse_unicode_if_high_surrogate_p:n} returns a boolean true or false (i.\,e.\ \macro{\c_true_bool} or \macro{\c_false_bool}).
 
-The variants \macro{\jsonparse_unicode_if_high_surrogate:eTF} etc.\ are predefined for this conditional function.
-
 \begin{macrodef}*
-|\jsonparse_unicode_if_low_surrogate:nTF| {<codepoint>}
+|\jsonparse_unicode_if_low_surrogate:n|?TF? {<codepoint>}
   {<true code>} {<false code>}
-|\jsonparse_unicode_if_low_surrogate:nT| {<codepoint>} {<true code>}
-|\jsonparse_unicode_if_low_surrogate:nF| {<codepoint>} {<false code>}
+|\jsonparse_unicode_if_low_surrogate:e|?TF? {<codepoint>}
+  {<true code>} {<false code>}
 |\jsonparse_unicode_if_low_surrogate_p:n| {<codepoint>}
+|\jsonparse_unicode_if_low_surrogate_p:e| {<codepoint>}
 \end{macrodef}
-The expandable conditional function \macro{\jsonparse_unicode_if_low_surrogate:nTF} checks whether the codepoint entered as argument (an integer that can be hexadecimal if preceded by \macro{"}) is in the range of \macro{"DC00} and \macro{"DFFF} which means that it is the last part of a surrogate pair (a low surrogate). The variants that only provide an argument for the true or false case work accordingly. The command \macro{\jsonparse_unicode_if_low_surrogate_p:n} returns a boolean true or false (i.\,e.\ \macro{\c_true_bool} or \macro{\c_false_bool}).
+The expandable conditional function \macro{\jsonparse_unicode_if_low_surrogate:nTF} checks whether the codepoint entered as argument (an integer that can be hexadecimal if preceded by \macro{"}) is in the range of \macro{"DC00} and \macro{"DFFF} which means that it is the last part of a surrogate pair (a low surrogate). The conditional function executes the true or false code depending on the evaluation. The variants that only provide an argument for the true or false case work accordingly. The command \macro{\jsonparse_unicode_if_low_surrogate_p:n} returns a boolean true or false (i.\,e.\ \macro{\c_true_bool} or \macro{\c_false_bool}).
 
-The variants \macro{\jsonparse_unicode_if_low_surrogate_p:eTF} etc.\ are predefined for this conditional function.
-
 \begin{macrodef}*
 |\jsonparse_unicode_convert_surrogate_pair:nn| {<codepoint>} {<codepoint>}
+|\jsonparse_unicode_convert_surrogate_pair:ee| {<codepoint>} {<codepoint>}
 \end{macrodef}
 The expandable command \macro{\jsonparse_unicode_convert_surrogate_pair:nn} converts a surrogate pair to the relevant Unicode codepoint. The returned value is an integer. It takes as first argument the codepoint of the low surrogate and as second argument the codepoint of the high surrogate. It does not check whether the codepoints actually belong to the relevant ranges of codepoints for high and low surrogates.
 
-The variant \macro{\jsonparse_unicode_convert_surrogate_pair:ee} is predefined.
-
 % =====
 
 \printchanges

Modified: branches/branch2024.final/Master/texmf-dist/tex/latex/jsonparse/jsonparse.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/latex/jsonparse/jsonparse.sty	2025-02-11 20:55:25 UTC (rev 73896)
+++ branches/branch2024.final/Master/texmf-dist/tex/latex/jsonparse/jsonparse.sty	2025-02-11 20:55:33 UTC (rev 73897)
@@ -10,7 +10,7 @@
 %
 % This work has the LPPL maintenance status `maintained'.
 %
-\ProvidesExplPackage {jsonparse} {2025-02-03} {1.1.1}
+\ProvidesExplPackage {jsonparse} {2025-02-08} {1.1.2}
   {A handy way to parse, store and access JSON data from files or strings in LaTeX documents}
 
 \msg_new:nnn { jsonparse } { old-kernel } {
@@ -46,7 +46,7 @@
 
 \msg_new:nnn { jsonparse } { nested-non-expandable } {
   \msg_error_text:n { jsonparse } \iow_newline:
-  Non-expandable ~ commands ~ such ~ as ~ \token_to_str:N \JSONParseValue \c_space_tl 
+  Non-expandable ~ commands ~ such ~ as ~ \token_to_str:N \JSONParseValue \c_space_tl
   not ~ allowed ~ in ~ inline ~ function. \iow_newline:
   Use ~ \token_to_str:N \JSONParseExpandableValue \c_space_tl instead.
 }
@@ -128,7 +128,7 @@
 
 \tl_new:N \l__jsonparse_array_map_code_before_tl
 \tl_new:N \l__jsonparse_array_map_code_after_tl
-\tl_new:N \g__jsonparse_array_map_store_in_tl
+\tl_new:N \l__jsonparse_array_map_store_in_tl
 
 \clist_new:N \l__jsonparse_unused_keys_clist
 
@@ -244,7 +244,7 @@
 }
 
 \keys_define:nn { jsonparse / map } {
-  store ~ in                  .tl_gset:N  = \g__jsonparse_array_map_store_in_tl
+  store ~ in                  .tl_set:N   = \l__jsonparse_array_map_store_in_tl
 }
 
 \cs_new_protected:Npn \__jsonparse_warning_unused_keys: {
@@ -270,7 +270,7 @@
   \cs_new:Npn \str_foldcase:n { \str_casefold:n }
 }
 
-\exp_args_generate:n { NoV }
+\exp_args_generate:n { NeoV }
 
 \cs_generate_variant:Nn \file_input:n { e }
 \cs_generate_variant:Nn \tl_gset:Nn { Ne , ce }
@@ -296,6 +296,7 @@
 \cs_generate_variant:Nn \keys_set_known:nnN { noN }
 \cs_generate_variant:Nn \iow_now:Nn { Ne }
 \cs_generate_variant:Nn \iow_open:Nn { Ne }
+\cs_generate_variant:Nn \codepoint_generate:nn { en }
 \cs_generate_variant:Nn \msg_error:nnn { nno }
 \cs_generate_variant:Nn \msg_error:nnnn { nnoo }
 \cs_generate_variant:Nn \msg_info:nnn { nne }
@@ -338,6 +339,7 @@
 \tl_new:N \g__jsonparse_json_tl
 \tl_new:N \l__jsonparse_input_tl
 \tl_new:N \l__jsonparse_temp_tl
+\tl_new:N \l__jsonparse_temp_copy_tl
 \tl_new:N \l__jsonparse_keys_tl
 \tl_new:N \l__jsonparse_keys_array_tl
 \tl_new:N \l__jsonparse_prefix_tl
@@ -358,7 +360,7 @@
 \tl_new:N \l__jsonparse_array_keys_index_roman_tl
 
 \str_new:N \l__jsonparse_array_values_key_str
-\tl_new:N \l__jsonparse_array_values_insert_tl
+\tl_new:N \l__jsonparse_array_values_sep_tl
 
 \clist_new:N \l__jsonparse_array_map_keys_clist
 \str_new:N \l__jsonparse_array_map_function_str
@@ -592,6 +594,7 @@
       \__jsonparse_parse_other:w \l__jsonparse_input_tl \q_stop
   }
 }
+\cs_generate_variant:Nn \jsonparse_parse:n { e , o }
 
 \cs_new_protected:Npn \jsonparse_parse_to_prop:Nn #1#2 {
   \bool_if:NT \l__jsonparse_debug_mode_bool {
@@ -609,6 +612,7 @@
     }
   }
 }
+\cs_generate_variant:Nn \jsonparse_parse_to_prop:Nn { Ne }
 
 % ===
 
@@ -871,7 +875,7 @@
     \tl_remove_once:Nn \l__jsonparse_remainder_tl { , }
   }
   \tl_if_empty:NF \l__jsonparse_remainder_tl {
-    \exp_args:No \jsonparse_parse:n { \l__jsonparse_remainder_tl }
+    \jsonparse_parse:o { \l__jsonparse_remainder_tl }
   }
 }
 
@@ -1000,7 +1004,7 @@
         \__jsonparse_nested_construct_cs:Noo \x \c_left_brace_str \c_right_brace_str
         \tl_set:Nn \obeyedline { ~ }
         \tl_gset_rescan:Nne \g__jsonparse_json_tl { \cctab_select:N \c__jsonparse_json_escape_cctab } {#3}
-        \exp_args:NNe \jsonparse_parse_to_prop:Nn #2 { \g__jsonparse_json_tl }
+        \jsonparse_parse_to_prop:Ne #2 { \g__jsonparse_json_tl }
       \group_end:
       \bool_if:NT \l__jsonparse_externalize_bool {
         \__jsonparse_externalize:Nn #2 { \l__jsonparse_externalize_file_name_tl .jsonparse }
@@ -1048,7 +1052,7 @@
         \cs_set:Npn \u { \exp_not:N \u }
         \file_get:nnN {#3} { \cctab_select:N \c__jsonparse_json_escape_cctab } \l__jsonparse_externalize_file_data_tl
         \tl_gset_eq:NN \g__jsonparse_json_tl \l__jsonparse_externalize_file_data_tl
-        \exp_args:NNe \jsonparse_parse_to_prop:Nn #2 { \g__jsonparse_json_tl }
+        \jsonparse_parse_to_prop:Ne #2 { \g__jsonparse_json_tl }
       \group_end:
       \bool_if:NT \l__jsonparse_externalize_bool {
         \__jsonparse_externalize:Nn #2 { \l__jsonparse_externalize_file_name_tl .jsonparse }
@@ -1103,7 +1107,7 @@
 \cs_new:Npn \__jsonparse_unicode_char_aux:nNNNN #1#2#3#4#5 {
   \tl_if_empty:nTF {#1} {
     \jsonparse_unicode_if_high_surrogate:eF { " \str_uppercase:n {#2#3#4#5} } {
-      \exp_args:Ne \codepoint_generate:nn { " \str_uppercase:n {#2#3#4#5} } { 12 }
+      \codepoint_generate:en { " \str_uppercase:n {#2#3#4#5} } { 12 }
     }
   } {
     \jsonparse_unicode_if_low_surrogate:eTF { " \str_uppercase:n {#2#3#4#5} } {
@@ -1112,7 +1116,7 @@
           { \str_uppercase:n {#1} } { " \str_uppercase:n {#2#3#4#5} }
       } { 12 }
     } {
-      \exp_args:Ne \codepoint_generate:nn { " \str_uppercase:n {#2#3#4#5} } { 12 }
+      \codepoint_generate:en { " \str_uppercase:n {#2#3#4#5} } { 12 }
     }
   }
 }
@@ -1153,28 +1157,57 @@
   }
 }
 
-\cs_new_protected:Npn \__jsonparse_rescan:n #1 {
+\cs_new_protected:Npn \jsonparse_rescan:n #1 {
   \group_begin:
     \__jsonparse_rescan_setup:Nn \l__jsonparse_temp_tl {#1}
     \tl_rescan:no { } { \l__jsonparse_temp_tl }
   \group_end:
 }
+\cs_generate_variant:Nn \jsonparse_rescan:n { e }
 
-\cs_new_protected:Npn \__jsonparse_gset_rescan:Nn #1#2 {
+\cs_new_protected:Npn \jsonparse_set_rescan:Nn #1#2 {
   \group_begin:
     \__jsonparse_rescan_setup:Nn \l__jsonparse_temp_tl {#2}
+    \tl_set_rescan:Nno #1 { } { \l__jsonparse_temp_tl }
+  \group_end:
+}
+\cs_generate_variant:Nn \jsonparse_set_rescan:Nn { Ne }
+
+\cs_new_protected:Npn \jsonparse_gset_rescan:Nn #1#2 {
+  \group_begin:
+    \__jsonparse_rescan_setup:Nn \l__jsonparse_temp_tl {#2}
     \tl_gset_rescan:Nno #1 { } { \l__jsonparse_temp_tl }
   \group_end:
 }
-\cs_generate_variant:Nn \__jsonparse_gset_rescan:Nn { Ne }
+\cs_generate_variant:Nn \jsonparse_gset_rescan:Nn { Ne }
 
+\cs_new_protected:Npn \jsonparse_put_right_rescan:Nn #1#2 {
+  \group_begin:
+    \tl_set_eq:NN \l__jsonparse_temp_copy_tl #1
+    \__jsonparse_rescan_setup:Nn \l__jsonparse_temp_tl {#2}
+    \tl_set_rescan:Nno #1 { } { \l__jsonparse_temp_tl }
+    \tl_put_left:NV #1 \l__jsonparse_temp_copy_tl
+  \group_end:
+}
+\cs_generate_variant:Nn \jsonparse_put_right_rescan:Nn { Ne }
+
+\cs_new_protected:Npn \jsonparse_gput_right_rescan:Nn #1#2 {
+  \group_begin:
+    \tl_set_eq:NN \l__jsonparse_temp_copy_tl #1
+    \__jsonparse_rescan_setup:Nn \l__jsonparse_temp_tl {#2}
+    \tl_gset_rescan:Nno #1 { } { \l__jsonparse_temp_tl }
+    \tl_gput_left:NV #1 \l__jsonparse_temp_copy_tl
+  \group_end:
+}
+\cs_generate_variant:Nn \jsonparse_gput_right_rescan:Nn { Ne }
+
 \NewDocumentCommand { \JSONParseValue } { O{} m m } {
   \__jsonparse_warning_undefined_prop:N #2
   \group_begin:
-    \keys_set_known:nn { jsonparse / typeset } {#1} \l__jsonparse_unused_keys_clist
+    \keys_set_known:nnN { jsonparse / typeset } {#1} \l__jsonparse_unused_keys_clist
     \__jsonparse_warning_unused_keys:
     \bool_if:NTF \l__jsonparse_rescan_bool {
-      \exp_args:Ne \__jsonparse_rescan:n { \prop_item:Ne #2 {#3} }
+      \jsonparse_rescan:e { \prop_item:Ne #2 {#3} }
     } {
       \prop_item:Ne #2 {#3}
     }
@@ -1198,7 +1231,7 @@
   \tl_if_exist:NF #1 {
     \tl_new:N #1
   }
-  \__jsonparse_gset_rescan:Ne #1 { \prop_item:Ne #2 {#3} }
+  \jsonparse_gset_rescan:Ne #1 { \prop_item:Ne #2 {#3} }
 }
 
 \cs_new_protected:Npn \__jsonparse_parse_keys:nn #1#2 {
@@ -1299,52 +1332,73 @@
   \bool_if:NTF \l__jsonparse_prop_map_first_bool {
     \bool_set_false:N \l__jsonparse_prop_map_first_bool
   } {
-    \l__jsonparse_array_values_insert_tl
+    \tl_if_empty:NTF \l__jsonparse_array_map_store_in_tl {
+      \l__jsonparse_array_values_sep_tl
+    } {
+      \exp_last_unbraced:No \tl_gput_right:NV \l__jsonparse_array_map_store_in_tl
+        \l__jsonparse_array_values_sep_tl
+    }
   }
   \bool_if:NTF \l__jsonparse_rescan_bool {
-    \exp_args:Ne \__jsonparse_rescan:n {
-      \prop_item:Ne \l__jsonparse_temp_copy_prop {
-        \l__jsonparse_array_sep_left_str
-        \bool_if:NTF \l__jsonparse_zero_based_bool {
-          \int_eval:n { #1 - 1 }
-        } {
-          #1
+    \tl_if_empty:NTF \l__jsonparse_array_map_store_in_tl {
+      \jsonparse_rescan:e {
+        \prop_item:Ne \l__jsonparse_temp_copy_prop {
+          \__jsonparse_array_use_index:n {#1}
         }
-        \l__jsonparse_array_sep_right_str
-        \str_if_empty:NF \l__jsonparse_array_values_key_str {
-          \l__jsonparse_child_sep_str
-          \l__jsonparse_array_values_key_str
+      }
+    } {
+      \exp_last_unbraced:No \jsonparse_gput_right_rescan:Ne \l__jsonparse_array_map_store_in_tl {
+        \prop_item:Ne \l__jsonparse_temp_copy_prop {
+          \__jsonparse_array_use_index:n {#1}
         }
       }
     }
   } {
-    \prop_item:Ne \l__jsonparse_temp_copy_prop {
-      \l__jsonparse_array_sep_left_str
-      \bool_if:NTF \l__jsonparse_zero_based_bool {
-        \int_eval:n { #1 - 1 }
-      } {
-        #1
+    \tl_if_empty:NTF \l__jsonparse_array_map_store_in_tl {
+      \prop_item:Ne \l__jsonparse_temp_copy_prop {
+        \__jsonparse_array_use_index:n {#1}
       }
-      \l__jsonparse_array_sep_right_str
-      \str_if_empty:NF \l__jsonparse_array_values_key_str {
-        \l__jsonparse_child_sep_str
-        \l__jsonparse_array_values_key_str
+    } {
+      \exp_last_unbraced:No \tl_gput_right:Ne \l__jsonparse_array_map_store_in_tl {
+        \prop_item:Ne \l__jsonparse_temp_copy_prop {
+          \__jsonparse_array_use_index:n {#1}
+        }
       }
     }
   }
 }
 
+\cs_new:Npn \__jsonparse_array_use_index:n #1 {
+  \l__jsonparse_array_sep_left_str
+  \bool_if:NTF \l__jsonparse_zero_based_bool {
+    \int_eval:n { #1 - 1 }
+  } {
+    #1
+  }
+  \l__jsonparse_array_sep_right_str
+  \str_if_empty:NF \l__jsonparse_array_values_key_str {
+    \l__jsonparse_child_sep_str
+    \l__jsonparse_array_values_key_str
+  }
+}
+
 \NewDocumentCommand { \JSONParseArrayUse } { O{} m m O{} m } {
   \__jsonparse_warning_undefined_prop:N #2
   \group_begin:
-    \keys_set_known:nn { jsonparse / typeset } {#1} \l__jsonparse_unused_keys_clist
+    \keys_set_known:nnN { jsonparse / typeset } {#1} \l__jsonparse_unused_keys_clist
+    \keys_set_known:noN { jsonparse / map } { \l__jsonparse_unused_keys_clist } \l__jsonparse_unused_keys_clist
     \__jsonparse_warning_unused_keys:
     \prop_set_eq:NN \l__jsonparse_temp_copy_prop #2
     \jsonparse_filter:Nn \l__jsonparse_temp_copy_prop {#3}
     \jsonparse_array_count:NN \l__jsonparse_temp_copy_prop \l__jsonparse_array_count_int
     \str_set:Ne \l__jsonparse_array_values_key_str {#4}
-    \tl_set:Nn \l__jsonparse_array_values_insert_tl {#5}
+    \tl_set:Nn \l__jsonparse_array_values_sep_tl {#5}
     \bool_set_true:N \l__jsonparse_prop_map_first_bool
+    \tl_if_empty:NF \l__jsonparse_array_map_store_in_tl {
+      \exp_last_unbraced:No \tl_if_exist:NF \l__jsonparse_array_map_store_in_tl {
+        \exp_last_unbraced:No \tl_new:N \l__jsonparse_array_map_store_in_tl
+      }
+    }
     \int_step_function:nN { \l__jsonparse_array_count_int }
       \__jsonparse_array_use:n
   \group_end:
@@ -1372,7 +1426,7 @@
   }
   \bool_if:NTF \l__jsonparse_rescan_bool {
     \tl_gset:cn { JSONParseArrayValue \l__jsonparse_array_keys_index_roman_tl } {
-      \exp_args:Ne \__jsonparse_rescan:n {
+      \jsonparse_rescan:e {
         \prop_item:Ne \l__jsonparse_temp_copy_prop {
           \l__jsonparse_array_sep_left_str
           \JSONParseArrayIndex
@@ -1411,7 +1465,7 @@
     }
     \bool_if:NTF \l__jsonparse_rescan_bool {
       \tl_gset:Nn \JSONParseArrayValue {
-        \exp_args:Ne \__jsonparse_rescan:n {
+        \jsonparse_rescan:e {
           \prop_item:Ne \l__jsonparse_temp_copy_prop {
             \l__jsonparse_array_sep_left_str
             \JSONParseArrayIndex
@@ -1458,7 +1512,7 @@
       {#5}
   }
   \group_begin:
-    \keys_set_known:nn { jsonparse / typeset } {#1} \l__jsonparse_unused_keys_clist
+    \keys_set_known:nnN { jsonparse / typeset } {#1} \l__jsonparse_unused_keys_clist
     \__jsonparse_warning_unused_keys:
     \prop_set_eq:NN \l__jsonparse_temp_copy_prop #2
     \jsonparse_filter:Nn \l__jsonparse_temp_copy_prop {#3}
@@ -1495,9 +1549,9 @@
 
 \cs_new:Npn \__jsonparse_array_map_inline_code:n #1 { }
 
-\cs_new:Npn \__jsonparse_array_map_inline:nn #1#2 {
-  \tl_if_empty:NT \g__jsonparse_array_map_store_in_tl {
-    \__jsonparse_array_map_inline_aux:nn {#1} {#2}
+\cs_new:Npn \__jsonparse_array_map_inline:nnn #1#2#3 {
+  \bool_if:nT {#1} {
+    \__jsonparse_array_map_inline_aux:nn {#2} {#3}
   }
 }
 
@@ -1512,7 +1566,7 @@
   \__jsonparse_warning_undefined_prop:N #2
   \cs_gset:Npn \__jsonparse_array_map_inline_code:n ##1 {#4}
   \group_begin:
-    \keys_set_known:nn { jsonparse / map } {#1} \l__jsonparse_unused_keys_clist
+    \keys_set_known:nnN { jsonparse / map } {#1} \l__jsonparse_unused_keys_clist
     \__jsonparse_warning_unused_keys:
     \prop_set_eq:NN \l__jsonparse_temp_copy_prop #2
     \jsonparse_filter:Nn \l__jsonparse_temp_copy_prop {#3}
@@ -1520,20 +1574,20 @@
     \bool_if:NT \l__jsonparse_zero_based_bool {
       \int_decr:N \l__jsonparse_array_count_int
     }
-    \tl_if_empty:NF \g__jsonparse_array_map_store_in_tl {
+    \tl_if_empty:NF \l__jsonparse_array_map_store_in_tl {
       \__jsonparse_warning_function_expandable:
-      \exp_last_unbraced:No \tl_if_exist:NF \g__jsonparse_array_map_store_in_tl {
-        \exp_last_unbraced:No \tl_new:N \g__jsonparse_array_map_store_in_tl
+      \exp_last_unbraced:No \tl_if_exist:NF \l__jsonparse_array_map_store_in_tl {
+        \exp_last_unbraced:No \tl_new:N \l__jsonparse_array_map_store_in_tl
       }
-      \exp_last_unbraced:No \tl_gset:Ne \g__jsonparse_array_map_store_in_tl {
+      \exp_last_unbraced:No \tl_gset:Ne \l__jsonparse_array_map_store_in_tl {
         \__jsonparse_array_map_inline_aux:oV { \l__jsonparse_zero_based_bool }
           \l__jsonparse_array_count_int
       }
     }
-    \exp_args:NNoV
+    \exp_args:NNeoV
   \group_end:
-  \__jsonparse_array_map_inline:nn { \l__jsonparse_zero_based_bool }
-    \l__jsonparse_array_count_int
+  \__jsonparse_array_map_inline:nnn { \tl_if_empty_p:N \l__jsonparse_array_map_store_in_tl }
+    { \l__jsonparse_zero_based_bool } \l__jsonparse_array_count_int
 }
 
 % ===



More information about the tex-live-commits mailing list.