-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add formatting hints to numbers #344
Conversation
4f7d67f
to
15293a0
Compare
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.
Looking good so far! I really like the merging used in the primops - it's nice to try to preserve the styling where possible.
Good point about the endianness of the ASCII literals. I wasn't really sure about them when I first implemented them, but yeah, they might require some more thought. 🤔
Binary, | ||
Decimal, | ||
Hexadecimal, | ||
Ascii, |
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 wonder if calling this AsciiBe
would remind us of the endianness of this? But maybe just making an issue about this would be enough.
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.
A little research suggests that the common case is for these to be big-endian (E.g. OSType, PNG, AIFF, RIFF, AVI, WAV, DirectX, OpenType). Seems reasonable to just call it Ascii
for now.
Ok I addressed the comments. I originally opened this PR with some parts remaining but many have been addressed. So it's probably suitable for merging now, if you agree. |
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 good!
This is to allow the TestCommand to be able to select a different snapshot name based on the command being run.
Fixes #328
Opening this PR for feedback, before proceeding further. The PR adds int hints so that number literals and number patterns retain their original format. For example:
Possible further work
I think the extra— I've now done thisIntStyle
field inConst
messes upPartialEq
. Looks like I'll need to manually implement it and have it ignore that field.table_id
intable_record
inopentype.fathom
should use the ASCII format.core
.Propagate the style from the inputs to ops— I had a go at thisAdd some more tests