-
Notifications
You must be signed in to change notification settings - Fork 109
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
lib: Requalify: better document annotation #813
Conversation
Looks like this needs more work, some issues with creative requalify in CRefine got me :( |
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 job working through this horrible issue and thank you for the detailed comment!
Previous attempts to update the code to allow ctrl+clicking on names resulted in markup overlap errors for arch_requalify commands. This was due to a misconception that YXML strings already containing correct position information (e.g. obtained via Parse.const) would be used directly by Proof_context.read_const/read_type_name. This is not the case. Instead, position information is adjusted for the content length, and since we add a prefix for L4V_ARCH, we got annotation that did not match the document text. After hours of digging to uncover the above issue, we get this: * the "check_parsed_nm" in gen_requalify was not an extra check, but a hook to do document annotation; updated comments * use Proof_Context.check_const/check_type_name with user-supplied name and parsed position of Parse.name, and manually report resulting markup (do not use previously resolved name as it could point to a hidden const/type) * since the above works for arch_requalify_const, the normal requalify_const becomes a simpler instance of it * the whole Parse.const/Parse.typ was a red herring and ultimately did not add anything to the code except for read_const/read_type_name interaction; removed The resulting code is simpler; large cautionary comments remain for future generations. Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Document/test surprising interactions of hide_const, locales and requalify for the purposes of temporarily making arch-specific constants visible in theory scope. Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
c11037f
to
e949698
Compare
Updated to fix the lookup of a resolved name, because somehow it's possible to look up a short name and get a qualified name that's been hidden... which for whatever reason is fine to create aliases to, but not find to resolve to (we use this in Kernel_C for temporarily making things visible to C Parser). |
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.
Cool. And impressive job finding all that out, this is about as arcane as it gets.
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.
Looks even better now with the tests passing! Once again, thank you for the thorough comments in the new test.
Previous attempts to update the code to allow ctrl+clicking on names resulted in markup overlap errors for arch_requalify commands. This was due to a misconception that YXML strings already containing correct position information (e.g. obtained via Parse.const) would be used directly by Proof_context.read_const/read_type_name. This is not the case. Instead, position information is adjusted for the content length, and since we add a prefix for L4V_ARCH, we got annotation that did not match the document text.
After hours of digging to uncover the above issue, we get this:
The resulting code is simpler; a large cautionary comment remains for future generations.