| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Jython
Revision: 5233
Author: fwierzbicki
Date: 22 Aug 2008 11:31:56
Changes: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.
Files:| ... | ...@@ -455,15 +455,15 @@ | |
| 455 | 455 | throw Py.TypeError("number coercion failed"); |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | public static PyObject compile(String data, String filename, String type) { | |
| 459 | return Py.compile_flags(data, filename, type, Py.getCompilerFlags()); | |
| 458 | public static PyObject compile(String data, String filename, String kind) { | |
| 459 | return Py.compile_flags(data, filename, kind, Py.getCompilerFlags()); | |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | public static PyObject compile(String data, String filename, String type, int flags, boolean dont_inherit) { | |
| 462 | public static PyObject compile(String data, String filename, String kind, int flags, boolean dont_inherit) { | |
| 463 | 463 | if ((flags & ~PyTableCode.CO_ALL_FEATURES) != 0) { |
| 464 | 464 | throw Py.ValueError("compile(): unrecognised flags"); |
| 465 | 465 | } |
| 466 | return Py.compile_flags(data, filename, type, Py.getCompilerFlags(flags, dont_inherit)); | |
| 466 | return Py.compile_flags(data, filename, kind, Py.getCompilerFlags(flags, dont_inherit)); | |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | public static void delattr(PyObject o, String n) { |
| ... | ...@@ -1641,8 +1641,8 @@ | |
| 1641 | 1641 | } |
| 1642 | 1642 | |
| 1643 | 1643 | public static PyObject compile(InputStream istream, String filename, |
| 1644 | String type) { | |
| 1645 | return compile_flags(istream, filename, type, null); | |
| 1644 | String kind) { | |
| 1645 | return compile_flags(istream, filename, kind, null); | |
| 1646 | 1646 | } |
| 1647 | 1647 | |
| 1648 | 1648 | // with compiler-flags |
| ... | ...@@ -1664,15 +1664,15 @@ | |
| 1664 | 1664 | } |
| 1665 | 1665 | |
| 1666 | 1666 | public static PyObject compile_flags(InputStream istream, String filename, |
| 1667 | String type,CompilerFlags cflags) | |
| 1667 | String kind,CompilerFlags cflags) | |
| 1668 | 1668 | { |
| 1669 | modType node = ParserFacade.parse(istream, type, filename, cflags); | |
| 1669 | modType node = ParserFacade.parse(istream, kind, filename, cflags); | |
| 1670 | 1670 | if (cflags != null && cflags.only_ast) { |
| 1671 | 1671 | return Py.java2py(node); |
| 1672 | 1672 | } |
| 1673 | 1673 | |
| 1674 | 1674 | boolean printResults = false; |
| 1675 | if (type.equals("single")) { | |
| 1675 | if (kind.equals("single")) { | |
| 1676 | 1676 | printResults = true; |
| 1677 | 1677 | } |
| 1678 | 1678 | return Py.compile_flags(node, getName(), filename, true, printResults, cflags); |
| ... | ...@@ -1680,7 +1680,7 @@ | |
| 1680 | 1680 | |
| 1681 | 1681 | public static PyObject compile_flags(String data, |
| 1682 | 1682 | String filename, |
| 1683 | String type, | |
| 1683 | String kind, | |
| 1684 | 1684 | CompilerFlags cflags) { |
| 1685 | 1685 | |
| 1686 | 1686 | if (data.contains("\0")) { |
| ... | ...@@ -1695,7 +1695,7 @@ | |
| 1695 | 1695 | } |
| 1696 | 1696 | return Py.compile_flags(new ByteArrayInputStream(bytes), |
| 1697 | 1697 | filename, |
| 1698 | type, | |
| 1698 | kind, | |
| 1699 | 1699 | cflags); |
| 1700 | 1700 | } |
| 1701 | 1701 |