MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / InsertCurlysIfRequired

Method InsertCurlysIfRequired

CodeGenerator.cpp:5135–5149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5133//-----------------------------------------------------------------------------
5134
5135void CodeGenerator::InsertCurlysIfRequired(const Stmt* stmt)
5136{
5137 const bool requiresCurlys{not isa<InitListExpr>(stmt) and not isa<ParenExpr>(stmt) and
5138 not isa<CXXDefaultInitExpr>(stmt)};
5139
5140 if(requiresCurlys) {
5141 mOutputFormatHelper.Append('{');
5142 }
5143
5144 InsertArg(stmt);
5145
5146 if(requiresCurlys) {
5147 mOutputFormatHelper.Append('}');
5148 }
5149}
5150//-----------------------------------------------------------------------------
5151
5152void CodeGenerator::WrapInParensOrCurlys(const BraceKind braceKind,

Callers 1

InsertCXXMethodHeaderMethod · 0.80

Calls 1

AppendMethod · 0.80

Tested by

no test coverage detected