Lines Matching refs:value
30 def ToGNString(value: str, allow_dicts: bool=True) -> str:
36 if isinstance(value, str):
37 if value.find('\n') >= 0:
40 value.replace('\\', '\\\\').replace('"', '\\"').replace('$', '\\$') + \
43 if isinstance(value, str):
44 return ToGNString(value.encode('utf-8'))
46 if isinstance(value, bool):
47 if value:
51 if isinstance(value, list):
52 return '[ %s ]' % ', '.join(ToGNString(v) for v in value)
54 if isinstance(value, dict):
58 for key in sorted(value):
61 result += "%s = %s\n" % (key, ToGNString(value[key], False))
64 if isinstance(value, int):
65 return str(value)
132 def UnescapeGNString(value: list) -> str:
140 while i < len(value):
141 if value[i] == '\\':
142 if i < len(value) - 1:
143 next_char = value[i + 1]
152 result.append(value[i])