diff --git a/tools/python/jwutils/stree/serdes.py b/tools/python/jwutils/stree/serdes.py index c36fd2b..c712438 100644 --- a/tools/python/jwutils/stree/serdes.py +++ b/tools/python/jwutils/stree/serdes.py @@ -6,14 +6,18 @@ def _cleanup_line(line): r = '' in_quote = None for c in line: - if c == in_quote: - in_quote = None + # slog(DEBUG, "in_quote = >" + str(in_quote) + "<") + if in_quote is not None: + if c == in_quote: + in_quote = None else: if c in [ '"', "'" ]: in_quote = c elif in_quote is None and c == '#': return r.strip() r += c + if len(r) >= 2 and r[0] in [ '"', "'" ] and r[-1] == r[0]: + return r[1:-1] return r def parse(s): # export @@ -23,6 +27,7 @@ def parse(s): # export for line in s.splitlines(): slog(DEBUG, "line=", line) line = _cleanup_line(line) + #slog(DEBUG, "cleaned line=", line) if not len(line): continue if line[0] == '[':