This is an archive of the discontinued LLVM Phabricator instance.

[clangd][tests] Fix delimiter handling
ClosedPublic

Authored by jkorous on Apr 18 2018, 5:44 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

jkorous created this revision.Apr 18 2018, 5:44 AM

Hi Sam, could you please take a look at this minor fix?

sammccall accepted this revision.Apr 19 2018, 4:17 AM

Oops, thanks! LG, optional suggestion

JSONRPCDispatcher.cpp
281 ↗(On Diff #142918)

This trades one gotcha (empty lines delimit) for another (---- looks valid, but isn't).
What about adding LineRef.startswith("-") to the original check?

This revision is now accepted and ready to land.Apr 19 2018, 4:17 AM

[ultranit] Sorry, just to be sure - did you really mean any number of dashes

if (LineRef.startswith("-") && LineRef.find_first_not_of('-') == llvm::StringRef::npos)

or at least three?

if (LineRef.startswith("---") && LineRef.find_first_not_of('-') == llvm::StringRef::npos)

[ultranit] Sorry, just to be sure - did you really mean any number of dashes

if (LineRef.startswith("-") && LineRef.find_first_not_of('-') == llvm::StringRef::npos)

or at least three?

if (LineRef.startswith("---") && LineRef.find_first_not_of('-') == llvm::StringRef::npos)

I meant any number, but at-least-three is fine too! Up to you.

This revision was automatically updated to reflect the committed changes.