-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
✨ Allow #embed file replacement and preserve eol-tokens #5600
✨ Allow #embed file replacement and preserve eol-tokens #5600
Conversation
This is great! When I refactored the #include code, I did think about adding #embed, but it would've resulted in a messy PR at the time and then I forgot about it. So thanks! |
Well, good to hear I got to clean this up for you from the old idea! Anything I need to do in other places? I only found that I had to modify here through brute-force searching for things to change; any other places that need the regex handling changes? |
Text that comes after the `#embed` (or `#include`) is also now preserved, as in previous times they were ignored (this was allowed by both standards for `#include`, but the tokens that come after `#embed` do matter as they are parameters).
f8e5b23
to
441e238
Compare
I don't think so, I think it's all in here. But we'll give it a test or two |
Looks to be working correctly in various situations. Although I was unable to find a compiler that supports this yet, do you know of any? |
You can use the llvm/llvm-project#68620 |
Sorry, forgot to include a quick link: https://godbolt.org/z/Pb35fW7qs |
Ahhhh, thanks. I did try that, but with c++ and then I got a warning with the example that's on https://en.cppreference.com/w/c/preprocessor/embed
but that's of course just about the if_empty and not the embed itself Ok, cool |
Also I do not know how well this will work with binary files. After this goes live and you have an example that goes awry, let me know |
Weird, I must've goofed something up. But, thanks for merging! Here's to waiting 24 hours to see it hit the main site. 🎉 |
this is now live |
Text that comes after the
#embed
(or#include
) is also now preserved, as in previous times they were ignored (this was allowed by both standards for#include
, but the tokens that come after#embed
do matter as they are parameters).