-
Notifications
You must be signed in to change notification settings - Fork 26
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
Let pretty printing use OverloadedStrings #409
Let pretty printing use OverloadedStrings #409
Conversation
"bool" | ||
"char" | ||
"int" | ||
"string" |
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 believe that string
has been deprecated
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.
Yes, and we still give a warning when using that type! When it's completely removed from the compiler, the emacs-mode could also drop it.
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.
...on second thought, maybe the Emacs mode shouldn't encourage using string
if it's deprecated!
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 need to rebase anyway, so I'll remove this in the process.
apart from those two small comments, I am merging this as soon as it is rebased |
This commit refactors the pretty printing of C and Encore ASTs, mainly by using [OverloadedStrings](https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/guide-to-ghc-extensions/basic-syntax-extensions#overloadedstrings). This GHC extension lets you use string literals where another `String` like data-type is expected. The pretty printers work with the type `Doc`, meaning we had to write `text "*"` when we wanted a literal `"*"`. Now, the string literal is enough. Also cleaned up parts of the code and made the emacs mode more resilent to change.
Fixed and rebased! |
Merging in 15 min |
This commit refactors the pretty printing of C and Encore ASTs, mainly
by using OverloadedStrings. This GHC extension lets you use string literals
where another
String
like data-type is expected. The pretty printerswork with the type
Doc
, meaning we had to writetext "*"
when wewanted a literal
"*"
. Now, the string literal is enough. Also cleaned upparts of the code and made the emacs mode more resilent to change.