@@ -4635,7 +4635,9 @@ void PrintAST::visitPostfixOperatorDecl(PostfixOperatorDecl *decl) {
4635
4635
});
4636
4636
}
4637
4637
4638
- void PrintAST::visitModuleDecl (ModuleDecl *decl) { }
4638
+ void PrintAST::visitModuleDecl (ModuleDecl *decl) {
4639
+
4640
+ }
4639
4641
4640
4642
void PrintAST::visitMissingDecl (MissingDecl *missing) {
4641
4643
Printer << " missing_decl" ;
@@ -4785,12 +4787,27 @@ void PrintAST::visitErrorExpr(ErrorExpr *expr) {
4785
4787
Printer << " <error>" ;
4786
4788
}
4787
4789
4788
- void PrintAST::visitTernaryExpr (TernaryExpr *expr) {}
4790
+ void PrintAST::visitTernaryExpr (TernaryExpr *expr) {
4791
+ if (auto condExpr = expr->getCondExpr ()) {
4792
+ visit (expr->getCondExpr ());
4793
+ }
4794
+ Printer << " ? " ;
4795
+ visit (expr->getThenExpr ());
4796
+ Printer << " : " ;
4797
+ if (auto elseExpr = expr->getElseExpr ()) {
4798
+ visit (expr->getElseExpr ());
4799
+ }
4800
+ }
4789
4801
4790
4802
void PrintAST::visitIsExpr (IsExpr *expr) {
4803
+ visit (expr->getSubExpr ());
4804
+ Printer << " is " ;
4805
+ printType (expr->getCastType ());
4791
4806
}
4792
4807
4793
4808
void PrintAST::visitTapExpr (TapExpr *expr) {
4809
+ printType (expr->getVar ()->getType ());
4810
+ printBraceStmt (expr->getBody ());
4794
4811
}
4795
4812
4796
4813
void PrintAST::visitTryExpr (TryExpr *expr) {
@@ -4871,6 +4888,9 @@ void PrintAST::visitDictionaryExpr(DictionaryExpr *expr) {
4871
4888
}
4872
4889
4873
4890
void PrintAST::visitArrowExpr (ArrowExpr *expr) {
4891
+ visit (expr->getArgsExpr ());
4892
+ Printer << " -> " ;
4893
+ visit (expr->getResultExpr ());
4874
4894
}
4875
4895
4876
4896
void PrintAST::visitAwaitExpr (AwaitExpr *expr) {
@@ -4913,6 +4933,7 @@ void PrintAST::visitTupleExpr(TupleExpr *expr) {
4913
4933
}
4914
4934
4915
4935
void PrintAST::visitTypeJoinExpr (TypeJoinExpr *expr) {
4936
+
4916
4937
}
4917
4938
4918
4939
void PrintAST::visitAssignExpr (AssignExpr *expr) {
@@ -4934,12 +4955,17 @@ void PrintAST::visitBinaryExpr(BinaryExpr *expr) {
4934
4955
}
4935
4956
4936
4957
void PrintAST::visitCoerceExpr (CoerceExpr *expr) {
4958
+ visit (expr->getSubExpr ());
4959
+ Printer << " as " ;
4960
+ printType (expr->getCastType ());
4937
4961
}
4938
4962
4939
4963
void PrintAST::visitOneWayExpr (OneWayExpr *expr) {
4964
+
4940
4965
}
4941
4966
4942
4967
void PrintAST::visitClosureExpr (ClosureExpr *expr) {
4968
+
4943
4969
}
4944
4970
4945
4971
void PrintAST::visitDeclRefExpr (DeclRefExpr *expr) {
@@ -4956,6 +4982,7 @@ void PrintAST::visitErasureExpr(ErasureExpr *expr) {
4956
4982
}
4957
4983
4958
4984
void PrintAST::visitKeyPathExpr (KeyPathExpr *expr) {
4985
+
4959
4986
}
4960
4987
4961
4988
void PrintAST::visitSingleValueStmtExpr (SingleValueStmtExpr *expr) {
@@ -4968,6 +4995,7 @@ void PrintAST::visitForceTryExpr(ForceTryExpr *expr) {
4968
4995
}
4969
4996
4970
4997
void PrintAST::visitSequenceExpr (SequenceExpr *expr) {
4998
+
4971
4999
}
4972
5000
4973
5001
void PrintAST::visitSuperRefExpr (SuperRefExpr *expr) {
0 commit comments