Skip to content

Bracket support for #if and #endif in cpp#159997

Merged
hediet merged 1 commit intomicrosoft:mainfrom
OtherHorizon:main
Sep 5, 2022
Merged

Bracket support for #if and #endif in cpp#159997
hediet merged 1 commit intomicrosoft:mainfrom
OtherHorizon:main

Conversation

@OtherHorizon
Copy link

No description provided.

@aeschli
Copy link
Contributor

aeschli commented Sep 5, 2022

Calling #if and #elseif 'brackets' is a stretch and I don't think we do this in other languages...

@hediet
Copy link
Member

hediet commented Sep 5, 2022

@aeschli this is about #if and #endif (not #elseif). There are languages that use begin and end or even \begin and \end as bracket pairs.

What are your concerns about this new "bracket" pair?

@hediet hediet added this to the September 2022 milestone Sep 5, 2022
@aeschli
Copy link
Contributor

aeschli commented Sep 5, 2022

Sorry, yes, of course I meant endif.

Just worrying of unexpected issues and follow up work as we don't use brackets in that way yet. But I see in our source code we have examples and tests for keywords as brackets. Your call, @hediet

I assume #159586 is the motivating issue.

@aeschli aeschli self-requested a review September 5, 2022 09:31
@hediet hediet enabled auto-merge September 5, 2022 09:50
@hediet hediet merged commit 959cf13 into microsoft:main Sep 5, 2022
@jlelong
Copy link
Contributor

jlelong commented Sep 19, 2022

Trailing commas are not allowed in JSON objects. With this PR, the c++ language configuration file cannot read with standard JSON parser anymore.

@sean-mcmanus
Copy link
Contributor

@jlelong It's fixed with #161192 .

@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C/C++ Preprocessor #if and #endif should have distinct colors just like brackets

8 participants