-
Notifications
You must be signed in to change notification settings - Fork 157
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
Parse ellipsis (...) in the old parser #503
Conversation
@Thirumalai-Shaktivel if you wouldn't mind adding tests for .. and None, then we can merge this. |
@@ -83,6 +83,8 @@ module LPython | |||
| ConstantBool(bool value, string? kind) | |||
| ConstantFloat(float value, string? kind) | |||
| ConstantComplex(float re, float im, string? kind) | |||
| ConstantEllipsis(string? kind) |
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.
How are we going to support this in the ASR?
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 think ...
is similar to pass
, so that's just an empty subroutine, so you leave the body
argument empty in ASR.
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.
What I've noticed is that people use Ellipsis
to indicate something they want to fill in later (like a todo empty block) and pass
stmt to mean a block is intended to have no code.
...
is used in NumPy code, too, as a placeholder in slice notation.
See more uses here: https://python.land/python-ellipsis
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.
It has different uses. For the "empty block" use, we can just represent that with an empty block in ASR.
Thanks! |
No description provided.