This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] parse C# object initialisers
ClosedPublic

Authored by jbcoe on Mar 2 2020, 10:56 AM.

Details

Summary

Treat C# object initializers as braced lists.

Allow lambdas inside C# braced lists.

Diff Detail

Event Timeline

jbcoe created this revision.Mar 2 2020, 10:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2020, 10:56 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
krasimir added inline comments.Mar 3 2020, 11:47 AM
clang/lib/Format/UnwrappedLineParser.cpp
1978

I don't understand why this is needed, and removing this if does not cause any tests to fail.
Please add a test case that will fail if we remove this if, or consider removing otherwise.

jbcoe marked an inline comment as done.Mar 3 2020, 2:28 PM
jbcoe added inline comments.
clang/lib/Format/UnwrappedLineParser.cpp
1978

I'll remove this for now and put together a follow up patch with test cases for more obscure object initializer use cases.

jbcoe planned changes to this revision.Mar 3 2020, 2:30 PM
jbcoe updated this revision to Diff 248039.Mar 3 2020, 2:35 PM

Remove code without test coverage.

krasimir accepted this revision.Mar 4 2020, 4:04 AM

Thank you!

This revision is now accepted and ready to land.Mar 4 2020, 4:04 AM
This revision was automatically updated to reflect the committed changes.