public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/kdevelop-python] f44: Add support for Python 3.6
@ 2026-07-04 0:59 Jan Grulich
0 siblings, 0 replies; only message in thread
From: Jan Grulich @ 2026-07-04 0:59 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/kdevelop-python
Branch : f44
Commit : 75bb64ad2a2e65d1421e15fadb7fda6c48945339
Author : Jan Grulich <jgrulich@redhat.com>
Date : 2016-12-23T08:55:59+01:00
Stats : +477/-2 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/kdevelop-python/c/75bb64ad2a2e65d1421e15fadb7fda6c48945339?branch=f44
Log:
Add support for Python 3.6
---
diff --git a/kdevelop-python.spec b/kdevelop-python.spec
index a9182e1..bccb8fc 100644
--- a/kdevelop-python.spec
+++ b/kdevelop-python.spec
@@ -6,7 +6,7 @@ Name: kdevelop-python
Version: 5.0.3
%global py3_suffix -py3
%global py3_tag .py3
-Release: 2%{?py3_tag}%{?dist}
+Release: 3%{?py3_tag}%{?dist}
License: GPLv2
Source0: http://download.kde.org/stable/kdevelop/%{version}/src/kdev-python-%{version}.tar.xz
@@ -20,7 +20,7 @@ Patch0: kdev-python-1.7.0-py3-shebang.patch
Patch1: kdev-python-1.7.0-py3-doc-syntax.patch
Patch2: kdev-python-missing-dependency.patch
-
+Patch3: kdevelop-python36.patch
Summary: Python 3 Plugin for KDevelop
URL: https://www.kdevelop.org/
@@ -66,6 +66,10 @@ Python 3 language support for the KDevelop Integrated Development Environment.
# add missing dependency on kdelibs4support
%patch2 -p1 -b .missing-dependency
+# add support for Python 3.6
+%if 0%{?fedora} > 25
+%patch3 -p1 -b .kdevelop-python36
+%endif
%build
mkdir %{_target_platform}
@@ -101,6 +105,9 @@ rm -f %{buildroot}%{_datadir}/kdevpythonsupport/documentation_files/PyKDE4/parse
%changelog
+* Thu Dec 22 2016 Jan Grulich <jgrulich@redhat.com> - 5.0.3-3.py3
+- Add support for Python 3.6 (taken from upstream)
+
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 5.0.3-2.py3
- Rebuild for Python 3.6
diff --git a/kdevelop-python36.patch b/kdevelop-python36.patch
new file mode 100644
index 0000000..d572b7b
--- /dev/null
+++ b/kdevelop-python36.patch
@@ -0,0 +1,468 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b06a665..ec8dc3e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -31,10 +31,10 @@ add_definitions( -DTRANSLATION_DOMAIN=\"kdevpython\" )
+
+ # find the system python 3 interpreter, only used for determining search paths.
+ # must be called before find_package(KF5) because it searchs for python too, but finds python2
+-find_package(Python 3.5 REQUIRED)
++find_package(Python 3.6 REQUIRED)
+ configure_file( "${kdevpython_SOURCE_DIR}/kdevpythonversion.h.cmake" "${kdevpython_BINARY_DIR}/kdevpythonversion.h" @ONLY )
+-if ( (NOT PYTHON_LIBRARIES) OR "${PYTHON_VERSION_MINOR}" GREATER 5 )
+- message(FATAL_ERROR "Python >= 3.5.0 but < 3.6 with --enable-shared is required to build kdev-python")
++if ( (NOT PYTHON_LIBRARIES) OR "${PYTHON_VERSION_MINOR}" GREATER 6 )
++ message(FATAL_ERROR "Python >= 3.6.0 but < 3.7 with --enable-shared is required to build kdev-python")
+ endif()
+
+ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Widgets Test)
+diff --git a/cmake/modules/FindPython.cmake b/cmake/modules/FindPython.cmake
+index 37eca7e..15bfd45 100644
+--- a/cmake/modules/FindPython.cmake
++++ b/cmake/modules/FindPython.cmake
+@@ -31,7 +31,7 @@
+ include(FindPackageHandleStandardArgs)
+
+ # TODO
+-set(LOOKING_FOR_VERSION "3.5")
++set(LOOKING_FOR_VERSION "3.6")
+
+ # allow specifying which Python installation to use
+ if (NOT PYTHON_EXEC)
+diff --git a/duchain/declarationbuilder.cpp b/duchain/declarationbuilder.cpp
+index 43c61cf..c626326 100644
+--- a/duchain/declarationbuilder.cpp
++++ b/duchain/declarationbuilder.cpp
+@@ -557,7 +557,7 @@ void DeclarationBuilder::visitComprehension(ComprehensionAst* node)
+ // and both other occurences are uses of that declaration.
+ // TODO add a special case to the usebuilder to display the second occurence as a declaration
+ RangeInRevision declarationRange(currentContext()->range().start, currentContext()->range().start);
+- declarationRange.end.column -= 1;
++ declarationRange.end.column -= 2;
+ declarationRange.start.column -= 1;
+
+ AbstractType::Ptr targetType(new IntegralType(IntegralType::TypeMixed));
+diff --git a/parser/ast.cpp b/parser/ast.cpp
+index 4a011df..41fe56b 100644
+--- a/parser/ast.cpp
++++ b/parser/ast.cpp
+@@ -64,9 +64,14 @@ AugmentedAssignmentAst::AugmentedAssignmentAst(Ast* parent): StatementAst(parent
+
+ }
+
++AnnotationAssignmentAst::AnnotationAssignmentAst(Ast* parent): StatementAst(parent, Ast::AnnotationAssignmentAstType), target(0), value(0), annotation(0)
++{
++
++}
++
+ BinaryOperationAst::BinaryOperationAst(Ast* parent): ExpressionAst(parent, Ast::BinaryOperationAstType), lhs(0), rhs(0)
+ {
+-
++
+ }
+
+ BooleanOperationAst::BooleanOperationAst(Ast* parent): ExpressionAst(parent, Ast::BooleanOperationAstType)
+@@ -290,7 +295,17 @@ StatementAst::StatementAst(Ast* parent, AstType type): Ast(parent, type)
+
+ StringAst::StringAst(Ast* parent): ExpressionAst(parent, Ast::StringAstType), value(""), usedAsComment(false)
+ {
+-
++
++}
++
++JoinedStringAst::JoinedStringAst(Ast* parent): ExpressionAst(parent, Ast::JoinedStringAstType), values()
++{
++
++}
++
++FormattedValueAst::FormattedValueAst(Ast* parent): ExpressionAst(parent, Ast::FormattedValueAstType), value(nullptr), conversion(0), formatSpec(0)
++{
++
+ }
+
+ BytesAst::BytesAst(Ast* parent): ExpressionAst(parent, Ast::BytesAstType), value("")
+diff --git a/parser/ast.h b/parser/ast.h
+index 91646b6..b69a706 100644
+--- a/parser/ast.h
++++ b/parser/ast.h
+@@ -93,6 +93,7 @@ public:
+ ContinueAstType,
+ AssertionAstType,
+ AugmentedAssignmentAstType,
++ AnnotationAssignmentAstType,
+ LastStatementType,
+ ExpressionAstType, // everything below is an expression
+ AwaitAstType,
+@@ -116,6 +117,8 @@ public:
+ CompareAstType,
+ NumberAstType,
+ StringAstType,
++ JoinedStringAstType,
++ FormattedValueAstType,
+ BytesAstType,
+ SubscriptAstType,
+ StarredAstType,
+@@ -325,6 +328,14 @@ public:
+ ExpressionAst* value;
+ };
+
++class KDEVPYTHONPARSER_EXPORT AnnotationAssignmentAst : public StatementAst {
++public:
++ AnnotationAssignmentAst(Ast* parent);
++ ExpressionAst* target;
++ ExpressionAst* value;
++ ExpressionAst* annotation;
++};
++
+ class KDEVPYTHONPARSER_EXPORT ForAst : public StatementAst {
+ public:
+ ForAst(Ast* parent);
+@@ -594,6 +605,20 @@ public:
+ bool usedAsComment;
+ };
+
++class KDEVPYTHONPARSER_EXPORT JoinedStringAst : public ExpressionAst {
++public:
++ JoinedStringAst(Ast* parent);
++ QList<ExpressionAst*> values;
++};
++
++class KDEVPYTHONPARSER_EXPORT FormattedValueAst : public ExpressionAst {
++public:
++ FormattedValueAst(Ast* parent);
++ ExpressionAst* value;
++ int conversion;
++ ExpressionAst* formatSpec;
++};
++
+ class KDEVPYTHONPARSER_EXPORT BytesAst : public ExpressionAst {
+ public:
+ BytesAst(Ast* parent);
+diff --git a/parser/astdefaultvisitor.cpp b/parser/astdefaultvisitor.cpp
+index 2c20585..0ac0e50 100644
+--- a/parser/astdefaultvisitor.cpp
++++ b/parser/astdefaultvisitor.cpp
+@@ -48,6 +48,17 @@ void AstDefaultVisitor::visitString(StringAst* node) { Q_UNUSED(node); }
+ void AstDefaultVisitor::visitBytes(BytesAst* node) { Q_UNUSED(node); }
+ void AstDefaultVisitor::visitIdentifier(Identifier* node) { Q_UNUSED(node); }
+
++void AstDefaultVisitor::visitJoinedString(JoinedStringAst* node) {
++ foreach (Ast* value, node->values) {
++ visitNode(value);
++ }
++}
++
++void AstDefaultVisitor::visitFormattedValue(FormattedValueAst* node) {
++ visitNode(node->value);
++ visitNode(node->formatSpec);
++}
++
+ void AstDefaultVisitor::visitStarred(StarredAst* node) {
+ visitNode(node->value);
+ }
+@@ -326,6 +337,13 @@ void AstDefaultVisitor::visitAugmentedAssignment(AugmentedAssignmentAst* node)
+ visitNode(node->value);
+ }
+
++void AstDefaultVisitor::visitAnnotationAssignment(AnnotationAssignmentAst* node)
++{
++ visitNode(node->target);
++ visitNode(node->annotation);
++ visitNode(node->value);
++}
++
+ void AstDefaultVisitor::visitBinaryOperation(BinaryOperationAst* node)
+ {
+ visitNode(node->lhs);
+diff --git a/parser/astdefaultvisitor.h b/parser/astdefaultvisitor.h
+index 153e219..8422971 100644
+--- a/parser/astdefaultvisitor.h
++++ b/parser/astdefaultvisitor.h
+@@ -48,6 +48,7 @@ public:
+ virtual void visitDelete(DeleteAst* node);
+ virtual void visitAssignment(AssignmentAst* node);
+ virtual void visitAugmentedAssignment(AugmentedAssignmentAst* node);
++ virtual void visitAnnotationAssignment(AnnotationAssignmentAst* node);
+ virtual void visitFor(ForAst* node);
+ virtual void visitWhile(WhileAst* node);
+ virtual void visitIf(IfAst* node);
+@@ -76,6 +77,8 @@ public:
+ virtual void visitCompare(CompareAst* node);
+ virtual void visitNumber(NumberAst* node);
+ virtual void visitString(StringAst* node);
++ virtual void visitJoinedString(JoinedStringAst* node);
++ virtual void visitFormattedValue(FormattedValueAst* node);
+ virtual void visitBytes(BytesAst* node);
+ virtual void visitYield(YieldAst* node);
+ virtual void visitYieldFrom(YieldFromAst* node);
+@@ -118,6 +121,7 @@ public:
+ virtual void visitDelete(DeleteAst* node) { AstDefaultVisitor::visitDelete(node); delete node; }
+ virtual void visitAssignment(AssignmentAst* node) { AstDefaultVisitor::visitAssignment(node); delete node; }
+ virtual void visitAugmentedAssignment(AugmentedAssignmentAst* node) { AstDefaultVisitor::visitAugmentedAssignment(node); delete node; }
++ virtual void visitAnnotationAssignment(AnnotationAssignmentAst* node) { AstDefaultVisitor::visitAnnotationAssignment(node); delete node; }
+ virtual void visitFor(ForAst* node) { AstDefaultVisitor::visitFor(node); delete node; }
+ virtual void visitWhile(WhileAst* node) { AstDefaultVisitor::visitWhile(node); delete node; }
+ virtual void visitIf(IfAst* node) { AstDefaultVisitor::visitIf(node); delete node; }
+@@ -146,6 +150,8 @@ public:
+ virtual void visitCompare(CompareAst* node) { AstDefaultVisitor::visitCompare(node); delete node; }
+ virtual void visitNumber(NumberAst* node) { AstDefaultVisitor::visitNumber(node); delete node; }
+ virtual void visitString(StringAst* node) { AstDefaultVisitor::visitString(node); delete node; }
++ virtual void visitJoinedString(JoinedStringAst* node) { AstDefaultVisitor::visitJoinedString(node); delete node; }
++ virtual void visitFormattedValue(FormattedValueAst* node) { AstDefaultVisitor::visitFormattedValue(node); delete node; }
+ virtual void visitBytes(BytesAst* node) { AstDefaultVisitor::visitBytes(node); delete node; }
+ virtual void visitYield(YieldAst* node) { AstDefaultVisitor::visitYield(node); delete node; }
+ virtual void visitYieldFrom(YieldFromAst* node) { AstDefaultVisitor::visitYieldFrom(node); delete node; }
+diff --git a/parser/astvisitor.cpp b/parser/astvisitor.cpp
+index bff4566..ace7d61 100644
+--- a/parser/astvisitor.cpp
++++ b/parser/astvisitor.cpp
+@@ -46,6 +46,7 @@ void AstVisitor::visitNode(Ast* node)
+ case Ast::DeleteAstType: this->visitDelete(static_cast<DeleteAst*>(node)); break;
+ case Ast::AssignmentAstType: this->visitAssignment(static_cast<AssignmentAst*>(node)); break;
+ case Ast::AugmentedAssignmentAstType: this->visitAugmentedAssignment(static_cast<AugmentedAssignmentAst*>(node)); break;
++ case Ast::AnnotationAssignmentAstType: this->visitAnnotationAssignment(static_cast<AnnotationAssignmentAst*>(node)); break;
+ case Ast::ForAstType: this->visitFor(static_cast<ForAst*>(node)); break;
+ case Ast::WhileAstType: this->visitWhile(static_cast<WhileAst*>(node)); break;
+ case Ast::IfAstType: this->visitIf(static_cast<IfAst*>(node)); break;
+@@ -74,6 +75,8 @@ void AstVisitor::visitNode(Ast* node)
+ case Ast::CompareAstType: this->visitCompare(static_cast<CompareAst*>(node)); break;
+ case Ast::NumberAstType: this->visitNumber(static_cast<NumberAst*>(node)); break;
+ case Ast::StringAstType: this->visitString(static_cast<StringAst*>(node)); break;
++ case Ast::FormattedValueAstType: this->visitFormattedValue(static_cast<FormattedValueAst*>(node)); break;
++ case Ast::JoinedStringAstType: this->visitJoinedString(static_cast<JoinedStringAst*>(node)); break;
+ case Ast::BytesAstType: this->visitBytes(static_cast<BytesAst*>(node)); break;
+ case Ast::YieldAstType: this->visitYield(static_cast<YieldAst*>(node)); break;
+ case Ast::NameAstType: this->visitName(static_cast<NameAst*>(node)); break;
+diff --git a/parser/astvisitor.h b/parser/astvisitor.h
+index 3e455e6..ce1a92a 100644
+--- a/parser/astvisitor.h
++++ b/parser/astvisitor.h
+@@ -53,6 +53,7 @@ public:
+ virtual void visitDelete(DeleteAst* node) { Q_UNUSED(node); };
+ virtual void visitAssignment(AssignmentAst* node) { Q_UNUSED(node); };
+ virtual void visitAugmentedAssignment(AugmentedAssignmentAst* node) { Q_UNUSED(node); };
++ virtual void visitAnnotationAssignment(AnnotationAssignmentAst* node) { Q_UNUSED(node); };
+ virtual void visitFor(ForAst* node) { Q_UNUSED(node); };
+ virtual void visitWhile(WhileAst* node) { Q_UNUSED(node); };
+ virtual void visitIf(IfAst* node) { Q_UNUSED(node); };
+@@ -83,6 +84,8 @@ public:
+ virtual void visitCompare(CompareAst* node) { Q_UNUSED(node); };
+ virtual void visitNumber(NumberAst* node) { Q_UNUSED(node); };
+ virtual void visitString(StringAst* node) { Q_UNUSED(node); };
++ virtual void visitFormattedValue(FormattedValueAst* node) { Q_UNUSED(node); };
++ virtual void visitJoinedString(JoinedStringAst* node) { Q_UNUSED(node); };
+ virtual void visitBytes(BytesAst* node) { Q_UNUSED(node); };
+ virtual void visitYield(YieldAst* node) { Q_UNUSED(node); };
+ virtual void visitName(NameAst* node) { Q_UNUSED(node); };
+diff --git a/parser/conversionGenerator.py b/parser/conversionGenerator.py
+index 385dbcb..d44e51e 100644
+--- a/parser/conversionGenerator.py
++++ b/parser/conversionGenerator.py
+@@ -9,7 +9,7 @@
+
+ import sys
+
+-contents = open('python35.sdef').read().replace("\n", "").split(';;')
++contents = open('python36.sdef').read().replace("\n", "").split(';;')
+
+ func_structure = '''
+ Ast* visitNode(%{RULE_FOR}* node) {
+@@ -19,7 +19,7 @@ func_structure = '''
+ switch ( node->kind ) {
+ %{SWITCH_LINES}
+ default:
+- qWarning() << "Unsupported statement AST type: " << node->kind;
++ qWarning() << "Unsupported %{RULE_FOR} AST type: " << node->kind;
+ Q_ASSERT(false);
+ }
+ %{APPENDIX}
+diff --git a/parser/generated.h b/parser/generated.h
+index bb0a107..874ad4e 100644
+--- a/parser/generated.h
++++ b/parser/generated.h
+@@ -124,7 +124,7 @@ private:
+ break;
+ }
+ default:
+- qWarning() << "Unsupported statement AST type: " << node->kind;
++ qWarning() << "Unsupported _excepthandler AST type: " << node->kind;
+ Q_ASSERT(false);
+ }
+
+@@ -284,6 +284,20 @@ private:
+ result = v;
+ break;
+ }
++ case JoinedStr_kind: {
++ JoinedStringAst* v = new JoinedStringAst(parent());
++ nodeStack.push(v); v->values = visitNodeList<_expr, ExpressionAst>(node->v.JoinedStr.values); nodeStack.pop();
++ result = v;
++ break;
++ }
++ case FormattedValue_kind: {
++ FormattedValueAst* v = new FormattedValueAst(parent());
++ nodeStack.push(v); v->value = static_cast<ExpressionAst*>(visitNode(node->v.FormattedValue.value)); nodeStack.pop();
++ v->conversion = node->v.FormattedValue.conversion;
++ nodeStack.push(v); v->formatSpec = static_cast<ExpressionAst*>(visitNode(node->v.FormattedValue.format_spec)); nodeStack.pop();
++ result = v;
++ break;
++ }
+ case Bytes_kind: {
+ BytesAst* v = new BytesAst(parent());
+ v->value = PyUnicodeObjectToQString(node->v.Bytes.s);
+@@ -366,7 +380,7 @@ private:
+ break;
+ }
+ default:
+- qWarning() << "Unsupported statement AST type: " << node->kind;
++ qWarning() << "Unsupported _expr AST type: " << node->kind;
+ Q_ASSERT(false);
+ }
+
+@@ -445,7 +459,7 @@ private:
+ break;
+ }
+ default:
+- qWarning() << "Unsupported statement AST type: " << node->kind;
++ qWarning() << "Unsupported _slice AST type: " << node->kind;
+ Q_ASSERT(false);
+ }
+
+@@ -565,6 +579,14 @@ private:
+ result = v;
+ break;
+ }
++ case AnnAssign_kind: {
++ AnnotationAssignmentAst* v = new AnnotationAssignmentAst(parent());
++ nodeStack.push(v); v->target = static_cast<ExpressionAst*>(visitNode(node->v.AnnAssign.target)); nodeStack.pop();
++ nodeStack.push(v); v->annotation = static_cast<ExpressionAst*>(visitNode(node->v.AnnAssign.annotation)); nodeStack.pop();
++ nodeStack.push(v); v->value = static_cast<ExpressionAst*>(visitNode(node->v.AnnAssign.value)); nodeStack.pop();
++ result = v;
++ break;
++ }
+ case For_kind: {
+ ForAst* v = new ForAst(parent());
+ nodeStack.push(v); v->target = static_cast<ExpressionAst*>(visitNode(node->v.For.target)); nodeStack.pop();
+@@ -690,7 +712,7 @@ private:
+ break;
+ }
+ default:
+- qWarning() << "Unsupported statement AST type: " << node->kind;
++ qWarning() << "Unsupported _stmt AST type: " << node->kind;
+ Q_ASSERT(false);
+ }
+
+diff --git a/parser/python35.sdef b/parser/python35.sdef
+deleted file mode 100644
+index 30f1277..0000000
+--- a/parser/python35.sdef
++++ /dev/null
+@@ -1,78 +0,0 @@
+-COMMENT;This file specifies rules for a conversion of a python (C) to a plugin-internal (C++) syntax tree;;
+-COMMENT;All lines are terminated by a double semicolon token, newlines are ignored.;;
+-COMMENT;-> stands for "convert AST", => for "convert AST list", ~> for "make an identifier", :> is an assignment w/o conversion, and *> is an enum cast.;;
+-COMMENT;$> is a string assignment, +> is a "mindless assignment, like, it just does v->arg = node->arg.
+-COMMENT;_> is a Singleton Assignment (converts Py_True, Py_False, Py_None to enum)
+-COMMENT;the CODE statement can be used to add custom code.;;
+-
+-
+-RULE_FOR _stmt;KIND Expr_kind;ACTIONS create|ExpressionAst set|value->ExpressionAst,value;;
+-RULE_FOR _stmt;KIND FunctionDef_kind;ACTIONS create|FunctionDefinitionAst set|name~>name set|arguments->ArgumentsAst,args
+- set|body=>Ast,body set|decorators=>ExpressionAst,decorator_list set|returns->ExpressionAst,returns;;
+-RULE_FOR _stmt;KIND AsyncFunctionDef_kind;ACTIONS create|FunctionDefinitionAst set|name~>name set|arguments->ArgumentsAst,args
+- set|body=>Ast,body set|decorators=>ExpressionAst,decorator_list set|returns->ExpressionAst,returns;CODE v->async = true;;
+-RULE_FOR _stmt;KIND ClassDef_kind;ACTIONS create|ClassDefinitionAst set|name~>name set|baseClasses=>ExpressionAst,bases set|body=>Ast,body
+- set|decorators=>ExpressionAst,decorator_list;;
+-RULE_FOR _stmt;KIND Return_kind;ACTIONS create|ReturnAst set|value->ExpressionAst,value;;
+-RULE_FOR _stmt;KIND Delete_kind;ACTIONS create|DeleteAst set|targets=>ExpressionAst,targets;;
+-RULE_FOR _stmt;KIND Assign_kind;ACTIONS create|AssignmentAst set|targets=>ExpressionAst,targets set|value->ExpressionAst,value;;
+-RULE_FOR _stmt;KIND AugAssign_kind;ACTIONS create|AugmentedAssignmentAst set|target->ExpressionAst,target set|op*>OperatorTypes,op set|value->ExpressionAst,value;;
+-RULE_FOR _stmt;KIND For_kind;ACTIONS create|ForAst set|target->ExpressionAst,target set|iterator->ExpressionAst,iter set|body=>Ast,body set|orelse=>Ast,orelse;;
+-RULE_FOR _stmt;KIND AsyncFor_kind;ACTIONS create|ForAst set|target->ExpressionAst,target set|iterator->ExpressionAst,iter set|body=>Ast,body set|orelse=>Ast,orelse;;
+-RULE_FOR _stmt;KIND While_kind;ACTIONS create|WhileAst set|condition->ExpressionAst,test set|body=>Ast,body set|orelse=>Ast,orelse;;
+-RULE_FOR _stmt;KIND If_kind;ACTIONS create|IfAst set|condition->ExpressionAst,test set|body=>Ast,body set|orelse=>Ast,orelse;;
+-RULE_FOR _stmt;KIND With_kind;ACTIONS create|WithAst set|body=>Ast,body set|items=>WithItemAst,items;;
+-RULE_FOR _stmt;KIND AsyncWith_kind;ACTIONS create|WithAst set|body=>Ast,body set|items=>WithItemAst,items;;
+-
+-COMMENT;FIXME: the struct Raise has changed, so the following line is likely wrong;;
+-RULE_FOR _stmt;KIND Raise_kind;ACTIONS create|RaiseAst set|type->ExpressionAst,exc;;
+-RULE_FOR _stmt;KIND Try_kind;ACTIONS create|TryAst set|body=>Ast,body set|handlers=>ExceptionHandlerAst,handlers set|orelse=>Ast,orelse set|finally=>Ast,finalbody;;
+-RULE_FOR _stmt;KIND Assert_kind;ACTIONS create|AssertionAst set|condition->ExpressionAst,test set|message->ExpressionAst,msg;;
+-RULE_FOR _stmt;KIND Import_kind;ACTIONS create|ImportAst set|names=>AliasAst,names;;
+-RULE_FOR _stmt;KIND ImportFrom_kind;ACTIONS create|ImportFromAst set|module~>module set|names=>AliasAst,names set|level:>level;;
+-RULE_FOR _stmt;KIND Global_kind;ACTIONS create|GlobalAst set|names=>Identifier,names;;
+-RULE_FOR _stmt;KIND Break_kind;ACTIONS create|BreakAst;;
+-RULE_FOR _stmt;KIND Continue_kind;ACTIONS create|ContinueAst;;
+-RULE_FOR _stmt;KIND Pass_kind;ACTIONS create|PassAst;;
+-RULE_FOR _stmt;KIND Nonlocal_kind;ACTIONS create|NonlocalAst;;
+-
+-RULE_FOR _expr;KIND Await_kind;ACTIONS create|AwaitAst set|value->ExpressionAst,value;;
+-RULE_FOR _expr;KIND BoolOp_kind;ACTIONS create|BooleanOperationAst set|type*>BooleanOperationTypes,op set|values=>ExpressionAst,values;;
+-RULE_FOR _expr;KIND BinOp_kind;ACTIONS create|BinaryOperationAst set|type*>OperatorTypes,op set|lhs->ExpressionAst,left set|rhs->ExpressionAst,right;;
+-RULE_FOR _expr;KIND UnaryOp_kind;ACTIONS create|UnaryOperationAst set|type*>UnaryOperatorTypes,op set|operand->ExpressionAst,operand;;
+-RULE_FOR _expr;KIND Lambda_kind;ACTIONS create|LambdaAst set|arguments->ArgumentsAst,args set|body->ExpressionAst,body;;
+-RULE_FOR _expr;KIND IfExp_kind;ACTIONS create|IfExpressionAst set|condition->ExpressionAst,test set|body->ExpressionAst,body set|orelse->ExpressionAst,orelse;;
+-RULE_FOR _expr;KIND Dict_kind;ACTIONS create|DictAst set|keys=>ExpressionAst,keys set|values=>ExpressionAst,values;;
+-RULE_FOR _expr;KIND Set_kind;ACTIONS create|SetAst set|elements=>ExpressionAst,elts;;
+-RULE_FOR _expr;KIND ListComp_kind;ACTIONS create|ListComprehensionAst set|element->ExpressionAst,elt set|generators=>ComprehensionAst,generators;;
+-RULE_FOR _expr;KIND SetComp_kind;ACTIONS create|SetComprehensionAst set|element->ExpressionAst,elt set|generators=>ComprehensionAst,generators;;
+-RULE_FOR _expr;KIND DictComp_kind;ACTIONS create|DictionaryComprehensionAst set|key->ExpressionAst,key set|value->ExpressionAst,value set|generators=>ComprehensionAst,generators;;
+-RULE_FOR _expr;KIND GeneratorExp_kind;ACTIONS create|GeneratorExpressionAst set|element->ExpressionAst,elt set|generators=>ComprehensionAst,generators;;
+-RULE_FOR _expr;KIND Yield_kind;ACTIONS create|YieldAst set|value->ExpressionAst,value;;
+-RULE_FOR _expr;KIND Compare_kind;ACTIONS create|CompareAst set|leftmostElement->ExpressionAst,left set|operators#>ComparisonOperatorTypes,ops set|comparands=>ExpressionAst,comparators;;
+-RULE_FOR _expr;KIND Call_kind;ACTIONS create|CallAst set|function->ExpressionAst,func set|arguments=>ExpressionAst,args set|keywords=>KeywordAst,keywords;CODE v->function->belongsToCall = v;;
+-RULE_FOR _expr;KIND Num_kind;ACTIONS create|NumberAst;CODE v->isInt = PyLong_Check(node->v.Num.n); v->value = PyLong_AsLong(node->v.Num.n);;
+-RULE_FOR _expr;KIND Str_kind;ACTIONS create|StringAst set|value$>s;;
+-RULE_FOR _expr;KIND Bytes_kind;ACTIONS create|BytesAst set|value$>s;;
+-RULE_FOR _expr;KIND Attribute_kind;ACTIONS create|AttributeAst set|attribute~>attr set|value->ExpressionAst,value set|context*>Context,ctx;;
+-RULE_FOR _expr;KIND Subscript_kind;ACTIONS create|SubscriptAst set|value->ExpressionAst,value set|slice->SliceAst,slice set|context*>Context,ctx;;
+-RULE_FOR _expr;KIND Starred_kind;ACTIONS create|StarredAst set|value->ExpressionAst,value set|context*>Context,ctx;;
+-RULE_FOR _expr;KIND Name_kind;ACTIONS create|NameAst set|identifier~>id set|context*>Context,ctx;;
+-RULE_FOR _expr;KIND List_kind;ACTIONS create|ListAst set|elements=>ExpressionAst,elts set|context*>Context,ctx;;
+-RULE_FOR _expr;KIND Tuple_kind;ACTIONS create|TupleAst set|elements=>ExpressionAst,elts set|context*>Context,ctx;;
+-RULE_FOR _expr;KIND Ellipsis_kind;ACTIONS create|EllipsisAst;;
+-RULE_FOR _expr;KIND NameConstant_kind;ACTIONS create|NameConstantAst set|value_>value;;
+-RULE_FOR _expr;KIND YieldFrom_kind;ACTIONS create|YieldFromAst set|value->ExpressionAst,value;;
+-
+-RULE_FOR _slice;KIND Slice_kind;ACTIONS create|SliceAst set|lower->ExpressionAst,lower set|upper->ExpressionAst,upper set|step->ExpressionAst,step;;
+-RULE_FOR _slice;KIND ExtSlice_kind;ACTIONS create|ExtendedSliceAst set|dims=>SliceAst,dims;;
+-RULE_FOR _slice;KIND Index_kind;ACTIONS create|IndexAst set|value->ExpressionAst,value;;
+-
+-
+-RULE_FOR _comprehension;KIND any;ACTIONS create|ComprehensionAst set|target->ExpressionAst,target set|iterator->ExpressionAst,iter set|conditions=>ExpressionAst,ifs;;
+-RULE_FOR _excepthandler;KIND ExceptHandler_kind;ACTIONS create|ExceptionHandlerAst set|type->ExpressionAst,type set|name~>name set|body=>Ast,body;;
+-RULE_FOR _arguments;KIND any;ACTIONS create|ArgumentsAst set|vararg->ArgAst,vararg set|kwarg->ArgAst,kwarg set|arguments=>ArgAst,args set|defaultValues=>ExpressionAst,defaults set|kwonlyargs=>ArgAst,kwonlyargs;;
+-RULE_FOR _arg;KIND any;ACTIONS create|ArgAst set|argumentName~>arg set|annotation->ExpressionAst,annotation;;
+-RULE_FOR _keyword;KIND any;ACTIONS create|KeywordAst set|argumentName~>arg set|value->ExpressionAst,value;;
+-RULE_FOR _alias;KIND any;ACTIONS create|AliasAst set|name~>name set|asName~>asname;;
+-RULE_FOR _withitem;KIND any; ACTIONS create|WithItemAst set|contextExpression->ExpressionAst,context_expr set|optionalVars->NameAst,optional_vars;;
+diff --git a/parser/tests/pyasttest.cpp b/parser/tests/pyasttest.cpp
+index 875662a..7995b18 100644
+--- a/parser/tests/pyasttest.cpp
++++ b/parser/tests/pyasttest.cpp
+@@ -153,6 +153,8 @@ void PyAstTest::testStatements_data()
+ QTest::newRow("continue") << "while True: continue";
+ QTest::newRow("pass") << "pass";
+ QTest::newRow("nonlocal") << "nonlocal x";
++ QTest::newRow("varannotation1") << "primes: List[int] = []";
++ QTest::newRow("varannotation2") << "captain: str # Note: no initial value!";
+ }
+
+ void PyAstTest::testSlices()
+@@ -221,10 +223,16 @@ void PyAstTest::testExpressions_data()
+ QTest::newRow("None") << "None";
+ QTest::newRow("False") << "False";
+ QTest::newRow("True") << "True";
++
++ QTest::newRow("async_generator") << "async def foo(): result = [i async for i in aiter() if i % 2]";
++ QTest::newRow("await_generator") << "async def foo(): result = [await fun() for fun in funcs]";
++
++ QTest::newRow("underscore_literals") << "0x_FF_FF_FF_FF";
+ QTest::newRow("dstar_unpack") << "ext_map = {\n"
+ " **{ext: self.obj_extension for ext in self.src_extensions},\n"
+ " **{ext: self.res_extension for ext in self._rc_extensions + self._mc_extensions},\n"
+ "}";
++ QTest::newRow("formatted_string_literal") << "f\"He said his name is {name}.\"";
+ }
+
+ void PyAstTest::testCorrectedFuncRanges()
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-04 0:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-04 0:59 [rpms/kdevelop-python] f44: Add support for Python 3.6 Jan Grulich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox