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

bitfield_gen: properly escape backslash #1250

Merged
merged 2 commits into from
May 27, 2024
Merged

bitfield_gen: properly escape backslash #1250

merged 2 commits into from
May 27, 2024

Conversation

lsf37
Copy link
Member

@lsf37 lsf37 commented May 20, 2024

Replace "\<" in strings with "\\<". Until recently python did not complain about this illegal escape sequence, but now it warns.

I've checked that we're not replacing anything in raw strings (r"..." and r'...').

Replace "\<"" in strings with "\\<". Until recently python did not
complain about this illegal escape sequence, but now it warns.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
@lsf37 lsf37 added the hw-build do all sel4test hardware builds on this PR label May 20, 2024
@lsf37 lsf37 requested a review from Indanz May 20, 2024 04:22
@lsf37 lsf37 self-assigned this May 20, 2024
Copy link
Contributor

@Indanz Indanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the '' in the output though? That is, why not just remove the '' instead?

It's probably clearer if all strings that can be made raw are, instead of all this escaping.

@lsf37
Copy link
Member Author

lsf37 commented May 20, 2024

The " in the output is part of the Isabelle syntax, i.e. what we want to produce are strings like

definition x :: "some_type \<Rightarrow> some_other_type" where

Using raw strings would be nicer in many places, but that needs actual thinking about where that is appropriate. A lot of these are templates with substitution etc.

@lsf37 lsf37 removed the hw-build do all sel4test hardware builds on this PR label May 27, 2024
@lsf37 lsf37 merged commit ddeb18a into master May 27, 2024
43 checks passed
@lsf37 lsf37 deleted the lsf37/bitfield-escape branch May 27, 2024 04:34
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

Successfully merging this pull request may close these issues.

None yet

2 participants