-
Notifications
You must be signed in to change notification settings - Fork 22
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
Concrete ident for coq #1073
Concrete ident for coq #1073
Conversation
abdcd67
to
9e36cb0
Compare
For Coq I cannot name tuple fields, 0,1,2,.., furthermore fields need to be unique, so we should use the path in the name of the fields. This naming also has to be consistent when used elsewhere, so I changing this in concrete ident. |
96e7a0e
to
3305abc
Compare
390a82a
to
1abd124
Compare
73ae346
to
f0517ad
Compare
Arguments t_Foo:clear implicits. | ||
Arguments t_Foo. | ||
|
||
Record t_Bar : Type := | ||
{ | ||
0 : t_Foo; | ||
t_Bar_0 : t_Foo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a solution to tuple structs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think enum_constructor_name_transform
will do the job as well.
Such a choice need to be backend specific
@@ -47,13 +47,13 @@ Export Hax_lib (t_int). | |||
|
|||
Record t_Foo : Type := | |||
{ | |||
f_field : t_u8; | |||
t_Foo_f_field : t_u8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a solution to overlapping field names in structs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see!
Then you need to improve the name policies API: the binding enum_constructor_name_transform
is what you want, but you need to add an extra argument "struct_name" or something, just as I did for enum_constructor_name_transform
.
Do you see what I mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, yes. Makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😃
Let's chat if something looks odd or whatever, I'm available, just ping me if needed :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will also fix the issue I had, with overwriting keywords (e.g. end
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! 🎉
f0517ad
to
1587ec2
Compare
1587ec2
to
14904e9
Compare
Closed in favor of #1108, which has more features |
Move concrete ident modifications for Coq backend (#987) to separate PR.