Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cpp.cond,cpp.predefined,version.syn] Highlight preprocessor dates #5125

Open
JohelEGP opened this issue Nov 24, 2021 · 13 comments
Open

[cpp.cond,cpp.predefined,version.syn] Highlight preprocessor dates #5125

JohelEGP opened this issue Nov 24, 2021 · 13 comments

Comments

@JohelEGP
Copy link
Contributor

This is a follow up for #5109. Code highlighting has been previously discussed at #572.

I have a working example at https://github.com/JohelEGP/draft/tree/highlight_cpp_dates that looks like this:

1637770981
1637770792
1637770771
1637770755

@JohelEGP
Copy link
Contributor Author

The month highlighted in light gray:
1637875889
1637875903
1637875939
1637875952
1637875970

@jensmaurer
Copy link
Member

Probably not.

@jensmaurer jensmaurer reopened this Nov 25, 2021
@jensmaurer
Copy link
Member

Sorry, this was ambiguous: I was specifically referring to the "grey month" version. We should form a wider consensus whether we want any color-based highlighting here at all.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Nov 25, 2021
@JohelEGP
Copy link
Contributor Author

I don't think the colors I chose do the proposal any justice. They look like hyperlinks, one unused and one used. Using bold didn't help; the code hardly looked any different.

@JohelEGP
Copy link
Contributor Author

I find this looks much nicer:
1637881502
1637881364
1637881349
1637881449
1637881523

@JohelEGP
Copy link
Contributor Author

JohelEGP commented Apr 1, 2023

My suggestions are a bit hideous. It'd be better to base the issue's resolution by referencing existing documents. This is probably clash with general code highlighting anyways.

@AlisdairM
Copy link
Contributor

I have previously prepared a PR that I did not push, where I used digit separators for all the long literals in the standard. In that case, these macros were rendered as:
#define __cpp_lib_addressof_constexpr. 2016'03L // also in <memory>

Is that something I should consider submitting instead?

The main intent in that PR was making the large numbers specified in the random numbers clause more readable.

@JohelEGP
Copy link
Contributor Author

JohelEGP commented Apr 1, 2023

Is that something I should consider submitting instead?

No, see:

This is a follow up for #5109.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 12, 2023

Editorial meeting decision: we prefer if we added digit separators, and that is an observable change that requires a (small) paper (with an Annex C change). Such a paper is warmly invited.

@jensmaurer jensmaurer removed the decision-required A decision of the editorial group (or the Project Editor) is required. label Jun 12, 2023
@JohelEGP

This comment was marked as resolved.

@jwakely
Copy link
Member

jwakely commented Jun 14, 2023

If ' were used to split dates, this idiom would stop working.

Why? The preprocessor understands digit separators and they don't affect the value.

@JohelEGP
Copy link
Contributor Author

You're right: https://compiler-explorer.com/z/ozK9xE5qs!
I didn't think that through enough.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 14, 2023

The breaking change is that stringification observes the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants