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
Support for "volatile" keyword #1667
Conversation
4d044ad
to
a77a58a
Compare
From a code design perspective, it feels like there should be two separate subclasses for the |
Thinking about this some more, I'm unsure if |
From a C/C++ point of view, "const" and "volatile" are often considered together. The name "cv" isn't my invention, it's regularly used when talking about const/volatile modifiers (just one example: http://en.cppreference.com/w/cpp/language/cv). But of course I can change |
The problem is that in the current code, |
Is there any chance to revisit this? |
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.
Ok, I'm fine with this change. Only found a little improvement to simplify the parsing code.
Cython/Compiler/Parsing.py
Outdated
@@ -2481,14 +2481,25 @@ def p_c_simple_base_type(s, self_flag, nonempty, templates = None): | |||
pos = s.position() | |||
if not s.sy == 'IDENT': | |||
error(pos, "Expected an identifier, found '%s'" % s.sy) | |||
if s.systring == 'const': | |||
s.next() | |||
if s.systring in ['const', 'volatile']: |
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.
Proposal:
is_const = is_volatile = False
while s.sy == 'IDENT' and s.systring in ('const', 'volatile'):
...
if s.sy != 'IDENT':
error(...)
if is_const or is_volatile:
...
Fun fact: |
eef2a28
to
86a2a43
Compare
Why is Travis CI no longer testing this PR? |
It is, its last test run was half an hour ago. |
No description provided.