[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-22 Thread Robin Caloudis via cfe-commits
https://github.com/robincaloudis closed https://github.com/llvm/llvm-project/pull/92741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-22 Thread Robin Caloudis via cfe-commits
robincaloudis wrote: Thanks @owenca, @mydeveloperday and @HazardyKnusperkeks for the explanation and insights! I'm closing this issue as @owenca found a much better solution. https://github.com/llvm/llvm-project/pull/92741 ___ cfe-commits mailing

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-21 Thread Owen Pan via cfe-commits
owenca wrote: See #92880. https://github.com/llvm/llvm-project/pull/92741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-21 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > > Since I am by no means an expert on Clang, a few questions arose > > > > * As Clang formats the code correctly (no code changes necessary) when > > instead of `xor` a different function name e.g. `xooor` is used, I wonder > > why `xor` is tokenized as Unary

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-21 Thread via cfe-commits
mydeveloperday wrote: I thought we had some code like this around using a variable called "try" https://github.com/llvm/llvm-project/pull/92741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-21 Thread via cfe-commits
mydeveloperday wrote: Because if this code was in a .h and not a .c you wouldn't know what language you were in https://github.com/llvm/llvm-project/pull/92741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-21 Thread Owen Pan via cfe-commits
@@ -5280,7 +5280,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine , // handled. if (Left.is(tok::amp) && Right.is(tok::r_square)) return Style.SpacesInSquareBrackets; -return Style.SpaceAfterLogicalNot && Left.is(tok::exclaim); +return

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-21 Thread Owen Pan via cfe-commits
owenca wrote: > Since I am by no means an expert on Clang, a few questions arose > > * As Clang formats the code correctly (no code changes necessary) when > instead of `xor` a different function name e.g. `xooor` is used, I wonder why > `xor` is tokenized as Unary operator in the first place

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Robin Caloudis (robincaloudis) Changes Closes https://github.com/llvm/llvm-project/issues/92688 --- Full diff: https://github.com/llvm/llvm-project/pull/92741.diff 2 Files Affected: - (modified)

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-20 Thread Robin Caloudis via cfe-commits
https://github.com/robincaloudis ready_for_review https://github.com/llvm/llvm-project/pull/92741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-20 Thread Robin Caloudis via cfe-commits
robincaloudis wrote: Even though this PR gives us the correct behavior, I do not think it is good. Since I am by no means an expert on Clang, a few questions arose * Why is `xor` tokenized as unary operator even though it's a word token in C? * How to properly distinguish between keyword

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-20 Thread Robin Caloudis via cfe-commits
https://github.com/robincaloudis created https://github.com/llvm/llvm-project/pull/92741 Closes https://github.com/llvm/llvm-project/issues/92688 >From 9e8c360029fb6789360ad4296e2f14098db76dd6 Mon Sep 17 00:00:00 2001 From: Robin Caloudis Date: Mon, 20 May 2024 13:21:32 +0200 Subject: [PATCH