[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-09-05 Thread Marco Elver via Phabricator via cfe-commits
melver added a comment. In https://reviews.llvm.org/D51036#1223254, @sammccall wrote: > In https://reviews.llvm.org/D51036#1223230, @melver wrote: > > > Awaiting remaining reviewer acceptance. > > > > FYI: I do not have commit commit access -- what is the procedure to commit > > once diff is acc

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-09-05 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341450: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export'… (authored by sammccall, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://re

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-09-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. This revision is now accepted and ready to land. In https://reviews.llvm.org/D51036#1223254, @sammccall wrote: > In https://reviews.llvm.org/D51036#1223230, @melver wrote: > > > Awaiting remaining reviewer acceptance. > > > > FYI: I do not

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-09-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In https://reviews.llvm.org/D51036#1223230, @melver wrote: > Awaiting remaining reviewer acceptance. > > FYI: I do not have commit commit access -- what is the procedure to commit > once diff is accepted? > > Many thanks! Anyone with commit access can land it for you

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-09-04 Thread Marco Elver via Phabricator via cfe-commits
melver added a comment. Awaiting remaining reviewer acceptance. FYI: I do not have commit commit access -- what is the procedure to commit once diff is accepted? Many thanks! Repository: rC Clang https://reviews.llvm.org/D51036 ___ cfe-commits

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-27 Thread Marco Elver via Phabricator via cfe-commits
melver added inline comments. Comment at: lib/Format/Format.cpp:1312 auto &Line = *AnnotatedLines[i]; if (Line.startsWith(tok::kw_namespace) || + Line.startsWith(tok::kw_inline, tok::kw_namespace) || owenpan wrote: > sammccall wrote: > > th

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-27 Thread Marco Elver via Phabricator via cfe-commits
melver updated this revision to Diff 162653. melver marked 4 inline comments as done. melver added a comment. Many thanks! PTAL. Repository: rC Clang https://reviews.llvm.org/D51036 Files: lib/Format/Format.cpp lib/Format/FormatToken.h lib/Format/NamespaceEndCommentsFixer.cpp lib/For

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: lib/Format/UnwrappedLineFormatter.cpp:533-535 + !(Line.startsWith(tok::kw_namespace) || + Line.startsWith(tok::kw_inline, tok::kw_namespace) || + Line.startsWith(tok::kw_export, tok::kw

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: lib/Format/Format.cpp:1312 auto &Line = *AnnotatedLines[i]; if (Line.startsWith(tok::kw_namespace) || + Line.startsWith(tok::kw_inline, tok::kw_namespace) || sammccall wrote: > these 3 startswith c

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-24 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: unittests/Format/FormatTest.cpp:7582 Style); + verifyFormat("export namespace Foo\n" + "{};", you may want to add tests for other modules TS syntax (e.g. non-namespace export decls). It

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-24 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. Nice fix! Comment at: lib/Format/Format.cpp:1312 auto &Line = *AnnotatedLines[i]; if (Line.startsWith(tok::kw_namespace) || + Line.startsWith(tok::kw_inline, tok::kw_namespace) || --

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-22 Thread Marco Elver via Phabricator via cfe-commits
melver updated this revision to Diff 161960. melver marked 8 inline comments as done. melver added a comment. Many thanks for the suggestions! PTAL. Repository: rC Clang https://reviews.llvm.org/D51036 Files: lib/Format/Format.cpp lib/Format/FormatToken.h lib/Format/NamespaceEndCommen

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:1066-1072 +if (Style.isCpp()) { + nextToken(); + if (FormatTok->Tok.is(tok::kw_namespace)) { +parseNamespace(); +return; + } +} owenpan wrote: > `

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: lib/Format/NamespaceEndCommentsFixer.cpp:128-133 + // Detect "(inline|export)? namespace" in the beginning of a line. + if (NamespaceTok->is(tok::kw_inline) || NamespaceTok->is(tok::kw_export)) NamespaceTok = NamespaceTok->getNext

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: lib/Format/NamespaceEndCommentsFixer.cpp:129-130 + // Detect "(inline|export)? namespace" in the beginning of a line. + if (NamespaceTok->is(tok::kw_inline) || NamespaceTok->is(tok::kw_export)) NamespaceTok = NamespaceTok->getNext

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan requested changes to this revision. owenpan added a comment. This revision now requires changes to proceed. By the way, I didn't review the test cases. Comment at: lib/Format/FormatToken.h:524-525 +// Detect "(inline|export)? namespace" in the beginning of a line. +

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-21 Thread Marco Elver via Phabricator via cfe-commits
melver created this revision. Herald added a subscriber: cfe-commits. This fixes formatting namespaces with preceding 'inline' and 'export' (Modules TS) specifiers. This change fixes namespaces not being identified as such with preceding 'inline' or 'export' specifiers. Motivation: I was exper