You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we see that \typeout needs to have an expandable value: the log shows
Line 4: \JSONParseValue {\__prop_flatten:w \s__prop {$}}{array[0]}
Line 5: a-b
It seems that the \JSONParseArrayMapFunction may also need an expandable context. If I try to split \JSONParseArrayValue, then I end up seeing \jsonparse_rescan:e {<\JSONParseArrayValue>}, and the splitting doesn't work. In my case, I was able to specify rescan=false for the \JSONParseArrayMapFunction to have everything work out, but would it be possible to have \JSONParseExpandableArrayMapFunction or \JSONParseExpandableArrayValue? You mentioned in #54 that \JSONParseArrayMapInline is not expandable. Does this mean array maps are inherently non-expandable? Would I have been able to split if I had also needed to rescan?
Expandability in the context of handling arrays has been an issue from the very start and I tried to improve the existing functions already. It seems I need to revisit this again, but it may take some time. For now, this is not yet an answer, but only some first thoughts:
Note that \JSONParseArrayMapInline is indeed not fully expandable (and of course it depends on the inline code), but depending on the context, you should in most cases still be able to use it inside a list or tabular.
In some cases you can also try to use the store in key to save the result of the function in a token list variable that you can then use in other ways (see the PGFPlots example in the doc).
Now that I read your issue again in more detail, it rather seems to be an problem with rescanning. Due to the fact that \tl_rescan:nn is not expandable, there is no straight-forward way to process an expandable and also rescanned token list. The typical way to overcome this problem is to store the rescanned result in another token list variable and then use this.
You can make use of \jsonparse_rescan:n and/or \jsonparse_set_rescan:Nn to have better control about when and where the rescanning takes place:
Activity
jasperhabicht commentedon Jan 19, 2026
Expandability in the context of handling arrays has been an issue from the very start and I tried to improve the existing functions already. It seems I need to revisit this again, but it may take some time. For now, this is not yet an answer, but only some first thoughts:
Note that
\JSONParseArrayMapInlineis indeed not fully expandable (and of course it depends on the inline code), but depending on the context, you should in most cases still be able to use it inside a list or tabular.In some cases you can also try to use the
store inkey to save the result of the function in a token list variable that you can then use in other ways (see the PGFPlots example in the doc).jasperhabicht commentedon Jan 19, 2026
Now that I read your issue again in more detail, it rather seems to be an problem with rescanning. Due to the fact that
\tl_rescan:nnis not expandable, there is no straight-forward way to process an expandable and also rescanned token list. The typical way to overcome this problem is to store the rescanned result in another token list variable and then use this.You can make use of
\jsonparse_rescan:nand/or\jsonparse_set_rescan:Nnto have better control about when and where the rescanning takes place: