change instring to preserve quotes when not used to enclose a macro field

As it was, the code was excluding all quotes from arg, even in translatable strings.  Although this did not break any code that uses the args, I don't care for that behavior.
This commit is contained in:
Groggy Dice 2013-12-16 19:04:35 -05:00
parent 195399bcb2
commit 8660806c42

View file

@ -148,10 +148,10 @@ def parse_macroref(start, line):
if instring:
if line[i] == '"':
instring = False
else:
arg += line[i]
arg += line[i]
elif line[i] == '"':
instring = not instring
arg += line[i]
elif line[i] == "{":
if brackdepth > 0:
arg += line[i]
@ -173,6 +173,8 @@ def parse_macroref(start, line):
line[i].isspace() and \
brackdepth == 1 and \
parendepth == 0:
if arg.startswith('"') and arg.endswith('"'):
arg = arg[1:-1]
args.append(arg.strip())
arg = ""
elif not line[i].isspace() or parendepth > 0: