Is it possible to create function foo that takes list of arguments and this argument is also a list, e.g. to require the following semantics \foo[x:1,z,y:2], i.e. it takes three comma separated arguments x:1, y:2 and z, where x:1 is parsed into two arguments passing to another function inside foo and 1 is optional argument?
For example, suppose function \textoverset defined as follows:
\NewDocumentCommand{\textoverset}{ m m }{%
\tikz[baseline=(Root.base)]{%
\node[inner sep=0pt,
outer sep=0pt,
label={#3}] (Root) {#2};
}%
}
Suppose textoverset is utilised inside foo, so invoking \underline{\foo[x:1,z,y:2]} would give result depicted in the attachment.


I implicitly meant that under the
xcould be word of arbitrary length, so in this case all words are stuck together. Could you, please, suggest how to handle this?P.S. You answers do meet question conditions, which means the answer should be accepted, but I found out that I implicitly meant slightly different. What should I do in this case — accept answer and create another question, edit question and wait for other solutions?
– Vezzp Jul 05 '19 at 15:05\textoverset{worm}{1} \textoverset{yummy}{} \textoverset{zoo}{2}and\foo{worm:1,yummy,zoo:2}. In first case there is spacing between lower words, in the second — there is no.P.S. Got you.
– Vezzp Jul 05 '19 at 15:16