translator_comments.append((lineno, value))
break
elif funcname and call_stack == 0:
- if tok == OP and value == ')':
+ nested = (tok == NAME and value in keywords)
+ if (tok == OP and value == ')') or nested:
if buf:
messages.append(''.join(buf))
del buf[:]
messages = []
translator_comments = []
in_translator_comments = False
+ if nested:
+ funcname = value
elif tok == STRING:
# Unwrap quotes in a safe manner, maintaining the string's
# encoding