From 820d68cfd42e353f188f9c0c2f4cfaf4fcb23c1a Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sat, 4 Sep 2021 13:03:50 +0200 Subject: [PATCH] kde-frameworks/syntax-highlighting: Python: Add "yield from" keyword Upstream commit 439f8cbfe0b5d1f931c2233d1790e1280170c24c KDE-bug: https://bugs.kde.org/show_bug.cgi?id=441540 Package-Manager: Portage-3.0.22, Repoman-3.0.3 Signed-off-by: Andreas Sturmlechner --- ...5.85.0-python-add-yield-from-keyword.patch | 170 ++++++++++++++++++ .../syntax-highlighting-5.85.0-r1.ebuild | 33 ++++ 2 files changed, 203 insertions(+) create mode 100644 kde-frameworks/syntax-highlighting/files/syntax-highlighting-5.85.0-python-add-yield-from-keyword.patch create mode 100644 kde-frameworks/syntax-highlighting/syntax-highlighting-5.85.0-r1.ebuild diff --git a/kde-frameworks/syntax-highlighting/files/syntax-highlighting-5.85.0-python-add-yield-from-keyword.patch b/kde-frameworks/syntax-highlighting/files/syntax-highlighting-5.85.0-python-add-yield-from-keyword.patch new file mode 100644 index 0000000000000..ba1ae38355e84 --- /dev/null +++ b/kde-frameworks/syntax-highlighting/files/syntax-highlighting-5.85.0-python-add-yield-from-keyword.patch @@ -0,0 +1,170 @@ +From 439f8cbfe0b5d1f931c2233d1790e1280170c24c Mon Sep 17 00:00:00 2001 +From: Jan Paul Batrina +Date: Sat, 28 Aug 2021 21:27:41 +0800 +Subject: [PATCH] Python: Add "yield from" keyword + +BUG: 441540 +--- + autotests/folding/test.py.fold | 9 +++++++++ + autotests/html/test.py.dark.html | 9 +++++++++ + autotests/html/test.py.html | 9 +++++++++ + autotests/input/test.py | 9 +++++++++ + autotests/reference/test.py.ref | 9 +++++++++ + data/syntax/python.xml | 17 +++++++++++++++-- + 6 files changed, 60 insertions(+), 2 deletions(-) + +diff --git a/autotests/folding/test.py.fold b/autotests/folding/test.py.fold +index 7bbf054c..5e7a3ba8 100644 +--- a/autotests/folding/test.py.fold ++++ b/autotests/folding/test.py.fold +@@ -118,6 +118,15 @@ match(command.split(["quit"]: + print("Goodbye!") + ++def func1(): ++ yield 1 ++ yield from [func(), 1, 2, "3"] ++ # invalid, "from" no longer part of "yield from" ++ yield, from 1 ++ ++async def func2(): ++ await asyncio.sleep(1) ++ + "\\\\\\\\\\ENSURE THAT THIS AND THE FOLLOWING LINES ARE AT THE END OF THE FILE\\\\\\\\\\ \ + " + a = 'otherwise all succeeding lines will be +diff --git a/autotests/html/test.py.dark.html b/autotests/html/test.py.dark.html +index 23718b11..1d6c1dd2 100644 +--- a/autotests/html/test.py.dark.html ++++ b/autotests/html/test.py.dark.html +@@ -124,6 +124,15 @@ match(command.split()) + case ["quit"]: + print("Goodbye!") + ++def func1(): ++ yield 1 ++ yield from [func(), 1, 2, "3"] ++ # invalid, "from" no longer part of "yield from" ++ yield, from 1 ++ ++async def func2(): ++ await asyncio.sleep(1) ++ + "\\\\\\\\\\ENSURE THAT THIS AND THE FOLLOWING LINES ARE AT THE END OF THE FILE\\\\\\\\\\ \ + " + a = 'otherwise all succeeding lines will be +diff --git a/autotests/html/test.py.html b/autotests/html/test.py.html +index 55cfefb0..4d7a2709 100644 +--- a/autotests/html/test.py.html ++++ b/autotests/html/test.py.html +@@ -124,6 +124,15 @@ match(command.split()) + case ["quit"]: + print("Goodbye!") + ++def func1(): ++ yield 1 ++ yield from [func(), 1, 2, "3"] ++ # invalid, "from" no longer part of "yield from" ++ yield, from 1 ++ ++async def func2(): ++ await asyncio.sleep(1) ++ + "\\\\\\\\\\ENSURE THAT THIS AND THE FOLLOWING LINES ARE AT THE END OF THE FILE\\\\\\\\\\ \ + " + a = 'otherwise all succeeding lines will be +diff --git a/autotests/input/test.py b/autotests/input/test.py +index 3eb8378d..d91db578 100644 +--- a/autotests/input/test.py ++++ b/autotests/input/test.py +@@ -118,6 +118,15 @@ match(command.split()): + case ["quit"]: + print("Goodbye!") + ++def func1(): ++ yield 1 ++ yield from [func(), 1, 2, "3"] ++ # invalid, "from" no longer part of "yield from" ++ yield, from 1 ++ ++async def func2(): ++ await asyncio.sleep(1) ++ + "\\\\\\\\\\ENSURE THAT THIS AND THE FOLLOWING LINES ARE AT THE END OF THE FILE\\\\\\\\\\ \ + " + a = 'otherwise all succeeding lines will be +diff --git a/autotests/reference/test.py.ref b/autotests/reference/test.py.ref +index 9c5bdb54..1742da2b 100644 +--- a/autotests/reference/test.py.ref ++++ b/autotests/reference/test.py.ref +@@ -118,6 +118,15 @@ + case ["quit"]:
+ print("Goodbye!")
+
++def func1():
++ yield 1
++ yield from [func(), 1, 2, "3"]
++ # invalid, "from" no longer part of "yield from"
++ yield, from 1
++
++async def func2():
++ await asyncio.sleep(1)
++
+ "\\\\\\\\\\ENSURE THAT THIS AND THE FOLLOWING LINES ARE AT THE END OF THE FILE\\\\\\\\\\ \
+ "
+ a = 'otherwise all succeeding lines will be
+diff --git a/data/syntax/python.xml b/data/syntax/python.xml +index 7143bf30..676872f0 100644 +--- a/data/syntax/python.xml ++++ b/data/syntax/python.xml +@@ -52,7 +52,7 @@ + + + +- ++ + + + import +@@ -90,10 +90,17 @@ + try + while + with +- yield + async + await + ++ ++ yield ++ ++ yield from ++ + + match + case +@@ -380,6 +387,7 @@ + + + ++ + + + +@@ -428,6 +436,11 @@ + + + ++ ++ ++ ++ ++ + +