- Added example code for BreakStringLiterals;
Details
- Reviewers
MyDeveloperDay - Commits
- rG23b78364150c: [clang-format] update documentation
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This file is auto-generated from include/clang/format/Format.h. Changes need to be made there and then this files needs to be regenerated with docs/tools/dump_format_style.py. Sorry, we probably need to make that more obvious.
@mrexodia, Thank you for this patch, I'm sorry you've had no response, I'm trying to go through some of the old reviews.
This revision needs rebasing, at least some of the changes have been already made, and I'm not sure about the Mozilla Bracing Style is quite right, but your other examples will help to improve the documentation.
include/clang/Format/Format.h | ||
---|---|---|
447 ↗ | (On Diff #93818) | Are you sure this is correct? I tried a small example and didn't get this |
If I'm not mistaken the documentation I updated was not for BS_Mozilla, but for BS_Stroustrup. It's been a very long time though so I absolutely don't remember unfortunately.
I tried that too
--- Language: Cpp BreakBeforeBraces: Stroustrup ...
But I don't seem to get the style for that either, maybe I did something wrong?
try { foo(); } catch () { } void foo() { bar(); } class foo { }; if (foo()) { } else { }
Looking here https://en.wikipedia.org/wiki/Indentation_style#Variant:_Stroustrup I think the original document wasn't quite correct its the "cuddled" catch and else that the Stroustrup style doesn't have
i.e.
} else {
rather than
} else {
Okay I remember what happened now. In the past Allman and Stroustroup had the same documentation (Allman being incorrect), so I updated the documentation for Allman, but by accident I updated the documentation for Stroustroup instead. Anyway I went over the changes and will upload a new diff with the ones that are still relevant today.
When I land this change, I'll include the ClangFormatStyleOptions.rst to match (plus some minor NFC) in Format.h that are preventing dump_format_style.py from being rerun
in a later commit I'll try and bring the Format.h and ClangFormaatStyleOptions.rst back into line