diff --git a/tools/python/jwutils/stree/serdes.py b/tools/python/jwutils/stree/serdes.py index 50e5c07..b3b575f 100644 --- a/tools/python/jwutils/stree/serdes.py +++ b/tools/python/jwutils/stree/serdes.py @@ -41,11 +41,20 @@ def parse(s): # export assert(len(sec) > 0) sec = '.'.join(sec.split('.')[0:-1]) continue - assignment = line.split('=') - if len(assignment) != 2: + lhs = '' + rhs = None + for c in line: + if rhs is None: + if c == '=': + rhs = '' + continue + lhs += c + continue + rhs += c + + if rhs is None: raise Exception("failed to parse assignment", line) - slog(DEBUG, "sec=", sec, "assignment=", assignment) - root.add(sec + '.' + cleanup_string(assignment[0]), quote(assignment[1])) + root.add(sec + '.' + cleanup_string(lhs), quote(cleanup_string(rhs))) return root def read(path): # export