- local function unesc_digits (x)
- if x:sub(1,1)=="\\" then return x end -- Hack to parse correctly "\\123"
- local k, j, i = x:reverse():byte(1, 3)
+ local function unesc_digits (backslashes, digits)
+ if #backslashes%2==0 then
+ -- Even number of backslashes, they escape each other, not the digits.
+ -- Return them so that unesc_letter() can treaat them
+ return backslashes..digits
+ else
+ -- Remove the odd backslash, which escapes the number sequence.
+ -- The rest will be returned and parsed by unesc_letter()
+ backslashes = backslashes :sub (1,-2)
+ end
+ local k, j, i = digits:reverse():byte(1, 3)