Commit e36bd4a8 authored by Milian Wolff's avatar Milian Wolff
Browse files

Merge branch '5.6'

parents 28b549cf f7c252fd
......@@ -255,6 +255,7 @@ void PyDUChainTest::testCrashes() {
void PyDUChainTest::testCrashes_data() {
QTest::addColumn<QString>("code");
QTest::newRow("composite_slice") << "A = M[1:3, 3]";
QTest::newRow("unicode_char") << "a = \"í\"";
QTest::newRow("unicode escape char") << "print(\"\\xe9\")";
QTest::newRow("augassign") << "a = 3\na += 5";
......
......@@ -114,6 +114,7 @@
<category>IDE</category>
</categories>
<releases>
<release version="5.6.1" date="2020-12-08"/>
<release version="5.6.0" date="2020-09-07">
<url>https://www.kdevelop.org/news/kdevelop-560-released</url>
<artifacts>
......
......@@ -9,7 +9,7 @@
import sys
contents = open('python38.sdef').read().replace("\n", "").split(';;')
contents = open('python39.sdef').read().replace("\n", "").split(';;')
func_structure = '''
Ast* visitNode(%{RULE_FOR}* node) {
......
......@@ -510,7 +510,7 @@ PyObject *value = node->v.Constant.value;if (value == Py_None) { NameConstant
#if PYTHON_VERSION < QT_VERSION_CHECK(3, 9, 0)
case ExtSlice_kind: {
TupleAst* v = new TupleAst(parent());
nodeStack.push(v); v->elements = visitNodeList<_expr, ExpressionAst>(node->v.ExtSlice.dims); nodeStack.pop();
nodeStack.push(v); v->elements = visitNodeList<_slice, ExpressionAst>(node->v.ExtSlice.dims); nodeStack.pop();
result = v;
break;
}
......
......@@ -132,7 +132,8 @@ RULE_FOR _expr;KIND NamedExpr_kind;ACTIONS create|AssignmentExpressionAst set|ta
RULE_FOR _expr;KIND Slice_kind;ACTIONS create|SliceAst set|lower->ExpressionAst,lower set|upper->ExpressionAst,upper set|step->ExpressionAst,step;SINCE 3.9;;
RULE_FOR _slice;KIND Slice_kind;ACTIONS create|SliceAst set|lower->ExpressionAst,lower set|upper->ExpressionAst,upper set|step->ExpressionAst,step;BEFORE 3.9;;
RULE_FOR _slice;KIND ExtSlice_kind;ACTIONS create|TupleAst set|elements=>ExpressionAst,dims;BEFORE 3.9;;
RULE_FOR _slice;KIND ExtSlice_kind;ACTIONS create|TupleAst;BEFORE 3.9;CODE
nodeStack.push(v); v->elements = visitNodeList<_slice, ExpressionAst>(node->v.ExtSlice.dims); nodeStack.pop();;
RULE_FOR _slice;KIND Index_kind;ACTIONS;BEFORE 3.9;CODE return visitNode(node->v.Index.value);;
......
......@@ -152,6 +152,17 @@ void PyAstTest::testStatements_data()
QTest::newRow("continue") << "while True: continue";
QTest::newRow("pass") << "pass";
QTest::newRow("nonlocal") << "nonlocal x";
QTest::newRow("delete") << "del x";
QTest::newRow("augassign_plus") << "a += b";
QTest::newRow("augassign_minus") << "a -= b";
QTest::newRow("augassign_mul") << "a *= b";
QTest::newRow("augassign_div") << "a /= b";
QTest::newRow("augassign_or") << "a &= b";
QTest::newRow("augassign_and") << "a |= b";
QTest::newRow("augassign_xor") << "a ^= b";
#if PYTHON_VERSION >= QT_VERSION_CHECK(3, 5, 0)
QTest::newRow("augassign_matmul") << "a @= b";
#endif
#if PYTHON_VERSION >= QT_VERSION_CHECK(3, 6, 0)
QTest::newRow("varannotation1") << "primes: List[int] = []";
QTest::newRow("varannotation2") << "captain: str # Note: no initial value!";
......@@ -171,6 +182,7 @@ void PyAstTest::testSlices_data()
QTest::newRow("slice2") << "x[2:3]";
QTest::newRow("slice3") << "x[::]";
QTest::newRow("slice4") << "x[1:2:3]";
QTest::newRow("slice_ellipsis") << "myList[1:2, ..., 0]";
}
void PyAstTest::testOther()
......@@ -224,6 +236,11 @@ void PyAstTest::testExpressions_data()
QTest::newRow("None") << "None";
QTest::newRow("False") << "False";
QTest::newRow("True") << "True";
QTest::newRow("Set") << "{1, 2, 3}";
QTest::newRow("SetComp") << "{1 for x in [1, 2, 3]}";
QTest::newRow("ExtSlice") << "A[1:3,3:5]";
QTest::newRow("FString") << "f\"hi {a.b}\"";
QTest::newRow("Formatted") << "'%s %s' % ('one', 'two')";
#if PYTHON_VERSION >= QT_VERSION_CHECK(3, 6, 0)
QTest::newRow("async_generator") << "async def foo(): result = [i async for i in aiter() if i % 2]";
......@@ -237,6 +254,9 @@ void PyAstTest::testExpressions_data()
" **{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("async_for") << "[i async for i in foo()]";
QTest::newRow("async_for_stmt") << "async for x in y: pass";
QTest::newRow("async_with_stmt") << "async with x as y: pass";
#endif
#if PYTHON_VERSION >= QT_VERSION_CHECK(3, 8, 0)
QTest::newRow("assignment_expr_1") << "a = (b := 10)";
......
......@@ -75,7 +75,7 @@
<number>1000</number>
</property>
<property name="singleStep">
<number>2</number>
<number>1</number>
</property>
<property name="value">
<number>80</number>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment