Element type definition with variables

Hi, excuse me, for example if I have this in my lines style:

highway=residential [0x01]

how can I make “0x01” a variable?

I mean, I would to do that:

surface=asphalt → var=0x01
surface=gravel → var=0x02

highway=residential [var]

It’s possible? How?
Thanks very much.

–enrico

I was wondering what this question was about until I saw http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q4/027283.html as well, so I guess it’s actually asking about “mkgmap”.