Update of /cvsroot/jython/jython/org/python/compiler
In directory usw-pr-cvs1:/tmp/cvs-serv19136/compiler
Modified Files:
ArgListCompiler.java
Log Message:
Mangle the name of tuple function parameters. it now matches CPython and
allow test_grammar to complete.
Index: ArgListCompiler.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/compiler/ArgListCompiler.java,v
retrieving revision 2.3
retrieving revision 2.4
diff -C2 -d -r2.3 -r2.4
*** ArgListCompiler.java 2000/01/17 19:45:04 2.3
--- ArgListCompiler.java 2001/08/05 14:42:45 2.4
***************
*** 66,73 ****
name, node);
}
- names.addElement(name);
//Handle tuple arguments properly
if (node.getChild(0).id == PythonGrammarTreeConstants.JJTFPLIST) {
SimpleNode expr = new SimpleNode(
PythonGrammarTreeConstants.JJTEXPR_STMT);
--- 66,77 ----
name, node);
}
//Handle tuple arguments properly
if (node.getChild(0).id == PythonGrammarTreeConstants.JJTFPLIST) {
+ int idx = ((SimpleNode) node.jjtGetParent()).getChildIndex(node);
+ if (idx >= 0) {
+ name = "." + (idx * 2);
+ }
+
SimpleNode expr = new SimpleNode(
PythonGrammarTreeConstants.JJTEXPR_STMT);
***************
*** 80,83 ****
--- 84,88 ----
init_code.jjtAddChild(expr, init_code.getNumChildren());
}
+ names.addElement(name);
// Handle default args if specified
|