File tree 1 file changed +7
-6
lines changed 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -351,18 +351,20 @@ def get_pattern(self, ps):
351
351
elements = []
352
352
ps .skip_ws ()
353
353
354
- while ps .current ():
355
- ch = ps .current ()
354
+ ch = ps .current ()
355
+ while ch :
356
+ if ch == '\n ' :
357
+ break
356
358
357
359
if ch == '{' :
358
360
element = self .get_placeable (ps )
359
361
elements .append (element )
360
- elif ch == '\n ' :
361
- break
362
362
else :
363
363
element = self .get_text_element (ps )
364
364
elements .append (element )
365
365
366
+ ch = ps .current ()
367
+
366
368
return ast .Pattern (elements )
367
369
368
370
@with_span
@@ -387,13 +389,12 @@ def get_text_element(self, ps):
387
389
continue
388
390
389
391
elif ch == '\\ ' :
390
- ch2 = ps .peek ()
392
+ ch2 = ps .next ()
391
393
392
394
if ch2 == '{' or ch2 == '"' :
393
395
buf += ch2
394
396
else :
395
397
buf += ch + ch2
396
- ps .next ()
397
398
398
399
else :
399
400
buf += ch
You can’t perform that action at this time.
0 commit comments