You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Klass {
void method() {
String foo = "asdf";
dummy(foo.length());
}
}
Generated output:
#!/usr/bin/env python
""" generated source for module test """
class Klass(object):
""" generated source for class Klass """
def method(self):
""" generated source for method method """
foo = "asdf"
len(dummy(foo))
As you can see, the len() should be applied to foo not dummy()
This is a problem in the output substitution regular expression. The regex in question (match, substitute) looks like this:
(r'(\s)(\S*?)(\.length\(\))', r'\1len(\2)')
I'm tempted to just rip out the regex and say that you're on your own... this really should be fixed at the AST level. I'll think about it and get back with you when I've made up my mind.
Activity
natural commentedon May 2, 2012
This is a problem in the output substitution regular expression. The regex in question (match, substitute) looks like this:
I'm tempted to just rip out the regex and say that you're on your own... this really should be fixed at the AST level. I'll think about it and get back with you when I've made up my mind.