1.1 --- a/lib/__builtins__/str.py Sun Jan 29 18:52:35 2017 +0100
1.2 +++ b/lib/__builtins__/str.py Sun Jan 29 22:56:43 2017 +0100
1.3 @@ -96,10 +96,20 @@
1.4
1.5 while i < end:
1.6 c = self[i]
1.7 - n = ord(c)
1.8 +
1.9 + # Handle quotes before anything else.
1.10 +
1.11 + if c == quote:
1.12 + b.append("\\")
1.13 + b.append(quote)
1.14 + i += 1
1.15 + last = i
1.16 + continue
1.17
1.18 # Extended unquoted text.
1.19
1.20 + n = ord(c)
1.21 +
1.22 if 32 <= n < 128:
1.23 i += 1
1.24 continue
1.25 @@ -110,10 +120,7 @@
1.26
1.27 # Add quoted value.
1.28
1.29 - if c == quote:
1.30 - b.append("\\")
1.31 - b.append(quote)
1.32 - elif c == "\t":
1.33 + if c == "\t":
1.34 b.append("\\t")
1.35 elif c == "\n":
1.36 b.append("\\n")
1.37 @@ -530,8 +537,8 @@
1.38 intervals.
1.39 """
1.40
1.41 - self._check_index(start)
1.42 - self._check_end_index(end)
1.43 + start = self._confine_index(start)
1.44 + end = self._confine_index(end)
1.45 check_int(step)
1.46
1.47 if step == 0: