Closed ntrel closed 8 months ago
Note that keeping Cpp1 apostrophe as digit separator caused this parsing complication. Personally I think underscore reads much nicer (and is used in many other languages) and wouldn't need special tracking here.
The last point of https://github.com/hsutter/cppfront/issues/289#issuecomment-1480594843 also addresses a comment about using something other than '
as a digit separator.
@ntrel It's possible that underscore would conflict with user defined literals.
Not really.
0_0
separates.
0_d
UDLs.
This is a valid UDL. https://www.godbolt.org/z/sn8r9a3zv https://www.godbolt.org/z/PvnK3jvMj
double operator ""_0(const char* args);
Now that there is no comma operator, could comma be used instead?
On 8 December 2023 16:55:28 gregmarr @.***> wrote:
@ntrelhttps://github.com/ntrel It's possible that underscore would conflict with user defined literals.
— Reply to this email directly, view it on GitHubhttps://github.com/hsutter/cppfront/pull/881#issuecomment-1847521542, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AALUZQNDERFHIXPFZDDJCOTYINA75AVCNFSM6AAAAABAMZ5ODSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBXGUZDCNJUGI. You are receiving this because you are subscribed to this thread.Message ID: @.***>
No.
For ambiguities, see https://www.reddit.com/r/cpp/comments/18canwt/small_rant_the_comma_operator_is_one_of_the_worst/.
One example is f(1,2)
.
Is that 12
, or 1
and 2
?
Oof, yeah how could I have missed such a blatant ambiguity...
On 8 December 2023 17:42:28 Johel Ernesto Guerrero Peña @.***> wrote:
No. For ambiguities, see https://www.reddit.com/r/cpp/comments/18canwt/small_rant_the_comma_operator_is_one_of_the_worst/. One example is f(1,2). Is that 12, or 1 and 2?
— Reply to this email directly, view it on GitHubhttps://github.com/hsutter/cppfront/pull/881#issuecomment-1847579696, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AALUZQKCACPZWDHGEOGQ2BLYINGQFAVCNFSM6AAAAABAMZ5ODSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBXGU3TSNRZGY. You are receiving this because you commented.Message ID: @.***>
Thanks for this! I appreciate the PR, but I ended up fixing it a different way (using a shortcut to try not to duplicate as much of numeric literal parsing during brace matching, but if we discover problems with that we can look at this PR again). Again, thanks very much.
Fixes #862.