-
-
Notifications
You must be signed in to change notification settings - Fork 664
Handle issue #20395 #22154
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
base: master
Are you sure you want to change the base?
Handle issue #20395 #22154
Conversation
| restore_symbols = false; | ||
| } | ||
|
|
||
|
|
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.
unrelated
d3447c8 to
f155bcd
Compare
|
I am a little skeptical about this. I would need to expand this for all D keywords in all type of code. but I don't think skipping them is the right call. maybe prepending a |
|
Thanks for your pull request and interest in making D better, @Emmankoko! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
|
dab28f9 to
fa14379
Compare
diff --git a/home/circleci/dmd/compiler/src/dmd/frontend.h b/home/circleci/dmd/generated/linux/release/64/frontend.h
index d0063f09f..8bb76e554 100644
--- a/home/circleci/dmd/compiler/src/dmd/frontend.h
+++ b/home/circleci/dmd/generated/linux/release/64/frontend.h
@@ -9018,10 +9018,10 @@ struct Token final
};
Identifier* ident;
};
+ void checkKeyword();
void setString(const char* ptr, size_t length);
void setString(const OutBuffer& buf);
void setString();
- void checkKeyword();
const char* toChars() const;
static const char* toChars(TOK value);
Token() : |
I just updated the header as well. but I don't know yet if that's a key factor too. or what am I doing wrong with the frontend.h file. |
|
This is a good start but I have doubts about patching up identifiers in the C parser, it looks fragile and slow having to find and replace keywords in so many places. It also creates unexpected changes in the mangling of function symbols. Could you try creating aliases like |
my only concern is that, if I create an alias and we have in the end, |
Which matches C behavior, which I think is good
This is not expressible in D code obviously, but internally, ImportC already allows creating identifiers that are D keywords in the AST so I assume it handles it just fine. If you encounter any trouble you can get back to me. |
Okay right! that's valid. |
|
I'm sceptical about this. What are you going to do with the libm function Likewise it potentially introduces symbol conflicts where none existed in C - I don't think ImportC should try to be smart. It only needs to parse C code, from the D user code interface anything less than WYSIWYG only seeks to cause confusion. |
for typedefs with ids that are D type keywords, maybe avoid aliasing them.
this ensures D semantics are not broken.
There's a need for new check keyword functions because of the inability for the one already implemented in D work well for C code. because the C ids are not parsed as tokens but identifiers.
@dkorpel @thewilsonator
has been discussed in forum:
https://forum.dlang.org/post/[email protected]