From: <fwi...@us...> - 2008-05-28 02:05:20
|
Revision: 4466 http://jython.svn.sourceforge.net/jython/?rev=4466&view=rev Author: fwierzbicki Date: 2008-05-27 19:05:18 -0700 (Tue, 27 May 2008) Log Message: ----------- Now that things are close to working, time to completely destroy things again. Switched to pulling in 2.5 Python libraries. Took first baby step by attempting to support def f(): yield which is not valid 2.3 syntax. (This is actually what motivated this -- I was about to "fix" the grammar to disallow this when I accidentally noticed that it was valid 2.5 syntax. Modified Paths: -------------- branches/asm/src/org/python/compiler/CodeCompiler.java Property Changed: ---------------- branches/asm/ Property changes on: branches/asm ___________________________________________________________________ Name: svn:externals - CPythonLib http://svn.python.org/projects/python/branches/release23-maint/Lib/ + CPythonLib http://svn.python.org/projects/python/branches/release25-maint/Lib/ Modified: branches/asm/src/org/python/compiler/CodeCompiler.java =================================================================== --- branches/asm/src/org/python/compiler/CodeCompiler.java 2008-05-27 23:37:54 UTC (rev 4465) +++ branches/asm/src/org/python/compiler/CodeCompiler.java 2008-05-28 02:05:18 UTC (rev 4466) @@ -40,8 +40,10 @@ import org.python.antlr.ast.ExtSlice; import org.python.antlr.ast.For; import org.python.antlr.ast.FunctionDef; +import org.python.antlr.ast.GeneratorExp; import org.python.antlr.ast.Global; import org.python.antlr.ast.If; +import org.python.antlr.ast.IfExp; import org.python.antlr.ast.Import; import org.python.antlr.ast.ImportFrom; import org.python.antlr.ast.Index; @@ -66,7 +68,10 @@ import org.python.antlr.ast.UnaryOp; import org.python.antlr.ast.Unicode; import org.python.antlr.ast.While; +import org.python.antlr.ast.With; import org.python.antlr.ast.Yield; +import org.python.antlr.ast.aliasType; +import org.python.antlr.ast.argumentsType; import org.python.antlr.ast.cmpopType; import org.python.antlr.ast.comprehensionType; import org.python.antlr.ast.excepthandlerType; @@ -75,7 +80,9 @@ import org.python.antlr.ast.keywordType; import org.python.antlr.ast.modType; import org.python.antlr.ast.operatorType; +import org.python.antlr.ast.sliceType; import org.python.antlr.ast.stmtType; +import org.python.antlr.ast.unaryopType; public class CodeCompiler extends Visitor implements Opcodes, ClassConstants //, PythonGrammarTreeConstants { @@ -533,7 +540,11 @@ } saveLocals(); - visit(node.value); + if (node.value != null) { + visit(node.value); + } else { + getNone(); + } setLastI(++yield_count); code.areturn(); @@ -1926,6 +1937,11 @@ return null; } + public Object visitGeneratorExp(GeneratorExp node) { + //FIXME + return null; + } + protected Object unhandled_node(PythonTree node) throws Exception { throw new Exception("Unhandled node " + node); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |