@@ -1691,6 +1691,7 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
1691
1691
Indent += 2 ;
1692
1692
OS.indent (Indent);
1693
1693
PrintWithColorRAII (OS, ParenthesisColor) << ' (' ;
1694
+ PrintWithColorRAII (OS, ExprColor) << label;
1694
1695
OS << ' \n ' ;
1695
1696
printRec (E);
1696
1697
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
@@ -1749,6 +1750,15 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
1749
1750
1750
1751
return OS;
1751
1752
}
1753
+
1754
+ void printSemanticExpr (Expr * semanticExpr) {
1755
+ if (semanticExpr == nullptr ) {
1756
+ return ;
1757
+ }
1758
+
1759
+ OS << ' \n ' ;
1760
+ printRecLabeled (semanticExpr, " semantic_expr" );
1761
+ }
1752
1762
1753
1763
void visitErrorExpr (ErrorExpr *E) {
1754
1764
printCommon (E, " error_expr" );
@@ -1809,6 +1819,7 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
1809
1819
OS << ' \n ' ;
1810
1820
printRec (Segment);
1811
1821
}
1822
+ printSemanticExpr (E->getSemanticExpr ());
1812
1823
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
1813
1824
}
1814
1825
void visitMagicIdentifierLiteralExpr (MagicIdentifierLiteralExpr *E) {
@@ -1832,6 +1843,8 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
1832
1843
printArgumentLabels (E->getArgumentLabels ());
1833
1844
OS << " \n " ;
1834
1845
printRec (E->getArg ());
1846
+ printSemanticExpr (E->getSemanticExpr ());
1847
+ PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
1835
1848
}
1836
1849
1837
1850
void visitDiscardAssignmentExpr (DiscardAssignmentExpr *E) {
@@ -1983,20 +1996,16 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
1983
1996
OS << ' \n ' ;
1984
1997
printRec (elt);
1985
1998
}
1999
+ printSemanticExpr (E->getSemanticExpr ());
1986
2000
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
1987
2001
}
1988
2002
void visitDictionaryExpr (DictionaryExpr *E) {
1989
2003
printCommon (E, " dictionary_expr" );
1990
- if (auto semaE = E->getSemanticExpr ()) {
1991
- OS << ' \n ' ;
1992
- printRec (semaE);
1993
- PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
1994
- return ;
1995
- }
1996
2004
for (auto elt : E->getElements ()) {
1997
2005
OS << ' \n ' ;
1998
2006
printRec (elt);
1999
2007
}
2008
+ printSemanticExpr (E->getSemanticExpr ());
2000
2009
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
2001
2010
}
2002
2011
void visitSubscriptExpr (SubscriptExpr *E) {
@@ -2496,6 +2505,7 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
2496
2505
OS << ' \n ' ;
2497
2506
printRec (ExpTyR);
2498
2507
}
2508
+ printSemanticExpr (E->getSemanticExpr ());
2499
2509
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
2500
2510
}
2501
2511
void visitObjCSelectorExpr (ObjCSelectorExpr *E) {
0 commit comments