From: <fwi...@us...> - 2008-08-22 15:31:59
|
Revision: 5233 http://jython.svn.sourceforge.net/jython/?rev=5233&view=rev Author: fwierzbicki Date: 2008-08-22 15:31:56 +0000 (Fri, 22 Aug 2008) Log Message: ----------- Switch "type"->"kind" for the compile parameter value which specifies the kind of parse/compile "exec", "eval", or "single". CPython's source uses "kind" and other parts of Jython use this term as well. Modified Paths: -------------- trunk/jython/src/org/python/core/Py.java trunk/jython/src/org/python/core/__builtin__.java Modified: trunk/jython/src/org/python/core/Py.java =================================================================== --- trunk/jython/src/org/python/core/Py.java 2008-08-21 23:59:46 UTC (rev 5232) +++ trunk/jython/src/org/python/core/Py.java 2008-08-22 15:31:56 UTC (rev 5233) @@ -1641,8 +1641,8 @@ } public static PyObject compile(InputStream istream, String filename, - String type) { - return compile_flags(istream, filename, type, null); + String kind) { + return compile_flags(istream, filename, kind, null); } // with compiler-flags @@ -1664,15 +1664,15 @@ } public static PyObject compile_flags(InputStream istream, String filename, - String type,CompilerFlags cflags) + String kind,CompilerFlags cflags) { - modType node = ParserFacade.parse(istream, type, filename, cflags); + modType node = ParserFacade.parse(istream, kind, filename, cflags); if (cflags != null && cflags.only_ast) { return Py.java2py(node); } boolean printResults = false; - if (type.equals("single")) { + if (kind.equals("single")) { printResults = true; } return Py.compile_flags(node, getName(), filename, true, printResults, cflags); @@ -1680,7 +1680,7 @@ public static PyObject compile_flags(String data, String filename, - String type, + String kind, CompilerFlags cflags) { if (data.contains("\0")) { @@ -1695,7 +1695,7 @@ } return Py.compile_flags(new ByteArrayInputStream(bytes), filename, - type, + kind, cflags); } Modified: trunk/jython/src/org/python/core/__builtin__.java =================================================================== --- trunk/jython/src/org/python/core/__builtin__.java 2008-08-21 23:59:46 UTC (rev 5232) +++ trunk/jython/src/org/python/core/__builtin__.java 2008-08-22 15:31:56 UTC (rev 5233) @@ -455,15 +455,15 @@ throw Py.TypeError("number coercion failed"); } - public static PyObject compile(String data, String filename, String type) { - return Py.compile_flags(data, filename, type, Py.getCompilerFlags()); + public static PyObject compile(String data, String filename, String kind) { + return Py.compile_flags(data, filename, kind, Py.getCompilerFlags()); } - public static PyObject compile(String data, String filename, String type, int flags, boolean dont_inherit) { + public static PyObject compile(String data, String filename, String kind, int flags, boolean dont_inherit) { if ((flags & ~PyTableCode.CO_ALL_FEATURES) != 0) { throw Py.ValueError("compile(): unrecognised flags"); } - return Py.compile_flags(data, filename, type, Py.getCompilerFlags(flags, dont_inherit)); + return Py.compile_flags(data, filename, kind, Py.getCompilerFlags(flags, dont_inherit)); } public static void delattr(PyObject o, String n) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |