@@ -1380,7 +1380,7 @@ def _EvalDoubleQuoted(self, parts, part_vals):
1380
1380
# of (DoubleQuoted [Literal '']). This is better but it means we
1381
1381
# have to check for it.
1382
1382
if len (parts ) == 0 :
1383
- v = Piece ('' , True , False )
1383
+ v = word_ . PieceQuoted ('' )
1384
1384
part_vals .append (v )
1385
1385
return
1386
1386
@@ -1782,6 +1782,7 @@ def _EvalExtGlob(self, part, part_vals):
1782
1782
else :
1783
1783
op_str = lexer .LazyStr (op )
1784
1784
# Do NOT split these.
1785
+ # TODO: should be PieceQuoted
1785
1786
part_vals .append (Piece (op_str , False , False ))
1786
1787
1787
1788
for i , w in enumerate (part .arms ):
@@ -1857,18 +1858,18 @@ def _EvalWordPart(self, part, part_vals, flags):
1857
1858
elif case (word_part_e .BracedRangeDigit ):
1858
1859
part = cast (word_part .BracedRangeDigit , UP_part )
1859
1860
# This is the '5' in {1..10} - whether it's quoted should not
1860
- # matter
1861
+ # matter - it doesn't look like a glob
1861
1862
v = Piece (part .s , False , False )
1862
1863
part_vals .append (v )
1863
1864
1864
1865
elif case (word_part_e .EscapedLiteral ):
1865
1866
part = cast (word_part .EscapedLiteral , UP_part )
1866
- v = Piece (part .ch , True , False )
1867
+ v = word_ . PieceQuoted (part .ch )
1867
1868
part_vals .append (v )
1868
1869
1869
1870
elif case (word_part_e .SingleQuoted ):
1870
1871
part = cast (SingleQuoted , UP_part )
1871
- v = Piece (part .sval , True , False )
1872
+ v = word_ . PieceQuoted (part .sval )
1872
1873
part_vals .append (v )
1873
1874
1874
1875
elif case (word_part_e .DoubleQuoted ):
@@ -1904,7 +1905,7 @@ def _EvalWordPart(self, part, part_vals, flags):
1904
1905
# We never parse a quoted string into a TildeSub.
1905
1906
assert not quoted
1906
1907
s = self .tilde_ev .Eval (part )
1907
- v = Piece ( s , True , False ) # NOT split even when unquoted!
1908
+ v = word_ . PieceQuoted ( s )
1908
1909
part_vals .append (v )
1909
1910
1910
1911
elif case (word_part_e .ArithSub ):
@@ -2615,7 +2616,7 @@ def _EvalProcessSub(self, cs_part):
2615
2616
# type: (CommandSub) -> Piece
2616
2617
dev_path = self .shell_ex .RunProcessSub (cs_part )
2617
2618
# pretend it's quoted; no split or glob
2618
- return Piece (dev_path , True , False )
2619
+ return word_ . PieceQuoted (dev_path )
2619
2620
2620
2621
2621
2622
_DUMMY = '__NO_COMMAND_SUB__'
@@ -2659,7 +2660,7 @@ def _EvalCommandSub(self, cs_part, quoted):
2659
2660
def _EvalProcessSub (self , cs_part ):
2660
2661
# type: (CommandSub) -> Piece
2661
2662
# pretend it's quoted; no split or glob
2662
- return Piece ('__NO_PROCESS_SUB__' , True , False )
2663
+ return word_ . PieceQuoted ('__NO_PROCESS_SUB__' )
2663
2664
2664
2665
2665
2666
# vim: sw=4
0 commit comments