-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fixes export failures on nested parses #99
Conversation
Exports can fail if multiple nested blocks are present: File "/usr/local/lib/python2.7/site-packages/textx/export.py", line 194, in _export for attr_name, attr in obj_cls._tx_attrs.items(): AttributeError: type object 'str' has no attribute '_tx_attrs' This adds in "str" to primitive types to avoid this.
Your example works fine with both Python 2.7 and 3.x. |
My bad, though I tried it again with the same model and code:
I wonder if it's specific to my machine's python2 then. |
@imaduro I follow your exact steps and managed to reproduce. I'll investigate. Thanks for reporting. |
Ah, I got it. textX is using unicode strings. Your input string must be a unicode. I guess we should make some checks in |
I meant please open an issue for this since this is a PR :) |
Will do! Thanks! |
While using Python2, if a grammar can have multiple nested expressions, the exporter will fail to export these if Strings are present within them.
Example.tx
then using the string
(value + (exp + bla)) - blabla
This bug only affects Python 2, Python 3 does not run into this error.