Remove unused function logmask_to_str
Do not calculate the scope for keywords and punctuators as they never
end up in the output anyway.