diff --git a/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonNature.java b/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonNature.java index c10c8e800a..2b7fc40734 100644 --- a/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonNature.java +++ b/plugins/org.python.pydev.ast/src/org/python/pydev/plugin/nature/PythonNature.java @@ -1308,6 +1308,8 @@ public static int getGrammarVersionFromStr(String grammarVersion) { return GRAMMAR_PYTHON_VERSION_3_11; case "3.12": return GRAMMAR_PYTHON_VERSION_3_12; + case "3.13": + return GRAMMAR_PYTHON_VERSION_3_13; /*[[[end]]]*/ // @formatter:on default: diff --git a/plugins/org.python.pydev.core/src/org/python/pydev/core/IGrammarVersionProvider.java b/plugins/org.python.pydev.core/src/org/python/pydev/core/IGrammarVersionProvider.java index f340788aed..e39fc55f74 100644 --- a/plugins/org.python.pydev.core/src/org/python/pydev/core/IGrammarVersionProvider.java +++ b/plugins/org.python.pydev.core/src/org/python/pydev/core/IGrammarVersionProvider.java @@ -43,8 +43,9 @@ public interface IGrammarVersionProvider { public static final int GRAMMAR_PYTHON_VERSION_3_10 = 104; public static final int GRAMMAR_PYTHON_VERSION_3_11 = 105; public static final int GRAMMAR_PYTHON_VERSION_3_12 = 106; - public static final int LATEST_GRAMMAR_PY3_VERSION = GRAMMAR_PYTHON_VERSION_3_12; - public static final int LATEST_GRAMMAR_PY2_VERSION = GRAMMAR_PYTHON_VERSION_3_12; + public static final int GRAMMAR_PYTHON_VERSION_3_13 = 107; + public static final int LATEST_GRAMMAR_PY3_VERSION = GRAMMAR_PYTHON_VERSION_3_13; + public static final int LATEST_GRAMMAR_PY2_VERSION = GRAMMAR_PYTHON_VERSION_3_13; /*[[[end]]]*/ /** @@ -111,6 +112,7 @@ public static List createList() { grammarVersions.add(IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_10); grammarVersions.add(IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_11); grammarVersions.add(IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_12); + grammarVersions.add(IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_13); /*[[[end]]]*/ return Collections.unmodifiableList(grammarVersions); } @@ -134,6 +136,7 @@ public static List createStr() { grammarVersions.add("3.10"); grammarVersions.add("3.11"); grammarVersions.add("3.12"); + grammarVersions.add("3.13"); /*[[[end]]]*/ return Collections.unmodifiableList(grammarVersions); } @@ -158,6 +161,7 @@ public static Map createDict() { ret.put(IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_10, "3.10"); ret.put(IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_11, "3.11"); ret.put(IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_12, "3.12"); + ret.put(IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_13, "3.13"); /*[[[end]]]*/ return Collections.unmodifiableMap(ret); } @@ -182,6 +186,7 @@ public static Map createStrToInt() { ret.put("3.10", IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_10); ret.put("3.11", IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_11); ret.put("3.12", IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_12); + ret.put("3.13", IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_13); /*[[[end]]]*/ return Collections.unmodifiableMap(ret); } diff --git a/plugins/org.python.pydev.core/src/org/python/pydev/core/IPythonNature.java b/plugins/org.python.pydev.core/src/org/python/pydev/core/IPythonNature.java index ffcc0ff497..7e933d8422 100644 --- a/plugins/org.python.pydev.core/src/org/python/pydev/core/IPythonNature.java +++ b/plugins/org.python.pydev.core/src/org/python/pydev/core/IPythonNature.java @@ -59,7 +59,7 @@ public static class Versions { cog.outl(f'public static final String LATEST_VERSION_NUMBER = "{python_versions_base[-1]}";') ]]]*/ - public static final String LATEST_VERSION_NUMBER = "3.12"; + public static final String LATEST_VERSION_NUMBER = "3.13"; /*[[[end]]]*/ static { @@ -112,6 +112,7 @@ public static class Versions { ALL_PYTHON_VERSIONS.add(PYTHON_VERSION_3_10); ALL_PYTHON_VERSIONS.add(PYTHON_VERSION_3_11); ALL_PYTHON_VERSIONS.add(PYTHON_VERSION_3_12); + ALL_PYTHON_VERSIONS.add(PYTHON_VERSION_3_13); ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_3_5); ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_3_6); @@ -121,6 +122,7 @@ public static class Versions { ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_3_10); ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_3_11); ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_3_12); + ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_3_13); ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_3_5); ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_3_6); @@ -130,6 +132,7 @@ public static class Versions { ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_3_10); ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_3_11); ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_3_12); + ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_3_13); VERSION_NUMBERS.add("3.5"); VERSION_NUMBERS.add("3.6"); @@ -139,6 +142,7 @@ public static class Versions { VERSION_NUMBERS.add("3.10"); VERSION_NUMBERS.add("3.11"); VERSION_NUMBERS.add("3.12"); + VERSION_NUMBERS.add("3.13"); mappedVersions.put("3.5", "3.5"); mappedVersions.put("3.6", "3.6"); @@ -148,6 +152,7 @@ public static class Versions { mappedVersions.put("3.10", "3.10"); mappedVersions.put("3.11", "3.11"); mappedVersions.put("3.12", "3.12"); + mappedVersions.put("3.13", "3.13"); /*[[[end]]]*/ ALL_PYTHON_VERSIONS.add(PYTHON_VERSION_INTERPRETER); @@ -271,6 +276,7 @@ public static int getInternalVersion(String version) { public static final String PYTHON_VERSION_3_10 = "python 3.10"; public static final String PYTHON_VERSION_3_11 = "python 3.11"; public static final String PYTHON_VERSION_3_12 = "python 3.12"; + public static final String PYTHON_VERSION_3_13 = "python 3.13"; public static final String JYTHON_VERSION_3_5 = "jython 3.5"; public static final String JYTHON_VERSION_3_6 = "jython 3.6"; @@ -280,6 +286,7 @@ public static int getInternalVersion(String version) { public static final String JYTHON_VERSION_3_10 = "jython 3.10"; public static final String JYTHON_VERSION_3_11 = "jython 3.11"; public static final String JYTHON_VERSION_3_12 = "jython 3.12"; + public static final String JYTHON_VERSION_3_13 = "jython 3.13"; public static final String IRONPYTHON_VERSION_3_5 = "ironpython 3.5"; public static final String IRONPYTHON_VERSION_3_6 = "ironpython 3.6"; @@ -289,6 +296,7 @@ public static int getInternalVersion(String version) { public static final String IRONPYTHON_VERSION_3_10 = "ironpython 3.10"; public static final String IRONPYTHON_VERSION_3_11 = "ironpython 3.11"; public static final String IRONPYTHON_VERSION_3_12 = "ironpython 3.12"; + public static final String IRONPYTHON_VERSION_3_13 = "ironpython 3.13"; /*[[[end]]]*/ public static final String JYTHON_VERSION_INTERPRETER = "jython interpreter"; diff --git a/plugins/org.python.pydev.parser/src/org/python/pydev/parser/PyParser.java b/plugins/org.python.pydev.parser/src/org/python/pydev/parser/PyParser.java index 76e0bebe24..e92c60eca9 100644 --- a/plugins/org.python.pydev.parser/src/org/python/pydev/parser/PyParser.java +++ b/plugins/org.python.pydev.parser/src/org/python/pydev/parser/PyParser.java @@ -134,6 +134,8 @@ public static String getGrammarVersionStr(int grammarVersion) { return "grammar: Python 3.11"; case IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_12: return "grammar: Python 3.12"; + case IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_13: + return "grammar: Python 3.13"; /*[[[end]]]*/ } @@ -577,6 +579,9 @@ public static IGrammar createGrammar(boolean generateTree, int grammarVersion, c case IPythonNature.GRAMMAR_PYTHON_VERSION_3_12: grammar = new PythonGrammar312(generateTree, in); break; + case IPythonNature.GRAMMAR_PYTHON_VERSION_3_13: + grammar = new PythonGrammar312(generateTree, in); + break; /*[[[end]]]*/ //case CYTHON: not treated here (only in reparseDocument). default: diff --git a/rootproject/codegen_helper.py b/rootproject/codegen_helper.py index 4a9b8a3700..2e219a8f92 100644 --- a/rootproject/codegen_helper.py +++ b/rootproject/codegen_helper.py @@ -1,4 +1,4 @@ -python_versions_base = ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] +python_versions_base = ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] python_versions_underscore = [x.replace('.', '_') for x in python_versions_base] @@ -11,4 +11,5 @@ '3_10': 'PythonGrammar310', '3_11': 'PythonGrammar311', '3_12': 'PythonGrammar312', + '3_13': 'PythonGrammar312', }