Page MenuHomePhabricator

[clang-format] Recognize C# named argument colons as a token type
ClosedPublic

Authored by jbcoe on Feb 27 2020, 5:21 AM.

Details

Summary

No longer merge 'name' and ':' into a single token.

Ensure that line breaks cannot be placed before or after a named-argument colon.

Ensure that no space is inserted before a named-argument colon.

Diff Detail

Event Timeline

jbcoe created this revision.Feb 27 2020, 5:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2020, 5:21 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jbcoe edited the summary of this revision. (Show Details)Feb 27 2020, 5:28 AM
krasimir accepted this revision.Feb 27 2020, 5:29 AM

This is very nice! Brings the C# handling of the colon closer to other languages.

clang/lib/Format/TokenAnnotator.cpp
3498–3499

nit: please put this as an else if into the "// Language-specific stuff" section below.

This revision is now accepted and ready to land.Feb 27 2020, 5:29 AM
jbcoe updated this revision to Diff 246924.Feb 27 2020, 5:45 AM

Consolidate if blocks following review comment.

jbcoe marked an inline comment as done.Feb 27 2020, 5:45 AM
This revision was automatically updated to reflect the committed changes.