-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
Added support for returning Inline in transformers (Issue #763) #765
base: master
Are you sure you want to change the base?
Conversation
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.
Left a few comments.
res = self._call_userfunc_token(c) | ||
else: | ||
res = c | ||
if type(res) is Inline: |
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.
bad style: isinstance
should be used.
|
||
def a(self, children): | ||
return Inline('c', 'd') | ||
|
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.
Adding a test to test for a Token would be nice just in case we somehow break that in the future.
@@ -15,9 +15,16 @@ class Discard(Exception): | |||
""" | |||
pass | |||
|
|||
# Transformers | |||
class Inline(object): | |||
"""When returning an Inline instance in a transformer callback, |
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.
Question: Will this make sure that it is added to the docs?
Anyway, an example would be nice, as well as pointing out to use it Inline(a, b, c)
and not Inline((a,b,c))
.
And it should be added to the stubs.
And this PR is certainly not complete as can be seen from comments on #763. (e.g. still missing for the |
No description provided.