rems-project / cerberus

Cerberus C semantics
https://www.cl.cam.ac.uk/~pes20/cerberus/
Other
39 stars 18 forks source link

[CN] Allow `'` in numeric constants #337

Open yav opened 2 weeks ago

yav commented 2 weeks ago

It'd be nice to allow _ in numeric constants, so you can write things like -2147483648_i32 or 0x_FFFF_FFFF.

If we do this, it would also be nice to update the pretty printers to add _ before the type suffix of constants (e.g., 0_i32 instead of 0i32).

bcpierce00 commented 2 weeks ago

Excellent onboarding project.

On Thu, Jun 20, 2024 at 5:56 AM Iavor S. Diatchki @.***> wrote:

It'd be nice to allow _ in numeric constants, so you can write things like -2147483648_i32 or 0x_FFFF_FFFF.

If we do this, it would also be nice to update the pretty printers to add _ before the type suffix of constants (e.g., 0_i32 instead of 0i32).

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/rems-project/cerberus/issues/337__;!!IBzWLUs!SX3SQiAgba4dS_ZYlX9_UFiWRTmq3rUSlv_Ba4zIRxYeXjbdF23ex0PEBC_s2v7WY_Mbit4h0lRT8x8R75giCHj1SXi6$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ABVQQC6WLL7UP7HKG64IGMDZIKRNHAVCNFSM6AAAAABJTTOUS2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGM3DIMBTGE2DGNI__;!!IBzWLUs!SX3SQiAgba4dS_ZYlX9_UFiWRTmq3rUSlv_Ba4zIRxYeXjbdF23ex0PEBC_s2v7WY_Mbit4h0lRT8x8R75giCOq96OYg$ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

dc-mak commented 1 week ago

Unfortunately, to match C23 and C++, the separator must be '.