aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2023-12-13 02:43:57 +0300
committershadchin <shadchin@yandex-team.com>2023-12-13 03:08:48 +0300
commit5b48aabc614c6d407f885f3b228dc484ad4c5ba9 (patch)
tree602eb5cc5d85bf730c1de1fa50a13c2ee552830d /contrib
parent35d7049b38602e8cbfcd3f96257329a1abce947e (diff)
downloadydb-5b48aabc614c6d407f885f3b228dc484ad4c5ba9.tar.gz
Update Python 3 to 3.11.7
Diffstat (limited to 'contrib')
-rw-r--r--contrib/tools/python3/src/Include/errcode.h39
-rw-r--r--contrib/tools/python3/src/Include/patchlevel.h4
-rw-r--r--contrib/tools/python3/src/Lib/asyncio/streams.py19
-rw-r--r--contrib/tools/python3/src/Lib/asyncio/taskgroups.py6
-rw-r--r--contrib/tools/python3/src/Lib/asyncio/timeouts.py12
-rw-r--r--contrib/tools/python3/src/Lib/asyncio/unix_events.py13
-rw-r--r--contrib/tools/python3/src/Lib/codeop.py19
-rw-r--r--contrib/tools/python3/src/Lib/contextlib.py20
-rw-r--r--contrib/tools/python3/src/Lib/dis.py5
-rw-r--r--contrib/tools/python3/src/Lib/doctest.py25
-rw-r--r--contrib/tools/python3/src/Lib/enum.py11
-rw-r--r--contrib/tools/python3/src/Lib/gettext.py14
-rw-r--r--contrib/tools/python3/src/Lib/http/client.py12
-rw-r--r--contrib/tools/python3/src/Lib/io.py3
-rw-r--r--contrib/tools/python3/src/Lib/ipaddress.py3
-rw-r--r--contrib/tools/python3/src/Lib/locale.py9
-rw-r--r--contrib/tools/python3/src/Lib/logging/config.py12
-rw-r--r--contrib/tools/python3/src/Lib/logging/handlers.py6
-rwxr-xr-xcontrib/tools/python3/src/Lib/pdb.py29
-rwxr-xr-xcontrib/tools/python3/src/Lib/pydoc.py24
-rw-r--r--contrib/tools/python3/src/Lib/pydoc_data/topics.py229
-rw-r--r--contrib/tools/python3/src/Lib/re/_compiler.py4
-rw-r--r--contrib/tools/python3/src/Lib/re/_parser.py13
-rw-r--r--contrib/tools/python3/src/Lib/ssl.py12
-rw-r--r--contrib/tools/python3/src/Lib/traceback.py80
-rw-r--r--contrib/tools/python3/src/Lib/typing.py108
-rw-r--r--contrib/tools/python3/src/Lib/unittest/mock.py6
-rw-r--r--contrib/tools/python3/src/Lib/ya.make4
-rw-r--r--contrib/tools/python3/src/Lib/zoneinfo/_zoneinfo.py86
-rw-r--r--contrib/tools/python3/src/Modules/_blake2/blake2module.c25
-rw-r--r--contrib/tools/python3/src/Modules/_datetimemodule.c2
-rw-r--r--contrib/tools/python3/src/Modules/_io/bytesio.c7
-rw-r--r--contrib/tools/python3/src/Modules/_io/textio.c50
-rw-r--r--contrib/tools/python3/src/Modules/_io/winconsoleio.c36
-rw-r--r--contrib/tools/python3/src/Modules/_pickle.c14
-rw-r--r--contrib/tools/python3/src/Modules/_sqlite/ya.make4
-rw-r--r--contrib/tools/python3/src/Modules/_sre/sre.c5
-rw-r--r--contrib/tools/python3/src/Modules/_sre/sre_lib.h14
-rw-r--r--contrib/tools/python3/src/Modules/_zoneinfo.c371
-rw-r--r--contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c9
-rw-r--r--contrib/tools/python3/src/Modules/clinic/posixmodule.c.h6
-rw-r--r--contrib/tools/python3/src/Modules/itertoolsmodule.c13
-rw-r--r--contrib/tools/python3/src/Modules/posixmodule.c14
-rw-r--r--contrib/tools/python3/src/Modules/socketmodule.c13
-rw-r--r--contrib/tools/python3/src/Modules/termios.c39
-rw-r--r--contrib/tools/python3/src/Modules/ya.make4
-rw-r--r--contrib/tools/python3/src/Objects/bytearrayobject.c5
-rw-r--r--contrib/tools/python3/src/Objects/frameobject.c12
-rw-r--r--contrib/tools/python3/src/Objects/typeobject.c8
-rw-r--r--contrib/tools/python3/src/Parser/parser.c2262
-rw-r--r--contrib/tools/python3/src/Parser/pegen.c55
-rw-r--r--contrib/tools/python3/src/Parser/pegen.h1
-rw-r--r--contrib/tools/python3/src/Parser/pegen_errors.c12
-rw-r--r--contrib/tools/python3/src/Parser/string_parser.c5
-rw-r--r--contrib/tools/python3/src/Parser/tokenizer.c4
-rw-r--r--contrib/tools/python3/src/Python/ceval.c19
-rw-r--r--contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c95
-rw-r--r--contrib/tools/python3/src/Python/getargs.c2
-rw-r--r--contrib/tools/python3/src/Python/import.c15
-rw-r--r--contrib/tools/python3/src/Python/traceback.c73
-rw-r--r--contrib/tools/python3/src/README.rst2
-rw-r--r--contrib/tools/python3/src/ya.make4
-rw-r--r--contrib/tools/python3/ya.make4
63 files changed, 2382 insertions, 1649 deletions
diff --git a/contrib/tools/python3/src/Include/errcode.h b/contrib/tools/python3/src/Include/errcode.h
index 54ae929bf2..19ee83ec73 100644
--- a/contrib/tools/python3/src/Include/errcode.h
+++ b/contrib/tools/python3/src/Include/errcode.h
@@ -4,7 +4,6 @@
extern "C" {
#endif
-
/* Error codes passed around between file input, tokenizer, parser and
interpreter. This is necessary so we can turn them into Python
exceptions at a higher level. Note that some errors have a
@@ -13,24 +12,26 @@ extern "C" {
the parser only returns E_EOF when it hits EOF immediately, and it
never returns E_OK. */
-#define E_OK 10 /* No error */
-#define E_EOF 11 /* End Of File */
-#define E_INTR 12 /* Interrupted */
-#define E_TOKEN 13 /* Bad token */
-#define E_SYNTAX 14 /* Syntax error */
-#define E_NOMEM 15 /* Ran out of memory */
-#define E_DONE 16 /* Parsing complete */
-#define E_ERROR 17 /* Execution error */
-#define E_TABSPACE 18 /* Inconsistent mixing of tabs and spaces */
-#define E_OVERFLOW 19 /* Node had too many children */
-#define E_TOODEEP 20 /* Too many indentation levels */
-#define E_DEDENT 21 /* No matching outer block for dedent */
-#define E_DECODE 22 /* Error in decoding into Unicode */
-#define E_EOFS 23 /* EOF in triple-quoted string */
-#define E_EOLS 24 /* EOL in single-quoted string */
-#define E_LINECONT 25 /* Unexpected characters after a line continuation */
-#define E_BADSINGLE 27 /* Ill-formed single statement input */
-#define E_INTERACT_STOP 28 /* Interactive mode stopped tokenization */
+#define E_OK 10 /* No error */
+#define E_EOF 11 /* End Of File */
+#define E_INTR 12 /* Interrupted */
+#define E_TOKEN 13 /* Bad token */
+#define E_SYNTAX 14 /* Syntax error */
+#define E_NOMEM 15 /* Ran out of memory */
+#define E_DONE 16 /* Parsing complete */
+#define E_ERROR 17 /* Execution error */
+#define E_TABSPACE 18 /* Inconsistent mixing of tabs and spaces */
+#define E_OVERFLOW 19 /* Node had too many children */
+#define E_TOODEEP 20 /* Too many indentation levels */
+#define E_DEDENT 21 /* No matching outer block for dedent */
+#define E_DECODE 22 /* Error in decoding into Unicode */
+#define E_EOFS 23 /* EOF in triple-quoted string */
+#define E_EOLS 24 /* EOL in single-quoted string */
+#define E_LINECONT 25 /* Unexpected characters after a line continuation */
+#define E_BADSINGLE 27 /* Ill-formed single statement input */
+#define E_INTERACT_STOP 28 /* Interactive mode stopped tokenization */
+#define E_COLUMNOVERFLOW 29 /* Column offset overflow */
+
#ifdef __cplusplus
}
diff --git a/contrib/tools/python3/src/Include/patchlevel.h b/contrib/tools/python3/src/Include/patchlevel.h
index 70d71c1137..7acea93703 100644
--- a/contrib/tools/python3/src/Include/patchlevel.h
+++ b/contrib/tools/python3/src/Include/patchlevel.h
@@ -18,12 +18,12 @@
/*--start constants--*/
#define PY_MAJOR_VERSION 3
#define PY_MINOR_VERSION 11
-#define PY_MICRO_VERSION 6
+#define PY_MICRO_VERSION 7
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
#define PY_RELEASE_SERIAL 0
/* Version as a string */
-#define PY_VERSION "3.11.6"
+#define PY_VERSION "3.11.7"
/*--end constants--*/
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
diff --git a/contrib/tools/python3/src/Lib/asyncio/streams.py b/contrib/tools/python3/src/Lib/asyncio/streams.py
index 19d9154b66..23b6e4c32f 100644
--- a/contrib/tools/python3/src/Lib/asyncio/streams.py
+++ b/contrib/tools/python3/src/Lib/asyncio/streams.py
@@ -245,7 +245,19 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
res = self._client_connected_cb(reader,
self._stream_writer)
if coroutines.iscoroutine(res):
+ def callback(task):
+ exc = task.exception()
+ if exc is not None:
+ self._loop.call_exception_handler({
+ 'message': 'Unhandled exception in client_connected_cb',
+ 'exception': exc,
+ 'transport': transport,
+ })
+ transport.close()
+
self._task = self._loop.create_task(res)
+ self._task.add_done_callback(callback)
+
self._strong_reader = None
def connection_lost(self, exc):
@@ -392,8 +404,11 @@ class StreamWriter:
def __del__(self):
if not self._transport.is_closing():
- self.close()
-
+ if self._loop.is_closed():
+ warnings.warn("loop is closed", ResourceWarning)
+ else:
+ self.close()
+ warnings.warn(f"unclosed {self!r}", ResourceWarning)
class StreamReader:
diff --git a/contrib/tools/python3/src/Lib/asyncio/taskgroups.py b/contrib/tools/python3/src/Lib/asyncio/taskgroups.py
index 0fdea3697e..bfdbe63049 100644
--- a/contrib/tools/python3/src/Lib/asyncio/taskgroups.py
+++ b/contrib/tools/python3/src/Lib/asyncio/taskgroups.py
@@ -54,16 +54,14 @@ class TaskGroup:
async def __aenter__(self):
if self._entered:
raise RuntimeError(
- f"TaskGroup {self!r} has been already entered")
- self._entered = True
-
+ f"TaskGroup {self!r} has already been entered")
if self._loop is None:
self._loop = events.get_running_loop()
-
self._parent_task = tasks.current_task(self._loop)
if self._parent_task is None:
raise RuntimeError(
f'TaskGroup {self!r} cannot determine the parent task')
+ self._entered = True
return self
diff --git a/contrib/tools/python3/src/Lib/asyncio/timeouts.py b/contrib/tools/python3/src/Lib/asyncio/timeouts.py
index 029c468739..30042abb3a 100644
--- a/contrib/tools/python3/src/Lib/asyncio/timeouts.py
+++ b/contrib/tools/python3/src/Lib/asyncio/timeouts.py
@@ -49,8 +49,9 @@ class Timeout:
def reschedule(self, when: Optional[float]) -> None:
"""Reschedule the timeout."""
- assert self._state is not _State.CREATED
if self._state is not _State.ENTERED:
+ if self._state is _State.CREATED:
+ raise RuntimeError("Timeout has not been entered")
raise RuntimeError(
f"Cannot change state of {self._state.value} Timeout",
)
@@ -82,11 +83,14 @@ class Timeout:
return f"<Timeout [{self._state.value}]{info_str}>"
async def __aenter__(self) -> "Timeout":
+ if self._state is not _State.CREATED:
+ raise RuntimeError("Timeout has already been entered")
+ task = tasks.current_task()
+ if task is None:
+ raise RuntimeError("Timeout should be used inside a task")
self._state = _State.ENTERED
- self._task = tasks.current_task()
+ self._task = task
self._cancelling = self._task.cancelling()
- if self._task is None:
- raise RuntimeError("Timeout should be used inside a task")
self.reschedule(self._when)
return self
diff --git a/contrib/tools/python3/src/Lib/asyncio/unix_events.py b/contrib/tools/python3/src/Lib/asyncio/unix_events.py
index ac4519acc4..77d2670f83 100644
--- a/contrib/tools/python3/src/Lib/asyncio/unix_events.py
+++ b/contrib/tools/python3/src/Lib/asyncio/unix_events.py
@@ -1363,14 +1363,7 @@ class ThreadedChildWatcher(AbstractChildWatcher):
return True
def close(self):
- self._join_threads()
-
- def _join_threads(self):
- """Internal: Join all non-daemon threads"""
- threads = [thread for thread in list(self._threads.values())
- if thread.is_alive() and not thread.daemon]
- for thread in threads:
- thread.join()
+ pass
def __enter__(self):
return self
@@ -1389,7 +1382,7 @@ class ThreadedChildWatcher(AbstractChildWatcher):
def add_child_handler(self, pid, callback, *args):
loop = events.get_running_loop()
thread = threading.Thread(target=self._do_waitpid,
- name=f"waitpid-{next(self._pid_counter)}",
+ name=f"asyncio-waitpid-{next(self._pid_counter)}",
args=(loop, pid, callback, args),
daemon=True)
self._threads[pid] = thread
@@ -1443,8 +1436,6 @@ class _UnixDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
with events._lock:
if self._watcher is None: # pragma: no branch
self._watcher = ThreadedChildWatcher()
- if threading.current_thread() is threading.main_thread():
- self._watcher.attach_loop(self._local._loop)
def set_event_loop(self, loop):
"""Set the event loop.
diff --git a/contrib/tools/python3/src/Lib/codeop.py b/contrib/tools/python3/src/Lib/codeop.py
index 2213b69f23..e64911ee5a 100644
--- a/contrib/tools/python3/src/Lib/codeop.py
+++ b/contrib/tools/python3/src/Lib/codeop.py
@@ -70,8 +70,7 @@ def _maybe_compile(compiler, source, filename, symbol):
return None
# fallthrough
- return compiler(source, filename, symbol)
-
+ return compiler(source, filename, symbol, incomplete_input=False)
def _is_syntax_error(err1, err2):
rep1 = repr(err1)
@@ -82,8 +81,12 @@ def _is_syntax_error(err1, err2):
return True
return False
-def _compile(source, filename, symbol):
- return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT | PyCF_ALLOW_INCOMPLETE_INPUT)
+def _compile(source, filename, symbol, incomplete_input=True):
+ flags = 0
+ if incomplete_input:
+ flags |= PyCF_ALLOW_INCOMPLETE_INPUT
+ flags |= PyCF_DONT_IMPLY_DEDENT
+ return compile(source, filename, symbol, flags)
def compile_command(source, filename="<input>", symbol="single"):
r"""Compile a command and determine whether it is incomplete.
@@ -114,8 +117,12 @@ class Compile:
def __init__(self):
self.flags = PyCF_DONT_IMPLY_DEDENT | PyCF_ALLOW_INCOMPLETE_INPUT
- def __call__(self, source, filename, symbol):
- codeob = compile(source, filename, symbol, self.flags, True)
+ def __call__(self, source, filename, symbol, **kwargs):
+ flags = self.flags
+ if kwargs.get('incomplete_input', True) is False:
+ flags &= ~PyCF_DONT_IMPLY_DEDENT
+ flags &= ~PyCF_ALLOW_INCOMPLETE_INPUT
+ codeob = compile(source, filename, symbol, flags, True)
for feature in _features:
if codeob.co_flags & feature.compiler_flag:
self.flags |= feature.compiler_flag
diff --git a/contrib/tools/python3/src/Lib/contextlib.py b/contrib/tools/python3/src/Lib/contextlib.py
index 58e9a49887..4a338f5c63 100644
--- a/contrib/tools/python3/src/Lib/contextlib.py
+++ b/contrib/tools/python3/src/Lib/contextlib.py
@@ -145,7 +145,10 @@ class _GeneratorContextManager(
except StopIteration:
return False
else:
- raise RuntimeError("generator didn't stop")
+ try:
+ raise RuntimeError("generator didn't stop")
+ finally:
+ self.gen.close()
else:
if value is None:
# Need to force instantiation so we can reliably
@@ -187,7 +190,10 @@ class _GeneratorContextManager(
raise
exc.__traceback__ = traceback
return False
- raise RuntimeError("generator didn't stop after throw()")
+ try:
+ raise RuntimeError("generator didn't stop after throw()")
+ finally:
+ self.gen.close()
class _AsyncGeneratorContextManager(
_GeneratorContextManagerBase,
@@ -212,7 +218,10 @@ class _AsyncGeneratorContextManager(
except StopAsyncIteration:
return False
else:
- raise RuntimeError("generator didn't stop")
+ try:
+ raise RuntimeError("generator didn't stop")
+ finally:
+ await self.gen.aclose()
else:
if value is None:
# Need to force instantiation so we can reliably
@@ -254,7 +263,10 @@ class _AsyncGeneratorContextManager(
raise
exc.__traceback__ = traceback
return False
- raise RuntimeError("generator didn't stop after athrow()")
+ try:
+ raise RuntimeError("generator didn't stop after athrow()")
+ finally:
+ await self.gen.aclose()
def contextmanager(func):
diff --git a/contrib/tools/python3/src/Lib/dis.py b/contrib/tools/python3/src/Lib/dis.py
index 5bf52c3e6d..196c886f78 100644
--- a/contrib/tools/python3/src/Lib/dis.py
+++ b/contrib/tools/python3/src/Lib/dis.py
@@ -759,8 +759,7 @@ class Bytecode:
return output.getvalue()
-def _test():
- """Simple test program to disassemble a file."""
+def main():
import argparse
parser = argparse.ArgumentParser()
@@ -772,4 +771,4 @@ def _test():
dis(code)
if __name__ == "__main__":
- _test()
+ main()
diff --git a/contrib/tools/python3/src/Lib/doctest.py b/contrib/tools/python3/src/Lib/doctest.py
index a4b85378d1..2a855929ae 100644
--- a/contrib/tools/python3/src/Lib/doctest.py
+++ b/contrib/tools/python3/src/Lib/doctest.py
@@ -569,9 +569,11 @@ class DocTest:
def __lt__(self, other):
if not isinstance(other, DocTest):
return NotImplemented
- return ((self.name, self.filename, self.lineno, id(self))
+ self_lno = self.lineno if self.lineno is not None else -1
+ other_lno = other.lineno if other.lineno is not None else -1
+ return ((self.name, self.filename, self_lno, id(self))
<
- (other.name, other.filename, other.lineno, id(other)))
+ (other.name, other.filename, other_lno, id(other)))
######################################################################
## 3. DocTestParser
@@ -1373,7 +1375,24 @@ class DocTestRunner:
# The example raised an exception: check if it was expected.
else:
- exc_msg = traceback.format_exception_only(*exception[:2])[-1]
+ formatted_ex = traceback.format_exception_only(*exception[:2])
+ if issubclass(exception[0], SyntaxError):
+ # SyntaxError / IndentationError is special:
+ # we don't care about the carets / suggestions / etc
+ # We only care about the error message and notes.
+ # They start with `SyntaxError:` (or any other class name)
+ exception_line_prefixes = (
+ f"{exception[0].__qualname__}:",
+ f"{exception[0].__module__}.{exception[0].__qualname__}:",
+ )
+ exc_msg_index = next(
+ index
+ for index, line in enumerate(formatted_ex)
+ if line.startswith(exception_line_prefixes)
+ )
+ formatted_ex = formatted_ex[exc_msg_index:]
+
+ exc_msg = "".join(formatted_ex)
if not quiet:
got += _exception_traceback(exception)
diff --git a/contrib/tools/python3/src/Lib/enum.py b/contrib/tools/python3/src/Lib/enum.py
index 155cb13022..63833aaa71 100644
--- a/contrib/tools/python3/src/Lib/enum.py
+++ b/contrib/tools/python3/src/Lib/enum.py
@@ -1197,14 +1197,13 @@ class Enum(metaclass=EnumType):
def __dir__(self):
"""
- Returns all members and all public methods
+ Returns public methods and other interesting attributes.
"""
- if self.__class__._member_type_ is object:
- interesting = set(['__class__', '__doc__', '__eq__', '__hash__', '__module__', 'name', 'value'])
- else:
+ interesting = set()
+ if self.__class__._member_type_ is not object:
interesting = set(object.__dir__(self))
for name in getattr(self, '__dict__', []):
- if name[0] != '_':
+ if name[0] != '_' and name not in self._member_map_:
interesting.add(name)
for cls in self.__class__.mro():
for name, obj in cls.__dict__.items():
@@ -1217,7 +1216,7 @@ class Enum(metaclass=EnumType):
else:
# in case it was added by `dir(self)`
interesting.discard(name)
- else:
+ elif name not in self._member_map_:
interesting.add(name)
names = sorted(
set(['__class__', '__doc__', '__eq__', '__hash__', '__module__'])
diff --git a/contrib/tools/python3/src/Lib/gettext.py b/contrib/tools/python3/src/Lib/gettext.py
index 318f609548..e665b3eced 100644
--- a/contrib/tools/python3/src/Lib/gettext.py
+++ b/contrib/tools/python3/src/Lib/gettext.py
@@ -46,6 +46,7 @@ internationalized, to the local language and cultural habits.
# find this format documented anywhere.
+import operator
import os
import re
import sys
@@ -171,14 +172,21 @@ def _parse(tokens, priority=-1):
def _as_int(n):
try:
- i = round(n)
+ round(n)
except TypeError:
raise TypeError('Plural value must be an integer, got %s' %
(n.__class__.__name__,)) from None
+
import warnings
+ frame = sys._getframe(1)
+ stacklevel = 2
+ while frame.f_back is not None and frame.f_globals.get('__name__') == __name__:
+ stacklevel += 1
+ frame = frame.f_back
warnings.warn('Plural value must be an integer, got %s' %
(n.__class__.__name__,),
- DeprecationWarning, 4)
+ DeprecationWarning,
+ stacklevel)
return n
@@ -205,7 +213,7 @@ def c2py(plural):
elif c == ')':
depth -= 1
- ns = {'_as_int': _as_int}
+ ns = {'_as_int': _as_int, '__name__': __name__}
exec('''if True:
def func(n):
if not isinstance(n, int):
diff --git a/contrib/tools/python3/src/Lib/http/client.py b/contrib/tools/python3/src/Lib/http/client.py
index 1c7f4639db..87bca4d76a 100644
--- a/contrib/tools/python3/src/Lib/http/client.py
+++ b/contrib/tools/python3/src/Lib/http/client.py
@@ -172,6 +172,13 @@ def _encode(data, name='data'):
"if you want to send it encoded in UTF-8." %
(name.title(), data[err.start:err.end], name)) from None
+def _strip_ipv6_iface(enc_name: bytes) -> bytes:
+ """Remove interface scope from IPv6 address."""
+ enc_name, percent, _ = enc_name.partition(b"%")
+ if percent:
+ assert enc_name.startswith(b'['), enc_name
+ enc_name += b']'
+ return enc_name
class HTTPMessage(email.message.Message):
# XXX The only usage of this method is in
@@ -1161,7 +1168,7 @@ class HTTPConnection:
netloc_enc = netloc.encode("ascii")
except UnicodeEncodeError:
netloc_enc = netloc.encode("idna")
- self.putheader('Host', netloc_enc)
+ self.putheader('Host', _strip_ipv6_iface(netloc_enc))
else:
if self._tunnel_host:
host = self._tunnel_host
@@ -1178,8 +1185,9 @@ class HTTPConnection:
# As per RFC 273, IPv6 address should be wrapped with []
# when used as Host header
- if host.find(':') >= 0:
+ if ":" in host:
host_enc = b'[' + host_enc + b']'
+ host_enc = _strip_ipv6_iface(host_enc)
if port == self.default_port:
self.putheader('Host', host_enc)
diff --git a/contrib/tools/python3/src/Lib/io.py b/contrib/tools/python3/src/Lib/io.py
index a4186499c6..a58ab01ede 100644
--- a/contrib/tools/python3/src/Lib/io.py
+++ b/contrib/tools/python3/src/Lib/io.py
@@ -45,7 +45,8 @@ __all__ = ["BlockingIOError", "open", "open_code", "IOBase", "RawIOBase",
"FileIO", "BytesIO", "StringIO", "BufferedIOBase",
"BufferedReader", "BufferedWriter", "BufferedRWPair",
"BufferedRandom", "TextIOBase", "TextIOWrapper",
- "UnsupportedOperation", "SEEK_SET", "SEEK_CUR", "SEEK_END"]
+ "UnsupportedOperation", "SEEK_SET", "SEEK_CUR", "SEEK_END",
+ "DEFAULT_BUFFER_SIZE", "text_encoding", "IncrementalNewlineDecoder"]
import _io
diff --git a/contrib/tools/python3/src/Lib/ipaddress.py b/contrib/tools/python3/src/Lib/ipaddress.py
index 1cb71d8032..16ba16cd7d 100644
--- a/contrib/tools/python3/src/Lib/ipaddress.py
+++ b/contrib/tools/python3/src/Lib/ipaddress.py
@@ -1941,6 +1941,9 @@ class IPv6Address(_BaseV6, _BaseAddress):
return False
return self._scope_id == getattr(other, '_scope_id', None)
+ def __reduce__(self):
+ return (self.__class__, (str(self),))
+
@property
def scope_id(self):
"""Identifier of a particular zone of the address's scope.
diff --git a/contrib/tools/python3/src/Lib/locale.py b/contrib/tools/python3/src/Lib/locale.py
index 7a7694e1bf..f45841ed62 100644
--- a/contrib/tools/python3/src/Lib/locale.py
+++ b/contrib/tools/python3/src/Lib/locale.py
@@ -556,10 +556,11 @@ def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
"""
import warnings
- warnings.warn(
- "Use setlocale(), getencoding() and getlocale() instead",
- DeprecationWarning, stacklevel=2
- )
+ warnings._deprecated(
+ "locale.getdefaultlocale",
+ "{name!r} is deprecated and slated for removal in Python {remove}. "
+ "Use setlocale(), getencoding() and getlocale() instead.",
+ remove=(3, 15))
try:
# check if it's supported by the _locale module
diff --git a/contrib/tools/python3/src/Lib/logging/config.py b/contrib/tools/python3/src/Lib/logging/config.py
index 7e78a64a2f..735ffbe194 100644
--- a/contrib/tools/python3/src/Lib/logging/config.py
+++ b/contrib/tools/python3/src/Lib/logging/config.py
@@ -1,4 +1,4 @@
-# Copyright 2001-2019 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2023 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
@@ -19,7 +19,7 @@ Configuration functions for the logging package for Python. The core package
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
by Apache's log4j system.
-Copyright (C) 2001-2019 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2023 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
@@ -477,10 +477,10 @@ class BaseConfigurator(object):
c = config.pop('()')
if not callable(c):
c = self.resolve(c)
- props = config.pop('.', None)
# Check for valid identifiers
- kwargs = {k: config[k] for k in config if valid_ident(k)}
+ kwargs = {k: config[k] for k in config if (k != '.' and valid_ident(k))}
result = c(**kwargs)
+ props = config.pop('.', None)
if props:
for name, value in props.items():
setattr(result, name, value)
@@ -752,8 +752,7 @@ class DictConfigurator(BaseConfigurator):
'address' in config:
config['address'] = self.as_tuple(config['address'])
factory = klass
- props = config.pop('.', None)
- kwargs = {k: config[k] for k in config if valid_ident(k)}
+ kwargs = {k: config[k] for k in config if (k != '.' and valid_ident(k))}
try:
result = factory(**kwargs)
except TypeError as te:
@@ -771,6 +770,7 @@ class DictConfigurator(BaseConfigurator):
result.setLevel(logging._checkLevel(level))
if filters:
self.add_filters(result, filters)
+ props = config.pop('.', None)
if props:
for name, value in props.items():
setattr(result, name, value)
diff --git a/contrib/tools/python3/src/Lib/logging/handlers.py b/contrib/tools/python3/src/Lib/logging/handlers.py
index eadd1b6340..81041488c8 100644
--- a/contrib/tools/python3/src/Lib/logging/handlers.py
+++ b/contrib/tools/python3/src/Lib/logging/handlers.py
@@ -833,10 +833,8 @@ class SysLogHandler(logging.Handler):
"local7": LOG_LOCAL7,
}
- #The map below appears to be trivially lowercasing the key. However,
- #there's more to it than meets the eye - in some locales, lowercasing
- #gives unexpected results. See SF #1524081: in the Turkish locale,
- #"INFO".lower() != "info"
+ # Originally added to work around GH-43683. Unnecessary since GH-50043 but kept
+ # for backwards compatibility.
priority_map = {
"DEBUG" : "debug",
"INFO" : "info",
diff --git a/contrib/tools/python3/src/Lib/pdb.py b/contrib/tools/python3/src/Lib/pdb.py
index fe9eab9b5e..4a4a0b9d90 100755
--- a/contrib/tools/python3/src/Lib/pdb.py
+++ b/contrib/tools/python3/src/Lib/pdb.py
@@ -136,6 +136,9 @@ class _ScriptTarget(str):
if not os.path.exists(self):
print('Error:', self.orig, 'does not exist')
sys.exit(1)
+ if os.path.isdir(self):
+ print('Error:', self.orig, 'is a directory')
+ sys.exit(1)
# Replace pdb's dir with script's dir in front of module search path.
sys.path[0] = os.path.dirname(self)
@@ -162,6 +165,9 @@ class _ModuleTarget(str):
def check(self):
try:
self._details
+ except ImportError as e:
+ print(f"ImportError: {e}")
+ sys.exit(1)
except Exception:
traceback.print_exc()
sys.exit(1)
@@ -405,8 +411,9 @@ class Pdb(bdb.Bdb, cmd.Cmd):
# fields are changed to be displayed
if newvalue is not oldvalue and newvalue != oldvalue:
displaying[expr] = newvalue
- self.message('display %s: %r [old: %r]' %
- (expr, newvalue, oldvalue))
+ self.message('display %s: %s [old: %s]' %
+ (expr, self._safe_repr(newvalue, expr),
+ self._safe_repr(oldvalue, expr)))
def interaction(self, frame, traceback):
# Restore the previous signal handler at the Pdb prompt.
@@ -1221,7 +1228,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
for i in range(n):
name = co.co_varnames[i]
if name in dict:
- self.message('%s = %r' % (name, dict[name]))
+ self.message('%s = %s' % (name, self._safe_repr(dict[name], name)))
else:
self.message('%s = *** undefined ***' % (name,))
do_a = do_args
@@ -1231,7 +1238,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
Print the return value for the last return of a function.
"""
if '__return__' in self.curframe_locals:
- self.message(repr(self.curframe_locals['__return__']))
+ self.message(self._safe_repr(self.curframe_locals['__return__'], "retval"))
else:
self.error('Not yet returned!')
do_rv = do_retval
@@ -1268,6 +1275,12 @@ class Pdb(bdb.Bdb, cmd.Cmd):
except:
self._error_exc()
+ def _safe_repr(self, obj, expr):
+ try:
+ return repr(obj)
+ except Exception as e:
+ return _rstr(f"*** repr({expr}) failed: {self._format_exc(e)} ***")
+
def do_p(self, arg):
"""p expression
Print the value of the expression.
@@ -1438,12 +1451,12 @@ class Pdb(bdb.Bdb, cmd.Cmd):
"""
if not arg:
self.message('Currently displaying:')
- for item in self.displaying.get(self.curframe, {}).items():
- self.message('%s: %r' % item)
+ for key, val in self.displaying.get(self.curframe, {}).items():
+ self.message('%s: %s' % (key, self._safe_repr(val, key)))
else:
val = self._getval_except(arg)
self.displaying.setdefault(self.curframe, {})[arg] = val
- self.message('display %s: %r' % (arg, val))
+ self.message('display %s: %s' % (arg, self._safe_repr(val, arg)))
complete_display = _complete_expression
@@ -1645,6 +1658,8 @@ class Pdb(bdb.Bdb, cmd.Cmd):
self.run(target.code)
+ def _format_exc(self, exc: BaseException):
+ return traceback.format_exception_only(exc)[-1].strip()
def _getsourcelines(self, obj):
# GH-103319
diff --git a/contrib/tools/python3/src/Lib/pydoc.py b/contrib/tools/python3/src/Lib/pydoc.py
index 5e191bc1c4..14b99039b3 100755
--- a/contrib/tools/python3/src/Lib/pydoc.py
+++ b/contrib/tools/python3/src/Lib/pydoc.py
@@ -2073,20 +2073,22 @@ has the same effect as typing a particular string at the help> prompt.
self.output.write('\n')
def intro(self):
- self.output.write('''
-Welcome to Python {0}'s help utility!
-
-If this is your first time using Python, you should definitely check out
-the tutorial on the internet at https://docs.python.org/{0}/tutorial/.
+ self.output.write('''\
+Welcome to Python {0}'s help utility! If this is your first time using
+Python, you should definitely check out the tutorial at
+https://docs.python.org/{0}/tutorial/.
Enter the name of any module, keyword, or topic to get help on writing
-Python programs and using Python modules. To quit this help utility and
-return to the interpreter, just type "quit".
+Python programs and using Python modules. To get a list of available
+modules, keywords, symbols, or topics, enter "modules", "keywords",
+"symbols", or "topics".
+
+Each module also comes with a one-line summary of what it does; to list
+the modules whose name or summary contain a given string such as "spam",
+enter "modules spam".
-To get a list of available modules, keywords, symbols, or topics, type
-"modules", "keywords", "symbols", or "topics". Each module also comes
-with a one-line summary of what it does; to list the modules whose name
-or summary contain a given string such as "spam", type "modules spam".
+To quit this help utility and return to the interpreter,
+enter "q" or "quit".
'''.format('%d.%d' % sys.version_info[:2]))
def list(self, items, columns=4, width=80):
diff --git a/contrib/tools/python3/src/Lib/pydoc_data/topics.py b/contrib/tools/python3/src/Lib/pydoc_data/topics.py
index 06422d21c6..9cdf477d44 100644
--- a/contrib/tools/python3/src/Lib/pydoc_data/topics.py
+++ b/contrib/tools/python3/src/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Mon Oct 2 14:27:48 2023
+# Autogenerated by Sphinx on Mon Dec 4 17:55:07 2023
# as part of the release process.
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
@@ -552,30 +552,30 @@ topics = {'assert': 'The "assert" statement\n'
'[2] In pattern matching, a sequence is defined as one of the\n'
' following:\n'
'\n'
- ' * a class that inherits from "collections.abc.Sequence"\n'
+ ' * a class that inherits from "collections.abc.Sequence"\n'
'\n'
- ' * a Python class that has been registered as\n'
- ' "collections.abc.Sequence"\n'
+ ' * a Python class that has been registered as\n'
+ ' "collections.abc.Sequence"\n'
'\n'
- ' * a builtin class that has its (CPython) '
- '"Py_TPFLAGS_SEQUENCE"\n'
- ' bit set\n'
+ ' * a builtin class that has its (CPython) "Py_TPFLAGS_SEQUENCE" '
+ 'bit\n'
+ ' set\n'
'\n'
- ' * a class that inherits from any of the above\n'
+ ' * a class that inherits from any of the above\n'
'\n'
' The following standard library classes are sequences:\n'
'\n'
- ' * "array.array"\n'
+ ' * "array.array"\n'
'\n'
- ' * "collections.deque"\n'
+ ' * "collections.deque"\n'
'\n'
- ' * "list"\n'
+ ' * "list"\n'
'\n'
- ' * "memoryview"\n'
+ ' * "memoryview"\n'
'\n'
- ' * "range"\n'
+ ' * "range"\n'
'\n'
- ' * "tuple"\n'
+ ' * "tuple"\n'
'\n'
' Note:\n'
'\n'
@@ -586,16 +586,16 @@ topics = {'assert': 'The "assert" statement\n'
'[3] In pattern matching, a mapping is defined as one of the '
'following:\n'
'\n'
- ' * a class that inherits from "collections.abc.Mapping"\n'
+ ' * a class that inherits from "collections.abc.Mapping"\n'
'\n'
- ' * a Python class that has been registered as\n'
- ' "collections.abc.Mapping"\n'
+ ' * a Python class that has been registered as\n'
+ ' "collections.abc.Mapping"\n'
'\n'
- ' * a builtin class that has its (CPython) '
- '"Py_TPFLAGS_MAPPING"\n'
- ' bit set\n'
+ ' * a builtin class that has its (CPython) "Py_TPFLAGS_MAPPING" '
+ 'bit\n'
+ ' set\n'
'\n'
- ' * a class that inherits from any of the above\n'
+ ' * a class that inherits from any of the above\n'
'\n'
' The standard library classes "dict" and '
'"types.MappingProxyType"\n'
@@ -1181,16 +1181,23 @@ topics = {'assert': 'The "assert" statement\n'
'attribute references, which most objects do. This '
'object is then\n'
'asked to produce the attribute whose name is the '
- 'identifier. This\n'
- 'production can be customized by overriding the '
- '"__getattr__()" method.\n'
- 'If this attribute is not available, the exception '
- '"AttributeError" is\n'
- 'raised. Otherwise, the type and value of the object '
- 'produced is\n'
- 'determined by the object. Multiple evaluations of '
- 'the same attribute\n'
- 'reference may yield different objects.\n',
+ 'identifier. The type\n'
+ 'and value produced is determined by the object. '
+ 'Multiple evaluations\n'
+ 'of the same attribute reference may yield different '
+ 'objects.\n'
+ '\n'
+ 'This production can be customized by overriding the\n'
+ '"__getattribute__()" method or the "__getattr__()" '
+ 'method. The\n'
+ '"__getattribute__()" method is called first and '
+ 'either returns a value\n'
+ 'or raises "AttributeError" if the attribute is not '
+ 'available.\n'
+ '\n'
+ 'If an "AttributeError" is raised and the object has '
+ 'a "__getattr__()"\n'
+ 'method, that method is called as a fallback.\n',
'augassign': 'Augmented assignment statements\n'
'*******************************\n'
'\n'
@@ -2872,18 +2879,19 @@ topics = {'assert': 'The "assert" statement\n'
' bindings made during a successful pattern match outlive the\n'
' executed block and can be used after the match statement**.\n'
'\n'
- ' Note:\n'
+ ' Note:\n'
'\n'
- ' During failed pattern matches, some subpatterns may '
- 'succeed.\n'
- ' Do not rely on bindings being made for a failed match.\n'
- ' Conversely, do not rely on variables remaining unchanged '
- 'after\n'
- ' a failed match. The exact behavior is dependent on\n'
- ' implementation and may vary. This is an intentional '
- 'decision\n'
- ' made to allow different implementations to add '
- 'optimizations.\n'
+ ' During failed pattern matches, some subpatterns may '
+ 'succeed. Do\n'
+ ' not rely on bindings being made for a failed match. '
+ 'Conversely,\n'
+ ' do not rely on variables remaining unchanged after a '
+ 'failed\n'
+ ' match. The exact behavior is dependent on implementation '
+ 'and may\n'
+ ' vary. This is an intentional decision made to allow '
+ 'different\n'
+ ' implementations to add optimizations.\n'
'\n'
'3. If the pattern succeeds, the corresponding guard (if present) '
'is\n'
@@ -3535,9 +3543,10 @@ topics = {'assert': 'The "assert" statement\n'
'* convert "P1" to a keyword pattern using "CLS.__match_args__"\n'
'\n'
'* For each keyword argument "attr=P2":\n'
- ' * "hasattr(<subject>, "attr")"\n'
'\n'
- ' * "P2" matches "<subject>.attr"\n'
+ ' * "hasattr(<subject>, "attr")"\n'
+ '\n'
+ ' * "P2" matches "<subject>.attr"\n'
'\n'
'* … and so on for the corresponding keyword argument/pattern '
'pair.\n'
@@ -3998,30 +4007,30 @@ topics = {'assert': 'The "assert" statement\n'
'[2] In pattern matching, a sequence is defined as one of the\n'
' following:\n'
'\n'
- ' * a class that inherits from "collections.abc.Sequence"\n'
+ ' * a class that inherits from "collections.abc.Sequence"\n'
'\n'
- ' * a Python class that has been registered as\n'
- ' "collections.abc.Sequence"\n'
+ ' * a Python class that has been registered as\n'
+ ' "collections.abc.Sequence"\n'
'\n'
- ' * a builtin class that has its (CPython) '
- '"Py_TPFLAGS_SEQUENCE"\n'
- ' bit set\n'
+ ' * a builtin class that has its (CPython) '
+ '"Py_TPFLAGS_SEQUENCE" bit\n'
+ ' set\n'
'\n'
- ' * a class that inherits from any of the above\n'
+ ' * a class that inherits from any of the above\n'
'\n'
' The following standard library classes are sequences:\n'
'\n'
- ' * "array.array"\n'
+ ' * "array.array"\n'
'\n'
- ' * "collections.deque"\n'
+ ' * "collections.deque"\n'
'\n'
- ' * "list"\n'
+ ' * "list"\n'
'\n'
- ' * "memoryview"\n'
+ ' * "memoryview"\n'
'\n'
- ' * "range"\n'
+ ' * "range"\n'
'\n'
- ' * "tuple"\n'
+ ' * "tuple"\n'
'\n'
' Note:\n'
'\n'
@@ -4032,16 +4041,16 @@ topics = {'assert': 'The "assert" statement\n'
'[3] In pattern matching, a mapping is defined as one of the '
'following:\n'
'\n'
- ' * a class that inherits from "collections.abc.Mapping"\n'
+ ' * a class that inherits from "collections.abc.Mapping"\n'
'\n'
- ' * a Python class that has been registered as\n'
- ' "collections.abc.Mapping"\n'
+ ' * a Python class that has been registered as\n'
+ ' "collections.abc.Mapping"\n'
'\n'
- ' * a builtin class that has its (CPython) '
- '"Py_TPFLAGS_MAPPING"\n'
- ' bit set\n'
+ ' * a builtin class that has its (CPython) '
+ '"Py_TPFLAGS_MAPPING" bit\n'
+ ' set\n'
'\n'
- ' * a class that inherits from any of the above\n'
+ ' * a class that inherits from any of the above\n'
'\n'
' The standard library classes "dict" and '
'"types.MappingProxyType"\n'
@@ -6078,18 +6087,17 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'The grammar for a replacement field is as follows:\n'
'\n'
- ' replacement_field ::= "{" [field_name] ["!" '
- 'conversion] [":" format_spec] "}"\n'
- ' field_name ::= arg_name ("." attribute_name | '
- '"[" element_index "]")*\n'
- ' arg_name ::= [identifier | digit+]\n'
- ' attribute_name ::= identifier\n'
- ' element_index ::= digit+ | index_string\n'
- ' index_string ::= <any source character except '
- '"]"> +\n'
- ' conversion ::= "r" | "s" | "a"\n'
- ' format_spec ::= <described in the next '
- 'section>\n'
+ ' replacement_field ::= "{" [field_name] ["!" conversion] '
+ '[":" format_spec] "}"\n'
+ ' field_name ::= arg_name ("." attribute_name | "[" '
+ 'element_index "]")*\n'
+ ' arg_name ::= [identifier | digit+]\n'
+ ' attribute_name ::= identifier\n'
+ ' element_index ::= digit+ | index_string\n'
+ ' index_string ::= <any source character except "]"> '
+ '+\n'
+ ' conversion ::= "r" | "s" | "a"\n'
+ ' format_spec ::= <described in the next section>\n'
'\n'
'In less formal terms, the replacement field can start with '
'a\n'
@@ -6275,43 +6283,37 @@ topics = {'assert': 'The "assert" statement\n'
'The meaning of the various alignment options is as '
'follows:\n'
'\n'
- ' '
'+-----------+------------------------------------------------------------+\n'
- ' | Option | '
+ '| Option | '
'Meaning '
'|\n'
- ' '
'|===========|============================================================|\n'
- ' | "\'<\'" | Forces the field to be left-aligned '
- 'within the available |\n'
- ' | | space (this is the default for most '
+ '| "\'<\'" | Forces the field to be left-aligned within '
+ 'the available |\n'
+ '| | space (this is the default for most '
'objects). |\n'
- ' '
'+-----------+------------------------------------------------------------+\n'
- ' | "\'>\'" | Forces the field to be right-aligned '
- 'within the available |\n'
- ' | | space (this is the default for '
+ '| "\'>\'" | Forces the field to be right-aligned within '
+ 'the available |\n'
+ '| | space (this is the default for '
'numbers). |\n'
- ' '
'+-----------+------------------------------------------------------------+\n'
- ' | "\'=\'" | Forces the padding to be placed after '
- 'the sign (if any) |\n'
- ' | | but before the digits. This is used for '
+ '| "\'=\'" | Forces the padding to be placed after the '
+ 'sign (if any) |\n'
+ '| | but before the digits. This is used for '
'printing fields |\n'
- ' | | in the form ‘+000000120’. This alignment '
+ '| | in the form ‘+000000120’. This alignment '
'option is only |\n'
- ' | | valid for numeric types. It becomes the '
+ '| | valid for numeric types. It becomes the '
'default for |\n'
- ' | | numbers when ‘0’ immediately precedes the '
+ '| | numbers when ‘0’ immediately precedes the '
'field width. |\n'
- ' '
'+-----------+------------------------------------------------------------+\n'
- ' | "\'^\'" | Forces the field to be centered within '
- 'the available |\n'
- ' | | '
+ '| "\'^\'" | Forces the field to be centered within the '
+ 'available |\n'
+ '| | '
'space. '
'|\n'
- ' '
'+-----------+------------------------------------------------------------+\n'
'\n'
'Note that unless a minimum field width is defined, the '
@@ -6324,30 +6326,25 @@ topics = {'assert': 'The "assert" statement\n'
'be one of\n'
'the following:\n'
'\n'
- ' '
'+-----------+------------------------------------------------------------+\n'
- ' | Option | '
+ '| Option | '
'Meaning '
'|\n'
- ' '
'|===========|============================================================|\n'
- ' | "\'+\'" | indicates that a sign should be used for '
+ '| "\'+\'" | indicates that a sign should be used for '
'both positive as |\n'
- ' | | well as negative '
+ '| | well as negative '
'numbers. |\n'
- ' '
'+-----------+------------------------------------------------------------+\n'
- ' | "\'-\'" | indicates that a sign should be used '
- 'only for negative |\n'
- ' | | numbers (this is the default '
+ '| "\'-\'" | indicates that a sign should be used only '
+ 'for negative |\n'
+ '| | numbers (this is the default '
'behavior). |\n'
- ' '
'+-----------+------------------------------------------------------------+\n'
- ' | space | indicates that a leading space should be '
- 'used on positive |\n'
- ' | | numbers, and a minus sign on negative '
+ '| space | indicates that a leading space should be used '
+ 'on positive |\n'
+ '| | numbers, and a minus sign on negative '
'numbers. |\n'
- ' '
'+-----------+------------------------------------------------------------+\n'
'\n'
'The "\'z\'" option coerces negative zero floating-point '
@@ -12489,11 +12486,9 @@ topics = {'assert': 'The "assert" statement\n'
'bytes\n'
'literals.\n'
'\n'
- ' Changed in version 3.6: Unrecognized escape sequences produce '
- 'a\n'
- ' "DeprecationWarning". In a future Python version they will be '
- 'a\n'
- ' "SyntaxWarning" and eventually a "SyntaxError".\n'
+ 'Changed in version 3.6: Unrecognized escape sequences produce a\n'
+ '"DeprecationWarning". In a future Python version they will be a\n'
+ '"SyntaxWarning" and eventually a "SyntaxError".\n'
'\n'
'Even in a raw literal, quotes can be escaped with a backslash, '
'but the\n'
diff --git a/contrib/tools/python3/src/Lib/re/_compiler.py b/contrib/tools/python3/src/Lib/re/_compiler.py
index d8e0d2fdef..285c21936f 100644
--- a/contrib/tools/python3/src/Lib/re/_compiler.py
+++ b/contrib/tools/python3/src/Lib/re/_compiler.py
@@ -149,6 +149,8 @@ def _compile(code, pattern, flags):
emit(0) # look ahead
else:
lo, hi = av[1].getwidth()
+ if lo > MAXCODE:
+ raise error("looks too much behind")
if lo != hi:
raise error("look-behind requires fixed-width pattern")
emit(lo) # look behind
@@ -549,7 +551,7 @@ def _compile_info(code, pattern, flags):
else:
emit(MAXCODE)
prefix = prefix[:MAXCODE]
- emit(min(hi, MAXCODE))
+ emit(hi)
# add literal prefix
if prefix:
emit(len(prefix)) # length
diff --git a/contrib/tools/python3/src/Lib/re/_parser.py b/contrib/tools/python3/src/Lib/re/_parser.py
index 6b715f5403..c795a7fb00 100644
--- a/contrib/tools/python3/src/Lib/re/_parser.py
+++ b/contrib/tools/python3/src/Lib/re/_parser.py
@@ -68,6 +68,10 @@ FLAGS = {
TYPE_FLAGS = SRE_FLAG_ASCII | SRE_FLAG_LOCALE | SRE_FLAG_UNICODE
GLOBAL_FLAGS = SRE_FLAG_DEBUG | SRE_FLAG_TEMPLATE
+# Maximal value returned by SubPattern.getwidth().
+# Must be larger than MAXREPEAT, MAXCODE and sys.maxsize.
+MAXWIDTH = 1 << 64
+
class State:
# keeps track of state for parsing
def __init__(self):
@@ -178,7 +182,7 @@ class SubPattern:
lo = hi = 0
for op, av in self.data:
if op is BRANCH:
- i = MAXREPEAT - 1
+ i = MAXWIDTH
j = 0
for av in av[1]:
l, h = av.getwidth()
@@ -197,7 +201,10 @@ class SubPattern:
elif op in _REPEATCODES:
i, j = av[2].getwidth()
lo = lo + i * av[0]
- hi = hi + j * av[1]
+ if av[1] == MAXREPEAT and j:
+ hi = MAXWIDTH
+ else:
+ hi = hi + j * av[1]
elif op in _UNITCODES:
lo = lo + 1
hi = hi + 1
@@ -217,7 +224,7 @@ class SubPattern:
hi = hi + j
elif op is SUCCESS:
break
- self.width = min(lo, MAXREPEAT - 1), min(hi, MAXREPEAT)
+ self.width = min(lo, MAXWIDTH), min(hi, MAXWIDTH)
return self.width
class Tokenizer:
diff --git a/contrib/tools/python3/src/Lib/ssl.py b/contrib/tools/python3/src/Lib/ssl.py
index 568d2e62b8..e7990a95dd 100644
--- a/contrib/tools/python3/src/Lib/ssl.py
+++ b/contrib/tools/python3/src/Lib/ssl.py
@@ -1316,10 +1316,14 @@ class SSLSocket(socket):
def recv_into(self, buffer, nbytes=None, flags=0):
self._checkClosed()
- if buffer and (nbytes is None):
- nbytes = len(buffer)
- elif nbytes is None:
- nbytes = 1024
+ if nbytes is None:
+ if buffer is not None:
+ with memoryview(buffer) as view:
+ nbytes = view.nbytes
+ if not nbytes:
+ nbytes = 1024
+ else:
+ nbytes = 1024
if self._sslobj is not None:
if flags != 0:
raise ValueError(
diff --git a/contrib/tools/python3/src/Lib/traceback.py b/contrib/tools/python3/src/Lib/traceback.py
index d3edd3a63e..ea045e2761 100644
--- a/contrib/tools/python3/src/Lib/traceback.py
+++ b/contrib/tools/python3/src/Lib/traceback.py
@@ -145,14 +145,11 @@ def format_exception_only(exc, /, value=_sentinel):
The return value is a list of strings, each ending in a newline.
- Normally, the list contains a single string; however, for
- SyntaxError exceptions, it contains several lines that (when
- printed) display detailed information about where the syntax
- error occurred.
-
- The message indicating which exception occurred is always the last
- string in the list.
-
+ The list contains the exception's message, which is
+ normally a single string; however, for :exc:`SyntaxError` exceptions, it
+ contains several lines that (when printed) display detailed information
+ about where the syntax error occurred. Following the message, the list
+ contains the exception's ``__notes__``.
"""
if value is _sentinel:
value = exc
@@ -468,7 +465,8 @@ class StackSummary(list):
stripped_line = frame_summary.line.strip()
row.append(' {}\n'.format(stripped_line))
- orig_line_len = len(frame_summary._original_line)
+ line = frame_summary._original_line
+ orig_line_len = len(line)
frame_line_len = len(frame_summary.line.lstrip())
stripped_characters = orig_line_len - frame_line_len
if (
@@ -476,31 +474,40 @@ class StackSummary(list):
and frame_summary.end_colno is not None
):
start_offset = _byte_offset_to_character_offset(
- frame_summary._original_line, frame_summary.colno) + 1
+ line, frame_summary.colno)
end_offset = _byte_offset_to_character_offset(
- frame_summary._original_line, frame_summary.end_colno) + 1
+ line, frame_summary.end_colno)
+ code_segment = line[start_offset:end_offset]
anchors = None
if frame_summary.lineno == frame_summary.end_lineno:
with suppress(Exception):
- anchors = _extract_caret_anchors_from_line_segment(
- frame_summary._original_line[start_offset - 1:end_offset - 1]
- )
+ anchors = _extract_caret_anchors_from_line_segment(code_segment)
else:
- end_offset = stripped_characters + len(stripped_line)
+ # Don't count the newline since the anchors only need to
+ # go up until the last character of the line.
+ end_offset = len(line.rstrip())
# show indicators if primary char doesn't span the frame line
if end_offset - start_offset < len(stripped_line) or (
anchors and anchors.right_start_offset - anchors.left_end_offset > 0):
+ # When showing this on a terminal, some of the non-ASCII characters
+ # might be rendered as double-width characters, so we need to take
+ # that into account when calculating the length of the line.
+ dp_start_offset = _display_width(line, start_offset) + 1
+ dp_end_offset = _display_width(line, end_offset) + 1
+
row.append(' ')
- row.append(' ' * (start_offset - stripped_characters))
+ row.append(' ' * (dp_start_offset - stripped_characters))
if anchors:
- row.append(anchors.primary_char * (anchors.left_end_offset))
- row.append(anchors.secondary_char * (anchors.right_start_offset - anchors.left_end_offset))
- row.append(anchors.primary_char * (end_offset - start_offset - anchors.right_start_offset))
+ dp_left_end_offset = _display_width(code_segment, anchors.left_end_offset)
+ dp_right_start_offset = _display_width(code_segment, anchors.right_start_offset)
+ row.append(anchors.primary_char * dp_left_end_offset)
+ row.append(anchors.secondary_char * (dp_right_start_offset - dp_left_end_offset))
+ row.append(anchors.primary_char * (dp_end_offset - dp_start_offset - dp_right_start_offset))
else:
- row.append('^' * (end_offset - start_offset))
+ row.append('^' * (dp_end_offset - dp_start_offset))
row.append('\n')
@@ -621,6 +628,25 @@ def _extract_caret_anchors_from_line_segment(segment):
return None
+_WIDE_CHAR_SPECIFIERS = "WF"
+
+def _display_width(line, offset):
+ """Calculate the extra amount of width space the given source
+ code segment might take if it were to be displayed on a fixed
+ width output device. Supports wide unicode characters and emojis."""
+
+ # Fast track for ASCII-only strings
+ if line.isascii():
+ return offset
+
+ import unicodedata
+
+ return sum(
+ 2 if unicodedata.east_asian_width(char) in _WIDE_CHAR_SPECIFIERS else 1
+ for char in line[:offset]
+ )
+
+
class _ExceptionPrintContext:
def __init__(self):
@@ -817,13 +843,13 @@ class TracebackException:
The return value is a generator of strings, each ending in a newline.
- Normally, the generator emits a single string; however, for
- SyntaxError exceptions, it emits several lines that (when
- printed) display detailed information about where the syntax
- error occurred.
-
- The message indicating which exception occurred is always the last
- string in the output.
+ Generator yields the exception message.
+ For :exc:`SyntaxError` exceptions, it
+ also yields (before the exception message)
+ several lines that (when printed)
+ display detailed information about where the syntax error occurred.
+ Following the message, generator also yields
+ all the exception's ``__notes__``.
"""
if self.exc_type is None:
yield _format_final_exc_line(None, self._str)
diff --git a/contrib/tools/python3/src/Lib/typing.py b/contrib/tools/python3/src/Lib/typing.py
index 977e37d623..85166dfd94 100644
--- a/contrib/tools/python3/src/Lib/typing.py
+++ b/contrib/tools/python3/src/Lib/typing.py
@@ -211,8 +211,12 @@ def _should_unflatten_callable_args(typ, args):
For example::
- assert collections.abc.Callable[[int, int], str].__args__ == (int, int, str)
- assert collections.abc.Callable[ParamSpec, str].__args__ == (ParamSpec, str)
+ >>> import collections.abc
+ >>> P = ParamSpec('P')
+ >>> collections.abc.Callable[[int, int], str].__args__ == (int, int, str)
+ True
+ >>> collections.abc.Callable[P, str].__args__ == (P, str)
+ True
As a result, if we need to reconstruct the Callable from its __args__,
we need to unflatten it.
@@ -250,7 +254,10 @@ def _collect_parameters(args):
For example::
- assert _collect_parameters((T, Callable[P, T])) == (T, P)
+ >>> P = ParamSpec('P')
+ >>> T = TypeVar('T')
+ >>> _collect_parameters((T, Callable[P, T]))
+ (~T, ~P)
"""
parameters = []
for t in args:
@@ -2207,9 +2214,14 @@ class Annotated:
def __new__(cls, *args, **kwargs):
raise TypeError("Type Annotated cannot be instantiated.")
- @_tp_cache
def __class_getitem__(cls, params):
- if not isinstance(params, tuple) or len(params) < 2:
+ if not isinstance(params, tuple):
+ params = (params,)
+ return cls._class_getitem_inner(cls, *params)
+
+ @_tp_cache(typed=True)
+ def _class_getitem_inner(cls, *params):
+ if len(params) < 2:
raise TypeError("Annotated[...] should be used "
"with at least two arguments (a type and an "
"annotation).")
@@ -2417,14 +2429,15 @@ def get_origin(tp):
Examples::
- assert get_origin(Literal[42]) is Literal
- assert get_origin(int) is None
- assert get_origin(ClassVar[int]) is ClassVar
- assert get_origin(Generic) is Generic
- assert get_origin(Generic[T]) is Generic
- assert get_origin(Union[T, int]) is Union
- assert get_origin(List[Tuple[T, T]][int]) is list
- assert get_origin(P.args) is P
+ >>> P = ParamSpec('P')
+ >>> assert get_origin(Literal[42]) is Literal
+ >>> assert get_origin(int) is None
+ >>> assert get_origin(ClassVar[int]) is ClassVar
+ >>> assert get_origin(Generic) is Generic
+ >>> assert get_origin(Generic[T]) is Generic
+ >>> assert get_origin(Union[T, int]) is Union
+ >>> assert get_origin(List[Tuple[T, T]][int]) is list
+ >>> assert get_origin(P.args) is P
"""
if isinstance(tp, _AnnotatedAlias):
return Annotated
@@ -2445,11 +2458,12 @@ def get_args(tp):
Examples::
- assert get_args(Dict[str, int]) == (str, int)
- assert get_args(int) == ()
- assert get_args(Union[int, Union[T, int], str][int]) == (int, str)
- assert get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
- assert get_args(Callable[[], T][int]) == ([], int)
+ >>> T = TypeVar('T')
+ >>> assert get_args(Dict[str, int]) == (str, int)
+ >>> assert get_args(int) == ()
+ >>> assert get_args(Union[int, Union[T, int], str][int]) == (int, str)
+ >>> assert get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
+ >>> assert get_args(Callable[[], T][int]) == ([], int)
"""
if isinstance(tp, _AnnotatedAlias):
return (tp.__origin__,) + tp.__metadata__
@@ -2468,12 +2482,15 @@ def is_typeddict(tp):
For example::
- class Film(TypedDict):
- title: str
- year: int
-
- is_typeddict(Film) # => True
- is_typeddict(Union[list, str]) # => False
+ >>> from typing import TypedDict
+ >>> class Film(TypedDict):
+ ... title: str
+ ... year: int
+ ...
+ >>> is_typeddict(Film)
+ True
+ >>> is_typeddict(dict)
+ False
"""
return isinstance(tp, _TypedDictMeta)
@@ -2975,8 +2992,14 @@ class _TypedDictMeta(type):
for base in bases:
annotations.update(base.__dict__.get('__annotations__', {}))
- required_keys.update(base.__dict__.get('__required_keys__', ()))
- optional_keys.update(base.__dict__.get('__optional_keys__', ()))
+
+ base_required = base.__dict__.get('__required_keys__', set())
+ required_keys |= base_required
+ optional_keys -= base_required
+
+ base_optional = base.__dict__.get('__optional_keys__', set())
+ required_keys -= base_optional
+ optional_keys |= base_optional
annotations.update(own_annotations)
for annotation_key, annotation_type in own_annotations.items():
@@ -2988,14 +3011,23 @@ class _TypedDictMeta(type):
annotation_origin = get_origin(annotation_type)
if annotation_origin is Required:
- required_keys.add(annotation_key)
+ is_required = True
elif annotation_origin is NotRequired:
- optional_keys.add(annotation_key)
- elif total:
+ is_required = False
+ else:
+ is_required = total
+
+ if is_required:
required_keys.add(annotation_key)
+ optional_keys.discard(annotation_key)
else:
optional_keys.add(annotation_key)
+ required_keys.discard(annotation_key)
+ assert required_keys.isdisjoint(optional_keys), (
+ f"Required keys overlap with optional keys in {name}:"
+ f" {required_keys=}, {optional_keys=}"
+ )
tp_dict.__annotations__ = annotations
tp_dict.__required_keys__ = frozenset(required_keys)
tp_dict.__optional_keys__ = frozenset(optional_keys)
@@ -3022,15 +3054,15 @@ def TypedDict(typename, fields=None, /, *, total=True, **kwargs):
Usage::
- class Point2D(TypedDict):
- x: int
- y: int
- label: str
-
- a: Point2D = {'x': 1, 'y': 2, 'label': 'good'} # OK
- b: Point2D = {'z': 3, 'label': 'bad'} # Fails type check
-
- assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')
+ >>> class Point2D(TypedDict):
+ ... x: int
+ ... y: int
+ ... label: str
+ ...
+ >>> a: Point2D = {'x': 1, 'y': 2, 'label': 'good'} # OK
+ >>> b: Point2D = {'z': 3, 'label': 'bad'} # Fails type check
+ >>> Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')
+ True
The type info can be accessed via the Point2D.__annotations__ dict, and
the Point2D.__required_keys__ and Point2D.__optional_keys__ frozensets.
diff --git a/contrib/tools/python3/src/Lib/unittest/mock.py b/contrib/tools/python3/src/Lib/unittest/mock.py
index e78eb350b8..3c96f1e864 100644
--- a/contrib/tools/python3/src/Lib/unittest/mock.py
+++ b/contrib/tools/python3/src/Lib/unittest/mock.py
@@ -822,7 +822,7 @@ class NonCallableMock(Base):
def _format_mock_failure_message(self, args, kwargs, action='call'):
- message = 'expected %s not found.\nExpected: %s\nActual: %s'
+ message = 'expected %s not found.\nExpected: %s\n Actual: %s'
expected_string = self._format_mock_call_signature(args, kwargs)
call_args = self.call_args
actual_string = self._format_mock_call_signature(*call_args)
@@ -925,7 +925,7 @@ class NonCallableMock(Base):
if self.call_args is None:
expected = self._format_mock_call_signature(args, kwargs)
actual = 'not called.'
- error_message = ('expected call not found.\nExpected: %s\nActual: %s'
+ error_message = ('expected call not found.\nExpected: %s\n Actual: %s'
% (expected, actual))
raise AssertionError(error_message)
@@ -976,7 +976,7 @@ class NonCallableMock(Base):
raise AssertionError(
f'{problem}\n'
f'Expected: {_CallList(calls)}'
- f'{self._calls_repr(prefix="Actual").rstrip(".")}'
+ f'{self._calls_repr(prefix=" Actual").rstrip(".")}'
) from cause
return
diff --git a/contrib/tools/python3/src/Lib/ya.make b/contrib/tools/python3/src/Lib/ya.make
index 9495fe44b9..bf379aabbf 100644
--- a/contrib/tools/python3/src/Lib/ya.make
+++ b/contrib/tools/python3/src/Lib/ya.make
@@ -4,9 +4,9 @@ ENABLE(PYBUILD_NO_PY)
PY3_LIBRARY()
-VERSION(3.11.6)
+VERSION(3.11.7)
-ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.11.6.tar.gz)
+ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.11.7.tar.gz)
LICENSE(Python-2.0)
diff --git a/contrib/tools/python3/src/Lib/zoneinfo/_zoneinfo.py b/contrib/tools/python3/src/Lib/zoneinfo/_zoneinfo.py
index eede15b827..b77dc0ed39 100644
--- a/contrib/tools/python3/src/Lib/zoneinfo/_zoneinfo.py
+++ b/contrib/tools/python3/src/Lib/zoneinfo/_zoneinfo.py
@@ -517,8 +517,8 @@ class _DayOffset:
__slots__ = ["d", "julian", "hour", "minute", "second"]
def __init__(self, d, julian, hour=2, minute=0, second=0):
- if not (0 + julian) <= d <= 365:
- min_day = 0 + julian
+ min_day = 0 + julian # convert bool to int
+ if not min_day <= d <= 365:
raise ValueError(f"d must be in [{min_day}, 365], not: {d}")
self.d = d
@@ -560,11 +560,11 @@ class _CalendarOffset:
)
def __init__(self, m, w, d, hour=2, minute=0, second=0):
- if not 0 < m <= 12:
- raise ValueError("m must be in (0, 12]")
+ if not 1 <= m <= 12:
+ raise ValueError("m must be in [1, 12]")
- if not 0 < w <= 5:
- raise ValueError("w must be in (0, 5]")
+ if not 1 <= w <= 5:
+ raise ValueError("w must be in [1, 5]")
if not 0 <= d <= 6:
raise ValueError("d must be in [0, 6]")
@@ -634,18 +634,21 @@ def _parse_tz_str(tz_str):
offset_str, *start_end_str = tz_str.split(",", 1)
- # fmt: off
parser_re = re.compile(
- r"(?P<std>[^<0-9:.+-]+|<[a-zA-Z0-9+\-]+>)" +
- r"((?P<stdoff>[+-]?\d{1,2}(:\d{2}(:\d{2})?)?)" +
- r"((?P<dst>[^0-9:.+-]+|<[a-zA-Z0-9+\-]+>)" +
- r"((?P<dstoff>[+-]?\d{1,2}(:\d{2}(:\d{2})?)?))?" +
- r")?" + # dst
- r")?$" # stdoff
+ r"""
+ (?P<std>[^<0-9:.+-]+|<[a-zA-Z0-9+-]+>)
+ (?:
+ (?P<stdoff>[+-]?\d{1,3}(?::\d{2}(?::\d{2})?)?)
+ (?:
+ (?P<dst>[^0-9:.+-]+|<[a-zA-Z0-9+-]+>)
+ (?P<dstoff>[+-]?\d{1,3}(?::\d{2}(?::\d{2})?)?)?
+ )? # dst
+ )? # stdoff
+ """,
+ re.ASCII|re.VERBOSE
)
- # fmt: on
- m = parser_re.match(offset_str)
+ m = parser_re.fullmatch(offset_str)
if m is None:
raise ValueError(f"{tz_str} is not a valid TZ string")
@@ -696,16 +699,17 @@ def _parse_tz_str(tz_str):
def _parse_dst_start_end(dststr):
- date, *time = dststr.split("/")
- if date[0] == "M":
+ date, *time = dststr.split("/", 1)
+ type = date[:1]
+ if type == "M":
n_is_julian = False
- m = re.match(r"M(\d{1,2})\.(\d).(\d)$", date)
+ m = re.fullmatch(r"M(\d{1,2})\.(\d).(\d)", date, re.ASCII)
if m is None:
raise ValueError(f"Invalid dst start/end date: {dststr}")
date_offset = tuple(map(int, m.groups()))
offset = _CalendarOffset(*date_offset)
else:
- if date[0] == "J":
+ if type == "J":
n_is_julian = True
date = date[1:]
else:
@@ -715,38 +719,54 @@ def _parse_dst_start_end(dststr):
offset = _DayOffset(doy, n_is_julian)
if time:
- time_components = list(map(int, time[0].split(":")))
- n_components = len(time_components)
- if n_components < 3:
- time_components.extend([0] * (3 - n_components))
- offset.hour, offset.minute, offset.second = time_components
+ offset.hour, offset.minute, offset.second = _parse_transition_time(time[0])
return offset
+def _parse_transition_time(time_str):
+ match = re.fullmatch(
+ r"(?P<sign>[+-])?(?P<h>\d{1,3})(:(?P<m>\d{2})(:(?P<s>\d{2}))?)?",
+ time_str,
+ re.ASCII
+ )
+ if match is None:
+ raise ValueError(f"Invalid time: {time_str}")
+
+ h, m, s = (int(v or 0) for v in match.group("h", "m", "s"))
+
+ if h > 167:
+ raise ValueError(
+ f"Hour must be in [0, 167]: {time_str}"
+ )
+
+ if match.group("sign") == "-":
+ h, m, s = -h, -m, -s
+
+ return h, m, s
+
+
def _parse_tz_delta(tz_delta):
- match = re.match(
- r"(?P<sign>[+-])?(?P<h>\d{1,2})(:(?P<m>\d{2})(:(?P<s>\d{2}))?)?",
+ match = re.fullmatch(
+ r"(?P<sign>[+-])?(?P<h>\d{1,3})(:(?P<m>\d{2})(:(?P<s>\d{2}))?)?",
tz_delta,
+ re.ASCII
)
# Anything passed to this function should already have hit an equivalent
# regular expression to find the section to parse.
assert match is not None, tz_delta
- h, m, s = (
- int(v) if v is not None else 0
- for v in map(match.group, ("h", "m", "s"))
- )
+ h, m, s = (int(v or 0) for v in match.group("h", "m", "s"))
total = h * 3600 + m * 60 + s
- if not -86400 < total < 86400:
+ if h > 24:
raise ValueError(
- f"Offset must be strictly between -24h and +24h: {tz_delta}"
+ f"Offset hours must be in [0, 24]: {tz_delta}"
)
# Yes, +5 maps to an offset of -5h
if match.group("sign") != "-":
- total *= -1
+ total = -total
return total
diff --git a/contrib/tools/python3/src/Modules/_blake2/blake2module.c b/contrib/tools/python3/src/Modules/_blake2/blake2module.c
index 44d783b40d..93478f5c8b 100644
--- a/contrib/tools/python3/src/Modules/_blake2/blake2module.c
+++ b/contrib/tools/python3/src/Modules/_blake2/blake2module.c
@@ -74,6 +74,12 @@ _blake2_free(void *module)
Py_DECREF(x); \
} while(0)
+#define ADD_INT_CONST(NAME, VALUE) do { \
+ if (PyModule_AddIntConstant(m, NAME, VALUE) < 0) { \
+ return -1; \
+ } \
+} while (0)
+
static int
blake2_exec(PyObject *m)
{
@@ -95,10 +101,10 @@ blake2_exec(PyObject *m)
ADD_INT(d, "MAX_KEY_SIZE", BLAKE2B_KEYBYTES);
ADD_INT(d, "MAX_DIGEST_SIZE", BLAKE2B_OUTBYTES);
- PyModule_AddIntConstant(m, "BLAKE2B_SALT_SIZE", BLAKE2B_SALTBYTES);
- PyModule_AddIntConstant(m, "BLAKE2B_PERSON_SIZE", BLAKE2B_PERSONALBYTES);
- PyModule_AddIntConstant(m, "BLAKE2B_MAX_KEY_SIZE", BLAKE2B_KEYBYTES);
- PyModule_AddIntConstant(m, "BLAKE2B_MAX_DIGEST_SIZE", BLAKE2B_OUTBYTES);
+ ADD_INT_CONST("BLAKE2B_SALT_SIZE", BLAKE2B_SALTBYTES);
+ ADD_INT_CONST("BLAKE2B_PERSON_SIZE", BLAKE2B_PERSONALBYTES);
+ ADD_INT_CONST("BLAKE2B_MAX_KEY_SIZE", BLAKE2B_KEYBYTES);
+ ADD_INT_CONST("BLAKE2B_MAX_DIGEST_SIZE", BLAKE2B_OUTBYTES);
/* BLAKE2s */
st->blake2s_type = (PyTypeObject *)PyType_FromModuleAndSpec(
@@ -117,14 +123,17 @@ blake2_exec(PyObject *m)
ADD_INT(d, "MAX_KEY_SIZE", BLAKE2S_KEYBYTES);
ADD_INT(d, "MAX_DIGEST_SIZE", BLAKE2S_OUTBYTES);
- PyModule_AddIntConstant(m, "BLAKE2S_SALT_SIZE", BLAKE2S_SALTBYTES);
- PyModule_AddIntConstant(m, "BLAKE2S_PERSON_SIZE", BLAKE2S_PERSONALBYTES);
- PyModule_AddIntConstant(m, "BLAKE2S_MAX_KEY_SIZE", BLAKE2S_KEYBYTES);
- PyModule_AddIntConstant(m, "BLAKE2S_MAX_DIGEST_SIZE", BLAKE2S_OUTBYTES);
+ ADD_INT_CONST("BLAKE2S_SALT_SIZE", BLAKE2S_SALTBYTES);
+ ADD_INT_CONST("BLAKE2S_PERSON_SIZE", BLAKE2S_PERSONALBYTES);
+ ADD_INT_CONST("BLAKE2S_MAX_KEY_SIZE", BLAKE2S_KEYBYTES);
+ ADD_INT_CONST("BLAKE2S_MAX_DIGEST_SIZE", BLAKE2S_OUTBYTES);
return 0;
}
+#undef ADD_INT
+#undef ADD_INT_CONST
+
static PyModuleDef_Slot _blake2_slots[] = {
{Py_mod_exec, blake2_exec},
{0, NULL}
diff --git a/contrib/tools/python3/src/Modules/_datetimemodule.c b/contrib/tools/python3/src/Modules/_datetimemodule.c
index 5c67f38ec2..df0ce722d5 100644
--- a/contrib/tools/python3/src/Modules/_datetimemodule.c
+++ b/contrib/tools/python3/src/Modules/_datetimemodule.c
@@ -4649,7 +4649,7 @@ time_fromisoformat(PyObject *cls, PyObject *tstr) {
}
int hour = 0, minute = 0, second = 0, microsecond = 0;
- int tzoffset, tzimicrosecond = 0;
+ int tzoffset = 0, tzimicrosecond = 0;
int rv = parse_isoformat_time(p, len,
&hour, &minute, &second, &microsecond,
&tzoffset, &tzimicrosecond);
diff --git a/contrib/tools/python3/src/Modules/_io/bytesio.c b/contrib/tools/python3/src/Modules/_io/bytesio.c
index 930ef7e29d..e84eef4c75 100644
--- a/contrib/tools/python3/src/Modules/_io/bytesio.c
+++ b/contrib/tools/python3/src/Modules/_io/bytesio.c
@@ -124,12 +124,13 @@ unshare_buffer(bytesio *self, size_t size)
static int
resize_buffer(bytesio *self, size_t size)
{
+ assert(self->buf != NULL);
+ assert(self->exports == 0);
+
/* Here, unsigned types are used to avoid dealing with signed integer
overflow, which is undefined in C. */
size_t alloc = PyBytes_GET_SIZE(self->buf);
- assert(self->buf != NULL);
-
/* For simplicity, stay in the range of the signed type. Anyway, Python
doesn't allow strings to be longer than this. */
if (size > PY_SSIZE_T_MAX)
@@ -1083,7 +1084,7 @@ bytesiobuf_getbuffer(bytesiobuf *obj, Py_buffer *view, int flags)
"bytesiobuf_getbuffer: view==NULL argument is obsolete");
return -1;
}
- if (SHARED_BUF(b)) {
+ if (b->exports == 0 && SHARED_BUF(b)) {
if (unshare_buffer(b, b->string_size) < 0)
return -1;
}
diff --git a/contrib/tools/python3/src/Modules/_io/textio.c b/contrib/tools/python3/src/Modules/_io/textio.c
index 7d5afb4c44..b994dc3d7c 100644
--- a/contrib/tools/python3/src/Modules/_io/textio.c
+++ b/contrib/tools/python3/src/Modules/_io/textio.c
@@ -1099,6 +1099,15 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
else if (io_check_errors(errors)) {
return -1;
}
+ Py_ssize_t errors_len;
+ const char *errors_str = PyUnicode_AsUTF8AndSize(errors, &errors_len);
+ if (errors_str == NULL) {
+ return -1;
+ }
+ if (strlen(errors_str) != (size_t)errors_len) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ return -1;
+ }
if (validate_newline(newline) < 0) {
return -1;
@@ -1171,11 +1180,11 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
Py_INCREF(buffer);
/* Build the decoder object */
- if (_textiowrapper_set_decoder(self, codec_info, PyUnicode_AsUTF8(errors)) != 0)
+ if (_textiowrapper_set_decoder(self, codec_info, errors_str) != 0)
goto error;
/* Build the encoder object */
- if (_textiowrapper_set_encoder(self, codec_info, PyUnicode_AsUTF8(errors)) != 0)
+ if (_textiowrapper_set_encoder(self, codec_info, errors_str) != 0)
goto error;
/* Finished sorting out the codec details */
@@ -1272,24 +1281,34 @@ textiowrapper_change_encoding(textio *self, PyObject *encoding,
errors = &_Py_ID(strict);
}
}
+ Py_INCREF(errors);
+ const char *c_encoding = PyUnicode_AsUTF8(encoding);
+ if (c_encoding == NULL) {
+ Py_DECREF(encoding);
+ Py_DECREF(errors);
+ return -1;
+ }
const char *c_errors = PyUnicode_AsUTF8(errors);
if (c_errors == NULL) {
Py_DECREF(encoding);
+ Py_DECREF(errors);
return -1;
}
// Create new encoder & decoder
PyObject *codec_info = _PyCodec_LookupTextEncoding(
- PyUnicode_AsUTF8(encoding), "codecs.open()");
+ c_encoding, "codecs.open()");
if (codec_info == NULL) {
Py_DECREF(encoding);
+ Py_DECREF(errors);
return -1;
}
if (_textiowrapper_set_decoder(self, codec_info, c_errors) != 0 ||
_textiowrapper_set_encoder(self, codec_info, c_errors) != 0) {
Py_DECREF(codec_info);
Py_DECREF(encoding);
+ Py_DECREF(errors);
return -1;
}
Py_DECREF(codec_info);
@@ -1327,6 +1346,26 @@ _io_TextIOWrapper_reconfigure_impl(textio *self, PyObject *encoding,
int write_through;
const char *newline = NULL;
+ if (encoding != Py_None && !PyUnicode_Check(encoding)) {
+ PyErr_Format(PyExc_TypeError,
+ "reconfigure() argument 'encoding' must be str or None, not %s",
+ Py_TYPE(encoding)->tp_name);
+ return NULL;
+ }
+ if (errors != Py_None && !PyUnicode_Check(errors)) {
+ PyErr_Format(PyExc_TypeError,
+ "reconfigure() argument 'errors' must be str or None, not %s",
+ Py_TYPE(errors)->tp_name);
+ return NULL;
+ }
+ if (newline_obj != NULL && newline_obj != Py_None &&
+ !PyUnicode_Check(newline_obj))
+ {
+ PyErr_Format(PyExc_TypeError,
+ "reconfigure() argument 'newline' must be str or None, not %s",
+ Py_TYPE(newline_obj)->tp_name);
+ return NULL;
+ }
/* Check if something is in the read buffer */
if (self->decoded_chars != NULL) {
if (encoding != Py_None || errors != Py_None || newline_obj != NULL) {
@@ -1345,9 +1384,12 @@ _io_TextIOWrapper_reconfigure_impl(textio *self, PyObject *encoding,
line_buffering = convert_optional_bool(line_buffering_obj,
self->line_buffering);
+ if (line_buffering < 0) {
+ return NULL;
+ }
write_through = convert_optional_bool(write_through_obj,
self->write_through);
- if (line_buffering < 0 || write_through < 0) {
+ if (write_through < 0) {
return NULL;
}
diff --git a/contrib/tools/python3/src/Modules/_io/winconsoleio.c b/contrib/tools/python3/src/Modules/_io/winconsoleio.c
index 89431b1e4c..dcb7d32e78 100644
--- a/contrib/tools/python3/src/Modules/_io/winconsoleio.c
+++ b/contrib/tools/python3/src/Modules/_io/winconsoleio.c
@@ -132,6 +132,23 @@ char _PyIO_get_console_type(PyObject *path_or_fd) {
return m;
}
+static DWORD
+_find_last_utf8_boundary(const char *buf, DWORD len)
+{
+ /* This function never returns 0, returns the original len instead */
+ DWORD count = 1;
+ if (len == 0 || (buf[len - 1] & 0x80) == 0) {
+ return len;
+ }
+ for (;; count++) {
+ if (count > 3 || count >= len) {
+ return len;
+ }
+ if ((buf[len - count] & 0xc0) != 0x80) {
+ return len - count;
+ }
+ }
+}
/*[clinic input]
module _io
@@ -954,7 +971,7 @@ _io__WindowsConsoleIO_write_impl(winconsoleio *self, Py_buffer *b)
{
BOOL res = TRUE;
wchar_t *wbuf;
- DWORD len, wlen, orig_len, n = 0;
+ DWORD len, wlen, n = 0;
HANDLE handle;
if (self->fd == -1)
@@ -984,21 +1001,8 @@ _io__WindowsConsoleIO_write_impl(winconsoleio *self, Py_buffer *b)
have to reduce and recalculate. */
while (wlen > 32766 / sizeof(wchar_t)) {
len /= 2;
- orig_len = len;
- /* Reduce the length until we hit the final byte of a UTF-8 sequence
- * (top bit is unset). Fix for github issue 82052.
- */
- while (len > 0 && (((char *)b->buf)[len-1] & 0x80) != 0)
- --len;
- /* If we hit a length of 0, something has gone wrong. This shouldn't
- * be possible, as valid UTF-8 can have at most 3 non-final bytes
- * before a final one, and our buffer is way longer than that.
- * But to be on the safe side, if we hit this issue we just restore
- * the original length and let the console API sort it out.
- */
- if (len == 0) {
- len = orig_len;
- }
+ /* Fix for github issues gh-110913 and gh-82052. */
+ len = _find_last_utf8_boundary(b->buf, len);
wlen = MultiByteToWideChar(CP_UTF8, 0, b->buf, len, NULL, 0);
}
Py_END_ALLOW_THREADS
diff --git a/contrib/tools/python3/src/Modules/_pickle.c b/contrib/tools/python3/src/Modules/_pickle.c
index fb16ffc385..0adb61fd65 100644
--- a/contrib/tools/python3/src/Modules/_pickle.c
+++ b/contrib/tools/python3/src/Modules/_pickle.c
@@ -4691,6 +4691,13 @@ Pickler_traverse(PicklerObject *self, visitproc visit, void *arg)
Py_VISIT(self->fast_memo);
Py_VISIT(self->reducer_override);
Py_VISIT(self->buffer_callback);
+ PyMemoTable *memo = self->memo;
+ if (memo && memo->mt_table) {
+ Py_ssize_t i = memo->mt_allocated;
+ while (--i >= 0) {
+ Py_VISIT(memo->mt_table[i].me_key);
+ }
+ }
return 0;
}
@@ -7215,6 +7222,13 @@ Unpickler_traverse(UnpicklerObject *self, visitproc visit, void *arg)
Py_VISIT(self->stack);
Py_VISIT(self->pers_func);
Py_VISIT(self->buffers);
+ PyObject **memo = self->memo;
+ if (memo) {
+ Py_ssize_t i = self->memo_size;
+ while (--i >= 0) {
+ Py_VISIT(memo[i]);
+ }
+ }
return 0;
}
diff --git a/contrib/tools/python3/src/Modules/_sqlite/ya.make b/contrib/tools/python3/src/Modules/_sqlite/ya.make
index c32056e4a7..4f539fcbb8 100644
--- a/contrib/tools/python3/src/Modules/_sqlite/ya.make
+++ b/contrib/tools/python3/src/Modules/_sqlite/ya.make
@@ -2,9 +2,9 @@
LIBRARY()
-VERSION(3.11.6)
+VERSION(3.11.7)
-ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.11.6.tar.gz)
+ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.11.7.tar.gz)
LICENSE(Python-2.0)
diff --git a/contrib/tools/python3/src/Modules/_sre/sre.c b/contrib/tools/python3/src/Modules/_sre/sre.c
index 448e761c98..3bad9d8d0f 100644
--- a/contrib/tools/python3/src/Modules/_sre/sre.c
+++ b/contrib/tools/python3/src/Modules/_sre/sre.c
@@ -1437,6 +1437,9 @@ _sre_compile_impl(PyObject *module, PyObject *pattern, int flags,
for (i = 0; i < n; i++) {
PyObject *o = PyList_GET_ITEM(code, i);
unsigned long value = PyLong_AsUnsignedLong(o);
+ if (value == (unsigned long)-1 && PyErr_Occurred()) {
+ break;
+ }
self->code[i] = (SRE_CODE) value;
if ((unsigned long) self->code[i] != value) {
PyErr_SetString(PyExc_OverflowError,
@@ -1936,8 +1939,6 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
GET_SKIP;
GET_ARG; /* 0 for lookahead, width for lookbehind */
code--; /* Back up over arg to simplify math below */
- if (arg & 0x80000000)
- FAIL; /* Width too large */
/* Stop 1 before the end; we check the SUCCESS below */
if (_validate_inner(code+1, code+skip-2, groups))
FAIL;
diff --git a/contrib/tools/python3/src/Modules/_sre/sre_lib.h b/contrib/tools/python3/src/Modules/_sre/sre_lib.h
index f8d556b2db..95c1ada908 100644
--- a/contrib/tools/python3/src/Modules/_sre/sre_lib.h
+++ b/contrib/tools/python3/src/Modules/_sre/sre_lib.h
@@ -589,8 +589,8 @@ entrance:
/* optimization info block */
/* <INFO> <1=skip> <2=flags> <3=min> ... */
if (pattern[3] && (uintptr_t)(end - ptr) < pattern[3]) {
- TRACE(("reject (got %zd chars, need %zd)\n",
- end - ptr, (Py_ssize_t) pattern[3]));
+ TRACE(("reject (got %tu chars, need %zu)\n",
+ end - ptr, (size_t) pattern[3]));
RETURN_FAILURE;
}
pattern += pattern[1] + 1;
@@ -1507,7 +1507,7 @@ dispatch:
/* <ASSERT> <skip> <back> <pattern> */
TRACE(("|%p|%p|ASSERT %d\n", pattern,
ptr, pattern[1]));
- if (ptr - (SRE_CHAR *)state->beginning < (Py_ssize_t)pattern[1])
+ if ((uintptr_t)(ptr - (SRE_CHAR *)state->beginning) < pattern[1])
RETURN_FAILURE;
state->ptr = ptr - pattern[1];
DO_JUMP0(JUMP_ASSERT, jump_assert, pattern+2);
@@ -1520,7 +1520,7 @@ dispatch:
/* <ASSERT_NOT> <skip> <back> <pattern> */
TRACE(("|%p|%p|ASSERT_NOT %d\n", pattern,
ptr, pattern[1]));
- if (ptr - (SRE_CHAR *)state->beginning >= (Py_ssize_t)pattern[1]) {
+ if ((uintptr_t)(ptr - (SRE_CHAR *)state->beginning) >= pattern[1]) {
state->ptr = ptr - pattern[1];
LASTMARK_SAVE();
if (state->repeat)
@@ -1655,9 +1655,9 @@ SRE(search)(SRE_STATE* state, SRE_CODE* pattern)
flags = pattern[2];
- if (pattern[3] && end - ptr < (Py_ssize_t)pattern[3]) {
- TRACE(("reject (got %u chars, need %u)\n",
- (unsigned int)(end - ptr), pattern[3]));
+ if (pattern[3] && (uintptr_t)(end - ptr) < pattern[3]) {
+ TRACE(("reject (got %tu chars, need %zu)\n",
+ end - ptr, (size_t) pattern[3]));
return 0;
}
if (pattern[3] > 1) {
diff --git a/contrib/tools/python3/src/Modules/_zoneinfo.c b/contrib/tools/python3/src/Modules/_zoneinfo.c
index 5f584ff93e..e2ed67c026 100644
--- a/contrib/tools/python3/src/Modules/_zoneinfo.c
+++ b/contrib/tools/python3/src/Modules/_zoneinfo.c
@@ -59,21 +59,21 @@ struct TransitionRuleType {
typedef struct {
TransitionRuleType base;
- uint8_t month;
- uint8_t week;
- uint8_t day;
- int8_t hour;
- int8_t minute;
- int8_t second;
+ uint8_t month; /* 1 - 12 */
+ uint8_t week; /* 1 - 5 */
+ uint8_t day; /* 0 - 6 */
+ int16_t hour; /* -167 - 167, RFC 8536 §3.3.1 */
+ int8_t minute; /* signed 2 digits */
+ int8_t second; /* signed 2 digits */
} CalendarRule;
typedef struct {
TransitionRuleType base;
- uint8_t julian;
- unsigned int day;
- int8_t hour;
- int8_t minute;
- int8_t second;
+ uint8_t julian; /* 0, 1 */
+ uint16_t day; /* 0 - 365 */
+ int16_t hour; /* -167 - 167, RFC 8536 §3.3.1 */
+ int8_t minute; /* signed 2 digits */
+ int8_t second; /* signed 2 digits */
} DayRule;
struct StrongCacheNode {
@@ -122,15 +122,14 @@ ts_to_local(size_t *trans_idx, int64_t *trans_utc, long *utcoff,
static int
parse_tz_str(PyObject *tz_str_obj, _tzrule *out);
-static Py_ssize_t
-parse_abbr(const char *const p, PyObject **abbr);
-static Py_ssize_t
-parse_tz_delta(const char *const p, long *total_seconds);
-static Py_ssize_t
-parse_transition_time(const char *const p, int8_t *hour, int8_t *minute,
- int8_t *second);
-static Py_ssize_t
-parse_transition_rule(const char *const p, TransitionRuleType **out);
+static int
+parse_abbr(const char **p, PyObject **abbr);
+static int
+parse_tz_delta(const char **p, long *total_seconds);
+static int
+parse_transition_time(const char **p, int *hour, int *minute, int *second);
+static int
+parse_transition_rule(const char **p, TransitionRuleType **out);
static _ttinfo *
find_tzrule_ttinfo(_tzrule *rule, int64_t ts, unsigned char fold, int year);
@@ -1212,14 +1211,14 @@ calendarrule_year_to_timestamp(TransitionRuleType *base_self, int year)
}
int64_t ordinal = ymd_to_ord(year, self->month, month_day) - EPOCHORDINAL;
- return ((ordinal * 86400) + (int64_t)(self->hour * 3600) +
- (int64_t)(self->minute * 60) + (int64_t)(self->second));
+ return ordinal * 86400 + (int64_t)self->hour * 3600 +
+ (int64_t)self->minute * 60 + self->second;
}
/* Constructor for CalendarRule. */
int
-calendarrule_new(uint8_t month, uint8_t week, uint8_t day, int8_t hour,
- int8_t minute, int8_t second, CalendarRule *out)
+calendarrule_new(int month, int week, int day, int hour,
+ int minute, int second, CalendarRule *out)
{
// These bounds come from the POSIX standard, which describes an Mm.n.d
// rule as:
@@ -1228,33 +1227,36 @@ calendarrule_new(uint8_t month, uint8_t week, uint8_t day, int8_t hour,
// 5, 1 <= m <= 12, where week 5 means "the last d day in month m" which
// may occur in either the fourth or the fifth week). Week 1 is the first
// week in which the d'th day occurs. Day zero is Sunday.
- if (month <= 0 || month > 12) {
- PyErr_Format(PyExc_ValueError, "Month must be in (0, 12]");
+ if (month < 1 || month > 12) {
+ PyErr_Format(PyExc_ValueError, "Month must be in [1, 12]");
return -1;
}
- if (week <= 0 || week > 5) {
- PyErr_Format(PyExc_ValueError, "Week must be in (0, 5]");
+ if (week < 1 || week > 5) {
+ PyErr_Format(PyExc_ValueError, "Week must be in [1, 5]");
return -1;
}
- // If the 'day' parameter type is changed to a signed type,
- // "day < 0" check must be added.
- if (/* day < 0 || */ day > 6) {
+ if (day < 0 || day > 6) {
PyErr_Format(PyExc_ValueError, "Day must be in [0, 6]");
return -1;
}
+ if (hour < -167 || hour > 167) {
+ PyErr_Format(PyExc_ValueError, "Hour must be in [0, 167]");
+ return -1;
+ }
+
TransitionRuleType base = {&calendarrule_year_to_timestamp};
CalendarRule new_offset = {
.base = base,
- .month = month,
- .week = week,
- .day = day,
- .hour = hour,
- .minute = minute,
- .second = second,
+ .month = (uint8_t)month,
+ .week = (uint8_t)week,
+ .day = (uint8_t)day,
+ .hour = (int16_t)hour,
+ .minute = (int8_t)minute,
+ .second = (int8_t)second,
};
*out = new_offset;
@@ -1294,40 +1296,45 @@ dayrule_year_to_timestamp(TransitionRuleType *base_self, int year)
// always transitions on a given calendar day (other than February 29th),
// you would use a Julian day, e.g. J91 always refers to April 1st and J365
// always refers to December 31st.
- unsigned int day = self->day;
+ uint16_t day = self->day;
if (self->julian && day >= 59 && is_leap_year(year)) {
day += 1;
}
- return ((days_before_year + day) * 86400) + (self->hour * 3600) +
- (self->minute * 60) + self->second;
+ return (days_before_year + day) * 86400 + (int64_t)self->hour * 3600 +
+ (int64_t)self->minute * 60 + self->second;
}
/* Constructor for DayRule. */
static int
-dayrule_new(uint8_t julian, unsigned int day, int8_t hour, int8_t minute,
- int8_t second, DayRule *out)
+dayrule_new(int julian, int day, int hour, int minute,
+ int second, DayRule *out)
{
// The POSIX standard specifies that Julian days must be in the range (1 <=
// n <= 365) and that non-Julian (they call it "0-based Julian") days must
// be in the range (0 <= n <= 365).
if (day < julian || day > 365) {
- PyErr_Format(PyExc_ValueError, "day must be in [%u, 365], not: %u",
+ PyErr_Format(PyExc_ValueError, "day must be in [%d, 365], not: %d",
julian, day);
return -1;
}
+ if (hour < -167 || hour > 167) {
+ PyErr_Format(PyExc_ValueError, "Hour must be in [0, 167]");
+ return -1;
+ }
+
TransitionRuleType base = {
&dayrule_year_to_timestamp,
};
DayRule tmp = {
.base = base,
- .julian = julian,
- .day = day,
- .hour = hour,
- .minute = minute,
- .second = second,
+ .julian = (uint8_t)julian,
+ .day = (int16_t)day,
+ .hour = (int16_t)hour,
+ .minute = (int8_t)minute,
+ .second = (int8_t)second,
};
*out = tmp;
@@ -1484,21 +1491,18 @@ parse_tz_str(PyObject *tz_str_obj, _tzrule *out)
const char *p = tz_str;
// Read the `std` abbreviation, which must be at least 3 characters long.
- Py_ssize_t num_chars = parse_abbr(p, &std_abbr);
- if (num_chars < 1) {
- PyErr_Format(PyExc_ValueError, "Invalid STD format in %R", tz_str_obj);
+ if (parse_abbr(&p, &std_abbr)) {
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_ValueError, "Invalid STD format in %R", tz_str_obj);
+ }
goto error;
}
- p += num_chars;
-
// Now read the STD offset, which is required
- num_chars = parse_tz_delta(p, &std_offset);
- if (num_chars < 0) {
+ if (parse_tz_delta(&p, &std_offset)) {
PyErr_Format(PyExc_ValueError, "Invalid STD offset in %R", tz_str_obj);
goto error;
}
- p += num_chars;
// If the string ends here, there is no DST, otherwise we must parse the
// DST abbreviation and start and end dates and times.
@@ -1506,12 +1510,12 @@ parse_tz_str(PyObject *tz_str_obj, _tzrule *out)
goto complete;
}
- num_chars = parse_abbr(p, &dst_abbr);
- if (num_chars < 1) {
- PyErr_Format(PyExc_ValueError, "Invalid DST format in %R", tz_str_obj);
+ if (parse_abbr(&p, &dst_abbr)) {
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_ValueError, "Invalid DST format in %R", tz_str_obj);
+ }
goto error;
}
- p += num_chars;
if (*p == ',') {
// From the POSIX standard:
@@ -1521,14 +1525,11 @@ parse_tz_str(PyObject *tz_str_obj, _tzrule *out)
dst_offset = std_offset + 3600;
}
else {
- num_chars = parse_tz_delta(p, &dst_offset);
- if (num_chars < 0) {
+ if (parse_tz_delta(&p, &dst_offset)) {
PyErr_Format(PyExc_ValueError, "Invalid DST offset in %R",
tz_str_obj);
goto error;
}
-
- p += num_chars;
}
TransitionRuleType **transitions[2] = {&start, &end};
@@ -1541,14 +1542,12 @@ parse_tz_str(PyObject *tz_str_obj, _tzrule *out)
}
p++;
- num_chars = parse_transition_rule(p, transitions[i]);
- if (num_chars < 0) {
+ if (parse_transition_rule(&p, transitions[i])) {
PyErr_Format(PyExc_ValueError,
"Malformed transition rule in TZ string: %R",
tz_str_obj);
goto error;
}
- p += num_chars;
}
if (*p != '\0') {
@@ -1582,26 +1581,30 @@ error:
}
static int
-parse_uint(const char *const p, uint8_t *value)
+parse_digits(const char **p, int min, int max, int *value)
{
- if (!isdigit(*p)) {
- return -1;
+ assert(max <= 3);
+ *value = 0;
+ for (int i = 0; i < max; i++, (*p)++) {
+ if (!Py_ISDIGIT(**p)) {
+ return (i < min) ? -1 : 0;
+ }
+ *value *= 10;
+ *value += (**p) - '0';
}
-
- *value = (*p) - '0';
return 0;
}
/* Parse the STD and DST abbreviations from a TZ string. */
-static Py_ssize_t
-parse_abbr(const char *const p, PyObject **abbr)
+static int
+parse_abbr(const char **p, PyObject **abbr)
{
- const char *ptr = p;
- char buff = *ptr;
+ const char *ptr = *p;
const char *str_start;
const char *str_end;
if (*ptr == '<') {
+ char buff;
ptr++;
str_start = ptr;
while ((buff = *ptr) != '>') {
@@ -1625,7 +1628,7 @@ parse_abbr(const char *const p, PyObject **abbr)
ptr++;
}
else {
- str_start = p;
+ str_start = ptr;
// From the POSIX standard:
//
// In the unquoted form, all characters in these fields shall be
@@ -1635,6 +1638,9 @@ parse_abbr(const char *const p, PyObject **abbr)
ptr++;
}
str_end = ptr;
+ if (str_end == str_start) {
+ return -1;
+ }
}
*abbr = PyUnicode_FromStringAndSize(str_start, str_end - str_start);
@@ -1642,12 +1648,13 @@ parse_abbr(const char *const p, PyObject **abbr)
return -1;
}
- return ptr - p;
+ *p = ptr;
+ return 0;
}
/* Parse a UTC offset from a TZ str. */
-static Py_ssize_t
-parse_tz_delta(const char *const p, long *total_seconds)
+static int
+parse_tz_delta(const char **p, long *total_seconds)
{
// From the POSIX spec:
//
@@ -1662,75 +1669,30 @@ parse_tz_delta(const char *const p, long *total_seconds)
// The POSIX spec says that the values for `hour` must be between 0 and 24
// hours, but RFC 8536 §3.3.1 specifies that the hours part of the
// transition times may be signed and range from -167 to 167.
- long sign = -1;
- long hours = 0;
- long minutes = 0;
- long seconds = 0;
-
- const char *ptr = p;
- char buff = *ptr;
- if (buff == '-' || buff == '+') {
- // Negative numbers correspond to *positive* offsets, from the spec:
- //
- // If preceded by a '-', the timezone shall be east of the Prime
- // Meridian; otherwise, it shall be west (which may be indicated by
- // an optional preceding '+' ).
- if (buff == '-') {
- sign = 1;
- }
-
- ptr++;
- }
-
- // The hour can be 1 or 2 numeric characters
- for (size_t i = 0; i < 2; ++i) {
- buff = *ptr;
- if (!isdigit(buff)) {
- if (i == 0) {
- return -1;
- }
- else {
- break;
- }
- }
+ int hours = 0;
+ int minutes = 0;
+ int seconds = 0;
- hours *= 10;
- hours += buff - '0';
- ptr++;
- }
-
- if (hours > 24 || hours < 0) {
+ if (parse_transition_time(p, &hours, &minutes, &seconds)) {
return -1;
}
- // Minutes and seconds always of the format ":dd"
- long *outputs[2] = {&minutes, &seconds};
- for (size_t i = 0; i < 2; ++i) {
- if (*ptr != ':') {
- goto complete;
- }
- ptr++;
-
- for (size_t j = 0; j < 2; ++j) {
- buff = *ptr;
- if (!isdigit(buff)) {
- return -1;
- }
- *(outputs[i]) *= 10;
- *(outputs[i]) += buff - '0';
- ptr++;
- }
+ if (hours > 24 || hours < -24) {
+ return -1;
}
-complete:
- *total_seconds = sign * ((hours * 3600) + (minutes * 60) + seconds);
-
- return ptr - p;
+ // Negative numbers correspond to *positive* offsets, from the spec:
+ //
+ // If preceded by a '-', the timezone shall be east of the Prime
+ // Meridian; otherwise, it shall be west (which may be indicated by
+ // an optional preceding '+' ).
+ *total_seconds = -((hours * 3600L) + (minutes * 60) + seconds);
+ return 0;
}
/* Parse the date portion of a transition rule. */
-static Py_ssize_t
-parse_transition_rule(const char *const p, TransitionRuleType **out)
+static int
+parse_transition_rule(const char **p, TransitionRuleType **out)
{
// The full transition rule indicates when to change back and forth between
// STD and DST, and has the form:
@@ -1742,10 +1704,10 @@ parse_transition_rule(const char *const p, TransitionRuleType **out)
// does not include the ',' at the end of the first rule.
//
// The POSIX spec states that if *time* is not given, the default is 02:00.
- const char *ptr = p;
- int8_t hour = 2;
- int8_t minute = 0;
- int8_t second = 0;
+ const char *ptr = *p;
+ int hour = 2;
+ int minute = 0;
+ int second = 0;
// Rules come in one of three flavors:
//
@@ -1754,44 +1716,30 @@ parse_transition_rule(const char *const p, TransitionRuleType **out)
// 3. Mm.n.d: Specifying by month, week and day-of-week.
if (*ptr == 'M') {
- uint8_t month, week, day;
+ int month, week, day;
ptr++;
- if (parse_uint(ptr, &month)) {
+
+ if (parse_digits(&ptr, 1, 2, &month)) {
return -1;
}
- ptr++;
- if (*ptr != '.') {
- uint8_t tmp;
- if (parse_uint(ptr, &tmp)) {
- return -1;
- }
-
- month *= 10;
- month += tmp;
- ptr++;
+ if (*ptr++ != '.') {
+ return -1;
}
-
- uint8_t *values[2] = {&week, &day};
- for (size_t i = 0; i < 2; ++i) {
- if (*ptr != '.') {
- return -1;
- }
- ptr++;
-
- if (parse_uint(ptr, values[i])) {
- return -1;
- }
- ptr++;
+ if (parse_digits(&ptr, 1, 1, &week)) {
+ return -1;
+ }
+ if (*ptr++ != '.') {
+ return -1;
+ }
+ if (parse_digits(&ptr, 1, 1, &day)) {
+ return -1;
}
if (*ptr == '/') {
ptr++;
- Py_ssize_t num_chars =
- parse_transition_time(ptr, &hour, &minute, &second);
- if (num_chars < 0) {
+ if (parse_transition_time(&ptr, &hour, &minute, &second)) {
return -1;
}
- ptr += num_chars;
}
CalendarRule *rv = PyMem_Calloc(1, sizeof(CalendarRule));
@@ -1807,33 +1755,22 @@ parse_transition_rule(const char *const p, TransitionRuleType **out)
*out = (TransitionRuleType *)rv;
}
else {
- uint8_t julian = 0;
- unsigned int day = 0;
+ int julian = 0;
+ int day = 0;
if (*ptr == 'J') {
julian = 1;
ptr++;
}
- for (size_t i = 0; i < 3; ++i) {
- if (!isdigit(*ptr)) {
- if (i == 0) {
- return -1;
- }
- break;
- }
- day *= 10;
- day += (*ptr) - '0';
- ptr++;
+ if (parse_digits(&ptr, 1, 3, &day)) {
+ return -1;
}
if (*ptr == '/') {
ptr++;
- Py_ssize_t num_chars =
- parse_transition_time(ptr, &hour, &minute, &second);
- if (num_chars < 0) {
+ if (parse_transition_time(&ptr, &hour, &minute, &second)) {
return -1;
}
- ptr += num_chars;
}
DayRule *rv = PyMem_Calloc(1, sizeof(DayRule));
@@ -1848,13 +1785,13 @@ parse_transition_rule(const char *const p, TransitionRuleType **out)
*out = (TransitionRuleType *)rv;
}
- return ptr - p;
+ *p = ptr;
+ return 0;
}
/* Parse the time portion of a transition rule (e.g. following an /) */
-static Py_ssize_t
-parse_transition_time(const char *const p, int8_t *hour, int8_t *minute,
- int8_t *second)
+static int
+parse_transition_time(const char **p, int *hour, int *minute, int *second)
{
// From the spec:
//
@@ -1866,12 +1803,9 @@ parse_transition_time(const char *const p, int8_t *hour, int8_t *minute,
// h[h][:mm[:ss]]
//
// RFC 8536 also allows transition times to be signed and to range from
- // -167 to +167, but the current version only supports [0, 99].
- //
- // TODO: Support the full range of transition hours.
- int8_t *components[3] = {hour, minute, second};
- const char *ptr = p;
- int8_t sign = 1;
+ // -167 to +167.
+ const char *ptr = *p;
+ int sign = 1;
if (*ptr == '-' || *ptr == '+') {
if (*ptr == '-') {
@@ -1880,32 +1814,31 @@ parse_transition_time(const char *const p, int8_t *hour, int8_t *minute,
ptr++;
}
- for (size_t i = 0; i < 3; ++i) {
- if (i > 0) {
- if (*ptr != ':') {
- break;
- }
- ptr++;
+ // The hour can be 1 to 3 numeric characters
+ if (parse_digits(&ptr, 1, 3, hour)) {
+ return -1;
+ }
+ *hour *= sign;
+
+ // Minutes and seconds always of the format ":dd"
+ if (*ptr == ':') {
+ ptr++;
+ if (parse_digits(&ptr, 2, 2, minute)) {
+ return -1;
}
+ *minute *= sign;
- uint8_t buff = 0;
- for (size_t j = 0; j < 2; j++) {
- if (!isdigit(*ptr)) {
- if (i == 0 && j > 0) {
- break;
- }
+ if (*ptr == ':') {
+ ptr++;
+ if (parse_digits(&ptr, 2, 2, second)) {
return -1;
}
-
- buff *= 10;
- buff += (*ptr) - '0';
- ptr++;
+ *second *= sign;
}
-
- *(components[i]) = sign * buff;
}
- return ptr - p;
+ *p = ptr;
+ return 0;
}
/* Constructor for a _tzrule.
@@ -2260,8 +2193,8 @@ get_local_timestamp(PyObject *dt, int64_t *local_ts)
}
}
- *local_ts = (int64_t)(ord - EPOCHORDINAL) * 86400 +
- (int64_t)(hour * 3600 + minute * 60 + second);
+ *local_ts = (int64_t)(ord - EPOCHORDINAL) * 86400L +
+ (int64_t)(hour * 3600L + minute * 60 + second);
return 0;
}
diff --git a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c b/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c
index 7394cf67e0..6d906ecdd3 100644
--- a/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c
+++ b/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c
@@ -181,8 +181,9 @@ ENCODER(iso2022)
encoded = MAP_UNMAPPABLE;
for (dsg = CONFIG_DESIGNATIONS; dsg->mark; dsg++) {
+ Py_UCS4 buf[2] = {c, 0};
Py_ssize_t length = 1;
- encoded = dsg->encoder(&c, &length);
+ encoded = dsg->encoder(buf, &length);
if (encoded == MAP_MULTIPLE_AVAIL) {
/* this implementation won't work for pair
* of non-bmp characters. */
@@ -191,9 +192,11 @@ ENCODER(iso2022)
return MBERR_TOOFEW;
length = -1;
}
- else
+ else {
+ buf[1] = INCHAR2;
length = 2;
- encoded = dsg->encoder(&c, &length);
+ }
+ encoded = dsg->encoder(buf, &length);
if (encoded != MAP_UNMAPPABLE) {
insize = length;
break;
diff --git a/contrib/tools/python3/src/Modules/clinic/posixmodule.c.h b/contrib/tools/python3/src/Modules/clinic/posixmodule.c.h
index e5efd1a3a5..8d5a5fecbb 100644
--- a/contrib/tools/python3/src/Modules/clinic/posixmodule.c.h
+++ b/contrib/tools/python3/src/Modules/clinic/posixmodule.c.h
@@ -6259,7 +6259,7 @@ exit:
#endif /* (defined HAVE_TRUNCATE || defined MS_WINDOWS) */
-#if (defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG))
+#if (defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG) && !defined(__wasi__))
PyDoc_STRVAR(os_posix_fallocate__doc__,
"posix_fallocate($module, fd, offset, length, /)\n"
@@ -6304,7 +6304,7 @@ exit:
return return_value;
}
-#endif /* (defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG)) */
+#endif /* (defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG) && !defined(__wasi__)) */
#if (defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG))
@@ -9388,4 +9388,4 @@ exit:
#ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
-/*[clinic end generated code: output=8277545a0dea1505 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b649ad9a4e1f2427 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/src/Modules/itertoolsmodule.c b/contrib/tools/python3/src/Modules/itertoolsmodule.c
index d5cdfc591e..7a02a0d25b 100644
--- a/contrib/tools/python3/src/Modules/itertoolsmodule.c
+++ b/contrib/tools/python3/src/Modules/itertoolsmodule.c
@@ -119,21 +119,30 @@ pairwise_next(pairwiseobject *po)
return NULL;
}
if (old == NULL) {
- po->old = old = (*Py_TYPE(it)->tp_iternext)(it);
+ old = (*Py_TYPE(it)->tp_iternext)(it);
+ Py_XSETREF(po->old, old);
if (old == NULL) {
Py_CLEAR(po->it);
return NULL;
}
+ it = po->it;
+ if (it == NULL) {
+ Py_CLEAR(po->old);
+ return NULL;
+ }
}
+ Py_INCREF(old);
new = (*Py_TYPE(it)->tp_iternext)(it);
if (new == NULL) {
Py_CLEAR(po->it);
Py_CLEAR(po->old);
+ Py_DECREF(old);
return NULL;
}
/* Future optimization: Reuse the result tuple as we do in enumerate() */
result = PyTuple_Pack(2, old, new);
- Py_SETREF(po->old, new);
+ Py_XSETREF(po->old, new);
+ Py_DECREF(old);
return result;
}
diff --git a/contrib/tools/python3/src/Modules/posixmodule.c b/contrib/tools/python3/src/Modules/posixmodule.c
index a45e8887da..b494cb56e6 100644
--- a/contrib/tools/python3/src/Modules/posixmodule.c
+++ b/contrib/tools/python3/src/Modules/posixmodule.c
@@ -10992,7 +10992,10 @@ os_truncate_impl(PyObject *module, path_t *path, Py_off_t length)
#endif
-#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG)
+/* GH-111804: Due to posix_fallocate() not having consistent semantics across
+ OSs, support was dropped in WASI preview2. */
+#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG) && \
+ !defined(__wasi__)
/*[clinic input]
os.posix_fallocate
@@ -11030,7 +11033,7 @@ os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset,
errno = result;
return posix_error();
}
-#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG */
+#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG && !defined(__wasi__) */
#if defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)
@@ -11104,7 +11107,6 @@ win32_putenv(PyObject *name, PyObject *value)
}
Py_ssize_t size;
- /* PyUnicode_AsWideCharString() rejects embedded null characters */
wchar_t *env = PyUnicode_AsWideCharString(unicode, &size);
Py_DECREF(unicode);
@@ -11118,6 +11120,12 @@ win32_putenv(PyObject *name, PyObject *value)
PyMem_Free(env);
return NULL;
}
+ if (wcslen(env) != (size_t)size) {
+ PyErr_SetString(PyExc_ValueError,
+ "embedded null character");
+ PyMem_Free(env);
+ return NULL;
+ }
/* _wputenv() and SetEnvironmentVariableW() update the environment in the
Process Environment Block (PEB). _wputenv() also updates CRT 'environ'
diff --git a/contrib/tools/python3/src/Modules/socketmodule.c b/contrib/tools/python3/src/Modules/socketmodule.c
index da18bf9666..5089a88444 100644
--- a/contrib/tools/python3/src/Modules/socketmodule.c
+++ b/contrib/tools/python3/src/Modules/socketmodule.c
@@ -2822,12 +2822,14 @@ For IP sockets, the address info is a pair (hostaddr, port).");
static PyObject *
sock_setblocking(PySocketSockObject *s, PyObject *arg)
{
- long block;
+ long value;
+ int block;
- block = PyLong_AsLong(arg);
- if (block == -1 && PyErr_Occurred())
+ value = PyLong_AsLong(arg);
+ if (value == -1 && PyErr_Occurred())
return NULL;
+ block = (value != 0);
s->sock_timeout = _PyTime_FromSeconds(block ? -1 : 0);
if (internal_setblocking(s, block) == -1) {
return NULL;
@@ -5541,8 +5543,9 @@ socket_sethostname(PyObject *self, PyObject *args)
Py_buffer buf;
int res, flag = 0;
-#ifdef _AIX
-/* issue #18259, not declared in any useful header file */
+#if defined(_AIX) || (defined(__sun) && defined(__SVR4) && Py_SUNOS_VERSION <= 510)
+/* issue #18259, sethostname is not declared in any useful header file on AIX
+ * the same is true for Solaris 10 */
extern int sethostname(const char *, size_t);
#endif
diff --git a/contrib/tools/python3/src/Modules/termios.c b/contrib/tools/python3/src/Modules/termios.c
index 3900a6f0b8..be5d099072 100644
--- a/contrib/tools/python3/src/Modules/termios.c
+++ b/contrib/tools/python3/src/Modules/termios.c
@@ -183,17 +183,25 @@ termios_tcsetattr_impl(PyObject *module, int fd, int when, PyObject *term)
return PyErr_SetFromErrno(state->TermiosError);
}
- mode.c_iflag = (tcflag_t) PyLong_AsLong(PyList_GetItem(term, 0));
- mode.c_oflag = (tcflag_t) PyLong_AsLong(PyList_GetItem(term, 1));
- mode.c_cflag = (tcflag_t) PyLong_AsLong(PyList_GetItem(term, 2));
- mode.c_lflag = (tcflag_t) PyLong_AsLong(PyList_GetItem(term, 3));
- speed_t ispeed = (speed_t) PyLong_AsLong(PyList_GetItem(term, 4));
- speed_t ospeed = (speed_t) PyLong_AsLong(PyList_GetItem(term, 5));
- PyObject *cc = PyList_GetItem(term, 6);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
+ speed_t ispeed, ospeed;
+#define SET_FROM_LIST(TYPE, VAR, LIST, N) do { \
+ PyObject *item = PyList_GET_ITEM(LIST, N); \
+ long num = PyLong_AsLong(item); \
+ if (num == -1 && PyErr_Occurred()) { \
+ return NULL; \
+ } \
+ VAR = (TYPE)num; \
+} while (0)
+
+ SET_FROM_LIST(tcflag_t, mode.c_iflag, term, 0);
+ SET_FROM_LIST(tcflag_t, mode.c_oflag, term, 1);
+ SET_FROM_LIST(tcflag_t, mode.c_cflag, term, 2);
+ SET_FROM_LIST(tcflag_t, mode.c_lflag, term, 3);
+ SET_FROM_LIST(speed_t, ispeed, term, 4);
+ SET_FROM_LIST(speed_t, ospeed, term, 5);
+#undef SET_FROM_LIST
+
+ PyObject *cc = PyList_GET_ITEM(term, 6);
if (!PyList_Check(cc) || PyList_Size(cc) != NCCS) {
PyErr_Format(PyExc_TypeError,
"tcsetattr: attributes[6] must be %d element list",
@@ -208,8 +216,13 @@ termios_tcsetattr_impl(PyObject *module, int fd, int when, PyObject *term)
if (PyBytes_Check(v) && PyBytes_Size(v) == 1)
mode.c_cc[i] = (cc_t) * PyBytes_AsString(v);
- else if (PyLong_Check(v))
- mode.c_cc[i] = (cc_t) PyLong_AsLong(v);
+ else if (PyLong_Check(v)) {
+ long num = PyLong_AsLong(v);
+ if (num == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+ mode.c_cc[i] = (cc_t)num;
+ }
else {
PyErr_SetString(PyExc_TypeError,
"tcsetattr: elements of attributes must be characters or integers");
diff --git a/contrib/tools/python3/src/Modules/ya.make b/contrib/tools/python3/src/Modules/ya.make
index 0301557e23..e578584b6e 100644
--- a/contrib/tools/python3/src/Modules/ya.make
+++ b/contrib/tools/python3/src/Modules/ya.make
@@ -2,9 +2,9 @@
LIBRARY()
-VERSION(3.11.6)
+VERSION(3.11.7)
-ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.11.6.tar.gz)
+ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.11.7.tar.gz)
LICENSE(Python-2.0)
diff --git a/contrib/tools/python3/src/Objects/bytearrayobject.c b/contrib/tools/python3/src/Objects/bytearrayobject.c
index 6d46ebe2a4..1c50203084 100644
--- a/contrib/tools/python3/src/Objects/bytearrayobject.c
+++ b/contrib/tools/python3/src/Objects/bytearrayobject.c
@@ -2008,7 +2008,10 @@ static PyObject *
bytearray_join(PyByteArrayObject *self, PyObject *iterable_of_bytes)
/*[clinic end generated code: output=a8516370bf68ae08 input=aba6b1f9b30fcb8e]*/
{
- return stringlib_bytes_join((PyObject*)self, iterable_of_bytes);
+ self->ob_exports++; // this protects `self` from being cleared/resized if `iterable_of_bytes` is a custom iterator
+ PyObject* ret = stringlib_bytes_join((PyObject*)self, iterable_of_bytes);
+ self->ob_exports--; // unexport `self`
+ return ret;
}
/*[clinic input]
diff --git a/contrib/tools/python3/src/Objects/frameobject.c b/contrib/tools/python3/src/Objects/frameobject.c
index 425749d14c..c95e871188 100644
--- a/contrib/tools/python3/src/Objects/frameobject.c
+++ b/contrib/tools/python3/src/Objects/frameobject.c
@@ -315,19 +315,27 @@ mark_stacks(PyCodeObject *code_obj, int len)
case POP_JUMP_BACKWARD_IF_FALSE:
case POP_JUMP_FORWARD_IF_TRUE:
case POP_JUMP_BACKWARD_IF_TRUE:
+ case POP_JUMP_FORWARD_IF_NONE:
+ case POP_JUMP_BACKWARD_IF_NONE:
+ case POP_JUMP_FORWARD_IF_NOT_NONE:
+ case POP_JUMP_BACKWARD_IF_NOT_NONE:
{
int64_t target_stack;
int j = get_arg(code, i);
if (opcode == POP_JUMP_FORWARD_IF_FALSE ||
opcode == POP_JUMP_FORWARD_IF_TRUE ||
opcode == JUMP_IF_FALSE_OR_POP ||
- opcode == JUMP_IF_TRUE_OR_POP)
+ opcode == JUMP_IF_TRUE_OR_POP ||
+ opcode == POP_JUMP_FORWARD_IF_NONE ||
+ opcode == POP_JUMP_FORWARD_IF_NOT_NONE)
{
j += i + 1;
}
else {
assert(opcode == POP_JUMP_BACKWARD_IF_FALSE ||
- opcode == POP_JUMP_BACKWARD_IF_TRUE);
+ opcode == POP_JUMP_BACKWARD_IF_TRUE ||
+ opcode == POP_JUMP_BACKWARD_IF_NONE ||
+ opcode == POP_JUMP_BACKWARD_IF_NOT_NONE);
j = i + 1 - j;
}
assert(j < len);
diff --git a/contrib/tools/python3/src/Objects/typeobject.c b/contrib/tools/python3/src/Objects/typeobject.c
index 4bdf188158..8c2e725cac 100644
--- a/contrib/tools/python3/src/Objects/typeobject.c
+++ b/contrib/tools/python3/src/Objects/typeobject.c
@@ -2399,21 +2399,21 @@ subtype_getweakref(PyObject *obj, void *context)
static PyGetSetDef subtype_getsets_full[] = {
{"__dict__", subtype_dict, subtype_setdict,
- PyDoc_STR("dictionary for instance variables (if defined)")},
+ PyDoc_STR("dictionary for instance variables")},
{"__weakref__", subtype_getweakref, NULL,
- PyDoc_STR("list of weak references to the object (if defined)")},
+ PyDoc_STR("list of weak references to the object")},
{0}
};
static PyGetSetDef subtype_getsets_dict_only[] = {
{"__dict__", subtype_dict, subtype_setdict,
- PyDoc_STR("dictionary for instance variables (if defined)")},
+ PyDoc_STR("dictionary for instance variables")},
{0}
};
static PyGetSetDef subtype_getsets_weakref_only[] = {
{"__weakref__", subtype_getweakref, NULL,
- PyDoc_STR("list of weak references to the object (if defined)")},
+ PyDoc_STR("list of weak references to the object")},
{0}
};
diff --git a/contrib/tools/python3/src/Parser/parser.c b/contrib/tools/python3/src/Parser/parser.c
index b2c0cfe3c2..af4c8933b1 100644
--- a/contrib/tools/python3/src/Parser/parser.c
+++ b/contrib/tools/python3/src/Parser/parser.c
@@ -457,63 +457,63 @@ static char *soft_keywords[] = {
#define _tmp_149_type 1377
#define _tmp_150_type 1378
#define _tmp_151_type 1379
-#define _loop0_152_type 1380
+#define _tmp_152_type 1380
#define _loop0_153_type 1381
#define _loop0_154_type 1382
-#define _tmp_155_type 1383
+#define _loop0_155_type 1383
#define _tmp_156_type 1384
#define _tmp_157_type 1385
#define _tmp_158_type 1386
-#define _loop0_159_type 1387
+#define _tmp_159_type 1387
#define _loop0_160_type 1388
-#define _loop1_161_type 1389
-#define _tmp_162_type 1390
-#define _loop0_163_type 1391
-#define _tmp_164_type 1392
-#define _loop0_165_type 1393
-#define _tmp_166_type 1394
-#define _loop0_167_type 1395
-#define _loop1_168_type 1396
-#define _tmp_169_type 1397
+#define _loop0_161_type 1389
+#define _loop1_162_type 1390
+#define _tmp_163_type 1391
+#define _loop0_164_type 1392
+#define _tmp_165_type 1393
+#define _loop0_166_type 1394
+#define _tmp_167_type 1395
+#define _loop0_168_type 1396
+#define _loop1_169_type 1397
#define _tmp_170_type 1398
#define _tmp_171_type 1399
-#define _loop0_172_type 1400
-#define _tmp_173_type 1401
+#define _tmp_172_type 1400
+#define _loop0_173_type 1401
#define _tmp_174_type 1402
-#define _loop1_175_type 1403
-#define _loop0_176_type 1404
+#define _tmp_175_type 1403
+#define _loop1_176_type 1404
#define _loop0_177_type 1405
-#define _loop0_179_type 1406
-#define _gather_178_type 1407
-#define _tmp_180_type 1408
-#define _loop0_181_type 1409
-#define _tmp_182_type 1410
-#define _loop0_183_type 1411
-#define _tmp_184_type 1412
-#define _loop0_185_type 1413
-#define _loop1_186_type 1414
+#define _loop0_178_type 1406
+#define _loop0_180_type 1407
+#define _gather_179_type 1408
+#define _tmp_181_type 1409
+#define _loop0_182_type 1410
+#define _tmp_183_type 1411
+#define _loop0_184_type 1412
+#define _tmp_185_type 1413
+#define _loop0_186_type 1414
#define _loop1_187_type 1415
-#define _tmp_188_type 1416
+#define _loop1_188_type 1416
#define _tmp_189_type 1417
-#define _loop0_190_type 1418
-#define _tmp_191_type 1419
+#define _tmp_190_type 1418
+#define _loop0_191_type 1419
#define _tmp_192_type 1420
#define _tmp_193_type 1421
-#define _loop0_195_type 1422
-#define _gather_194_type 1423
-#define _loop0_197_type 1424
-#define _gather_196_type 1425
-#define _loop0_199_type 1426
-#define _gather_198_type 1427
-#define _loop0_201_type 1428
-#define _gather_200_type 1429
-#define _tmp_202_type 1430
-#define _loop0_203_type 1431
-#define _loop1_204_type 1432
-#define _tmp_205_type 1433
-#define _loop0_206_type 1434
-#define _loop1_207_type 1435
-#define _tmp_208_type 1436
+#define _tmp_194_type 1422
+#define _loop0_196_type 1423
+#define _gather_195_type 1424
+#define _loop0_198_type 1425
+#define _gather_197_type 1426
+#define _loop0_200_type 1427
+#define _gather_199_type 1428
+#define _loop0_202_type 1429
+#define _gather_201_type 1430
+#define _tmp_203_type 1431
+#define _loop0_204_type 1432
+#define _loop1_205_type 1433
+#define _tmp_206_type 1434
+#define _loop0_207_type 1435
+#define _loop1_208_type 1436
#define _tmp_209_type 1437
#define _tmp_210_type 1438
#define _tmp_211_type 1439
@@ -523,9 +523,9 @@ static char *soft_keywords[] = {
#define _tmp_215_type 1443
#define _tmp_216_type 1444
#define _tmp_217_type 1445
-#define _loop0_219_type 1446
-#define _gather_218_type 1447
-#define _tmp_220_type 1448
+#define _tmp_218_type 1446
+#define _loop0_220_type 1447
+#define _gather_219_type 1448
#define _tmp_221_type 1449
#define _tmp_222_type 1450
#define _tmp_223_type 1451
@@ -553,8 +553,14 @@ static char *soft_keywords[] = {
#define _tmp_245_type 1473
#define _tmp_246_type 1474
#define _tmp_247_type 1475
-#define _tmp_248_type 1476
-#define _tmp_249_type 1477
+#define _loop0_249_type 1476
+#define _gather_248_type 1477
+#define _tmp_250_type 1478
+#define _tmp_251_type 1479
+#define _tmp_252_type 1480
+#define _tmp_253_type 1481
+#define _tmp_254_type 1482
+#define _tmp_255_type 1483
static mod_ty file_rule(Parser *p);
static mod_ty interactive_rule(Parser *p);
@@ -936,63 +942,63 @@ static void *_tmp_148_rule(Parser *p);
static void *_tmp_149_rule(Parser *p);
static void *_tmp_150_rule(Parser *p);
static void *_tmp_151_rule(Parser *p);
-static asdl_seq *_loop0_152_rule(Parser *p);
+static void *_tmp_152_rule(Parser *p);
static asdl_seq *_loop0_153_rule(Parser *p);
static asdl_seq *_loop0_154_rule(Parser *p);
-static void *_tmp_155_rule(Parser *p);
+static asdl_seq *_loop0_155_rule(Parser *p);
static void *_tmp_156_rule(Parser *p);
static void *_tmp_157_rule(Parser *p);
static void *_tmp_158_rule(Parser *p);
-static asdl_seq *_loop0_159_rule(Parser *p);
+static void *_tmp_159_rule(Parser *p);
static asdl_seq *_loop0_160_rule(Parser *p);
-static asdl_seq *_loop1_161_rule(Parser *p);
-static void *_tmp_162_rule(Parser *p);
-static asdl_seq *_loop0_163_rule(Parser *p);
-static void *_tmp_164_rule(Parser *p);
-static asdl_seq *_loop0_165_rule(Parser *p);
-static void *_tmp_166_rule(Parser *p);
-static asdl_seq *_loop0_167_rule(Parser *p);
-static asdl_seq *_loop1_168_rule(Parser *p);
-static void *_tmp_169_rule(Parser *p);
+static asdl_seq *_loop0_161_rule(Parser *p);
+static asdl_seq *_loop1_162_rule(Parser *p);
+static void *_tmp_163_rule(Parser *p);
+static asdl_seq *_loop0_164_rule(Parser *p);
+static void *_tmp_165_rule(Parser *p);
+static asdl_seq *_loop0_166_rule(Parser *p);
+static void *_tmp_167_rule(Parser *p);
+static asdl_seq *_loop0_168_rule(Parser *p);
+static asdl_seq *_loop1_169_rule(Parser *p);
static void *_tmp_170_rule(Parser *p);
static void *_tmp_171_rule(Parser *p);
-static asdl_seq *_loop0_172_rule(Parser *p);
-static void *_tmp_173_rule(Parser *p);
+static void *_tmp_172_rule(Parser *p);
+static asdl_seq *_loop0_173_rule(Parser *p);
static void *_tmp_174_rule(Parser *p);
-static asdl_seq *_loop1_175_rule(Parser *p);
-static asdl_seq *_loop0_176_rule(Parser *p);
+static void *_tmp_175_rule(Parser *p);
+static asdl_seq *_loop1_176_rule(Parser *p);
static asdl_seq *_loop0_177_rule(Parser *p);
-static asdl_seq *_loop0_179_rule(Parser *p);
-static asdl_seq *_gather_178_rule(Parser *p);
-static void *_tmp_180_rule(Parser *p);
-static asdl_seq *_loop0_181_rule(Parser *p);
-static void *_tmp_182_rule(Parser *p);
-static asdl_seq *_loop0_183_rule(Parser *p);
-static void *_tmp_184_rule(Parser *p);
-static asdl_seq *_loop0_185_rule(Parser *p);
-static asdl_seq *_loop1_186_rule(Parser *p);
+static asdl_seq *_loop0_178_rule(Parser *p);
+static asdl_seq *_loop0_180_rule(Parser *p);
+static asdl_seq *_gather_179_rule(Parser *p);
+static void *_tmp_181_rule(Parser *p);
+static asdl_seq *_loop0_182_rule(Parser *p);
+static void *_tmp_183_rule(Parser *p);
+static asdl_seq *_loop0_184_rule(Parser *p);
+static void *_tmp_185_rule(Parser *p);
+static asdl_seq *_loop0_186_rule(Parser *p);
static asdl_seq *_loop1_187_rule(Parser *p);
-static void *_tmp_188_rule(Parser *p);
+static asdl_seq *_loop1_188_rule(Parser *p);
static void *_tmp_189_rule(Parser *p);
-static asdl_seq *_loop0_190_rule(Parser *p);
-static void *_tmp_191_rule(Parser *p);
+static void *_tmp_190_rule(Parser *p);
+static asdl_seq *_loop0_191_rule(Parser *p);
static void *_tmp_192_rule(Parser *p);
static void *_tmp_193_rule(Parser *p);
-static asdl_seq *_loop0_195_rule(Parser *p);
-static asdl_seq *_gather_194_rule(Parser *p);
-static asdl_seq *_loop0_197_rule(Parser *p);
-static asdl_seq *_gather_196_rule(Parser *p);
-static asdl_seq *_loop0_199_rule(Parser *p);
-static asdl_seq *_gather_198_rule(Parser *p);
-static asdl_seq *_loop0_201_rule(Parser *p);
-static asdl_seq *_gather_200_rule(Parser *p);
-static void *_tmp_202_rule(Parser *p);
-static asdl_seq *_loop0_203_rule(Parser *p);
-static asdl_seq *_loop1_204_rule(Parser *p);
-static void *_tmp_205_rule(Parser *p);
-static asdl_seq *_loop0_206_rule(Parser *p);
-static asdl_seq *_loop1_207_rule(Parser *p);
-static void *_tmp_208_rule(Parser *p);
+static void *_tmp_194_rule(Parser *p);
+static asdl_seq *_loop0_196_rule(Parser *p);
+static asdl_seq *_gather_195_rule(Parser *p);
+static asdl_seq *_loop0_198_rule(Parser *p);
+static asdl_seq *_gather_197_rule(Parser *p);
+static asdl_seq *_loop0_200_rule(Parser *p);
+static asdl_seq *_gather_199_rule(Parser *p);
+static asdl_seq *_loop0_202_rule(Parser *p);
+static asdl_seq *_gather_201_rule(Parser *p);
+static void *_tmp_203_rule(Parser *p);
+static asdl_seq *_loop0_204_rule(Parser *p);
+static asdl_seq *_loop1_205_rule(Parser *p);
+static void *_tmp_206_rule(Parser *p);
+static asdl_seq *_loop0_207_rule(Parser *p);
+static asdl_seq *_loop1_208_rule(Parser *p);
static void *_tmp_209_rule(Parser *p);
static void *_tmp_210_rule(Parser *p);
static void *_tmp_211_rule(Parser *p);
@@ -1002,9 +1008,9 @@ static void *_tmp_214_rule(Parser *p);
static void *_tmp_215_rule(Parser *p);
static void *_tmp_216_rule(Parser *p);
static void *_tmp_217_rule(Parser *p);
-static asdl_seq *_loop0_219_rule(Parser *p);
-static asdl_seq *_gather_218_rule(Parser *p);
-static void *_tmp_220_rule(Parser *p);
+static void *_tmp_218_rule(Parser *p);
+static asdl_seq *_loop0_220_rule(Parser *p);
+static asdl_seq *_gather_219_rule(Parser *p);
static void *_tmp_221_rule(Parser *p);
static void *_tmp_222_rule(Parser *p);
static void *_tmp_223_rule(Parser *p);
@@ -1032,8 +1038,14 @@ static void *_tmp_244_rule(Parser *p);
static void *_tmp_245_rule(Parser *p);
static void *_tmp_246_rule(Parser *p);
static void *_tmp_247_rule(Parser *p);
-static void *_tmp_248_rule(Parser *p);
-static void *_tmp_249_rule(Parser *p);
+static asdl_seq *_loop0_249_rule(Parser *p);
+static asdl_seq *_gather_248_rule(Parser *p);
+static void *_tmp_250_rule(Parser *p);
+static void *_tmp_251_rule(Parser *p);
+static void *_tmp_252_rule(Parser *p);
+static void *_tmp_253_rule(Parser *p);
+static void *_tmp_254_rule(Parser *p);
+static void *_tmp_255_rule(Parser *p);
// file: statements? $
@@ -18915,7 +18927,7 @@ func_type_comment_rule(Parser *p)
}
// invalid_arguments:
-// | args ',' '*'
+// | ((','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs) | kwargs) ',' '*'
// | expression for_if_clauses ',' [args | expression for_if_clauses]
// | NAME '=' expression for_if_clauses
// | args for_if_clauses
@@ -18934,25 +18946,25 @@ invalid_arguments_rule(Parser *p)
}
void * _res = NULL;
int _mark = p->mark;
- { // args ',' '*'
+ { // ((','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs) | kwargs) ',' '*'
if (p->error_indicator) {
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> invalid_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args ',' '*'"));
+ D(fprintf(stderr, "%*c> invalid_arguments[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "((','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs) | kwargs) ',' '*'"));
Token * _literal;
- Token * _literal_1;
- expr_ty a;
+ void *_tmp_144_var;
+ Token * b;
if (
- (a = args_rule(p)) // args
+ (_tmp_144_var = _tmp_144_rule(p)) // (','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs) | kwargs
&&
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
- (_literal_1 = _PyPegen_expect_token(p, 16)) // token='*'
+ (b = _PyPegen_expect_token(p, 16)) // token='*'
)
{
- D(fprintf(stderr, "%*c+ invalid_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args ',' '*'"));
- _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "iterable argument unpacking follows keyword argument unpacking" );
+ D(fprintf(stderr, "%*c+ invalid_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "((','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs) | kwargs) ',' '*'"));
+ _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( b , "iterable argument unpacking follows keyword argument unpacking" );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
p->level--;
@@ -18962,7 +18974,7 @@ invalid_arguments_rule(Parser *p)
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s invalid_arguments[%d-%d]: %s failed!\n", p->level, ' ',
- p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args ',' '*'"));
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "((','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs) | kwargs) ',' '*'"));
}
{ // expression for_if_clauses ',' [args | expression for_if_clauses]
if (p->error_indicator) {
@@ -18982,7 +18994,7 @@ invalid_arguments_rule(Parser *p)
&&
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
- (_opt_var = _tmp_144_rule(p), !p->error_indicator) // [args | expression for_if_clauses]
+ (_opt_var = _tmp_145_rule(p), !p->error_indicator) // [args | expression for_if_clauses]
)
{
D(fprintf(stderr, "%*c+ invalid_arguments[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses ',' [args | expression for_if_clauses]"));
@@ -19153,7 +19165,7 @@ invalid_kwarg_rule(Parser *p)
Token* a;
Token * b;
if (
- (a = (Token*)_tmp_145_rule(p)) // 'True' | 'False' | 'None'
+ (a = (Token*)_tmp_146_rule(p)) // 'True' | 'False' | 'None'
&&
(b = _PyPegen_expect_token(p, 22)) // token='='
)
@@ -19213,7 +19225,7 @@ invalid_kwarg_rule(Parser *p)
expr_ty a;
Token * b;
if (
- _PyPegen_lookahead(0, _tmp_146_rule, p)
+ _PyPegen_lookahead(0, _tmp_147_rule, p)
&&
(a = expression_rule(p)) // expression
&&
@@ -19438,7 +19450,7 @@ invalid_expression_rule(Parser *p)
expr_ty a;
expr_ty b;
if (
- _PyPegen_lookahead(0, _tmp_147_rule, p)
+ _PyPegen_lookahead(0, _tmp_148_rule, p)
&&
(a = disjunction_rule(p)) // disjunction
&&
@@ -19474,7 +19486,7 @@ invalid_expression_rule(Parser *p)
&&
(b = disjunction_rule(p)) // disjunction
&&
- _PyPegen_lookahead(0, _tmp_148_rule, p)
+ _PyPegen_lookahead(0, _tmp_149_rule, p)
)
{
D(fprintf(stderr, "%*c+ invalid_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "disjunction 'if' disjunction !('else' | ':')"));
@@ -19563,7 +19575,7 @@ invalid_named_expression_rule(Parser *p)
&&
(b = bitwise_or_rule(p)) // bitwise_or
&&
- _PyPegen_lookahead(0, _tmp_149_rule, p)
+ _PyPegen_lookahead(0, _tmp_150_rule, p)
)
{
D(fprintf(stderr, "%*c+ invalid_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME '=' bitwise_or !('=' | ':=')"));
@@ -19589,7 +19601,7 @@ invalid_named_expression_rule(Parser *p)
Token * b;
expr_ty bitwise_or_var;
if (
- _PyPegen_lookahead(0, _tmp_150_rule, p)
+ _PyPegen_lookahead(0, _tmp_151_rule, p)
&&
(a = bitwise_or_rule(p)) // bitwise_or
&&
@@ -19597,7 +19609,7 @@ invalid_named_expression_rule(Parser *p)
&&
(bitwise_or_var = bitwise_or_rule(p)) // bitwise_or
&&
- _PyPegen_lookahead(0, _tmp_151_rule, p)
+ _PyPegen_lookahead(0, _tmp_152_rule, p)
)
{
D(fprintf(stderr, "%*c+ invalid_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "!(list | tuple | genexp | 'True' | 'None' | 'False') bitwise_or '=' bitwise_or !('=' | ':=')"));
@@ -19678,7 +19690,7 @@ invalid_assignment_rule(Parser *p)
D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expression ',' star_named_expressions* ':' expression"));
Token * _literal;
Token * _literal_1;
- asdl_seq * _loop0_152_var;
+ asdl_seq * _loop0_153_var;
expr_ty a;
expr_ty expression_var;
if (
@@ -19686,7 +19698,7 @@ invalid_assignment_rule(Parser *p)
&&
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
- (_loop0_152_var = _loop0_152_rule(p)) // star_named_expressions*
+ (_loop0_153_var = _loop0_153_rule(p)) // star_named_expressions*
&&
(_literal_1 = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -19743,10 +19755,10 @@ invalid_assignment_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "((star_targets '='))* star_expressions '='"));
Token * _literal;
- asdl_seq * _loop0_153_var;
+ asdl_seq * _loop0_154_var;
expr_ty a;
if (
- (_loop0_153_var = _loop0_153_rule(p)) // ((star_targets '='))*
+ (_loop0_154_var = _loop0_154_rule(p)) // ((star_targets '='))*
&&
(a = star_expressions_rule(p)) // star_expressions
&&
@@ -19773,10 +19785,10 @@ invalid_assignment_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "((star_targets '='))* yield_expr '='"));
Token * _literal;
- asdl_seq * _loop0_154_var;
+ asdl_seq * _loop0_155_var;
expr_ty a;
if (
- (_loop0_154_var = _loop0_154_rule(p)) // ((star_targets '='))*
+ (_loop0_155_var = _loop0_155_rule(p)) // ((star_targets '='))*
&&
(a = yield_expr_rule(p)) // yield_expr
&&
@@ -19802,7 +19814,7 @@ invalid_assignment_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions augassign (yield_expr | star_expressions)"));
- void *_tmp_155_var;
+ void *_tmp_156_var;
expr_ty a;
AugOperator* augassign_var;
if (
@@ -19810,7 +19822,7 @@ invalid_assignment_rule(Parser *p)
&&
(augassign_var = augassign_rule(p)) // augassign
&&
- (_tmp_155_var = _tmp_155_rule(p)) // yield_expr | star_expressions
+ (_tmp_156_var = _tmp_156_rule(p)) // yield_expr | star_expressions
)
{
D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions augassign (yield_expr | star_expressions)"));
@@ -20036,11 +20048,11 @@ invalid_comprehension_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_comprehension[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('[' | '(' | '{') starred_expression for_if_clauses"));
- void *_tmp_156_var;
+ void *_tmp_157_var;
expr_ty a;
asdl_comprehension_seq* for_if_clauses_var;
if (
- (_tmp_156_var = _tmp_156_rule(p)) // '[' | '(' | '{'
+ (_tmp_157_var = _tmp_157_rule(p)) // '[' | '(' | '{'
&&
(a = starred_expression_rule(p)) // starred_expression
&&
@@ -20067,12 +20079,12 @@ invalid_comprehension_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_comprehension[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('[' | '{') star_named_expression ',' star_named_expressions for_if_clauses"));
Token * _literal;
- void *_tmp_157_var;
+ void *_tmp_158_var;
expr_ty a;
asdl_expr_seq* b;
asdl_comprehension_seq* for_if_clauses_var;
if (
- (_tmp_157_var = _tmp_157_rule(p)) // '[' | '{'
+ (_tmp_158_var = _tmp_158_rule(p)) // '[' | '{'
&&
(a = star_named_expression_rule(p)) // star_named_expression
&&
@@ -20102,12 +20114,12 @@ invalid_comprehension_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_comprehension[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('[' | '{') star_named_expression ',' for_if_clauses"));
- void *_tmp_158_var;
+ void *_tmp_159_var;
expr_ty a;
Token * b;
asdl_comprehension_seq* for_if_clauses_var;
if (
- (_tmp_158_var = _tmp_158_rule(p)) // '[' | '{'
+ (_tmp_159_var = _tmp_159_rule(p)) // '[' | '{'
&&
(a = star_named_expression_rule(p)) // star_named_expression
&&
@@ -20217,11 +20229,11 @@ invalid_parameters_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default* invalid_parameters_helper param_no_default"));
- asdl_seq * _loop0_159_var;
+ asdl_seq * _loop0_160_var;
arg_ty a;
void *invalid_parameters_helper_var;
if (
- (_loop0_159_var = _loop0_159_rule(p)) // param_no_default*
+ (_loop0_160_var = _loop0_160_rule(p)) // param_no_default*
&&
(invalid_parameters_helper_var = invalid_parameters_helper_rule(p)) // invalid_parameters_helper
&&
@@ -20247,18 +20259,18 @@ invalid_parameters_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default* '(' param_no_default+ ','? ')'"));
- asdl_seq * _loop0_160_var;
- asdl_seq * _loop1_161_var;
+ asdl_seq * _loop0_161_var;
+ asdl_seq * _loop1_162_var;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
Token * a;
Token * b;
if (
- (_loop0_160_var = _loop0_160_rule(p)) // param_no_default*
+ (_loop0_161_var = _loop0_161_rule(p)) // param_no_default*
&&
(a = _PyPegen_expect_token(p, 7)) // token='('
&&
- (_loop1_161_var = _loop1_161_rule(p)) // param_no_default+
+ (_loop1_162_var = _loop1_162_rule(p)) // param_no_default+
&&
(_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator) // ','?
&&
@@ -20311,13 +20323,13 @@ invalid_parameters_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(slash_no_default | slash_with_default) param_maybe_default* '/'"));
- asdl_seq * _loop0_163_var;
- void *_tmp_162_var;
+ asdl_seq * _loop0_164_var;
+ void *_tmp_163_var;
Token * a;
if (
- (_tmp_162_var = _tmp_162_rule(p)) // slash_no_default | slash_with_default
+ (_tmp_163_var = _tmp_163_rule(p)) // slash_no_default | slash_with_default
&&
- (_loop0_163_var = _loop0_163_rule(p)) // param_maybe_default*
+ (_loop0_164_var = _loop0_164_rule(p)) // param_maybe_default*
&&
(a = _PyPegen_expect_token(p, 17)) // token='/'
)
@@ -20342,22 +20354,22 @@ invalid_parameters_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "[(slash_no_default | slash_with_default)] param_maybe_default* '*' (',' | param_no_default) param_maybe_default* '/'"));
Token * _literal;
- asdl_seq * _loop0_165_var;
- asdl_seq * _loop0_167_var;
+ asdl_seq * _loop0_166_var;
+ asdl_seq * _loop0_168_var;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- void *_tmp_166_var;
+ void *_tmp_167_var;
Token * a;
if (
- (_opt_var = _tmp_164_rule(p), !p->error_indicator) // [(slash_no_default | slash_with_default)]
+ (_opt_var = _tmp_165_rule(p), !p->error_indicator) // [(slash_no_default | slash_with_default)]
&&
- (_loop0_165_var = _loop0_165_rule(p)) // param_maybe_default*
+ (_loop0_166_var = _loop0_166_rule(p)) // param_maybe_default*
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
- (_tmp_166_var = _tmp_166_rule(p)) // ',' | param_no_default
+ (_tmp_167_var = _tmp_167_rule(p)) // ',' | param_no_default
&&
- (_loop0_167_var = _loop0_167_rule(p)) // param_maybe_default*
+ (_loop0_168_var = _loop0_168_rule(p)) // param_maybe_default*
&&
(a = _PyPegen_expect_token(p, 17)) // token='/'
)
@@ -20382,10 +20394,10 @@ invalid_parameters_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default+ '/' '*'"));
Token * _literal;
- asdl_seq * _loop1_168_var;
+ asdl_seq * _loop1_169_var;
Token * a;
if (
- (_loop1_168_var = _loop1_168_rule(p)) // param_maybe_default+
+ (_loop1_169_var = _loop1_169_rule(p)) // param_maybe_default+
&&
(_literal = _PyPegen_expect_token(p, 17)) // token='/'
&&
@@ -20435,7 +20447,7 @@ invalid_default_rule(Parser *p)
if (
(a = _PyPegen_expect_token(p, 22)) // token='='
&&
- _PyPegen_lookahead(1, _tmp_169_rule, p)
+ _PyPegen_lookahead(1, _tmp_170_rule, p)
)
{
D(fprintf(stderr, "%*c+ invalid_default[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'=' &(')' | ',')"));
@@ -20481,12 +20493,12 @@ invalid_star_etc_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (')' | ',' (')' | '**'))"));
- void *_tmp_170_var;
+ void *_tmp_171_var;
Token * a;
if (
(a = _PyPegen_expect_token(p, 16)) // token='*'
&&
- (_tmp_170_var = _tmp_170_rule(p)) // ')' | ',' (')' | '**')
+ (_tmp_171_var = _tmp_171_rule(p)) // ')' | ',' (')' | '**')
)
{
D(fprintf(stderr, "%*c+ invalid_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (')' | ',' (')' | '**'))"));
@@ -20569,20 +20581,20 @@ invalid_star_etc_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (param_no_default | ',') param_maybe_default* '*' (param_no_default | ',')"));
Token * _literal;
- asdl_seq * _loop0_172_var;
- void *_tmp_171_var;
- void *_tmp_173_var;
+ asdl_seq * _loop0_173_var;
+ void *_tmp_172_var;
+ void *_tmp_174_var;
Token * a;
if (
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
- (_tmp_171_var = _tmp_171_rule(p)) // param_no_default | ','
+ (_tmp_172_var = _tmp_172_rule(p)) // param_no_default | ','
&&
- (_loop0_172_var = _loop0_172_rule(p)) // param_maybe_default*
+ (_loop0_173_var = _loop0_173_rule(p)) // param_maybe_default*
&&
(a = _PyPegen_expect_token(p, 16)) // token='*'
&&
- (_tmp_173_var = _tmp_173_rule(p)) // param_no_default | ','
+ (_tmp_174_var = _tmp_174_rule(p)) // param_no_default | ','
)
{
D(fprintf(stderr, "%*c+ invalid_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (param_no_default | ',') param_maybe_default* '*' (param_no_default | ',')"));
@@ -20698,7 +20710,7 @@ invalid_kwds_rule(Parser *p)
&&
(_literal_1 = _PyPegen_expect_token(p, 12)) // token=','
&&
- (a = (Token*)_tmp_174_rule(p)) // '*' | '**' | '/'
+ (a = (Token*)_tmp_175_rule(p)) // '*' | '**' | '/'
)
{
D(fprintf(stderr, "%*c+ invalid_kwds[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' param ',' ('*' | '**' | '/')"));
@@ -20764,13 +20776,13 @@ invalid_parameters_helper_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_parameters_helper[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default+"));
- asdl_seq * _loop1_175_var;
+ asdl_seq * _loop1_176_var;
if (
- (_loop1_175_var = _loop1_175_rule(p)) // param_with_default+
+ (_loop1_176_var = _loop1_176_rule(p)) // param_with_default+
)
{
D(fprintf(stderr, "%*c+ invalid_parameters_helper[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_with_default+"));
- _res = _loop1_175_var;
+ _res = _loop1_176_var;
goto done;
}
p->mark = _mark;
@@ -20809,11 +20821,11 @@ invalid_lambda_parameters_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* invalid_lambda_parameters_helper lambda_param_no_default"));
- asdl_seq * _loop0_176_var;
+ asdl_seq * _loop0_177_var;
arg_ty a;
void *invalid_lambda_parameters_helper_var;
if (
- (_loop0_176_var = _loop0_176_rule(p)) // lambda_param_no_default*
+ (_loop0_177_var = _loop0_177_rule(p)) // lambda_param_no_default*
&&
(invalid_lambda_parameters_helper_var = invalid_lambda_parameters_helper_rule(p)) // invalid_lambda_parameters_helper
&&
@@ -20839,18 +20851,18 @@ invalid_lambda_parameters_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* '(' ','.lambda_param+ ','? ')'"));
- asdl_seq * _gather_178_var;
- asdl_seq * _loop0_177_var;
+ asdl_seq * _gather_179_var;
+ asdl_seq * _loop0_178_var;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
Token * a;
Token * b;
if (
- (_loop0_177_var = _loop0_177_rule(p)) // lambda_param_no_default*
+ (_loop0_178_var = _loop0_178_rule(p)) // lambda_param_no_default*
&&
(a = _PyPegen_expect_token(p, 7)) // token='('
&&
- (_gather_178_var = _gather_178_rule(p)) // ','.lambda_param+
+ (_gather_179_var = _gather_179_rule(p)) // ','.lambda_param+
&&
(_opt_var = _PyPegen_expect_token(p, 12), !p->error_indicator) // ','?
&&
@@ -20903,13 +20915,13 @@ invalid_lambda_parameters_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(lambda_slash_no_default | lambda_slash_with_default) lambda_param_maybe_default* '/'"));
- asdl_seq * _loop0_181_var;
- void *_tmp_180_var;
+ asdl_seq * _loop0_182_var;
+ void *_tmp_181_var;
Token * a;
if (
- (_tmp_180_var = _tmp_180_rule(p)) // lambda_slash_no_default | lambda_slash_with_default
+ (_tmp_181_var = _tmp_181_rule(p)) // lambda_slash_no_default | lambda_slash_with_default
&&
- (_loop0_181_var = _loop0_181_rule(p)) // lambda_param_maybe_default*
+ (_loop0_182_var = _loop0_182_rule(p)) // lambda_param_maybe_default*
&&
(a = _PyPegen_expect_token(p, 17)) // token='/'
)
@@ -20934,22 +20946,22 @@ invalid_lambda_parameters_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "[(lambda_slash_no_default | lambda_slash_with_default)] lambda_param_maybe_default* '*' (',' | lambda_param_no_default) lambda_param_maybe_default* '/'"));
Token * _literal;
- asdl_seq * _loop0_183_var;
- asdl_seq * _loop0_185_var;
+ asdl_seq * _loop0_184_var;
+ asdl_seq * _loop0_186_var;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
- void *_tmp_184_var;
+ void *_tmp_185_var;
Token * a;
if (
- (_opt_var = _tmp_182_rule(p), !p->error_indicator) // [(lambda_slash_no_default | lambda_slash_with_default)]
+ (_opt_var = _tmp_183_rule(p), !p->error_indicator) // [(lambda_slash_no_default | lambda_slash_with_default)]
&&
- (_loop0_183_var = _loop0_183_rule(p)) // lambda_param_maybe_default*
+ (_loop0_184_var = _loop0_184_rule(p)) // lambda_param_maybe_default*
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
- (_tmp_184_var = _tmp_184_rule(p)) // ',' | lambda_param_no_default
+ (_tmp_185_var = _tmp_185_rule(p)) // ',' | lambda_param_no_default
&&
- (_loop0_185_var = _loop0_185_rule(p)) // lambda_param_maybe_default*
+ (_loop0_186_var = _loop0_186_rule(p)) // lambda_param_maybe_default*
&&
(a = _PyPegen_expect_token(p, 17)) // token='/'
)
@@ -20974,10 +20986,10 @@ invalid_lambda_parameters_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default+ '/' '*'"));
Token * _literal;
- asdl_seq * _loop1_186_var;
+ asdl_seq * _loop1_187_var;
Token * a;
if (
- (_loop1_186_var = _loop1_186_rule(p)) // lambda_param_maybe_default+
+ (_loop1_187_var = _loop1_187_rule(p)) // lambda_param_maybe_default+
&&
(_literal = _PyPegen_expect_token(p, 17)) // token='/'
&&
@@ -21049,13 +21061,13 @@ invalid_lambda_parameters_helper_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_lambda_parameters_helper[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default+"));
- asdl_seq * _loop1_187_var;
+ asdl_seq * _loop1_188_var;
if (
- (_loop1_187_var = _loop1_187_rule(p)) // lambda_param_with_default+
+ (_loop1_188_var = _loop1_188_rule(p)) // lambda_param_with_default+
)
{
D(fprintf(stderr, "%*c+ invalid_lambda_parameters_helper[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default+"));
- _res = _loop1_187_var;
+ _res = _loop1_188_var;
goto done;
}
p->mark = _mark;
@@ -21092,11 +21104,11 @@ invalid_lambda_star_etc_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (':' | ',' (':' | '**'))"));
Token * _literal;
- void *_tmp_188_var;
+ void *_tmp_189_var;
if (
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
- (_tmp_188_var = _tmp_188_rule(p)) // ':' | ',' (':' | '**')
+ (_tmp_189_var = _tmp_189_rule(p)) // ':' | ',' (':' | '**')
)
{
D(fprintf(stderr, "%*c+ invalid_lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (':' | ',' (':' | '**'))"));
@@ -21149,20 +21161,20 @@ invalid_lambda_star_etc_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (lambda_param_no_default | ',') lambda_param_maybe_default* '*' (lambda_param_no_default | ',')"));
Token * _literal;
- asdl_seq * _loop0_190_var;
- void *_tmp_189_var;
- void *_tmp_191_var;
+ asdl_seq * _loop0_191_var;
+ void *_tmp_190_var;
+ void *_tmp_192_var;
Token * a;
if (
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
- (_tmp_189_var = _tmp_189_rule(p)) // lambda_param_no_default | ','
+ (_tmp_190_var = _tmp_190_rule(p)) // lambda_param_no_default | ','
&&
- (_loop0_190_var = _loop0_190_rule(p)) // lambda_param_maybe_default*
+ (_loop0_191_var = _loop0_191_rule(p)) // lambda_param_maybe_default*
&&
(a = _PyPegen_expect_token(p, 16)) // token='*'
&&
- (_tmp_191_var = _tmp_191_rule(p)) // lambda_param_no_default | ','
+ (_tmp_192_var = _tmp_192_rule(p)) // lambda_param_no_default | ','
)
{
D(fprintf(stderr, "%*c+ invalid_lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (lambda_param_no_default | ',') lambda_param_maybe_default* '*' (lambda_param_no_default | ',')"));
@@ -21281,7 +21293,7 @@ invalid_lambda_kwds_rule(Parser *p)
&&
(_literal_1 = _PyPegen_expect_token(p, 12)) // token=','
&&
- (a = (Token*)_tmp_192_rule(p)) // '*' | '**' | '/'
+ (a = (Token*)_tmp_193_rule(p)) // '*' | '**' | '/'
)
{
D(fprintf(stderr, "%*c+ invalid_lambda_kwds[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**' lambda_param ',' ('*' | '**' | '/')"));
@@ -21389,7 +21401,7 @@ invalid_with_item_rule(Parser *p)
&&
(a = expression_rule(p)) // expression
&&
- _PyPegen_lookahead(1, _tmp_193_rule, p)
+ _PyPegen_lookahead(1, _tmp_194_rule, p)
)
{
D(fprintf(stderr, "%*c+ invalid_with_item[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression 'as' expression &(',' | ')' | ':')"));
@@ -21617,7 +21629,7 @@ invalid_with_stmt_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC? 'with' ','.(expression ['as' star_target])+ NEWLINE"));
- asdl_seq * _gather_194_var;
+ asdl_seq * _gather_195_var;
Token * _keyword;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
@@ -21627,7 +21639,7 @@ invalid_with_stmt_rule(Parser *p)
&&
(_keyword = _PyPegen_expect_token(p, 612)) // token='with'
&&
- (_gather_194_var = _gather_194_rule(p)) // ','.(expression ['as' star_target])+
+ (_gather_195_var = _gather_195_rule(p)) // ','.(expression ['as' star_target])+
&&
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
)
@@ -21651,7 +21663,7 @@ invalid_with_stmt_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC? 'with' '(' ','.(expressions ['as' star_target])+ ','? ')' NEWLINE"));
- asdl_seq * _gather_196_var;
+ asdl_seq * _gather_197_var;
Token * _keyword;
Token * _literal;
Token * _literal_1;
@@ -21667,7 +21679,7 @@ invalid_with_stmt_rule(Parser *p)
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
- (_gather_196_var = _gather_196_rule(p)) // ','.(expressions ['as' star_target])+
+ (_gather_197_var = _gather_197_rule(p)) // ','.(expressions ['as' star_target])+
&&
(_opt_var_1 = _PyPegen_expect_token(p, 12), !p->error_indicator) // ','?
&&
@@ -21717,7 +21729,7 @@ invalid_with_stmt_indent_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_with_stmt_indent[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC? 'with' ','.(expression ['as' star_target])+ ':' NEWLINE !INDENT"));
- asdl_seq * _gather_198_var;
+ asdl_seq * _gather_199_var;
Token * _literal;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
@@ -21728,7 +21740,7 @@ invalid_with_stmt_indent_rule(Parser *p)
&&
(a = _PyPegen_expect_token(p, 612)) // token='with'
&&
- (_gather_198_var = _gather_198_rule(p)) // ','.(expression ['as' star_target])+
+ (_gather_199_var = _gather_199_rule(p)) // ','.(expression ['as' star_target])+
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -21756,7 +21768,7 @@ invalid_with_stmt_indent_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_with_stmt_indent[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC? 'with' '(' ','.(expressions ['as' star_target])+ ','? ')' ':' NEWLINE !INDENT"));
- asdl_seq * _gather_200_var;
+ asdl_seq * _gather_201_var;
Token * _literal;
Token * _literal_1;
Token * _literal_2;
@@ -21773,7 +21785,7 @@ invalid_with_stmt_indent_rule(Parser *p)
&&
(_literal = _PyPegen_expect_token(p, 7)) // token='('
&&
- (_gather_200_var = _gather_200_rule(p)) // ','.(expressions ['as' star_target])+
+ (_gather_201_var = _gather_201_rule(p)) // ','.(expressions ['as' star_target])+
&&
(_opt_var_1 = _PyPegen_expect_token(p, 12), !p->error_indicator) // ','?
&&
@@ -21871,7 +21883,7 @@ invalid_try_stmt_rule(Parser *p)
&&
(block_var = block_rule(p)) // block
&&
- _PyPegen_lookahead(0, _tmp_202_rule, p)
+ _PyPegen_lookahead(0, _tmp_203_rule, p)
)
{
D(fprintf(stderr, "%*c+ invalid_try_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'try' ':' block !('except' | 'finally')"));
@@ -21896,8 +21908,8 @@ invalid_try_stmt_rule(Parser *p)
Token * _keyword;
Token * _literal;
Token * _literal_1;
- asdl_seq * _loop0_203_var;
- asdl_seq * _loop1_204_var;
+ asdl_seq * _loop0_204_var;
+ asdl_seq * _loop1_205_var;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
Token * a;
@@ -21908,9 +21920,9 @@ invalid_try_stmt_rule(Parser *p)
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
- (_loop0_203_var = _loop0_203_rule(p)) // block*
+ (_loop0_204_var = _loop0_204_rule(p)) // block*
&&
- (_loop1_204_var = _loop1_204_rule(p)) // except_block+
+ (_loop1_205_var = _loop1_205_rule(p)) // except_block+
&&
(a = _PyPegen_expect_token(p, 634)) // token='except'
&&
@@ -21918,7 +21930,7 @@ invalid_try_stmt_rule(Parser *p)
&&
(expression_var = expression_rule(p)) // expression
&&
- (_opt_var = _tmp_205_rule(p), !p->error_indicator) // ['as' NAME]
+ (_opt_var = _tmp_206_rule(p), !p->error_indicator) // ['as' NAME]
&&
(_literal_1 = _PyPegen_expect_token(p, 11)) // token=':'
)
@@ -21945,8 +21957,8 @@ invalid_try_stmt_rule(Parser *p)
Token * _keyword;
Token * _literal;
Token * _literal_1;
- asdl_seq * _loop0_206_var;
- asdl_seq * _loop1_207_var;
+ asdl_seq * _loop0_207_var;
+ asdl_seq * _loop1_208_var;
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
Token * a;
@@ -21955,13 +21967,13 @@ invalid_try_stmt_rule(Parser *p)
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
- (_loop0_206_var = _loop0_206_rule(p)) // block*
+ (_loop0_207_var = _loop0_207_rule(p)) // block*
&&
- (_loop1_207_var = _loop1_207_rule(p)) // except_star_block+
+ (_loop1_208_var = _loop1_208_rule(p)) // except_star_block+
&&
(a = _PyPegen_expect_token(p, 634)) // token='except'
&&
- (_opt_var = _tmp_208_rule(p), !p->error_indicator) // [expression ['as' NAME]]
+ (_opt_var = _tmp_209_rule(p), !p->error_indicator) // [expression ['as' NAME]]
&&
(_literal_1 = _PyPegen_expect_token(p, 11)) // token=':'
)
@@ -22029,7 +22041,7 @@ invalid_except_stmt_rule(Parser *p)
&&
(expressions_var = expressions_rule(p)) // expressions
&&
- (_opt_var_1 = _tmp_209_rule(p), !p->error_indicator) // ['as' NAME]
+ (_opt_var_1 = _tmp_210_rule(p), !p->error_indicator) // ['as' NAME]
&&
(_literal_1 = _PyPegen_expect_token(p, 11)) // token=':'
)
@@ -22067,7 +22079,7 @@ invalid_except_stmt_rule(Parser *p)
&&
(expression_var = expression_rule(p)) // expression
&&
- (_opt_var_1 = _tmp_210_rule(p), !p->error_indicator) // ['as' NAME]
+ (_opt_var_1 = _tmp_211_rule(p), !p->error_indicator) // ['as' NAME]
&&
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
)
@@ -22119,14 +22131,14 @@ invalid_except_stmt_rule(Parser *p)
}
D(fprintf(stderr, "%*c> invalid_except_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'except' '*' (NEWLINE | ':')"));
Token * _literal;
- void *_tmp_211_var;
+ void *_tmp_212_var;
Token * a;
if (
(a = _PyPegen_expect_token(p, 634)) // token='except'
&&
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
&&
- (_tmp_211_var = _tmp_211_rule(p)) // NEWLINE | ':'
+ (_tmp_212_var = _tmp_212_rule(p)) // NEWLINE | ':'
)
{
D(fprintf(stderr, "%*c+ invalid_except_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'except' '*' (NEWLINE | ':')"));
@@ -22233,7 +22245,7 @@ invalid_except_stmt_indent_rule(Parser *p)
&&
(expression_var = expression_rule(p)) // expression
&&
- (_opt_var = _tmp_212_rule(p), !p->error_indicator) // ['as' NAME]
+ (_opt_var = _tmp_213_rule(p), !p->error_indicator) // ['as' NAME]
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -22328,7 +22340,7 @@ invalid_except_star_stmt_indent_rule(Parser *p)
&&
(expression_var = expression_rule(p)) // expression
&&
- (_opt_var = _tmp_213_rule(p), !p->error_indicator) // ['as' NAME]
+ (_opt_var = _tmp_214_rule(p), !p->error_indicator) // ['as' NAME]
&&
(_literal_1 = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -22697,7 +22709,7 @@ invalid_class_argument_pattern_rule(Parser *p)
asdl_pattern_seq* a;
asdl_seq* keyword_patterns_var;
if (
- (_opt_var = _tmp_214_rule(p), !p->error_indicator) // [positional_patterns ',']
+ (_opt_var = _tmp_215_rule(p), !p->error_indicator) // [positional_patterns ',']
&&
(keyword_patterns_var = keyword_patterns_rule(p)) // keyword_patterns
&&
@@ -23191,7 +23203,7 @@ invalid_def_raw_rule(Parser *p)
&&
(_literal_1 = _PyPegen_expect_token(p, 8)) // token=')'
&&
- (_opt_var_2 = _tmp_215_rule(p), !p->error_indicator) // ['->' expression]
+ (_opt_var_2 = _tmp_216_rule(p), !p->error_indicator) // ['->' expression]
&&
(_literal_2 = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -23251,7 +23263,7 @@ invalid_class_def_raw_rule(Parser *p)
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
- (_opt_var = _tmp_216_rule(p), !p->error_indicator) // ['(' arguments? ')']
+ (_opt_var = _tmp_217_rule(p), !p->error_indicator) // ['(' arguments? ')']
&&
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
)
@@ -23286,7 +23298,7 @@ invalid_class_def_raw_rule(Parser *p)
&&
(name_var = _PyPegen_name_token(p)) // NAME
&&
- (_opt_var = _tmp_217_rule(p), !p->error_indicator) // ['(' arguments? ')']
+ (_opt_var = _tmp_218_rule(p), !p->error_indicator) // ['(' arguments? ')']
&&
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
&&
@@ -23337,11 +23349,11 @@ invalid_double_starred_kvpairs_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> invalid_double_starred_kvpairs[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.double_starred_kvpair+ ',' invalid_kvpair"));
- asdl_seq * _gather_218_var;
+ asdl_seq * _gather_219_var;
Token * _literal;
void *invalid_kvpair_var;
if (
- (_gather_218_var = _gather_218_rule(p)) // ','.double_starred_kvpair+
+ (_gather_219_var = _gather_219_rule(p)) // ','.double_starred_kvpair+
&&
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
@@ -23349,7 +23361,7 @@ invalid_double_starred_kvpairs_rule(Parser *p)
)
{
D(fprintf(stderr, "%*c+ invalid_double_starred_kvpairs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.double_starred_kvpair+ ',' invalid_kvpair"));
- _res = _PyPegen_dummy_name(p, _gather_218_var, _literal, invalid_kvpair_var);
+ _res = _PyPegen_dummy_name(p, _gather_219_var, _literal, invalid_kvpair_var);
goto done;
}
p->mark = _mark;
@@ -23402,7 +23414,7 @@ invalid_double_starred_kvpairs_rule(Parser *p)
&&
(a = _PyPegen_expect_token(p, 11)) // token=':'
&&
- _PyPegen_lookahead(1, _tmp_220_rule, p)
+ _PyPegen_lookahead(1, _tmp_221_rule, p)
)
{
D(fprintf(stderr, "%*c+ invalid_double_starred_kvpairs[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ':' &('}' | ',')"));
@@ -23513,7 +23525,7 @@ invalid_kvpair_rule(Parser *p)
&&
(a = _PyPegen_expect_token(p, 11)) // token=':'
&&
- _PyPegen_lookahead(1, _tmp_221_rule, p)
+ _PyPegen_lookahead(1, _tmp_222_rule, p)
)
{
D(fprintf(stderr, "%*c+ invalid_kvpair[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ':' &('}' | ',')"));
@@ -24364,12 +24376,12 @@ _loop1_14_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop1_14[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')"));
- void *_tmp_222_var;
+ void *_tmp_223_var;
while (
- (_tmp_222_var = _tmp_222_rule(p)) // star_targets '='
+ (_tmp_223_var = _tmp_223_rule(p)) // star_targets '='
)
{
- _res = _tmp_222_var;
+ _res = _tmp_223_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -24943,12 +24955,12 @@ _loop0_24_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop0_24[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('.' | '...')"));
- void *_tmp_223_var;
+ void *_tmp_224_var;
while (
- (_tmp_223_var = _tmp_223_rule(p)) // '.' | '...'
+ (_tmp_224_var = _tmp_224_rule(p)) // '.' | '...'
)
{
- _res = _tmp_223_var;
+ _res = _tmp_224_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -25011,12 +25023,12 @@ _loop1_25_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop1_25[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('.' | '...')"));
- void *_tmp_224_var;
+ void *_tmp_225_var;
while (
- (_tmp_224_var = _tmp_224_rule(p)) // '.' | '...'
+ (_tmp_225_var = _tmp_225_rule(p)) // '.' | '...'
)
{
- _res = _tmp_224_var;
+ _res = _tmp_225_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -25416,12 +25428,12 @@ _loop1_32_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop1_32[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('@' named_expression NEWLINE)"));
- void *_tmp_225_var;
+ void *_tmp_226_var;
while (
- (_tmp_225_var = _tmp_225_rule(p)) // '@' named_expression NEWLINE
+ (_tmp_226_var = _tmp_226_rule(p)) // '@' named_expression NEWLINE
)
{
- _res = _tmp_225_var;
+ _res = _tmp_226_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -28477,12 +28489,12 @@ _loop1_80_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop1_80[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' expression)"));
- void *_tmp_226_var;
+ void *_tmp_227_var;
while (
- (_tmp_226_var = _tmp_226_rule(p)) // ',' expression
+ (_tmp_227_var = _tmp_227_rule(p)) // ',' expression
)
{
- _res = _tmp_226_var;
+ _res = _tmp_227_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -28550,12 +28562,12 @@ _loop1_81_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop1_81[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' star_expression)"));
- void *_tmp_227_var;
+ void *_tmp_228_var;
while (
- (_tmp_227_var = _tmp_227_rule(p)) // ',' star_expression
+ (_tmp_228_var = _tmp_228_rule(p)) // ',' star_expression
)
{
- _res = _tmp_227_var;
+ _res = _tmp_228_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -28742,12 +28754,12 @@ _loop1_84_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop1_84[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('or' conjunction)"));
- void *_tmp_228_var;
+ void *_tmp_229_var;
while (
- (_tmp_228_var = _tmp_228_rule(p)) // 'or' conjunction
+ (_tmp_229_var = _tmp_229_rule(p)) // 'or' conjunction
)
{
- _res = _tmp_228_var;
+ _res = _tmp_229_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -28815,12 +28827,12 @@ _loop1_85_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop1_85[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('and' inversion)"));
- void *_tmp_229_var;
+ void *_tmp_230_var;
while (
- (_tmp_229_var = _tmp_229_rule(p)) // 'and' inversion
+ (_tmp_230_var = _tmp_230_rule(p)) // 'and' inversion
)
{
- _res = _tmp_229_var;
+ _res = _tmp_230_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -29010,7 +29022,7 @@ _loop0_89_rule(Parser *p)
while (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
- (elem = _tmp_230_rule(p)) // slice | starred_expression
+ (elem = _tmp_231_rule(p)) // slice | starred_expression
)
{
_res = elem;
@@ -29076,7 +29088,7 @@ _gather_88_rule(Parser *p)
void *elem;
asdl_seq * seq;
if (
- (elem = _tmp_230_rule(p)) // slice | starred_expression
+ (elem = _tmp_231_rule(p)) // slice | starred_expression
&&
(seq = _loop0_89_rule(p)) // _loop0_89
)
@@ -30762,12 +30774,12 @@ _loop0_114_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop0_114[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('if' disjunction)"));
- void *_tmp_231_var;
+ void *_tmp_232_var;
while (
- (_tmp_231_var = _tmp_231_rule(p)) // 'if' disjunction
+ (_tmp_232_var = _tmp_232_rule(p)) // 'if' disjunction
)
{
- _res = _tmp_231_var;
+ _res = _tmp_232_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -30830,12 +30842,12 @@ _loop0_115_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop0_115[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('if' disjunction)"));
- void *_tmp_232_var;
+ void *_tmp_233_var;
while (
- (_tmp_232_var = _tmp_232_rule(p)) // 'if' disjunction
+ (_tmp_233_var = _tmp_233_rule(p)) // 'if' disjunction
)
{
- _res = _tmp_232_var;
+ _res = _tmp_233_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -30963,7 +30975,7 @@ _loop0_118_rule(Parser *p)
while (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
- (elem = _tmp_233_rule(p)) // starred_expression | (assignment_expression | expression !':=') !'='
+ (elem = _tmp_234_rule(p)) // starred_expression | (assignment_expression | expression !':=') !'='
)
{
_res = elem;
@@ -31030,7 +31042,7 @@ _gather_117_rule(Parser *p)
void *elem;
asdl_seq * seq;
if (
- (elem = _tmp_233_rule(p)) // starred_expression | (assignment_expression | expression !':=') !'='
+ (elem = _tmp_234_rule(p)) // starred_expression | (assignment_expression | expression !':=') !'='
&&
(seq = _loop0_118_rule(p)) // _loop0_118
)
@@ -31601,12 +31613,12 @@ _loop0_128_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop0_128[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' star_target)"));
- void *_tmp_234_var;
+ void *_tmp_235_var;
while (
- (_tmp_234_var = _tmp_234_rule(p)) // ',' star_target
+ (_tmp_235_var = _tmp_235_rule(p)) // ',' star_target
)
{
- _res = _tmp_234_var;
+ _res = _tmp_235_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -31788,12 +31800,12 @@ _loop1_131_rule(Parser *p)
return NULL;
}
D(fprintf(stderr, "%*c> _loop1_131[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' star_target)"));
- void *_tmp_235_var;
+ void *_tmp_236_var;
while (
- (_tmp_235_var = _tmp_235_rule(p)) // ',' star_target
+ (_tmp_236_var = _tmp_236_rule(p)) // ',' star_target
)
{
- _res = _tmp_235_var;
+ _res = _tmp_236_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -32510,7 +32522,9 @@ _tmp_143_rule(Parser *p)
return _res;
}
-// _tmp_144: args | expression for_if_clauses
+// _tmp_144:
+// | (','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs)
+// | kwargs
static void *
_tmp_144_rule(Parser *p)
{
@@ -32524,23 +32538,81 @@ _tmp_144_rule(Parser *p)
}
void * _res = NULL;
int _mark = p->mark;
+ { // (','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs)
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs)"));
+ void *_tmp_237_var;
+ if (
+ (_tmp_237_var = _tmp_237_rule(p)) // ','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs
+ )
+ {
+ D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs)"));
+ _res = _tmp_237_var;
+ goto done;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs)"));
+ }
+ { // kwargs
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "kwargs"));
+ asdl_seq* kwargs_var;
+ if (
+ (kwargs_var = kwargs_rule(p)) // kwargs
+ )
+ {
+ D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "kwargs"));
+ _res = kwargs_var;
+ goto done;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "kwargs"));
+ }
+ _res = NULL;
+ done:
+ p->level--;
+ return _res;
+}
+
+// _tmp_145: args | expression for_if_clauses
+static void *
+_tmp_145_rule(Parser *p)
+{
+ if (p->level++ == MAXSTACK) {
+ p->error_indicator = 1;
+ PyErr_NoMemory();
+ }
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ void * _res = NULL;
+ int _mark = p->mark;
{ // args
if (p->error_indicator) {
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args"));
+ D(fprintf(stderr, "%*c> _tmp_145[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "args"));
expr_ty args_var;
if (
(args_var = args_rule(p)) // args
)
{
- D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args"));
+ D(fprintf(stderr, "%*c+ _tmp_145[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "args"));
_res = args_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_145[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "args"));
}
{ // expression for_if_clauses
@@ -32548,7 +32620,7 @@ _tmp_144_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses"));
+ D(fprintf(stderr, "%*c> _tmp_145[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses"));
expr_ty expression_var;
asdl_comprehension_seq* for_if_clauses_var;
if (
@@ -32557,12 +32629,12 @@ _tmp_144_rule(Parser *p)
(for_if_clauses_var = for_if_clauses_rule(p)) // for_if_clauses
)
{
- D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses"));
+ D(fprintf(stderr, "%*c+ _tmp_145[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression for_if_clauses"));
_res = _PyPegen_dummy_name(p, expression_var, for_if_clauses_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_145[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression for_if_clauses"));
}
_res = NULL;
@@ -32571,9 +32643,9 @@ _tmp_144_rule(Parser *p)
return _res;
}
-// _tmp_145: 'True' | 'False' | 'None'
+// _tmp_146: 'True' | 'False' | 'None'
static void *
-_tmp_145_rule(Parser *p)
+_tmp_146_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -32590,18 +32662,18 @@ _tmp_145_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_145[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'"));
+ D(fprintf(stderr, "%*c> _tmp_146[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 600)) // token='True'
)
{
- D(fprintf(stderr, "%*c+ _tmp_145[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'"));
+ D(fprintf(stderr, "%*c+ _tmp_146[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'"));
_res = _keyword;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_145[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_146[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'True'"));
}
{ // 'False'
@@ -32609,18 +32681,18 @@ _tmp_145_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_145[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'"));
+ D(fprintf(stderr, "%*c> _tmp_146[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 602)) // token='False'
)
{
- D(fprintf(stderr, "%*c+ _tmp_145[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'"));
+ D(fprintf(stderr, "%*c+ _tmp_146[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'"));
_res = _keyword;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_145[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_146[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'False'"));
}
{ // 'None'
@@ -32628,18 +32700,18 @@ _tmp_145_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_145[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'"));
+ D(fprintf(stderr, "%*c> _tmp_146[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 601)) // token='None'
)
{
- D(fprintf(stderr, "%*c+ _tmp_145[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'"));
+ D(fprintf(stderr, "%*c+ _tmp_146[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'"));
_res = _keyword;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_145[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_146[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'None'"));
}
_res = NULL;
@@ -32648,9 +32720,9 @@ _tmp_145_rule(Parser *p)
return _res;
}
-// _tmp_146: NAME '='
+// _tmp_147: NAME '='
static void *
-_tmp_146_rule(Parser *p)
+_tmp_147_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -32667,7 +32739,7 @@ _tmp_146_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_146[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME '='"));
+ D(fprintf(stderr, "%*c> _tmp_147[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME '='"));
Token * _literal;
expr_ty name_var;
if (
@@ -32676,12 +32748,12 @@ _tmp_146_rule(Parser *p)
(_literal = _PyPegen_expect_token(p, 22)) // token='='
)
{
- D(fprintf(stderr, "%*c+ _tmp_146[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME '='"));
+ D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME '='"));
_res = _PyPegen_dummy_name(p, name_var, _literal);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_146[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_147[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME '='"));
}
_res = NULL;
@@ -32690,9 +32762,9 @@ _tmp_146_rule(Parser *p)
return _res;
}
-// _tmp_147: NAME STRING | SOFT_KEYWORD
+// _tmp_148: NAME STRING | SOFT_KEYWORD
static void *
-_tmp_147_rule(Parser *p)
+_tmp_148_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -32709,7 +32781,7 @@ _tmp_147_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_147[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME STRING"));
+ D(fprintf(stderr, "%*c> _tmp_148[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME STRING"));
expr_ty name_var;
expr_ty string_var;
if (
@@ -32718,12 +32790,12 @@ _tmp_147_rule(Parser *p)
(string_var = _PyPegen_string_token(p)) // STRING
)
{
- D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME STRING"));
+ D(fprintf(stderr, "%*c+ _tmp_148[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME STRING"));
_res = _PyPegen_dummy_name(p, name_var, string_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_147[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_148[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME STRING"));
}
{ // SOFT_KEYWORD
@@ -32731,18 +32803,18 @@ _tmp_147_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_147[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "SOFT_KEYWORD"));
+ D(fprintf(stderr, "%*c> _tmp_148[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "SOFT_KEYWORD"));
expr_ty soft_keyword_var;
if (
(soft_keyword_var = _PyPegen_soft_keyword_token(p)) // SOFT_KEYWORD
)
{
- D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "SOFT_KEYWORD"));
+ D(fprintf(stderr, "%*c+ _tmp_148[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "SOFT_KEYWORD"));
_res = soft_keyword_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_147[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_148[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "SOFT_KEYWORD"));
}
_res = NULL;
@@ -32751,9 +32823,9 @@ _tmp_147_rule(Parser *p)
return _res;
}
-// _tmp_148: 'else' | ':'
+// _tmp_149: 'else' | ':'
static void *
-_tmp_148_rule(Parser *p)
+_tmp_149_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -32770,18 +32842,18 @@ _tmp_148_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_148[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'else'"));
+ D(fprintf(stderr, "%*c> _tmp_149[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'else'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 642)) // token='else'
)
{
- D(fprintf(stderr, "%*c+ _tmp_148[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'else'"));
+ D(fprintf(stderr, "%*c+ _tmp_149[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'else'"));
_res = _keyword;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_148[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_149[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'else'"));
}
{ // ':'
@@ -32789,18 +32861,18 @@ _tmp_148_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_148[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
+ D(fprintf(stderr, "%*c> _tmp_149[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
)
{
- D(fprintf(stderr, "%*c+ _tmp_148[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
+ D(fprintf(stderr, "%*c+ _tmp_149[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_148[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_149[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'"));
}
_res = NULL;
@@ -32809,9 +32881,9 @@ _tmp_148_rule(Parser *p)
return _res;
}
-// _tmp_149: '=' | ':='
+// _tmp_150: '=' | ':='
static void *
-_tmp_149_rule(Parser *p)
+_tmp_150_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -32828,18 +32900,18 @@ _tmp_149_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_149[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'='"));
+ D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 22)) // token='='
)
{
- D(fprintf(stderr, "%*c+ _tmp_149[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'='"));
+ D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'='"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_149[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'='"));
}
{ // ':='
@@ -32847,18 +32919,18 @@ _tmp_149_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_149[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':='"));
+ D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 53)) // token=':='
)
{
- D(fprintf(stderr, "%*c+ _tmp_149[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':='"));
+ D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':='"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_149[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':='"));
}
_res = NULL;
@@ -32867,9 +32939,9 @@ _tmp_149_rule(Parser *p)
return _res;
}
-// _tmp_150: list | tuple | genexp | 'True' | 'None' | 'False'
+// _tmp_151: list | tuple | genexp | 'True' | 'None' | 'False'
static void *
-_tmp_150_rule(Parser *p)
+_tmp_151_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -32886,18 +32958,18 @@ _tmp_150_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "list"));
+ D(fprintf(stderr, "%*c> _tmp_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "list"));
expr_ty list_var;
if (
(list_var = list_rule(p)) // list
)
{
- D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "list"));
+ D(fprintf(stderr, "%*c+ _tmp_151[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "list"));
_res = list_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_151[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "list"));
}
{ // tuple
@@ -32905,18 +32977,18 @@ _tmp_150_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "tuple"));
+ D(fprintf(stderr, "%*c> _tmp_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "tuple"));
expr_ty tuple_var;
if (
(tuple_var = tuple_rule(p)) // tuple
)
{
- D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "tuple"));
+ D(fprintf(stderr, "%*c+ _tmp_151[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "tuple"));
_res = tuple_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_151[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "tuple"));
}
{ // genexp
@@ -32924,18 +32996,18 @@ _tmp_150_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "genexp"));
+ D(fprintf(stderr, "%*c> _tmp_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "genexp"));
expr_ty genexp_var;
if (
(genexp_var = genexp_rule(p)) // genexp
)
{
- D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "genexp"));
+ D(fprintf(stderr, "%*c+ _tmp_151[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "genexp"));
_res = genexp_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_151[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "genexp"));
}
{ // 'True'
@@ -32943,18 +33015,18 @@ _tmp_150_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'"));
+ D(fprintf(stderr, "%*c> _tmp_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 600)) // token='True'
)
{
- D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'"));
+ D(fprintf(stderr, "%*c+ _tmp_151[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'"));
_res = _keyword;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_151[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'True'"));
}
{ // 'None'
@@ -32962,18 +33034,18 @@ _tmp_150_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'"));
+ D(fprintf(stderr, "%*c> _tmp_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 601)) // token='None'
)
{
- D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'"));
+ D(fprintf(stderr, "%*c+ _tmp_151[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'"));
_res = _keyword;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_151[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'None'"));
}
{ // 'False'
@@ -32981,18 +33053,18 @@ _tmp_150_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'"));
+ D(fprintf(stderr, "%*c> _tmp_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 602)) // token='False'
)
{
- D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'"));
+ D(fprintf(stderr, "%*c+ _tmp_151[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'"));
_res = _keyword;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_151[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'False'"));
}
_res = NULL;
@@ -33001,9 +33073,9 @@ _tmp_150_rule(Parser *p)
return _res;
}
-// _tmp_151: '=' | ':='
+// _tmp_152: '=' | ':='
static void *
-_tmp_151_rule(Parser *p)
+_tmp_152_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33020,18 +33092,18 @@ _tmp_151_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'='"));
+ D(fprintf(stderr, "%*c> _tmp_152[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 22)) // token='='
)
{
- D(fprintf(stderr, "%*c+ _tmp_151[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'='"));
+ D(fprintf(stderr, "%*c+ _tmp_152[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'='"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_151[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_152[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'='"));
}
{ // ':='
@@ -33039,18 +33111,18 @@ _tmp_151_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':='"));
+ D(fprintf(stderr, "%*c> _tmp_152[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':='"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 53)) // token=':='
)
{
- D(fprintf(stderr, "%*c+ _tmp_151[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':='"));
+ D(fprintf(stderr, "%*c+ _tmp_152[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':='"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_151[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_152[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':='"));
}
_res = NULL;
@@ -33059,9 +33131,9 @@ _tmp_151_rule(Parser *p)
return _res;
}
-// _loop0_152: star_named_expressions
+// _loop0_153: star_named_expressions
static asdl_seq *
-_loop0_152_rule(Parser *p)
+_loop0_153_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33087,7 +33159,7 @@ _loop0_152_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_152[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expressions"));
+ D(fprintf(stderr, "%*c> _loop0_153[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expressions"));
asdl_expr_seq* star_named_expressions_var;
while (
(star_named_expressions_var = star_named_expressions_rule(p)) // star_named_expressions
@@ -33110,7 +33182,7 @@ _loop0_152_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_152[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_153[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_named_expressions"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -33127,9 +33199,9 @@ _loop0_152_rule(Parser *p)
return _seq;
}
-// _loop0_153: (star_targets '=')
+// _loop0_154: (star_targets '=')
static asdl_seq *
-_loop0_153_rule(Parser *p)
+_loop0_154_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33155,13 +33227,13 @@ _loop0_153_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_153[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')"));
- void *_tmp_236_var;
+ D(fprintf(stderr, "%*c> _loop0_154[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')"));
+ void *_tmp_238_var;
while (
- (_tmp_236_var = _tmp_236_rule(p)) // star_targets '='
+ (_tmp_238_var = _tmp_238_rule(p)) // star_targets '='
)
{
- _res = _tmp_236_var;
+ _res = _tmp_238_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -33178,7 +33250,7 @@ _loop0_153_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_153[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_154[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(star_targets '=')"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -33195,9 +33267,9 @@ _loop0_153_rule(Parser *p)
return _seq;
}
-// _loop0_154: (star_targets '=')
+// _loop0_155: (star_targets '=')
static asdl_seq *
-_loop0_154_rule(Parser *p)
+_loop0_155_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33223,13 +33295,13 @@ _loop0_154_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_154[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')"));
- void *_tmp_237_var;
+ D(fprintf(stderr, "%*c> _loop0_155[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')"));
+ void *_tmp_239_var;
while (
- (_tmp_237_var = _tmp_237_rule(p)) // star_targets '='
+ (_tmp_239_var = _tmp_239_rule(p)) // star_targets '='
)
{
- _res = _tmp_237_var;
+ _res = _tmp_239_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
@@ -33246,7 +33318,7 @@ _loop0_154_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_154[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_155[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(star_targets '=')"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -33263,9 +33335,9 @@ _loop0_154_rule(Parser *p)
return _seq;
}
-// _tmp_155: yield_expr | star_expressions
+// _tmp_156: yield_expr | star_expressions
static void *
-_tmp_155_rule(Parser *p)
+_tmp_156_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33282,18 +33354,18 @@ _tmp_155_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_155[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr"));
+ D(fprintf(stderr, "%*c> _tmp_156[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr"));
expr_ty yield_expr_var;
if (
(yield_expr_var = yield_expr_rule(p)) // yield_expr
)
{
- D(fprintf(stderr, "%*c+ _tmp_155[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr"));
+ D(fprintf(stderr, "%*c+ _tmp_156[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr"));
_res = yield_expr_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_155[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_156[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr"));
}
{ // star_expressions
@@ -33301,18 +33373,18 @@ _tmp_155_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_155[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions"));
+ D(fprintf(stderr, "%*c> _tmp_156[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions"));
expr_ty star_expressions_var;
if (
(star_expressions_var = star_expressions_rule(p)) // star_expressions
)
{
- D(fprintf(stderr, "%*c+ _tmp_155[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions"));
+ D(fprintf(stderr, "%*c+ _tmp_156[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions"));
_res = star_expressions_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_155[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_156[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions"));
}
_res = NULL;
@@ -33321,9 +33393,9 @@ _tmp_155_rule(Parser *p)
return _res;
}
-// _tmp_156: '[' | '(' | '{'
+// _tmp_157: '[' | '(' | '{'
static void *
-_tmp_156_rule(Parser *p)
+_tmp_157_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33340,18 +33412,18 @@ _tmp_156_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_156[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['"));
+ D(fprintf(stderr, "%*c> _tmp_157[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 9)) // token='['
)
{
- D(fprintf(stderr, "%*c+ _tmp_156[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['"));
+ D(fprintf(stderr, "%*c+ _tmp_157[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_156[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_157[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'['"));
}
{ // '('
@@ -33359,18 +33431,18 @@ _tmp_156_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_156[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'('"));
+ D(fprintf(stderr, "%*c> _tmp_157[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'('"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 7)) // token='('
)
{
- D(fprintf(stderr, "%*c+ _tmp_156[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'('"));
+ D(fprintf(stderr, "%*c+ _tmp_157[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'('"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_156[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_157[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'('"));
}
{ // '{'
@@ -33378,18 +33450,18 @@ _tmp_156_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_156[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'"));
+ D(fprintf(stderr, "%*c> _tmp_157[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 25)) // token='{'
)
{
- D(fprintf(stderr, "%*c+ _tmp_156[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'"));
+ D(fprintf(stderr, "%*c+ _tmp_157[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_156[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_157[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{'"));
}
_res = NULL;
@@ -33398,9 +33470,9 @@ _tmp_156_rule(Parser *p)
return _res;
}
-// _tmp_157: '[' | '{'
+// _tmp_158: '[' | '{'
static void *
-_tmp_157_rule(Parser *p)
+_tmp_158_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33417,18 +33489,18 @@ _tmp_157_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_157[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['"));
+ D(fprintf(stderr, "%*c> _tmp_158[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 9)) // token='['
)
{
- D(fprintf(stderr, "%*c+ _tmp_157[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['"));
+ D(fprintf(stderr, "%*c+ _tmp_158[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_157[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_158[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'['"));
}
{ // '{'
@@ -33436,18 +33508,18 @@ _tmp_157_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_157[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'"));
+ D(fprintf(stderr, "%*c> _tmp_158[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 25)) // token='{'
)
{
- D(fprintf(stderr, "%*c+ _tmp_157[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'"));
+ D(fprintf(stderr, "%*c+ _tmp_158[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_157[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_158[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{'"));
}
_res = NULL;
@@ -33456,9 +33528,9 @@ _tmp_157_rule(Parser *p)
return _res;
}
-// _tmp_158: '[' | '{'
+// _tmp_159: '[' | '{'
static void *
-_tmp_158_rule(Parser *p)
+_tmp_159_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33475,18 +33547,18 @@ _tmp_158_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_158[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['"));
+ D(fprintf(stderr, "%*c> _tmp_159[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 9)) // token='['
)
{
- D(fprintf(stderr, "%*c+ _tmp_158[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['"));
+ D(fprintf(stderr, "%*c+ _tmp_159[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_158[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_159[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'['"));
}
{ // '{'
@@ -33494,18 +33566,18 @@ _tmp_158_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_158[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'"));
+ D(fprintf(stderr, "%*c> _tmp_159[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 25)) // token='{'
)
{
- D(fprintf(stderr, "%*c+ _tmp_158[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'"));
+ D(fprintf(stderr, "%*c+ _tmp_159[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_158[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_159[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{'"));
}
_res = NULL;
@@ -33514,9 +33586,9 @@ _tmp_158_rule(Parser *p)
return _res;
}
-// _loop0_159: param_no_default
+// _loop0_160: param_no_default
static asdl_seq *
-_loop0_159_rule(Parser *p)
+_loop0_160_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33542,7 +33614,7 @@ _loop0_159_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_159[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
+ D(fprintf(stderr, "%*c> _loop0_160[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
arg_ty param_no_default_var;
while (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
@@ -33565,7 +33637,7 @@ _loop0_159_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_159[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_160[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -33582,9 +33654,9 @@ _loop0_159_rule(Parser *p)
return _seq;
}
-// _loop0_160: param_no_default
+// _loop0_161: param_no_default
static asdl_seq *
-_loop0_160_rule(Parser *p)
+_loop0_161_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33610,7 +33682,7 @@ _loop0_160_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_160[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
+ D(fprintf(stderr, "%*c> _loop0_161[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
arg_ty param_no_default_var;
while (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
@@ -33633,7 +33705,7 @@ _loop0_160_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_160[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_161[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -33650,9 +33722,9 @@ _loop0_160_rule(Parser *p)
return _seq;
}
-// _loop1_161: param_no_default
+// _loop1_162: param_no_default
static asdl_seq *
-_loop1_161_rule(Parser *p)
+_loop1_162_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33678,7 +33750,7 @@ _loop1_161_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop1_161[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
+ D(fprintf(stderr, "%*c> _loop1_162[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
arg_ty param_no_default_var;
while (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
@@ -33701,7 +33773,7 @@ _loop1_161_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop1_161[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop1_162[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
}
if (_n == 0 || p->error_indicator) {
@@ -33723,9 +33795,9 @@ _loop1_161_rule(Parser *p)
return _seq;
}
-// _tmp_162: slash_no_default | slash_with_default
+// _tmp_163: slash_no_default | slash_with_default
static void *
-_tmp_162_rule(Parser *p)
+_tmp_163_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33742,18 +33814,18 @@ _tmp_162_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_162[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_no_default"));
+ D(fprintf(stderr, "%*c> _tmp_163[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_no_default"));
asdl_arg_seq* slash_no_default_var;
if (
(slash_no_default_var = slash_no_default_rule(p)) // slash_no_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_162[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_no_default"));
+ D(fprintf(stderr, "%*c+ _tmp_163[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_no_default"));
_res = slash_no_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_162[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_163[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slash_no_default"));
}
{ // slash_with_default
@@ -33761,18 +33833,18 @@ _tmp_162_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_162[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_with_default"));
+ D(fprintf(stderr, "%*c> _tmp_163[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_with_default"));
SlashWithDefault* slash_with_default_var;
if (
(slash_with_default_var = slash_with_default_rule(p)) // slash_with_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_162[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_with_default"));
+ D(fprintf(stderr, "%*c+ _tmp_163[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_with_default"));
_res = slash_with_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_162[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_163[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slash_with_default"));
}
_res = NULL;
@@ -33781,9 +33853,9 @@ _tmp_162_rule(Parser *p)
return _res;
}
-// _loop0_163: param_maybe_default
+// _loop0_164: param_maybe_default
static asdl_seq *
-_loop0_163_rule(Parser *p)
+_loop0_164_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33809,7 +33881,7 @@ _loop0_163_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_163[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
+ D(fprintf(stderr, "%*c> _loop0_164[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
NameDefaultPair* param_maybe_default_var;
while (
(param_maybe_default_var = param_maybe_default_rule(p)) // param_maybe_default
@@ -33832,7 +33904,7 @@ _loop0_163_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_163[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_164[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_maybe_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -33849,9 +33921,9 @@ _loop0_163_rule(Parser *p)
return _seq;
}
-// _tmp_164: slash_no_default | slash_with_default
+// _tmp_165: slash_no_default | slash_with_default
static void *
-_tmp_164_rule(Parser *p)
+_tmp_165_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33868,18 +33940,18 @@ _tmp_164_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_164[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_no_default"));
+ D(fprintf(stderr, "%*c> _tmp_165[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_no_default"));
asdl_arg_seq* slash_no_default_var;
if (
(slash_no_default_var = slash_no_default_rule(p)) // slash_no_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_164[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_no_default"));
+ D(fprintf(stderr, "%*c+ _tmp_165[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_no_default"));
_res = slash_no_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_164[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_165[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slash_no_default"));
}
{ // slash_with_default
@@ -33887,18 +33959,18 @@ _tmp_164_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_164[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_with_default"));
+ D(fprintf(stderr, "%*c> _tmp_165[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slash_with_default"));
SlashWithDefault* slash_with_default_var;
if (
(slash_with_default_var = slash_with_default_rule(p)) // slash_with_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_164[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_with_default"));
+ D(fprintf(stderr, "%*c+ _tmp_165[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slash_with_default"));
_res = slash_with_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_164[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_165[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slash_with_default"));
}
_res = NULL;
@@ -33907,9 +33979,9 @@ _tmp_164_rule(Parser *p)
return _res;
}
-// _loop0_165: param_maybe_default
+// _loop0_166: param_maybe_default
static asdl_seq *
-_loop0_165_rule(Parser *p)
+_loop0_166_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33935,7 +34007,7 @@ _loop0_165_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_165[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
+ D(fprintf(stderr, "%*c> _loop0_166[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
NameDefaultPair* param_maybe_default_var;
while (
(param_maybe_default_var = param_maybe_default_rule(p)) // param_maybe_default
@@ -33958,7 +34030,7 @@ _loop0_165_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_165[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_166[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_maybe_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -33975,9 +34047,9 @@ _loop0_165_rule(Parser *p)
return _seq;
}
-// _tmp_166: ',' | param_no_default
+// _tmp_167: ',' | param_no_default
static void *
-_tmp_166_rule(Parser *p)
+_tmp_167_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -33994,18 +34066,18 @@ _tmp_166_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_166[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c> _tmp_167[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
)
{
- D(fprintf(stderr, "%*c+ _tmp_166[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c+ _tmp_167[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_166[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_167[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','"));
}
{ // param_no_default
@@ -34013,18 +34085,18 @@ _tmp_166_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_166[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
+ D(fprintf(stderr, "%*c> _tmp_167[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
arg_ty param_no_default_var;
if (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_166[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default"));
+ D(fprintf(stderr, "%*c+ _tmp_167[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default"));
_res = param_no_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_166[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_167[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
}
_res = NULL;
@@ -34033,9 +34105,9 @@ _tmp_166_rule(Parser *p)
return _res;
}
-// _loop0_167: param_maybe_default
+// _loop0_168: param_maybe_default
static asdl_seq *
-_loop0_167_rule(Parser *p)
+_loop0_168_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34061,7 +34133,7 @@ _loop0_167_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_167[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
+ D(fprintf(stderr, "%*c> _loop0_168[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
NameDefaultPair* param_maybe_default_var;
while (
(param_maybe_default_var = param_maybe_default_rule(p)) // param_maybe_default
@@ -34084,7 +34156,7 @@ _loop0_167_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_167[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_168[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_maybe_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -34101,9 +34173,9 @@ _loop0_167_rule(Parser *p)
return _seq;
}
-// _loop1_168: param_maybe_default
+// _loop1_169: param_maybe_default
static asdl_seq *
-_loop1_168_rule(Parser *p)
+_loop1_169_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34129,7 +34201,7 @@ _loop1_168_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop1_168[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
+ D(fprintf(stderr, "%*c> _loop1_169[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
NameDefaultPair* param_maybe_default_var;
while (
(param_maybe_default_var = param_maybe_default_rule(p)) // param_maybe_default
@@ -34152,7 +34224,7 @@ _loop1_168_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop1_168[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop1_169[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_maybe_default"));
}
if (_n == 0 || p->error_indicator) {
@@ -34174,9 +34246,9 @@ _loop1_168_rule(Parser *p)
return _seq;
}
-// _tmp_169: ')' | ','
+// _tmp_170: ')' | ','
static void *
-_tmp_169_rule(Parser *p)
+_tmp_170_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34193,18 +34265,18 @@ _tmp_169_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_169[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'"));
+ D(fprintf(stderr, "%*c> _tmp_170[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 8)) // token=')'
)
{
- D(fprintf(stderr, "%*c+ _tmp_169[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'"));
+ D(fprintf(stderr, "%*c+ _tmp_170[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_169[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_170[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'"));
}
{ // ','
@@ -34212,18 +34284,18 @@ _tmp_169_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_169[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c> _tmp_170[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
)
{
- D(fprintf(stderr, "%*c+ _tmp_169[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c+ _tmp_170[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_169[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_170[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','"));
}
_res = NULL;
@@ -34232,9 +34304,9 @@ _tmp_169_rule(Parser *p)
return _res;
}
-// _tmp_170: ')' | ',' (')' | '**')
+// _tmp_171: ')' | ',' (')' | '**')
static void *
-_tmp_170_rule(Parser *p)
+_tmp_171_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34251,18 +34323,18 @@ _tmp_170_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_170[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'"));
+ D(fprintf(stderr, "%*c> _tmp_171[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 8)) // token=')'
)
{
- D(fprintf(stderr, "%*c+ _tmp_170[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'"));
+ D(fprintf(stderr, "%*c+ _tmp_171[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_170[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_171[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'"));
}
{ // ',' (')' | '**')
@@ -34270,21 +34342,21 @@ _tmp_170_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_170[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')"));
+ D(fprintf(stderr, "%*c> _tmp_171[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')"));
Token * _literal;
- void *_tmp_238_var;
+ void *_tmp_240_var;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
- (_tmp_238_var = _tmp_238_rule(p)) // ')' | '**'
+ (_tmp_240_var = _tmp_240_rule(p)) // ')' | '**'
)
{
- D(fprintf(stderr, "%*c+ _tmp_170[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')"));
- _res = _PyPegen_dummy_name(p, _literal, _tmp_238_var);
+ D(fprintf(stderr, "%*c+ _tmp_171[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')"));
+ _res = _PyPegen_dummy_name(p, _literal, _tmp_240_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_170[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_171[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (')' | '**')"));
}
_res = NULL;
@@ -34293,9 +34365,9 @@ _tmp_170_rule(Parser *p)
return _res;
}
-// _tmp_171: param_no_default | ','
+// _tmp_172: param_no_default | ','
static void *
-_tmp_171_rule(Parser *p)
+_tmp_172_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34312,18 +34384,18 @@ _tmp_171_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_171[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
+ D(fprintf(stderr, "%*c> _tmp_172[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
arg_ty param_no_default_var;
if (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_171[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default"));
+ D(fprintf(stderr, "%*c+ _tmp_172[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default"));
_res = param_no_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_171[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_172[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
}
{ // ','
@@ -34331,18 +34403,18 @@ _tmp_171_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_171[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c> _tmp_172[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
)
{
- D(fprintf(stderr, "%*c+ _tmp_171[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c+ _tmp_172[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_171[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_172[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','"));
}
_res = NULL;
@@ -34351,9 +34423,9 @@ _tmp_171_rule(Parser *p)
return _res;
}
-// _loop0_172: param_maybe_default
+// _loop0_173: param_maybe_default
static asdl_seq *
-_loop0_172_rule(Parser *p)
+_loop0_173_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34379,7 +34451,7 @@ _loop0_172_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_172[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
+ D(fprintf(stderr, "%*c> _loop0_173[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_maybe_default"));
NameDefaultPair* param_maybe_default_var;
while (
(param_maybe_default_var = param_maybe_default_rule(p)) // param_maybe_default
@@ -34402,7 +34474,7 @@ _loop0_172_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_172[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_173[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_maybe_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -34419,9 +34491,9 @@ _loop0_172_rule(Parser *p)
return _seq;
}
-// _tmp_173: param_no_default | ','
+// _tmp_174: param_no_default | ','
static void *
-_tmp_173_rule(Parser *p)
+_tmp_174_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34438,18 +34510,18 @@ _tmp_173_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_173[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
+ D(fprintf(stderr, "%*c> _tmp_174[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default"));
arg_ty param_no_default_var;
if (
(param_no_default_var = param_no_default_rule(p)) // param_no_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_173[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default"));
+ D(fprintf(stderr, "%*c+ _tmp_174[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_no_default"));
_res = param_no_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_173[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_174[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default"));
}
{ // ','
@@ -34457,18 +34529,18 @@ _tmp_173_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_173[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c> _tmp_174[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
)
{
- D(fprintf(stderr, "%*c+ _tmp_173[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c+ _tmp_174[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_173[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_174[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','"));
}
_res = NULL;
@@ -34477,9 +34549,9 @@ _tmp_173_rule(Parser *p)
return _res;
}
-// _tmp_174: '*' | '**' | '/'
+// _tmp_175: '*' | '**' | '/'
static void *
-_tmp_174_rule(Parser *p)
+_tmp_175_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34496,18 +34568,18 @@ _tmp_174_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_174[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*'"));
+ D(fprintf(stderr, "%*c> _tmp_175[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
)
{
- D(fprintf(stderr, "%*c+ _tmp_174[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*'"));
+ D(fprintf(stderr, "%*c+ _tmp_175[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_174[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_175[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*'"));
}
{ // '**'
@@ -34515,18 +34587,18 @@ _tmp_174_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_174[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'"));
+ D(fprintf(stderr, "%*c> _tmp_175[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 35)) // token='**'
)
{
- D(fprintf(stderr, "%*c+ _tmp_174[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'"));
+ D(fprintf(stderr, "%*c+ _tmp_175[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_174[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_175[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**'"));
}
{ // '/'
@@ -34534,18 +34606,18 @@ _tmp_174_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_174[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'/'"));
+ D(fprintf(stderr, "%*c> _tmp_175[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'/'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 17)) // token='/'
)
{
- D(fprintf(stderr, "%*c+ _tmp_174[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'/'"));
+ D(fprintf(stderr, "%*c+ _tmp_175[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'/'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_174[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_175[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'/'"));
}
_res = NULL;
@@ -34554,9 +34626,9 @@ _tmp_174_rule(Parser *p)
return _res;
}
-// _loop1_175: param_with_default
+// _loop1_176: param_with_default
static asdl_seq *
-_loop1_175_rule(Parser *p)
+_loop1_176_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34582,7 +34654,7 @@ _loop1_175_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop1_175[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default"));
+ D(fprintf(stderr, "%*c> _loop1_176[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default"));
NameDefaultPair* param_with_default_var;
while (
(param_with_default_var = param_with_default_rule(p)) // param_with_default
@@ -34605,7 +34677,7 @@ _loop1_175_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop1_175[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop1_176[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default"));
}
if (_n == 0 || p->error_indicator) {
@@ -34627,9 +34699,9 @@ _loop1_175_rule(Parser *p)
return _seq;
}
-// _loop0_176: lambda_param_no_default
+// _loop0_177: lambda_param_no_default
static asdl_seq *
-_loop0_176_rule(Parser *p)
+_loop0_177_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34655,7 +34727,7 @@ _loop0_176_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_176[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
+ D(fprintf(stderr, "%*c> _loop0_177[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
arg_ty lambda_param_no_default_var;
while (
(lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default
@@ -34678,7 +34750,7 @@ _loop0_176_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_176[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_177[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -34695,9 +34767,9 @@ _loop0_176_rule(Parser *p)
return _seq;
}
-// _loop0_177: lambda_param_no_default
+// _loop0_178: lambda_param_no_default
static asdl_seq *
-_loop0_177_rule(Parser *p)
+_loop0_178_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34723,7 +34795,7 @@ _loop0_177_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_177[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
+ D(fprintf(stderr, "%*c> _loop0_178[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
arg_ty lambda_param_no_default_var;
while (
(lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default
@@ -34746,7 +34818,7 @@ _loop0_177_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_177[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_178[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -34763,9 +34835,9 @@ _loop0_177_rule(Parser *p)
return _seq;
}
-// _loop0_179: ',' lambda_param
+// _loop0_180: ',' lambda_param
static asdl_seq *
-_loop0_179_rule(Parser *p)
+_loop0_180_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34791,7 +34863,7 @@ _loop0_179_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_179[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' lambda_param"));
+ D(fprintf(stderr, "%*c> _loop0_180[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' lambda_param"));
Token * _literal;
arg_ty elem;
while (
@@ -34823,7 +34895,7 @@ _loop0_179_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_179[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_180[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' lambda_param"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -34840,9 +34912,9 @@ _loop0_179_rule(Parser *p)
return _seq;
}
-// _gather_178: lambda_param _loop0_179
+// _gather_179: lambda_param _loop0_180
static asdl_seq *
-_gather_178_rule(Parser *p)
+_gather_179_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34854,27 +34926,27 @@ _gather_178_rule(Parser *p)
}
asdl_seq * _res = NULL;
int _mark = p->mark;
- { // lambda_param _loop0_179
+ { // lambda_param _loop0_180
if (p->error_indicator) {
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _gather_178[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param _loop0_179"));
+ D(fprintf(stderr, "%*c> _gather_179[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param _loop0_180"));
arg_ty elem;
asdl_seq * seq;
if (
(elem = lambda_param_rule(p)) // lambda_param
&&
- (seq = _loop0_179_rule(p)) // _loop0_179
+ (seq = _loop0_180_rule(p)) // _loop0_180
)
{
- D(fprintf(stderr, "%*c+ _gather_178[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param _loop0_179"));
+ D(fprintf(stderr, "%*c+ _gather_179[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param _loop0_180"));
_res = _PyPegen_seq_insert_in_front(p, elem, seq);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _gather_178[%d-%d]: %s failed!\n", p->level, ' ',
- p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param _loop0_179"));
+ D(fprintf(stderr, "%*c%s _gather_179[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param _loop0_180"));
}
_res = NULL;
done:
@@ -34882,9 +34954,9 @@ _gather_178_rule(Parser *p)
return _res;
}
-// _tmp_180: lambda_slash_no_default | lambda_slash_with_default
+// _tmp_181: lambda_slash_no_default | lambda_slash_with_default
static void *
-_tmp_180_rule(Parser *p)
+_tmp_181_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34901,18 +34973,18 @@ _tmp_180_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_180[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default"));
+ D(fprintf(stderr, "%*c> _tmp_181[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default"));
asdl_arg_seq* lambda_slash_no_default_var;
if (
(lambda_slash_no_default_var = lambda_slash_no_default_rule(p)) // lambda_slash_no_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_180[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default"));
+ D(fprintf(stderr, "%*c+ _tmp_181[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default"));
_res = lambda_slash_no_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_180[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_181[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_slash_no_default"));
}
{ // lambda_slash_with_default
@@ -34920,18 +34992,18 @@ _tmp_180_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_180[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default"));
+ D(fprintf(stderr, "%*c> _tmp_181[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default"));
SlashWithDefault* lambda_slash_with_default_var;
if (
(lambda_slash_with_default_var = lambda_slash_with_default_rule(p)) // lambda_slash_with_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_180[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default"));
+ D(fprintf(stderr, "%*c+ _tmp_181[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default"));
_res = lambda_slash_with_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_180[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_181[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_slash_with_default"));
}
_res = NULL;
@@ -34940,9 +35012,9 @@ _tmp_180_rule(Parser *p)
return _res;
}
-// _loop0_181: lambda_param_maybe_default
+// _loop0_182: lambda_param_maybe_default
static asdl_seq *
-_loop0_181_rule(Parser *p)
+_loop0_182_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -34968,7 +35040,7 @@ _loop0_181_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_181[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
+ D(fprintf(stderr, "%*c> _loop0_182[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
NameDefaultPair* lambda_param_maybe_default_var;
while (
(lambda_param_maybe_default_var = lambda_param_maybe_default_rule(p)) // lambda_param_maybe_default
@@ -34991,7 +35063,7 @@ _loop0_181_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_181[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_182[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_maybe_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -35008,9 +35080,9 @@ _loop0_181_rule(Parser *p)
return _seq;
}
-// _tmp_182: lambda_slash_no_default | lambda_slash_with_default
+// _tmp_183: lambda_slash_no_default | lambda_slash_with_default
static void *
-_tmp_182_rule(Parser *p)
+_tmp_183_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35027,18 +35099,18 @@ _tmp_182_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_182[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default"));
+ D(fprintf(stderr, "%*c> _tmp_183[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default"));
asdl_arg_seq* lambda_slash_no_default_var;
if (
(lambda_slash_no_default_var = lambda_slash_no_default_rule(p)) // lambda_slash_no_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_182[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default"));
+ D(fprintf(stderr, "%*c+ _tmp_183[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_no_default"));
_res = lambda_slash_no_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_182[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_183[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_slash_no_default"));
}
{ // lambda_slash_with_default
@@ -35046,18 +35118,18 @@ _tmp_182_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_182[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default"));
+ D(fprintf(stderr, "%*c> _tmp_183[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default"));
SlashWithDefault* lambda_slash_with_default_var;
if (
(lambda_slash_with_default_var = lambda_slash_with_default_rule(p)) // lambda_slash_with_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_182[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default"));
+ D(fprintf(stderr, "%*c+ _tmp_183[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_slash_with_default"));
_res = lambda_slash_with_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_182[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_183[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_slash_with_default"));
}
_res = NULL;
@@ -35066,9 +35138,9 @@ _tmp_182_rule(Parser *p)
return _res;
}
-// _loop0_183: lambda_param_maybe_default
+// _loop0_184: lambda_param_maybe_default
static asdl_seq *
-_loop0_183_rule(Parser *p)
+_loop0_184_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35094,7 +35166,7 @@ _loop0_183_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_183[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
+ D(fprintf(stderr, "%*c> _loop0_184[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
NameDefaultPair* lambda_param_maybe_default_var;
while (
(lambda_param_maybe_default_var = lambda_param_maybe_default_rule(p)) // lambda_param_maybe_default
@@ -35117,7 +35189,7 @@ _loop0_183_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_183[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_184[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_maybe_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -35134,9 +35206,9 @@ _loop0_183_rule(Parser *p)
return _seq;
}
-// _tmp_184: ',' | lambda_param_no_default
+// _tmp_185: ',' | lambda_param_no_default
static void *
-_tmp_184_rule(Parser *p)
+_tmp_185_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35153,18 +35225,18 @@ _tmp_184_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_184[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c> _tmp_185[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
)
{
- D(fprintf(stderr, "%*c+ _tmp_184[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c+ _tmp_185[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_184[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_185[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','"));
}
{ // lambda_param_no_default
@@ -35172,18 +35244,18 @@ _tmp_184_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_184[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
+ D(fprintf(stderr, "%*c> _tmp_185[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
arg_ty lambda_param_no_default_var;
if (
(lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_184[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
+ D(fprintf(stderr, "%*c+ _tmp_185[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
_res = lambda_param_no_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_184[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_185[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
}
_res = NULL;
@@ -35192,9 +35264,9 @@ _tmp_184_rule(Parser *p)
return _res;
}
-// _loop0_185: lambda_param_maybe_default
+// _loop0_186: lambda_param_maybe_default
static asdl_seq *
-_loop0_185_rule(Parser *p)
+_loop0_186_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35220,7 +35292,7 @@ _loop0_185_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_185[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
+ D(fprintf(stderr, "%*c> _loop0_186[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
NameDefaultPair* lambda_param_maybe_default_var;
while (
(lambda_param_maybe_default_var = lambda_param_maybe_default_rule(p)) // lambda_param_maybe_default
@@ -35243,7 +35315,7 @@ _loop0_185_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_185[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_186[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_maybe_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -35260,9 +35332,9 @@ _loop0_185_rule(Parser *p)
return _seq;
}
-// _loop1_186: lambda_param_maybe_default
+// _loop1_187: lambda_param_maybe_default
static asdl_seq *
-_loop1_186_rule(Parser *p)
+_loop1_187_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35288,7 +35360,7 @@ _loop1_186_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop1_186[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
+ D(fprintf(stderr, "%*c> _loop1_187[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
NameDefaultPair* lambda_param_maybe_default_var;
while (
(lambda_param_maybe_default_var = lambda_param_maybe_default_rule(p)) // lambda_param_maybe_default
@@ -35311,7 +35383,7 @@ _loop1_186_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop1_186[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop1_187[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_maybe_default"));
}
if (_n == 0 || p->error_indicator) {
@@ -35333,9 +35405,9 @@ _loop1_186_rule(Parser *p)
return _seq;
}
-// _loop1_187: lambda_param_with_default
+// _loop1_188: lambda_param_with_default
static asdl_seq *
-_loop1_187_rule(Parser *p)
+_loop1_188_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35361,7 +35433,7 @@ _loop1_187_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop1_187[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default"));
+ D(fprintf(stderr, "%*c> _loop1_188[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default"));
NameDefaultPair* lambda_param_with_default_var;
while (
(lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default
@@ -35384,7 +35456,7 @@ _loop1_187_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop1_187[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop1_188[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default"));
}
if (_n == 0 || p->error_indicator) {
@@ -35406,9 +35478,9 @@ _loop1_187_rule(Parser *p)
return _seq;
}
-// _tmp_188: ':' | ',' (':' | '**')
+// _tmp_189: ':' | ',' (':' | '**')
static void *
-_tmp_188_rule(Parser *p)
+_tmp_189_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35425,18 +35497,18 @@ _tmp_188_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_188[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
+ D(fprintf(stderr, "%*c> _tmp_189[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
)
{
- D(fprintf(stderr, "%*c+ _tmp_188[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
+ D(fprintf(stderr, "%*c+ _tmp_189[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_188[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_189[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'"));
}
{ // ',' (':' | '**')
@@ -35444,21 +35516,21 @@ _tmp_188_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_188[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')"));
+ D(fprintf(stderr, "%*c> _tmp_189[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')"));
Token * _literal;
- void *_tmp_239_var;
+ void *_tmp_241_var;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
- (_tmp_239_var = _tmp_239_rule(p)) // ':' | '**'
+ (_tmp_241_var = _tmp_241_rule(p)) // ':' | '**'
)
{
- D(fprintf(stderr, "%*c+ _tmp_188[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')"));
- _res = _PyPegen_dummy_name(p, _literal, _tmp_239_var);
+ D(fprintf(stderr, "%*c+ _tmp_189[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')"));
+ _res = _PyPegen_dummy_name(p, _literal, _tmp_241_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_188[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_189[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (':' | '**')"));
}
_res = NULL;
@@ -35467,9 +35539,9 @@ _tmp_188_rule(Parser *p)
return _res;
}
-// _tmp_189: lambda_param_no_default | ','
+// _tmp_190: lambda_param_no_default | ','
static void *
-_tmp_189_rule(Parser *p)
+_tmp_190_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35486,18 +35558,18 @@ _tmp_189_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_189[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
+ D(fprintf(stderr, "%*c> _tmp_190[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
arg_ty lambda_param_no_default_var;
if (
(lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_189[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
+ D(fprintf(stderr, "%*c+ _tmp_190[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
_res = lambda_param_no_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_189[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_190[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
}
{ // ','
@@ -35505,18 +35577,18 @@ _tmp_189_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_189[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c> _tmp_190[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
)
{
- D(fprintf(stderr, "%*c+ _tmp_189[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c+ _tmp_190[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_189[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_190[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','"));
}
_res = NULL;
@@ -35525,9 +35597,9 @@ _tmp_189_rule(Parser *p)
return _res;
}
-// _loop0_190: lambda_param_maybe_default
+// _loop0_191: lambda_param_maybe_default
static asdl_seq *
-_loop0_190_rule(Parser *p)
+_loop0_191_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35553,7 +35625,7 @@ _loop0_190_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_190[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
+ D(fprintf(stderr, "%*c> _loop0_191[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_maybe_default"));
NameDefaultPair* lambda_param_maybe_default_var;
while (
(lambda_param_maybe_default_var = lambda_param_maybe_default_rule(p)) // lambda_param_maybe_default
@@ -35576,7 +35648,7 @@ _loop0_190_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_190[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_191[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_maybe_default"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -35593,9 +35665,9 @@ _loop0_190_rule(Parser *p)
return _seq;
}
-// _tmp_191: lambda_param_no_default | ','
+// _tmp_192: lambda_param_no_default | ','
static void *
-_tmp_191_rule(Parser *p)
+_tmp_192_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35612,18 +35684,18 @@ _tmp_191_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_191[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
+ D(fprintf(stderr, "%*c> _tmp_192[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
arg_ty lambda_param_no_default_var;
if (
(lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default
)
{
- D(fprintf(stderr, "%*c+ _tmp_191[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
+ D(fprintf(stderr, "%*c+ _tmp_192[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default"));
_res = lambda_param_no_default_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_191[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_192[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default"));
}
{ // ','
@@ -35631,18 +35703,18 @@ _tmp_191_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_191[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c> _tmp_192[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
)
{
- D(fprintf(stderr, "%*c+ _tmp_191[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c+ _tmp_192[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_191[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_192[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','"));
}
_res = NULL;
@@ -35651,9 +35723,9 @@ _tmp_191_rule(Parser *p)
return _res;
}
-// _tmp_192: '*' | '**' | '/'
+// _tmp_193: '*' | '**' | '/'
static void *
-_tmp_192_rule(Parser *p)
+_tmp_193_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35670,18 +35742,18 @@ _tmp_192_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_192[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*'"));
+ D(fprintf(stderr, "%*c> _tmp_193[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 16)) // token='*'
)
{
- D(fprintf(stderr, "%*c+ _tmp_192[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*'"));
+ D(fprintf(stderr, "%*c+ _tmp_193[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_192[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_193[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'*'"));
}
{ // '**'
@@ -35689,18 +35761,18 @@ _tmp_192_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_192[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'"));
+ D(fprintf(stderr, "%*c> _tmp_193[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 35)) // token='**'
)
{
- D(fprintf(stderr, "%*c+ _tmp_192[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'"));
+ D(fprintf(stderr, "%*c+ _tmp_193[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_192[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_193[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**'"));
}
{ // '/'
@@ -35708,18 +35780,18 @@ _tmp_192_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_192[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'/'"));
+ D(fprintf(stderr, "%*c> _tmp_193[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'/'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 17)) // token='/'
)
{
- D(fprintf(stderr, "%*c+ _tmp_192[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'/'"));
+ D(fprintf(stderr, "%*c+ _tmp_193[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'/'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_192[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_193[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'/'"));
}
_res = NULL;
@@ -35728,9 +35800,9 @@ _tmp_192_rule(Parser *p)
return _res;
}
-// _tmp_193: ',' | ')' | ':'
+// _tmp_194: ',' | ')' | ':'
static void *
-_tmp_193_rule(Parser *p)
+_tmp_194_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35747,18 +35819,18 @@ _tmp_193_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_193[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c> _tmp_194[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
)
{
- D(fprintf(stderr, "%*c+ _tmp_193[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c+ _tmp_194[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_193[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_194[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','"));
}
{ // ')'
@@ -35766,18 +35838,18 @@ _tmp_193_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_193[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'"));
+ D(fprintf(stderr, "%*c> _tmp_194[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 8)) // token=')'
)
{
- D(fprintf(stderr, "%*c+ _tmp_193[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'"));
+ D(fprintf(stderr, "%*c+ _tmp_194[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_193[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_194[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'"));
}
{ // ':'
@@ -35785,18 +35857,18 @@ _tmp_193_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_193[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
+ D(fprintf(stderr, "%*c> _tmp_194[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
)
{
- D(fprintf(stderr, "%*c+ _tmp_193[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
+ D(fprintf(stderr, "%*c+ _tmp_194[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_193[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_194[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'"));
}
_res = NULL;
@@ -35805,9 +35877,9 @@ _tmp_193_rule(Parser *p)
return _res;
}
-// _loop0_195: ',' (expression ['as' star_target])
+// _loop0_196: ',' (expression ['as' star_target])
static asdl_seq *
-_loop0_195_rule(Parser *p)
+_loop0_196_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35833,13 +35905,13 @@ _loop0_195_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_195[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expression ['as' star_target])"));
+ D(fprintf(stderr, "%*c> _loop0_196[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expression ['as' star_target])"));
Token * _literal;
void *elem;
while (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
- (elem = _tmp_240_rule(p)) // expression ['as' star_target]
+ (elem = _tmp_242_rule(p)) // expression ['as' star_target]
)
{
_res = elem;
@@ -35865,7 +35937,7 @@ _loop0_195_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_195[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_196[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (expression ['as' star_target])"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -35882,9 +35954,9 @@ _loop0_195_rule(Parser *p)
return _seq;
}
-// _gather_194: (expression ['as' star_target]) _loop0_195
+// _gather_195: (expression ['as' star_target]) _loop0_196
static asdl_seq *
-_gather_194_rule(Parser *p)
+_gather_195_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35896,27 +35968,27 @@ _gather_194_rule(Parser *p)
}
asdl_seq * _res = NULL;
int _mark = p->mark;
- { // (expression ['as' star_target]) _loop0_195
+ { // (expression ['as' star_target]) _loop0_196
if (p->error_indicator) {
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _gather_194[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_195"));
+ D(fprintf(stderr, "%*c> _gather_195[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_196"));
void *elem;
asdl_seq * seq;
if (
- (elem = _tmp_240_rule(p)) // expression ['as' star_target]
+ (elem = _tmp_242_rule(p)) // expression ['as' star_target]
&&
- (seq = _loop0_195_rule(p)) // _loop0_195
+ (seq = _loop0_196_rule(p)) // _loop0_196
)
{
- D(fprintf(stderr, "%*c+ _gather_194[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_195"));
+ D(fprintf(stderr, "%*c+ _gather_195[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_196"));
_res = _PyPegen_seq_insert_in_front(p, elem, seq);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _gather_194[%d-%d]: %s failed!\n", p->level, ' ',
- p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expression ['as' star_target]) _loop0_195"));
+ D(fprintf(stderr, "%*c%s _gather_195[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expression ['as' star_target]) _loop0_196"));
}
_res = NULL;
done:
@@ -35924,9 +35996,9 @@ _gather_194_rule(Parser *p)
return _res;
}
-// _loop0_197: ',' (expressions ['as' star_target])
+// _loop0_198: ',' (expressions ['as' star_target])
static asdl_seq *
-_loop0_197_rule(Parser *p)
+_loop0_198_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -35952,13 +36024,13 @@ _loop0_197_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_197[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expressions ['as' star_target])"));
+ D(fprintf(stderr, "%*c> _loop0_198[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expressions ['as' star_target])"));
Token * _literal;
void *elem;
while (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
- (elem = _tmp_241_rule(p)) // expressions ['as' star_target]
+ (elem = _tmp_243_rule(p)) // expressions ['as' star_target]
)
{
_res = elem;
@@ -35984,7 +36056,7 @@ _loop0_197_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_197[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_198[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (expressions ['as' star_target])"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -36001,9 +36073,9 @@ _loop0_197_rule(Parser *p)
return _seq;
}
-// _gather_196: (expressions ['as' star_target]) _loop0_197
+// _gather_197: (expressions ['as' star_target]) _loop0_198
static asdl_seq *
-_gather_196_rule(Parser *p)
+_gather_197_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36015,27 +36087,27 @@ _gather_196_rule(Parser *p)
}
asdl_seq * _res = NULL;
int _mark = p->mark;
- { // (expressions ['as' star_target]) _loop0_197
+ { // (expressions ['as' star_target]) _loop0_198
if (p->error_indicator) {
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _gather_196[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_197"));
+ D(fprintf(stderr, "%*c> _gather_197[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_198"));
void *elem;
asdl_seq * seq;
if (
- (elem = _tmp_241_rule(p)) // expressions ['as' star_target]
+ (elem = _tmp_243_rule(p)) // expressions ['as' star_target]
&&
- (seq = _loop0_197_rule(p)) // _loop0_197
+ (seq = _loop0_198_rule(p)) // _loop0_198
)
{
- D(fprintf(stderr, "%*c+ _gather_196[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_197"));
+ D(fprintf(stderr, "%*c+ _gather_197[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_198"));
_res = _PyPegen_seq_insert_in_front(p, elem, seq);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _gather_196[%d-%d]: %s failed!\n", p->level, ' ',
- p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expressions ['as' star_target]) _loop0_197"));
+ D(fprintf(stderr, "%*c%s _gather_197[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expressions ['as' star_target]) _loop0_198"));
}
_res = NULL;
done:
@@ -36043,9 +36115,9 @@ _gather_196_rule(Parser *p)
return _res;
}
-// _loop0_199: ',' (expression ['as' star_target])
+// _loop0_200: ',' (expression ['as' star_target])
static asdl_seq *
-_loop0_199_rule(Parser *p)
+_loop0_200_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36071,13 +36143,13 @@ _loop0_199_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_199[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expression ['as' star_target])"));
+ D(fprintf(stderr, "%*c> _loop0_200[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expression ['as' star_target])"));
Token * _literal;
void *elem;
while (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
- (elem = _tmp_242_rule(p)) // expression ['as' star_target]
+ (elem = _tmp_244_rule(p)) // expression ['as' star_target]
)
{
_res = elem;
@@ -36103,7 +36175,7 @@ _loop0_199_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_199[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_200[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (expression ['as' star_target])"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -36120,9 +36192,9 @@ _loop0_199_rule(Parser *p)
return _seq;
}
-// _gather_198: (expression ['as' star_target]) _loop0_199
+// _gather_199: (expression ['as' star_target]) _loop0_200
static asdl_seq *
-_gather_198_rule(Parser *p)
+_gather_199_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36134,27 +36206,27 @@ _gather_198_rule(Parser *p)
}
asdl_seq * _res = NULL;
int _mark = p->mark;
- { // (expression ['as' star_target]) _loop0_199
+ { // (expression ['as' star_target]) _loop0_200
if (p->error_indicator) {
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _gather_198[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_199"));
+ D(fprintf(stderr, "%*c> _gather_199[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_200"));
void *elem;
asdl_seq * seq;
if (
- (elem = _tmp_242_rule(p)) // expression ['as' star_target]
+ (elem = _tmp_244_rule(p)) // expression ['as' star_target]
&&
- (seq = _loop0_199_rule(p)) // _loop0_199
+ (seq = _loop0_200_rule(p)) // _loop0_200
)
{
- D(fprintf(stderr, "%*c+ _gather_198[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_199"));
+ D(fprintf(stderr, "%*c+ _gather_199[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_200"));
_res = _PyPegen_seq_insert_in_front(p, elem, seq);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _gather_198[%d-%d]: %s failed!\n", p->level, ' ',
- p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expression ['as' star_target]) _loop0_199"));
+ D(fprintf(stderr, "%*c%s _gather_199[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expression ['as' star_target]) _loop0_200"));
}
_res = NULL;
done:
@@ -36162,9 +36234,9 @@ _gather_198_rule(Parser *p)
return _res;
}
-// _loop0_201: ',' (expressions ['as' star_target])
+// _loop0_202: ',' (expressions ['as' star_target])
static asdl_seq *
-_loop0_201_rule(Parser *p)
+_loop0_202_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36190,13 +36262,13 @@ _loop0_201_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_201[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expressions ['as' star_target])"));
+ D(fprintf(stderr, "%*c> _loop0_202[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expressions ['as' star_target])"));
Token * _literal;
void *elem;
while (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
&&
- (elem = _tmp_243_rule(p)) // expressions ['as' star_target]
+ (elem = _tmp_245_rule(p)) // expressions ['as' star_target]
)
{
_res = elem;
@@ -36222,7 +36294,7 @@ _loop0_201_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_201[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_202[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (expressions ['as' star_target])"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -36239,9 +36311,9 @@ _loop0_201_rule(Parser *p)
return _seq;
}
-// _gather_200: (expressions ['as' star_target]) _loop0_201
+// _gather_201: (expressions ['as' star_target]) _loop0_202
static asdl_seq *
-_gather_200_rule(Parser *p)
+_gather_201_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36253,27 +36325,27 @@ _gather_200_rule(Parser *p)
}
asdl_seq * _res = NULL;
int _mark = p->mark;
- { // (expressions ['as' star_target]) _loop0_201
+ { // (expressions ['as' star_target]) _loop0_202
if (p->error_indicator) {
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _gather_200[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_201"));
+ D(fprintf(stderr, "%*c> _gather_201[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_202"));
void *elem;
asdl_seq * seq;
if (
- (elem = _tmp_243_rule(p)) // expressions ['as' star_target]
+ (elem = _tmp_245_rule(p)) // expressions ['as' star_target]
&&
- (seq = _loop0_201_rule(p)) // _loop0_201
+ (seq = _loop0_202_rule(p)) // _loop0_202
)
{
- D(fprintf(stderr, "%*c+ _gather_200[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_201"));
+ D(fprintf(stderr, "%*c+ _gather_201[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_202"));
_res = _PyPegen_seq_insert_in_front(p, elem, seq);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _gather_200[%d-%d]: %s failed!\n", p->level, ' ',
- p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expressions ['as' star_target]) _loop0_201"));
+ D(fprintf(stderr, "%*c%s _gather_201[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expressions ['as' star_target]) _loop0_202"));
}
_res = NULL;
done:
@@ -36281,9 +36353,9 @@ _gather_200_rule(Parser *p)
return _res;
}
-// _tmp_202: 'except' | 'finally'
+// _tmp_203: 'except' | 'finally'
static void *
-_tmp_202_rule(Parser *p)
+_tmp_203_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36300,18 +36372,18 @@ _tmp_202_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_202[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'except'"));
+ D(fprintf(stderr, "%*c> _tmp_203[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'except'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 634)) // token='except'
)
{
- D(fprintf(stderr, "%*c+ _tmp_202[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'except'"));
+ D(fprintf(stderr, "%*c+ _tmp_203[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'except'"));
_res = _keyword;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_202[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_203[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'except'"));
}
{ // 'finally'
@@ -36319,18 +36391,18 @@ _tmp_202_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_202[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'finally'"));
+ D(fprintf(stderr, "%*c> _tmp_203[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'finally'"));
Token * _keyword;
if (
(_keyword = _PyPegen_expect_token(p, 630)) // token='finally'
)
{
- D(fprintf(stderr, "%*c+ _tmp_202[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'finally'"));
+ D(fprintf(stderr, "%*c+ _tmp_203[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'finally'"));
_res = _keyword;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_202[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_203[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'finally'"));
}
_res = NULL;
@@ -36339,9 +36411,9 @@ _tmp_202_rule(Parser *p)
return _res;
}
-// _loop0_203: block
+// _loop0_204: block
static asdl_seq *
-_loop0_203_rule(Parser *p)
+_loop0_204_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36367,7 +36439,7 @@ _loop0_203_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_203[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "block"));
+ D(fprintf(stderr, "%*c> _loop0_204[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "block"));
asdl_stmt_seq* block_var;
while (
(block_var = block_rule(p)) // block
@@ -36390,7 +36462,7 @@ _loop0_203_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_203[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_204[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "block"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -36407,9 +36479,9 @@ _loop0_203_rule(Parser *p)
return _seq;
}
-// _loop1_204: except_block
+// _loop1_205: except_block
static asdl_seq *
-_loop1_204_rule(Parser *p)
+_loop1_205_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36435,7 +36507,7 @@ _loop1_204_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop1_204[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "except_block"));
+ D(fprintf(stderr, "%*c> _loop1_205[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "except_block"));
excepthandler_ty except_block_var;
while (
(except_block_var = except_block_rule(p)) // except_block
@@ -36458,7 +36530,7 @@ _loop1_204_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop1_204[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop1_205[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "except_block"));
}
if (_n == 0 || p->error_indicator) {
@@ -36480,9 +36552,9 @@ _loop1_204_rule(Parser *p)
return _seq;
}
-// _tmp_205: 'as' NAME
+// _tmp_206: 'as' NAME
static void *
-_tmp_205_rule(Parser *p)
+_tmp_206_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36499,7 +36571,7 @@ _tmp_205_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_205[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c> _tmp_206[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
Token * _keyword;
expr_ty name_var;
if (
@@ -36508,12 +36580,12 @@ _tmp_205_rule(Parser *p)
(name_var = _PyPegen_name_token(p)) // NAME
)
{
- D(fprintf(stderr, "%*c+ _tmp_205[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c+ _tmp_206[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
_res = _PyPegen_dummy_name(p, _keyword, name_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_205[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_206[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME"));
}
_res = NULL;
@@ -36522,9 +36594,9 @@ _tmp_205_rule(Parser *p)
return _res;
}
-// _loop0_206: block
+// _loop0_207: block
static asdl_seq *
-_loop0_206_rule(Parser *p)
+_loop0_207_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36550,7 +36622,7 @@ _loop0_206_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_206[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "block"));
+ D(fprintf(stderr, "%*c> _loop0_207[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "block"));
asdl_stmt_seq* block_var;
while (
(block_var = block_rule(p)) // block
@@ -36573,7 +36645,7 @@ _loop0_206_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_206[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_207[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "block"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -36590,9 +36662,9 @@ _loop0_206_rule(Parser *p)
return _seq;
}
-// _loop1_207: except_star_block
+// _loop1_208: except_star_block
static asdl_seq *
-_loop1_207_rule(Parser *p)
+_loop1_208_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36618,7 +36690,7 @@ _loop1_207_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop1_207[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "except_star_block"));
+ D(fprintf(stderr, "%*c> _loop1_208[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "except_star_block"));
excepthandler_ty except_star_block_var;
while (
(except_star_block_var = except_star_block_rule(p)) // except_star_block
@@ -36641,7 +36713,7 @@ _loop1_207_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop1_207[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop1_208[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "except_star_block"));
}
if (_n == 0 || p->error_indicator) {
@@ -36663,9 +36735,9 @@ _loop1_207_rule(Parser *p)
return _seq;
}
-// _tmp_208: expression ['as' NAME]
+// _tmp_209: expression ['as' NAME]
static void *
-_tmp_208_rule(Parser *p)
+_tmp_209_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36682,22 +36754,22 @@ _tmp_208_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_208[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ['as' NAME]"));
+ D(fprintf(stderr, "%*c> _tmp_209[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ['as' NAME]"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
expr_ty expression_var;
if (
(expression_var = expression_rule(p)) // expression
&&
- (_opt_var = _tmp_244_rule(p), !p->error_indicator) // ['as' NAME]
+ (_opt_var = _tmp_246_rule(p), !p->error_indicator) // ['as' NAME]
)
{
- D(fprintf(stderr, "%*c+ _tmp_208[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ['as' NAME]"));
+ D(fprintf(stderr, "%*c+ _tmp_209[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ['as' NAME]"));
_res = _PyPegen_dummy_name(p, expression_var, _opt_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_208[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_209[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ['as' NAME]"));
}
_res = NULL;
@@ -36706,9 +36778,9 @@ _tmp_208_rule(Parser *p)
return _res;
}
-// _tmp_209: 'as' NAME
+// _tmp_210: 'as' NAME
static void *
-_tmp_209_rule(Parser *p)
+_tmp_210_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36725,7 +36797,7 @@ _tmp_209_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_209[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c> _tmp_210[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
Token * _keyword;
expr_ty name_var;
if (
@@ -36734,12 +36806,12 @@ _tmp_209_rule(Parser *p)
(name_var = _PyPegen_name_token(p)) // NAME
)
{
- D(fprintf(stderr, "%*c+ _tmp_209[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c+ _tmp_210[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
_res = _PyPegen_dummy_name(p, _keyword, name_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_209[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_210[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME"));
}
_res = NULL;
@@ -36748,9 +36820,9 @@ _tmp_209_rule(Parser *p)
return _res;
}
-// _tmp_210: 'as' NAME
+// _tmp_211: 'as' NAME
static void *
-_tmp_210_rule(Parser *p)
+_tmp_211_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36767,7 +36839,7 @@ _tmp_210_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_210[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c> _tmp_211[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
Token * _keyword;
expr_ty name_var;
if (
@@ -36776,12 +36848,12 @@ _tmp_210_rule(Parser *p)
(name_var = _PyPegen_name_token(p)) // NAME
)
{
- D(fprintf(stderr, "%*c+ _tmp_210[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c+ _tmp_211[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
_res = _PyPegen_dummy_name(p, _keyword, name_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_210[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_211[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME"));
}
_res = NULL;
@@ -36790,9 +36862,9 @@ _tmp_210_rule(Parser *p)
return _res;
}
-// _tmp_211: NEWLINE | ':'
+// _tmp_212: NEWLINE | ':'
static void *
-_tmp_211_rule(Parser *p)
+_tmp_212_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36809,18 +36881,18 @@ _tmp_211_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_211[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
+ D(fprintf(stderr, "%*c> _tmp_212[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
Token * newline_var;
if (
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
)
{
- D(fprintf(stderr, "%*c+ _tmp_211[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
+ D(fprintf(stderr, "%*c+ _tmp_212[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NEWLINE"));
_res = newline_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_211[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_212[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NEWLINE"));
}
{ // ':'
@@ -36828,18 +36900,18 @@ _tmp_211_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_211[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
+ D(fprintf(stderr, "%*c> _tmp_212[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
)
{
- D(fprintf(stderr, "%*c+ _tmp_211[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
+ D(fprintf(stderr, "%*c+ _tmp_212[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_211[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_212[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'"));
}
_res = NULL;
@@ -36848,9 +36920,9 @@ _tmp_211_rule(Parser *p)
return _res;
}
-// _tmp_212: 'as' NAME
+// _tmp_213: 'as' NAME
static void *
-_tmp_212_rule(Parser *p)
+_tmp_213_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36867,7 +36939,7 @@ _tmp_212_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_212[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c> _tmp_213[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
Token * _keyword;
expr_ty name_var;
if (
@@ -36876,12 +36948,12 @@ _tmp_212_rule(Parser *p)
(name_var = _PyPegen_name_token(p)) // NAME
)
{
- D(fprintf(stderr, "%*c+ _tmp_212[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c+ _tmp_213[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
_res = _PyPegen_dummy_name(p, _keyword, name_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_212[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_213[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME"));
}
_res = NULL;
@@ -36890,9 +36962,9 @@ _tmp_212_rule(Parser *p)
return _res;
}
-// _tmp_213: 'as' NAME
+// _tmp_214: 'as' NAME
static void *
-_tmp_213_rule(Parser *p)
+_tmp_214_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36909,7 +36981,7 @@ _tmp_213_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_213[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c> _tmp_214[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
Token * _keyword;
expr_ty name_var;
if (
@@ -36918,12 +36990,12 @@ _tmp_213_rule(Parser *p)
(name_var = _PyPegen_name_token(p)) // NAME
)
{
- D(fprintf(stderr, "%*c+ _tmp_213[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c+ _tmp_214[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
_res = _PyPegen_dummy_name(p, _keyword, name_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_213[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_214[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME"));
}
_res = NULL;
@@ -36932,9 +37004,9 @@ _tmp_213_rule(Parser *p)
return _res;
}
-// _tmp_214: positional_patterns ','
+// _tmp_215: positional_patterns ','
static void *
-_tmp_214_rule(Parser *p)
+_tmp_215_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36951,7 +37023,7 @@ _tmp_214_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_214[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "positional_patterns ','"));
+ D(fprintf(stderr, "%*c> _tmp_215[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "positional_patterns ','"));
Token * _literal;
asdl_pattern_seq* positional_patterns_var;
if (
@@ -36960,12 +37032,12 @@ _tmp_214_rule(Parser *p)
(_literal = _PyPegen_expect_token(p, 12)) // token=','
)
{
- D(fprintf(stderr, "%*c+ _tmp_214[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "positional_patterns ','"));
+ D(fprintf(stderr, "%*c+ _tmp_215[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "positional_patterns ','"));
_res = _PyPegen_dummy_name(p, positional_patterns_var, _literal);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_214[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_215[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "positional_patterns ','"));
}
_res = NULL;
@@ -36974,9 +37046,9 @@ _tmp_214_rule(Parser *p)
return _res;
}
-// _tmp_215: '->' expression
+// _tmp_216: '->' expression
static void *
-_tmp_215_rule(Parser *p)
+_tmp_216_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -36993,7 +37065,7 @@ _tmp_215_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_215[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'->' expression"));
+ D(fprintf(stderr, "%*c> _tmp_216[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'->' expression"));
Token * _literal;
expr_ty expression_var;
if (
@@ -37002,12 +37074,12 @@ _tmp_215_rule(Parser *p)
(expression_var = expression_rule(p)) // expression
)
{
- D(fprintf(stderr, "%*c+ _tmp_215[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'->' expression"));
+ D(fprintf(stderr, "%*c+ _tmp_216[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'->' expression"));
_res = _PyPegen_dummy_name(p, _literal, expression_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_215[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_216[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'->' expression"));
}
_res = NULL;
@@ -37016,9 +37088,9 @@ _tmp_215_rule(Parser *p)
return _res;
}
-// _tmp_216: '(' arguments? ')'
+// _tmp_217: '(' arguments? ')'
static void *
-_tmp_216_rule(Parser *p)
+_tmp_217_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37035,7 +37107,7 @@ _tmp_216_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_216[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'"));
+ D(fprintf(stderr, "%*c> _tmp_217[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'"));
Token * _literal;
Token * _literal_1;
void *_opt_var;
@@ -37048,12 +37120,12 @@ _tmp_216_rule(Parser *p)
(_literal_1 = _PyPegen_expect_token(p, 8)) // token=')'
)
{
- D(fprintf(stderr, "%*c+ _tmp_216[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'"));
+ D(fprintf(stderr, "%*c+ _tmp_217[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'"));
_res = _PyPegen_dummy_name(p, _literal, _opt_var, _literal_1);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_216[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_217[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' arguments? ')'"));
}
_res = NULL;
@@ -37062,9 +37134,9 @@ _tmp_216_rule(Parser *p)
return _res;
}
-// _tmp_217: '(' arguments? ')'
+// _tmp_218: '(' arguments? ')'
static void *
-_tmp_217_rule(Parser *p)
+_tmp_218_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37081,7 +37153,7 @@ _tmp_217_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_217[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'"));
+ D(fprintf(stderr, "%*c> _tmp_218[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'"));
Token * _literal;
Token * _literal_1;
void *_opt_var;
@@ -37094,12 +37166,12 @@ _tmp_217_rule(Parser *p)
(_literal_1 = _PyPegen_expect_token(p, 8)) // token=')'
)
{
- D(fprintf(stderr, "%*c+ _tmp_217[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'"));
+ D(fprintf(stderr, "%*c+ _tmp_218[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' arguments? ')'"));
_res = _PyPegen_dummy_name(p, _literal, _opt_var, _literal_1);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_217[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_218[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' arguments? ')'"));
}
_res = NULL;
@@ -37108,9 +37180,9 @@ _tmp_217_rule(Parser *p)
return _res;
}
-// _loop0_219: ',' double_starred_kvpair
+// _loop0_220: ',' double_starred_kvpair
static asdl_seq *
-_loop0_219_rule(Parser *p)
+_loop0_220_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37136,7 +37208,7 @@ _loop0_219_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _loop0_219[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' double_starred_kvpair"));
+ D(fprintf(stderr, "%*c> _loop0_220[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' double_starred_kvpair"));
Token * _literal;
KeyValuePair* elem;
while (
@@ -37168,7 +37240,7 @@ _loop0_219_rule(Parser *p)
_mark = p->mark;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _loop0_219[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _loop0_220[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' double_starred_kvpair"));
}
asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
@@ -37185,9 +37257,9 @@ _loop0_219_rule(Parser *p)
return _seq;
}
-// _gather_218: double_starred_kvpair _loop0_219
+// _gather_219: double_starred_kvpair _loop0_220
static asdl_seq *
-_gather_218_rule(Parser *p)
+_gather_219_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37199,27 +37271,27 @@ _gather_218_rule(Parser *p)
}
asdl_seq * _res = NULL;
int _mark = p->mark;
- { // double_starred_kvpair _loop0_219
+ { // double_starred_kvpair _loop0_220
if (p->error_indicator) {
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _gather_218[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "double_starred_kvpair _loop0_219"));
+ D(fprintf(stderr, "%*c> _gather_219[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "double_starred_kvpair _loop0_220"));
KeyValuePair* elem;
asdl_seq * seq;
if (
(elem = double_starred_kvpair_rule(p)) // double_starred_kvpair
&&
- (seq = _loop0_219_rule(p)) // _loop0_219
+ (seq = _loop0_220_rule(p)) // _loop0_220
)
{
- D(fprintf(stderr, "%*c+ _gather_218[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "double_starred_kvpair _loop0_219"));
+ D(fprintf(stderr, "%*c+ _gather_219[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "double_starred_kvpair _loop0_220"));
_res = _PyPegen_seq_insert_in_front(p, elem, seq);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _gather_218[%d-%d]: %s failed!\n", p->level, ' ',
- p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "double_starred_kvpair _loop0_219"));
+ D(fprintf(stderr, "%*c%s _gather_219[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "double_starred_kvpair _loop0_220"));
}
_res = NULL;
done:
@@ -37227,9 +37299,9 @@ _gather_218_rule(Parser *p)
return _res;
}
-// _tmp_220: '}' | ','
+// _tmp_221: '}' | ','
static void *
-_tmp_220_rule(Parser *p)
+_tmp_221_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37246,18 +37318,18 @@ _tmp_220_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_220[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'}'"));
+ D(fprintf(stderr, "%*c> _tmp_221[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'}'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 26)) // token='}'
)
{
- D(fprintf(stderr, "%*c+ _tmp_220[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'}'"));
+ D(fprintf(stderr, "%*c+ _tmp_221[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'}'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_220[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_221[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'}'"));
}
{ // ','
@@ -37265,18 +37337,18 @@ _tmp_220_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_220[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c> _tmp_221[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
)
{
- D(fprintf(stderr, "%*c+ _tmp_220[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c+ _tmp_221[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_220[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_221[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','"));
}
_res = NULL;
@@ -37285,9 +37357,9 @@ _tmp_220_rule(Parser *p)
return _res;
}
-// _tmp_221: '}' | ','
+// _tmp_222: '}' | ','
static void *
-_tmp_221_rule(Parser *p)
+_tmp_222_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37304,18 +37376,18 @@ _tmp_221_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_221[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'}'"));
+ D(fprintf(stderr, "%*c> _tmp_222[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'}'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 26)) // token='}'
)
{
- D(fprintf(stderr, "%*c+ _tmp_221[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'}'"));
+ D(fprintf(stderr, "%*c+ _tmp_222[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'}'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_221[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_222[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'}'"));
}
{ // ','
@@ -37323,18 +37395,18 @@ _tmp_221_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_221[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c> _tmp_222[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 12)) // token=','
)
{
- D(fprintf(stderr, "%*c+ _tmp_221[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
+ D(fprintf(stderr, "%*c+ _tmp_222[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_221[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_222[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','"));
}
_res = NULL;
@@ -37343,9 +37415,9 @@ _tmp_221_rule(Parser *p)
return _res;
}
-// _tmp_222: star_targets '='
+// _tmp_223: star_targets '='
static void *
-_tmp_222_rule(Parser *p)
+_tmp_223_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37362,7 +37434,7 @@ _tmp_222_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_222[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
+ D(fprintf(stderr, "%*c> _tmp_223[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
Token * _literal;
expr_ty z;
if (
@@ -37371,7 +37443,7 @@ _tmp_222_rule(Parser *p)
(_literal = _PyPegen_expect_token(p, 22)) // token='='
)
{
- D(fprintf(stderr, "%*c+ _tmp_222[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
+ D(fprintf(stderr, "%*c+ _tmp_223[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
_res = z;
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
@@ -37381,7 +37453,7 @@ _tmp_222_rule(Parser *p)
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_222[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_223[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_targets '='"));
}
_res = NULL;
@@ -37390,9 +37462,9 @@ _tmp_222_rule(Parser *p)
return _res;
}
-// _tmp_223: '.' | '...'
+// _tmp_224: '.' | '...'
static void *
-_tmp_223_rule(Parser *p)
+_tmp_224_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37409,18 +37481,18 @@ _tmp_223_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_223[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'"));
+ D(fprintf(stderr, "%*c> _tmp_224[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 23)) // token='.'
)
{
- D(fprintf(stderr, "%*c+ _tmp_223[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'"));
+ D(fprintf(stderr, "%*c+ _tmp_224[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_223[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_224[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'.'"));
}
{ // '...'
@@ -37428,18 +37500,18 @@ _tmp_223_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_223[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'"));
+ D(fprintf(stderr, "%*c> _tmp_224[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 52)) // token='...'
)
{
- D(fprintf(stderr, "%*c+ _tmp_223[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'"));
+ D(fprintf(stderr, "%*c+ _tmp_224[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_223[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_224[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'...'"));
}
_res = NULL;
@@ -37448,9 +37520,9 @@ _tmp_223_rule(Parser *p)
return _res;
}
-// _tmp_224: '.' | '...'
+// _tmp_225: '.' | '...'
static void *
-_tmp_224_rule(Parser *p)
+_tmp_225_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37467,18 +37539,18 @@ _tmp_224_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_224[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'"));
+ D(fprintf(stderr, "%*c> _tmp_225[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 23)) // token='.'
)
{
- D(fprintf(stderr, "%*c+ _tmp_224[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'"));
+ D(fprintf(stderr, "%*c+ _tmp_225[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_224[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_225[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'.'"));
}
{ // '...'
@@ -37486,18 +37558,18 @@ _tmp_224_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_224[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'"));
+ D(fprintf(stderr, "%*c> _tmp_225[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 52)) // token='...'
)
{
- D(fprintf(stderr, "%*c+ _tmp_224[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'"));
+ D(fprintf(stderr, "%*c+ _tmp_225[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_224[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_225[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'...'"));
}
_res = NULL;
@@ -37506,9 +37578,9 @@ _tmp_224_rule(Parser *p)
return _res;
}
-// _tmp_225: '@' named_expression NEWLINE
+// _tmp_226: '@' named_expression NEWLINE
static void *
-_tmp_225_rule(Parser *p)
+_tmp_226_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37525,7 +37597,7 @@ _tmp_225_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_225[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE"));
+ D(fprintf(stderr, "%*c> _tmp_226[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE"));
Token * _literal;
expr_ty f;
Token * newline_var;
@@ -37537,7 +37609,7 @@ _tmp_225_rule(Parser *p)
(newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE'
)
{
- D(fprintf(stderr, "%*c+ _tmp_225[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE"));
+ D(fprintf(stderr, "%*c+ _tmp_226[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE"));
_res = f;
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
@@ -37547,7 +37619,7 @@ _tmp_225_rule(Parser *p)
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_225[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_226[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'@' named_expression NEWLINE"));
}
_res = NULL;
@@ -37556,9 +37628,9 @@ _tmp_225_rule(Parser *p)
return _res;
}
-// _tmp_226: ',' expression
+// _tmp_227: ',' expression
static void *
-_tmp_226_rule(Parser *p)
+_tmp_227_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37575,7 +37647,7 @@ _tmp_226_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_226[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression"));
+ D(fprintf(stderr, "%*c> _tmp_227[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression"));
Token * _literal;
expr_ty c;
if (
@@ -37584,7 +37656,7 @@ _tmp_226_rule(Parser *p)
(c = expression_rule(p)) // expression
)
{
- D(fprintf(stderr, "%*c+ _tmp_226[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' expression"));
+ D(fprintf(stderr, "%*c+ _tmp_227[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' expression"));
_res = c;
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
@@ -37594,7 +37666,7 @@ _tmp_226_rule(Parser *p)
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_226[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_227[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression"));
}
_res = NULL;
@@ -37603,9 +37675,9 @@ _tmp_226_rule(Parser *p)
return _res;
}
-// _tmp_227: ',' star_expression
+// _tmp_228: ',' star_expression
static void *
-_tmp_227_rule(Parser *p)
+_tmp_228_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37622,7 +37694,7 @@ _tmp_227_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_227[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_expression"));
+ D(fprintf(stderr, "%*c> _tmp_228[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_expression"));
Token * _literal;
expr_ty c;
if (
@@ -37631,7 +37703,7 @@ _tmp_227_rule(Parser *p)
(c = star_expression_rule(p)) // star_expression
)
{
- D(fprintf(stderr, "%*c+ _tmp_227[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_expression"));
+ D(fprintf(stderr, "%*c+ _tmp_228[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_expression"));
_res = c;
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
@@ -37641,7 +37713,7 @@ _tmp_227_rule(Parser *p)
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_227[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_228[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_expression"));
}
_res = NULL;
@@ -37650,9 +37722,9 @@ _tmp_227_rule(Parser *p)
return _res;
}
-// _tmp_228: 'or' conjunction
+// _tmp_229: 'or' conjunction
static void *
-_tmp_228_rule(Parser *p)
+_tmp_229_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37669,7 +37741,7 @@ _tmp_228_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_228[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'or' conjunction"));
+ D(fprintf(stderr, "%*c> _tmp_229[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'or' conjunction"));
Token * _keyword;
expr_ty c;
if (
@@ -37678,7 +37750,7 @@ _tmp_228_rule(Parser *p)
(c = conjunction_rule(p)) // conjunction
)
{
- D(fprintf(stderr, "%*c+ _tmp_228[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'or' conjunction"));
+ D(fprintf(stderr, "%*c+ _tmp_229[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'or' conjunction"));
_res = c;
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
@@ -37688,7 +37760,7 @@ _tmp_228_rule(Parser *p)
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_228[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_229[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'or' conjunction"));
}
_res = NULL;
@@ -37697,9 +37769,9 @@ _tmp_228_rule(Parser *p)
return _res;
}
-// _tmp_229: 'and' inversion
+// _tmp_230: 'and' inversion
static void *
-_tmp_229_rule(Parser *p)
+_tmp_230_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37716,7 +37788,7 @@ _tmp_229_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_229[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'and' inversion"));
+ D(fprintf(stderr, "%*c> _tmp_230[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'and' inversion"));
Token * _keyword;
expr_ty c;
if (
@@ -37725,7 +37797,7 @@ _tmp_229_rule(Parser *p)
(c = inversion_rule(p)) // inversion
)
{
- D(fprintf(stderr, "%*c+ _tmp_229[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'and' inversion"));
+ D(fprintf(stderr, "%*c+ _tmp_230[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'and' inversion"));
_res = c;
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
@@ -37735,7 +37807,7 @@ _tmp_229_rule(Parser *p)
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_229[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_230[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'and' inversion"));
}
_res = NULL;
@@ -37744,9 +37816,9 @@ _tmp_229_rule(Parser *p)
return _res;
}
-// _tmp_230: slice | starred_expression
+// _tmp_231: slice | starred_expression
static void *
-_tmp_230_rule(Parser *p)
+_tmp_231_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37763,18 +37835,18 @@ _tmp_230_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_230[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slice"));
+ D(fprintf(stderr, "%*c> _tmp_231[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "slice"));
expr_ty slice_var;
if (
(slice_var = slice_rule(p)) // slice
)
{
- D(fprintf(stderr, "%*c+ _tmp_230[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slice"));
+ D(fprintf(stderr, "%*c+ _tmp_231[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "slice"));
_res = slice_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_230[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_231[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "slice"));
}
{ // starred_expression
@@ -37782,18 +37854,18 @@ _tmp_230_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_230[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "starred_expression"));
+ D(fprintf(stderr, "%*c> _tmp_231[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "starred_expression"));
expr_ty starred_expression_var;
if (
(starred_expression_var = starred_expression_rule(p)) // starred_expression
)
{
- D(fprintf(stderr, "%*c+ _tmp_230[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "starred_expression"));
+ D(fprintf(stderr, "%*c+ _tmp_231[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "starred_expression"));
_res = starred_expression_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_230[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_231[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "starred_expression"));
}
_res = NULL;
@@ -37802,9 +37874,9 @@ _tmp_230_rule(Parser *p)
return _res;
}
-// _tmp_231: 'if' disjunction
+// _tmp_232: 'if' disjunction
static void *
-_tmp_231_rule(Parser *p)
+_tmp_232_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37821,7 +37893,7 @@ _tmp_231_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_231[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
+ D(fprintf(stderr, "%*c> _tmp_232[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
Token * _keyword;
expr_ty z;
if (
@@ -37830,7 +37902,7 @@ _tmp_231_rule(Parser *p)
(z = disjunction_rule(p)) // disjunction
)
{
- D(fprintf(stderr, "%*c+ _tmp_231[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
+ D(fprintf(stderr, "%*c+ _tmp_232[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
_res = z;
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
@@ -37840,7 +37912,7 @@ _tmp_231_rule(Parser *p)
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_231[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_232[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' disjunction"));
}
_res = NULL;
@@ -37849,9 +37921,9 @@ _tmp_231_rule(Parser *p)
return _res;
}
-// _tmp_232: 'if' disjunction
+// _tmp_233: 'if' disjunction
static void *
-_tmp_232_rule(Parser *p)
+_tmp_233_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37868,7 +37940,7 @@ _tmp_232_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_232[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
+ D(fprintf(stderr, "%*c> _tmp_233[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
Token * _keyword;
expr_ty z;
if (
@@ -37877,7 +37949,7 @@ _tmp_232_rule(Parser *p)
(z = disjunction_rule(p)) // disjunction
)
{
- D(fprintf(stderr, "%*c+ _tmp_232[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
+ D(fprintf(stderr, "%*c+ _tmp_233[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction"));
_res = z;
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
@@ -37887,7 +37959,7 @@ _tmp_232_rule(Parser *p)
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_232[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_233[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' disjunction"));
}
_res = NULL;
@@ -37896,9 +37968,9 @@ _tmp_232_rule(Parser *p)
return _res;
}
-// _tmp_233: starred_expression | (assignment_expression | expression !':=') !'='
+// _tmp_234: starred_expression | (assignment_expression | expression !':=') !'='
static void *
-_tmp_233_rule(Parser *p)
+_tmp_234_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37915,18 +37987,18 @@ _tmp_233_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_233[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "starred_expression"));
+ D(fprintf(stderr, "%*c> _tmp_234[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "starred_expression"));
expr_ty starred_expression_var;
if (
(starred_expression_var = starred_expression_rule(p)) // starred_expression
)
{
- D(fprintf(stderr, "%*c+ _tmp_233[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "starred_expression"));
+ D(fprintf(stderr, "%*c+ _tmp_234[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "starred_expression"));
_res = starred_expression_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_233[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_234[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "starred_expression"));
}
{ // (assignment_expression | expression !':=') !'='
@@ -37934,20 +38006,20 @@ _tmp_233_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_233[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(assignment_expression | expression !':=') !'='"));
- void *_tmp_245_var;
+ D(fprintf(stderr, "%*c> _tmp_234[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(assignment_expression | expression !':=') !'='"));
+ void *_tmp_247_var;
if (
- (_tmp_245_var = _tmp_245_rule(p)) // assignment_expression | expression !':='
+ (_tmp_247_var = _tmp_247_rule(p)) // assignment_expression | expression !':='
&&
_PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 22) // token='='
)
{
- D(fprintf(stderr, "%*c+ _tmp_233[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(assignment_expression | expression !':=') !'='"));
- _res = _tmp_245_var;
+ D(fprintf(stderr, "%*c+ _tmp_234[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(assignment_expression | expression !':=') !'='"));
+ _res = _tmp_247_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_233[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_234[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(assignment_expression | expression !':=') !'='"));
}
_res = NULL;
@@ -37956,9 +38028,9 @@ _tmp_233_rule(Parser *p)
return _res;
}
-// _tmp_234: ',' star_target
+// _tmp_235: ',' star_target
static void *
-_tmp_234_rule(Parser *p)
+_tmp_235_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -37975,7 +38047,7 @@ _tmp_234_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_234[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target"));
+ D(fprintf(stderr, "%*c> _tmp_235[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target"));
Token * _literal;
expr_ty c;
if (
@@ -37984,7 +38056,7 @@ _tmp_234_rule(Parser *p)
(c = star_target_rule(p)) // star_target
)
{
- D(fprintf(stderr, "%*c+ _tmp_234[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_target"));
+ D(fprintf(stderr, "%*c+ _tmp_235[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_target"));
_res = c;
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
@@ -37994,7 +38066,7 @@ _tmp_234_rule(Parser *p)
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_234[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_235[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_target"));
}
_res = NULL;
@@ -38003,9 +38075,9 @@ _tmp_234_rule(Parser *p)
return _res;
}
-// _tmp_235: ',' star_target
+// _tmp_236: ',' star_target
static void *
-_tmp_235_rule(Parser *p)
+_tmp_236_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38022,7 +38094,7 @@ _tmp_235_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_235[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target"));
+ D(fprintf(stderr, "%*c> _tmp_236[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target"));
Token * _literal;
expr_ty c;
if (
@@ -38031,7 +38103,7 @@ _tmp_235_rule(Parser *p)
(c = star_target_rule(p)) // star_target
)
{
- D(fprintf(stderr, "%*c+ _tmp_235[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_target"));
+ D(fprintf(stderr, "%*c+ _tmp_236[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_target"));
_res = c;
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
@@ -38041,7 +38113,7 @@ _tmp_235_rule(Parser *p)
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_235[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_236[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_target"));
}
_res = NULL;
@@ -38050,9 +38122,55 @@ _tmp_235_rule(Parser *p)
return _res;
}
-// _tmp_236: star_targets '='
+// _tmp_237:
+// | ','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs
static void *
-_tmp_236_rule(Parser *p)
+_tmp_237_rule(Parser *p)
+{
+ if (p->level++ == MAXSTACK) {
+ p->error_indicator = 1;
+ PyErr_NoMemory();
+ }
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ void * _res = NULL;
+ int _mark = p->mark;
+ { // ','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> _tmp_237[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs"));
+ asdl_seq * _gather_248_var;
+ Token * _literal;
+ asdl_seq* kwargs_var;
+ if (
+ (_gather_248_var = _gather_248_rule(p)) // ','.(starred_expression | (assignment_expression | expression !':=') !'=')+
+ &&
+ (_literal = _PyPegen_expect_token(p, 12)) // token=','
+ &&
+ (kwargs_var = kwargs_rule(p)) // kwargs
+ )
+ {
+ D(fprintf(stderr, "%*c+ _tmp_237[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs"));
+ _res = _PyPegen_dummy_name(p, _gather_248_var, _literal, kwargs_var);
+ goto done;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s _tmp_237[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.(starred_expression | (assignment_expression | expression !':=') !'=')+ ',' kwargs"));
+ }
+ _res = NULL;
+ done:
+ p->level--;
+ return _res;
+}
+
+// _tmp_238: star_targets '='
+static void *
+_tmp_238_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38069,7 +38187,7 @@ _tmp_236_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_236[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
+ D(fprintf(stderr, "%*c> _tmp_238[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
Token * _literal;
expr_ty star_targets_var;
if (
@@ -38078,12 +38196,12 @@ _tmp_236_rule(Parser *p)
(_literal = _PyPegen_expect_token(p, 22)) // token='='
)
{
- D(fprintf(stderr, "%*c+ _tmp_236[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
+ D(fprintf(stderr, "%*c+ _tmp_238[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
_res = _PyPegen_dummy_name(p, star_targets_var, _literal);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_236[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_238[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_targets '='"));
}
_res = NULL;
@@ -38092,9 +38210,9 @@ _tmp_236_rule(Parser *p)
return _res;
}
-// _tmp_237: star_targets '='
+// _tmp_239: star_targets '='
static void *
-_tmp_237_rule(Parser *p)
+_tmp_239_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38111,7 +38229,7 @@ _tmp_237_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_237[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
+ D(fprintf(stderr, "%*c> _tmp_239[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
Token * _literal;
expr_ty star_targets_var;
if (
@@ -38120,12 +38238,12 @@ _tmp_237_rule(Parser *p)
(_literal = _PyPegen_expect_token(p, 22)) // token='='
)
{
- D(fprintf(stderr, "%*c+ _tmp_237[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
+ D(fprintf(stderr, "%*c+ _tmp_239[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='"));
_res = _PyPegen_dummy_name(p, star_targets_var, _literal);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_237[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_239[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_targets '='"));
}
_res = NULL;
@@ -38134,9 +38252,9 @@ _tmp_237_rule(Parser *p)
return _res;
}
-// _tmp_238: ')' | '**'
+// _tmp_240: ')' | '**'
static void *
-_tmp_238_rule(Parser *p)
+_tmp_240_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38153,18 +38271,18 @@ _tmp_238_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_238[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'"));
+ D(fprintf(stderr, "%*c> _tmp_240[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 8)) // token=')'
)
{
- D(fprintf(stderr, "%*c+ _tmp_238[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'"));
+ D(fprintf(stderr, "%*c+ _tmp_240[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_238[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_240[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'"));
}
{ // '**'
@@ -38172,18 +38290,18 @@ _tmp_238_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_238[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'"));
+ D(fprintf(stderr, "%*c> _tmp_240[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 35)) // token='**'
)
{
- D(fprintf(stderr, "%*c+ _tmp_238[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'"));
+ D(fprintf(stderr, "%*c+ _tmp_240[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_238[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_240[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**'"));
}
_res = NULL;
@@ -38192,9 +38310,9 @@ _tmp_238_rule(Parser *p)
return _res;
}
-// _tmp_239: ':' | '**'
+// _tmp_241: ':' | '**'
static void *
-_tmp_239_rule(Parser *p)
+_tmp_241_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38211,18 +38329,18 @@ _tmp_239_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_239[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
+ D(fprintf(stderr, "%*c> _tmp_241[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 11)) // token=':'
)
{
- D(fprintf(stderr, "%*c+ _tmp_239[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
+ D(fprintf(stderr, "%*c+ _tmp_241[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_239[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_241[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'"));
}
{ // '**'
@@ -38230,18 +38348,18 @@ _tmp_239_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_239[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'"));
+ D(fprintf(stderr, "%*c> _tmp_241[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'"));
Token * _literal;
if (
(_literal = _PyPegen_expect_token(p, 35)) // token='**'
)
{
- D(fprintf(stderr, "%*c+ _tmp_239[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'"));
+ D(fprintf(stderr, "%*c+ _tmp_241[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'"));
_res = _literal;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_239[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_241[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**'"));
}
_res = NULL;
@@ -38250,9 +38368,9 @@ _tmp_239_rule(Parser *p)
return _res;
}
-// _tmp_240: expression ['as' star_target]
+// _tmp_242: expression ['as' star_target]
static void *
-_tmp_240_rule(Parser *p)
+_tmp_242_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38269,22 +38387,22 @@ _tmp_240_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_240[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]"));
+ D(fprintf(stderr, "%*c> _tmp_242[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
expr_ty expression_var;
if (
(expression_var = expression_rule(p)) // expression
&&
- (_opt_var = _tmp_246_rule(p), !p->error_indicator) // ['as' star_target]
+ (_opt_var = _tmp_250_rule(p), !p->error_indicator) // ['as' star_target]
)
{
- D(fprintf(stderr, "%*c+ _tmp_240[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]"));
+ D(fprintf(stderr, "%*c+ _tmp_242[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]"));
_res = _PyPegen_dummy_name(p, expression_var, _opt_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_240[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_242[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ['as' star_target]"));
}
_res = NULL;
@@ -38293,9 +38411,9 @@ _tmp_240_rule(Parser *p)
return _res;
}
-// _tmp_241: expressions ['as' star_target]
+// _tmp_243: expressions ['as' star_target]
static void *
-_tmp_241_rule(Parser *p)
+_tmp_243_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38312,22 +38430,22 @@ _tmp_241_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_241[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]"));
+ D(fprintf(stderr, "%*c> _tmp_243[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
expr_ty expressions_var;
if (
(expressions_var = expressions_rule(p)) // expressions
&&
- (_opt_var = _tmp_247_rule(p), !p->error_indicator) // ['as' star_target]
+ (_opt_var = _tmp_251_rule(p), !p->error_indicator) // ['as' star_target]
)
{
- D(fprintf(stderr, "%*c+ _tmp_241[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]"));
+ D(fprintf(stderr, "%*c+ _tmp_243[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]"));
_res = _PyPegen_dummy_name(p, expressions_var, _opt_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_241[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_243[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expressions ['as' star_target]"));
}
_res = NULL;
@@ -38336,9 +38454,9 @@ _tmp_241_rule(Parser *p)
return _res;
}
-// _tmp_242: expression ['as' star_target]
+// _tmp_244: expression ['as' star_target]
static void *
-_tmp_242_rule(Parser *p)
+_tmp_244_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38355,22 +38473,22 @@ _tmp_242_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_242[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]"));
+ D(fprintf(stderr, "%*c> _tmp_244[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
expr_ty expression_var;
if (
(expression_var = expression_rule(p)) // expression
&&
- (_opt_var = _tmp_248_rule(p), !p->error_indicator) // ['as' star_target]
+ (_opt_var = _tmp_252_rule(p), !p->error_indicator) // ['as' star_target]
)
{
- D(fprintf(stderr, "%*c+ _tmp_242[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]"));
+ D(fprintf(stderr, "%*c+ _tmp_244[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]"));
_res = _PyPegen_dummy_name(p, expression_var, _opt_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_242[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_244[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ['as' star_target]"));
}
_res = NULL;
@@ -38379,9 +38497,9 @@ _tmp_242_rule(Parser *p)
return _res;
}
-// _tmp_243: expressions ['as' star_target]
+// _tmp_245: expressions ['as' star_target]
static void *
-_tmp_243_rule(Parser *p)
+_tmp_245_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38398,22 +38516,22 @@ _tmp_243_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_243[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]"));
+ D(fprintf(stderr, "%*c> _tmp_245[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]"));
void *_opt_var;
UNUSED(_opt_var); // Silence compiler warnings
expr_ty expressions_var;
if (
(expressions_var = expressions_rule(p)) // expressions
&&
- (_opt_var = _tmp_249_rule(p), !p->error_indicator) // ['as' star_target]
+ (_opt_var = _tmp_253_rule(p), !p->error_indicator) // ['as' star_target]
)
{
- D(fprintf(stderr, "%*c+ _tmp_243[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]"));
+ D(fprintf(stderr, "%*c+ _tmp_245[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]"));
_res = _PyPegen_dummy_name(p, expressions_var, _opt_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_243[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_245[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expressions ['as' star_target]"));
}
_res = NULL;
@@ -38422,9 +38540,9 @@ _tmp_243_rule(Parser *p)
return _res;
}
-// _tmp_244: 'as' NAME
+// _tmp_246: 'as' NAME
static void *
-_tmp_244_rule(Parser *p)
+_tmp_246_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38441,7 +38559,7 @@ _tmp_244_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_244[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c> _tmp_246[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
Token * _keyword;
expr_ty name_var;
if (
@@ -38450,12 +38568,12 @@ _tmp_244_rule(Parser *p)
(name_var = _PyPegen_name_token(p)) // NAME
)
{
- D(fprintf(stderr, "%*c+ _tmp_244[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
+ D(fprintf(stderr, "%*c+ _tmp_246[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME"));
_res = _PyPegen_dummy_name(p, _keyword, name_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_244[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_246[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME"));
}
_res = NULL;
@@ -38464,9 +38582,9 @@ _tmp_244_rule(Parser *p)
return _res;
}
-// _tmp_245: assignment_expression | expression !':='
+// _tmp_247: assignment_expression | expression !':='
static void *
-_tmp_245_rule(Parser *p)
+_tmp_247_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38483,18 +38601,18 @@ _tmp_245_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_245[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "assignment_expression"));
+ D(fprintf(stderr, "%*c> _tmp_247[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "assignment_expression"));
expr_ty assignment_expression_var;
if (
(assignment_expression_var = assignment_expression_rule(p)) // assignment_expression
)
{
- D(fprintf(stderr, "%*c+ _tmp_245[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "assignment_expression"));
+ D(fprintf(stderr, "%*c+ _tmp_247[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "assignment_expression"));
_res = assignment_expression_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_245[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_247[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "assignment_expression"));
}
{ // expression !':='
@@ -38502,7 +38620,7 @@ _tmp_245_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_245[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression !':='"));
+ D(fprintf(stderr, "%*c> _tmp_247[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression !':='"));
expr_ty expression_var;
if (
(expression_var = expression_rule(p)) // expression
@@ -38510,12 +38628,12 @@ _tmp_245_rule(Parser *p)
_PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 53) // token=':='
)
{
- D(fprintf(stderr, "%*c+ _tmp_245[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression !':='"));
+ D(fprintf(stderr, "%*c+ _tmp_247[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression !':='"));
_res = expression_var;
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_245[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_247[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression !':='"));
}
_res = NULL;
@@ -38524,9 +38642,129 @@ _tmp_245_rule(Parser *p)
return _res;
}
-// _tmp_246: 'as' star_target
+// _loop0_249: ',' (starred_expression | (assignment_expression | expression !':=') !'=')
+static asdl_seq *
+_loop0_249_rule(Parser *p)
+{
+ if (p->level++ == MAXSTACK) {
+ p->error_indicator = 1;
+ PyErr_NoMemory();
+ }
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ void *_res = NULL;
+ int _mark = p->mark;
+ void **_children = PyMem_Malloc(sizeof(void *));
+ if (!_children) {
+ p->error_indicator = 1;
+ PyErr_NoMemory();
+ p->level--;
+ return NULL;
+ }
+ Py_ssize_t _children_capacity = 1;
+ Py_ssize_t _n = 0;
+ { // ',' (starred_expression | (assignment_expression | expression !':=') !'=')
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> _loop0_249[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (starred_expression | (assignment_expression | expression !':=') !'=')"));
+ Token * _literal;
+ void *elem;
+ while (
+ (_literal = _PyPegen_expect_token(p, 12)) // token=','
+ &&
+ (elem = _tmp_254_rule(p)) // starred_expression | (assignment_expression | expression !':=') !'='
+ )
+ {
+ _res = elem;
+ if (_res == NULL && PyErr_Occurred()) {
+ p->error_indicator = 1;
+ PyMem_Free(_children);
+ p->level--;
+ return NULL;
+ }
+ if (_n == _children_capacity) {
+ _children_capacity *= 2;
+ void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
+ if (!_new_children) {
+ PyMem_Free(_children);
+ p->error_indicator = 1;
+ PyErr_NoMemory();
+ p->level--;
+ return NULL;
+ }
+ _children = _new_children;
+ }
+ _children[_n++] = _res;
+ _mark = p->mark;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s _loop0_249[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (starred_expression | (assignment_expression | expression !':=') !'=')"));
+ }
+ asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena);
+ if (!_seq) {
+ PyMem_Free(_children);
+ p->error_indicator = 1;
+ PyErr_NoMemory();
+ p->level--;
+ return NULL;
+ }
+ for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]);
+ PyMem_Free(_children);
+ p->level--;
+ return _seq;
+}
+
+// _gather_248:
+// | (starred_expression | (assignment_expression | expression !':=') !'=') _loop0_249
+static asdl_seq *
+_gather_248_rule(Parser *p)
+{
+ if (p->level++ == MAXSTACK) {
+ p->error_indicator = 1;
+ PyErr_NoMemory();
+ }
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ asdl_seq * _res = NULL;
+ int _mark = p->mark;
+ { // (starred_expression | (assignment_expression | expression !':=') !'=') _loop0_249
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> _gather_248[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(starred_expression | (assignment_expression | expression !':=') !'=') _loop0_249"));
+ void *elem;
+ asdl_seq * seq;
+ if (
+ (elem = _tmp_254_rule(p)) // starred_expression | (assignment_expression | expression !':=') !'='
+ &&
+ (seq = _loop0_249_rule(p)) // _loop0_249
+ )
+ {
+ D(fprintf(stderr, "%*c+ _gather_248[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(starred_expression | (assignment_expression | expression !':=') !'=') _loop0_249"));
+ _res = _PyPegen_seq_insert_in_front(p, elem, seq);
+ goto done;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s _gather_248[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(starred_expression | (assignment_expression | expression !':=') !'=') _loop0_249"));
+ }
+ _res = NULL;
+ done:
+ p->level--;
+ return _res;
+}
+
+// _tmp_250: 'as' star_target
static void *
-_tmp_246_rule(Parser *p)
+_tmp_250_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38543,7 +38781,7 @@ _tmp_246_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_246[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
+ D(fprintf(stderr, "%*c> _tmp_250[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
Token * _keyword;
expr_ty star_target_var;
if (
@@ -38552,12 +38790,12 @@ _tmp_246_rule(Parser *p)
(star_target_var = star_target_rule(p)) // star_target
)
{
- D(fprintf(stderr, "%*c+ _tmp_246[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
+ D(fprintf(stderr, "%*c+ _tmp_250[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
_res = _PyPegen_dummy_name(p, _keyword, star_target_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_246[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_250[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' star_target"));
}
_res = NULL;
@@ -38566,9 +38804,9 @@ _tmp_246_rule(Parser *p)
return _res;
}
-// _tmp_247: 'as' star_target
+// _tmp_251: 'as' star_target
static void *
-_tmp_247_rule(Parser *p)
+_tmp_251_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38585,7 +38823,7 @@ _tmp_247_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_247[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
+ D(fprintf(stderr, "%*c> _tmp_251[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
Token * _keyword;
expr_ty star_target_var;
if (
@@ -38594,12 +38832,12 @@ _tmp_247_rule(Parser *p)
(star_target_var = star_target_rule(p)) // star_target
)
{
- D(fprintf(stderr, "%*c+ _tmp_247[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
+ D(fprintf(stderr, "%*c+ _tmp_251[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
_res = _PyPegen_dummy_name(p, _keyword, star_target_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_247[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_251[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' star_target"));
}
_res = NULL;
@@ -38608,9 +38846,9 @@ _tmp_247_rule(Parser *p)
return _res;
}
-// _tmp_248: 'as' star_target
+// _tmp_252: 'as' star_target
static void *
-_tmp_248_rule(Parser *p)
+_tmp_252_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38627,7 +38865,7 @@ _tmp_248_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_248[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
+ D(fprintf(stderr, "%*c> _tmp_252[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
Token * _keyword;
expr_ty star_target_var;
if (
@@ -38636,12 +38874,12 @@ _tmp_248_rule(Parser *p)
(star_target_var = star_target_rule(p)) // star_target
)
{
- D(fprintf(stderr, "%*c+ _tmp_248[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
+ D(fprintf(stderr, "%*c+ _tmp_252[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
_res = _PyPegen_dummy_name(p, _keyword, star_target_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_248[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_252[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' star_target"));
}
_res = NULL;
@@ -38650,9 +38888,9 @@ _tmp_248_rule(Parser *p)
return _res;
}
-// _tmp_249: 'as' star_target
+// _tmp_253: 'as' star_target
static void *
-_tmp_249_rule(Parser *p)
+_tmp_253_rule(Parser *p)
{
if (p->level++ == MAXSTACK) {
p->error_indicator = 1;
@@ -38669,7 +38907,7 @@ _tmp_249_rule(Parser *p)
p->level--;
return NULL;
}
- D(fprintf(stderr, "%*c> _tmp_249[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
+ D(fprintf(stderr, "%*c> _tmp_253[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
Token * _keyword;
expr_ty star_target_var;
if (
@@ -38678,12 +38916,12 @@ _tmp_249_rule(Parser *p)
(star_target_var = star_target_rule(p)) // star_target
)
{
- D(fprintf(stderr, "%*c+ _tmp_249[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
+ D(fprintf(stderr, "%*c+ _tmp_253[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target"));
_res = _PyPegen_dummy_name(p, _keyword, star_target_var);
goto done;
}
p->mark = _mark;
- D(fprintf(stderr, "%*c%s _tmp_249[%d-%d]: %s failed!\n", p->level, ' ',
+ D(fprintf(stderr, "%*c%s _tmp_253[%d-%d]: %s failed!\n", p->level, ' ',
p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' star_target"));
}
_res = NULL;
@@ -38692,6 +38930,126 @@ _tmp_249_rule(Parser *p)
return _res;
}
+// _tmp_254: starred_expression | (assignment_expression | expression !':=') !'='
+static void *
+_tmp_254_rule(Parser *p)
+{
+ if (p->level++ == MAXSTACK) {
+ p->error_indicator = 1;
+ PyErr_NoMemory();
+ }
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ void * _res = NULL;
+ int _mark = p->mark;
+ { // starred_expression
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> _tmp_254[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "starred_expression"));
+ expr_ty starred_expression_var;
+ if (
+ (starred_expression_var = starred_expression_rule(p)) // starred_expression
+ )
+ {
+ D(fprintf(stderr, "%*c+ _tmp_254[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "starred_expression"));
+ _res = starred_expression_var;
+ goto done;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s _tmp_254[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "starred_expression"));
+ }
+ { // (assignment_expression | expression !':=') !'='
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> _tmp_254[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(assignment_expression | expression !':=') !'='"));
+ void *_tmp_255_var;
+ if (
+ (_tmp_255_var = _tmp_255_rule(p)) // assignment_expression | expression !':='
+ &&
+ _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 22) // token='='
+ )
+ {
+ D(fprintf(stderr, "%*c+ _tmp_254[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(assignment_expression | expression !':=') !'='"));
+ _res = _tmp_255_var;
+ goto done;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s _tmp_254[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(assignment_expression | expression !':=') !'='"));
+ }
+ _res = NULL;
+ done:
+ p->level--;
+ return _res;
+}
+
+// _tmp_255: assignment_expression | expression !':='
+static void *
+_tmp_255_rule(Parser *p)
+{
+ if (p->level++ == MAXSTACK) {
+ p->error_indicator = 1;
+ PyErr_NoMemory();
+ }
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ void * _res = NULL;
+ int _mark = p->mark;
+ { // assignment_expression
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> _tmp_255[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "assignment_expression"));
+ expr_ty assignment_expression_var;
+ if (
+ (assignment_expression_var = assignment_expression_rule(p)) // assignment_expression
+ )
+ {
+ D(fprintf(stderr, "%*c+ _tmp_255[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "assignment_expression"));
+ _res = assignment_expression_var;
+ goto done;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s _tmp_255[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "assignment_expression"));
+ }
+ { // expression !':='
+ if (p->error_indicator) {
+ p->level--;
+ return NULL;
+ }
+ D(fprintf(stderr, "%*c> _tmp_255[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression !':='"));
+ expr_ty expression_var;
+ if (
+ (expression_var = expression_rule(p)) // expression
+ &&
+ _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 53) // token=':='
+ )
+ {
+ D(fprintf(stderr, "%*c+ _tmp_255[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression !':='"));
+ _res = expression_var;
+ goto done;
+ }
+ p->mark = _mark;
+ D(fprintf(stderr, "%*c%s _tmp_255[%d-%d]: %s failed!\n", p->level, ' ',
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression !':='"));
+ }
+ _res = NULL;
+ done:
+ p->level--;
+ return _res;
+}
+
void *
_PyPegen_parse(Parser *p)
{
diff --git a/contrib/tools/python3/src/Parser/pegen.c b/contrib/tools/python3/src/Parser/pegen.c
index 87b47bacec..3b85b095be 100644
--- a/contrib/tools/python3/src/Parser/pegen.c
+++ b/contrib/tools/python3/src/Parser/pegen.c
@@ -38,6 +38,61 @@ _PyPegen_byte_offset_to_character_offset(PyObject *line, Py_ssize_t col_offset)
return size;
}
+// Calculate the extra amount of width space the given source
+// code segment might take if it were to be displayed on a fixed
+// width output device. Supports wide unicode characters and emojis.
+Py_ssize_t
+_PyPegen_calculate_display_width(PyObject *line, Py_ssize_t character_offset)
+{
+ PyObject *segment = PyUnicode_Substring(line, 0, character_offset);
+ if (!segment) {
+ return -1;
+ }
+
+ // Fast track for ascii strings
+ if (PyUnicode_IS_ASCII(segment)) {
+ Py_DECREF(segment);
+ return character_offset;
+ }
+
+ PyObject *width_fn = _PyImport_GetModuleAttrString("unicodedata", "east_asian_width");
+ if (!width_fn) {
+ return -1;
+ }
+
+ Py_ssize_t width = 0;
+ Py_ssize_t len = PyUnicode_GET_LENGTH(segment);
+ for (Py_ssize_t i = 0; i < len; i++) {
+ PyObject *chr = PyUnicode_Substring(segment, i, i + 1);
+ if (!chr) {
+ Py_DECREF(segment);
+ Py_DECREF(width_fn);
+ return -1;
+ }
+
+ PyObject *width_specifier = PyObject_CallOneArg(width_fn, chr);
+ Py_DECREF(chr);
+ if (!width_specifier) {
+ Py_DECREF(segment);
+ Py_DECREF(width_fn);
+ return -1;
+ }
+
+ if (_PyUnicode_EqualToASCIIString(width_specifier, "W") ||
+ _PyUnicode_EqualToASCIIString(width_specifier, "F")) {
+ width += 2;
+ }
+ else {
+ width += 1;
+ }
+ Py_DECREF(width_specifier);
+ }
+
+ Py_DECREF(segment);
+ Py_DECREF(width_fn);
+ return width;
+}
+
// Here, mark is the start of the node, while p->mark is the end.
// If node==NULL, they should be the same.
int
diff --git a/contrib/tools/python3/src/Parser/pegen.h b/contrib/tools/python3/src/Parser/pegen.h
index fe0c327b87..2c4b2c3dfc 100644
--- a/contrib/tools/python3/src/Parser/pegen.h
+++ b/contrib/tools/python3/src/Parser/pegen.h
@@ -143,6 +143,7 @@ expr_ty _PyPegen_name_token(Parser *p);
expr_ty _PyPegen_number_token(Parser *p);
void *_PyPegen_string_token(Parser *p);
Py_ssize_t _PyPegen_byte_offset_to_character_offset(PyObject *line, Py_ssize_t col_offset);
+Py_ssize_t _PyPegen_calculate_display_width(PyObject *segment, Py_ssize_t character_offset);
// Error handling functions and APIs
typedef enum {
diff --git a/contrib/tools/python3/src/Parser/pegen_errors.c b/contrib/tools/python3/src/Parser/pegen_errors.c
index 3d8cccb0a9..fb9fa29097 100644
--- a/contrib/tools/python3/src/Parser/pegen_errors.c
+++ b/contrib/tools/python3/src/Parser/pegen_errors.c
@@ -101,6 +101,10 @@ _Pypegen_tokenizer_error(Parser *p)
msg = "unexpected character after line continuation character";
break;
}
+ case E_COLUMNOVERFLOW:
+ PyErr_SetString(PyExc_OverflowError,
+ "Parser column offset overflow - source line is too big");
+ return -1;
default:
msg = "unknown parsing error";
}
@@ -208,6 +212,10 @@ exit:
void *
_PyPegen_raise_error(Parser *p, PyObject *errtype, const char *errmsg, ...)
{
+ // Bail out if we already have an error set.
+ if (p->error_indicator && PyErr_Occurred()) {
+ return NULL;
+ }
if (p->fill == 0) {
va_list va;
va_start(va, errmsg);
@@ -262,6 +270,10 @@ get_error_line_from_tokenizer_buffers(Parser *p, Py_ssize_t lineno)
Py_ssize_t relative_lineno = p->starting_lineno ? lineno - p->starting_lineno + 1 : lineno;
const char* buf_end = p->tok->fp_interactive ? p->tok->interactive_src_end : p->tok->inp;
+ if (buf_end < cur_line) {
+ buf_end = cur_line + strlen(cur_line);
+ }
+
for (int i = 0; i < relative_lineno - 1; i++) {
char *new_line = strchr(cur_line, '\n');
// The assert is here for debug builds but the conditional that
diff --git a/contrib/tools/python3/src/Parser/string_parser.c b/contrib/tools/python3/src/Parser/string_parser.c
index fb2b9808af..7079b82d04 100644
--- a/contrib/tools/python3/src/Parser/string_parser.c
+++ b/contrib/tools/python3/src/Parser/string_parser.c
@@ -11,6 +11,11 @@
static int
warn_invalid_escape_sequence(Parser *p, const char *first_invalid_escape, Token *t)
{
+ if (p->call_invalid_rules) {
+ // Do not report warnings if we are in the second pass of the parser
+ // to avoid showing the warning twice.
+ return 0;
+ }
unsigned char c = *first_invalid_escape;
int octal = ('4' <= c && c <= '7');
PyObject *msg =
diff --git a/contrib/tools/python3/src/Parser/tokenizer.c b/contrib/tools/python3/src/Parser/tokenizer.c
index 7fc8a58562..566ad8dfa0 100644
--- a/contrib/tools/python3/src/Parser/tokenizer.c
+++ b/contrib/tools/python3/src/Parser/tokenizer.c
@@ -1057,6 +1057,10 @@ tok_nextc(struct tok_state *tok)
int rc;
for (;;) {
if (tok->cur != tok->inp) {
+ if (tok->cur - tok->buf >= INT_MAX) {
+ tok->done = E_COLUMNOVERFLOW;
+ return EOF;
+ }
return Py_CHARMASK(*tok->cur++); /* Fast path */
}
if (tok->done != E_OK) {
diff --git a/contrib/tools/python3/src/Python/ceval.c b/contrib/tools/python3/src/Python/ceval.c
index df11de084d..bb6bb35030 100644
--- a/contrib/tools/python3/src/Python/ceval.c
+++ b/contrib/tools/python3/src/Python/ceval.c
@@ -1060,7 +1060,9 @@ match_class(PyThreadState *tstate, PyObject *subject, PyObject *type,
}
if (match_self) {
// Easy. Copy the subject itself, and move on to kwargs.
- PyList_Append(attrs, subject);
+ if (PyList_Append(attrs, subject) < 0) {
+ goto fail;
+ }
}
else {
for (Py_ssize_t i = 0; i < nargs; i++) {
@@ -1076,7 +1078,10 @@ match_class(PyThreadState *tstate, PyObject *subject, PyObject *type,
if (attr == NULL) {
goto fail;
}
- PyList_Append(attrs, attr);
+ if (PyList_Append(attrs, attr) < 0) {
+ Py_DECREF(attr);
+ goto fail;
+ }
Py_DECREF(attr);
}
}
@@ -1089,7 +1094,10 @@ match_class(PyThreadState *tstate, PyObject *subject, PyObject *type,
if (attr == NULL) {
goto fail;
}
- PyList_Append(attrs, attr);
+ if (PyList_Append(attrs, attr) < 0) {
+ Py_DECREF(attr);
+ goto fail;
+ }
Py_DECREF(attr);
}
Py_SETREF(attrs, PyList_AsTuple(attrs));
@@ -3310,13 +3318,14 @@ handle_eval_breaker:
&PEEK(2*oparg), 2,
&PEEK(2*oparg - 1), 2,
oparg);
- if (map == NULL)
- goto error;
while (oparg--) {
Py_DECREF(POP());
Py_DECREF(POP());
}
+ if (map == NULL) {
+ goto error;
+ }
PUSH(map);
DISPATCH();
}
diff --git a/contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c b/contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c
index 10274f6b5b..d704c00486 100644
--- a/contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c
+++ b/contrib/tools/python3/src/Python/deepfreeze/deepfreeze.c
@@ -72164,46 +72164,6 @@ const_str_SEEK_END = {
};
static
struct {
- PyGC_Head _gc_head;
- struct {
- PyObject_VAR_HEAD
- PyObject *ob_item[19];
- }_object;
- }
-io_toplevel_consts_2 = {
- ._object = {
- .ob_base = {
- .ob_base = {
- .ob_refcnt = 999999999,
- .ob_type = &PyTuple_Type,
- },
- .ob_size = 19,
- },
- .ob_item = {
- & const_str_BlockingIOError._ascii.ob_base,
- &_Py_ID(open),
- & const_str_open_code._ascii.ob_base,
- & const_str_IOBase._ascii.ob_base,
- & const_str_RawIOBase._ascii.ob_base,
- & const_str_FileIO._ascii.ob_base,
- & const_str_BytesIO._ascii.ob_base,
- & const_str_StringIO._ascii.ob_base,
- & const_str_BufferedIOBase._ascii.ob_base,
- & const_str_BufferedReader._ascii.ob_base,
- & const_str_BufferedWriter._ascii.ob_base,
- & const_str_BufferedRWPair._ascii.ob_base,
- & const_str_BufferedRandom._ascii.ob_base,
- & const_str_TextIOBase._ascii.ob_base,
- &_Py_ID(TextIOWrapper),
- & const_str_UnsupportedOperation._ascii.ob_base,
- & const_str_SEEK_SET._ascii.ob_base,
- & const_str_SEEK_CUR._ascii.ob_base,
- & const_str_SEEK_END._ascii.ob_base,
- },
- },
-};
-static
- struct {
PyASCIIObject _ascii;
uint8_t _data[20];
}
@@ -72251,6 +72211,49 @@ static
PyGC_Head _gc_head;
struct {
PyObject_VAR_HEAD
+ PyObject *ob_item[22];
+ }_object;
+ }
+io_toplevel_consts_2 = {
+ ._object = {
+ .ob_base = {
+ .ob_base = {
+ .ob_refcnt = 999999999,
+ .ob_type = &PyTuple_Type,
+ },
+ .ob_size = 22,
+ },
+ .ob_item = {
+ & const_str_BlockingIOError._ascii.ob_base,
+ &_Py_ID(open),
+ & const_str_open_code._ascii.ob_base,
+ & const_str_IOBase._ascii.ob_base,
+ & const_str_RawIOBase._ascii.ob_base,
+ & const_str_FileIO._ascii.ob_base,
+ & const_str_BytesIO._ascii.ob_base,
+ & const_str_StringIO._ascii.ob_base,
+ & const_str_BufferedIOBase._ascii.ob_base,
+ & const_str_BufferedReader._ascii.ob_base,
+ & const_str_BufferedWriter._ascii.ob_base,
+ & const_str_BufferedRWPair._ascii.ob_base,
+ & const_str_BufferedRandom._ascii.ob_base,
+ & const_str_TextIOBase._ascii.ob_base,
+ &_Py_ID(TextIOWrapper),
+ & const_str_UnsupportedOperation._ascii.ob_base,
+ & const_str_SEEK_SET._ascii.ob_base,
+ & const_str_SEEK_CUR._ascii.ob_base,
+ & const_str_SEEK_END._ascii.ob_base,
+ & const_str_DEFAULT_BUFFER_SIZE._ascii.ob_base,
+ & const_str_text_encoding._ascii.ob_base,
+ & const_str_IncrementalNewlineDecoder._ascii.ob_base,
+ },
+ },
+};
+static
+ struct {
+ PyGC_Head _gc_head;
+ struct {
+ PyObject_VAR_HEAD
PyObject *ob_item[15];
}_object;
}
@@ -72509,7 +72512,7 @@ io_toplevel_consts_6 = {
.co_posonlyargcount = 0,
.co_kwonlyargcount = 0,
.co_stacksize = 6,
- .co_firstlineno = 60,
+ .co_firstlineno = 61,
.co_nlocalsplus = 2,
.co_nlocals = 2,
.co_nplaincellvars = 0,
@@ -72657,7 +72660,7 @@ io_toplevel_consts_10 = {
.co_posonlyargcount = 0,
.co_kwonlyargcount = 0,
.co_stacksize = 1,
- .co_firstlineno = 87,
+ .co_firstlineno = 88,
.co_nlocalsplus = 0,
.co_nlocals = 0,
.co_nplaincellvars = 0,
@@ -72783,7 +72786,7 @@ io_toplevel_consts_13 = {
.co_posonlyargcount = 0,
.co_kwonlyargcount = 0,
.co_stacksize = 1,
- .co_firstlineno = 90,
+ .co_firstlineno = 91,
.co_nlocalsplus = 0,
.co_nlocals = 0,
.co_nplaincellvars = 0,
@@ -72909,7 +72912,7 @@ io_toplevel_consts_15 = {
.co_posonlyargcount = 0,
.co_kwonlyargcount = 0,
.co_stacksize = 1,
- .co_firstlineno = 93,
+ .co_firstlineno = 94,
.co_nlocalsplus = 0,
.co_nlocals = 0,
.co_nplaincellvars = 0,
@@ -73035,7 +73038,7 @@ io_toplevel_consts_17 = {
.co_posonlyargcount = 0,
.co_kwonlyargcount = 0,
.co_stacksize = 1,
- .co_firstlineno = 96,
+ .co_firstlineno = 97,
.co_nlocalsplus = 0,
.co_nlocals = 0,
.co_nplaincellvars = 0,
@@ -73255,7 +73258,7 @@ io_toplevel_linetable = {
.ob_size = 713,
},
.ob_shash = -1,
- .ob_sval = "\xf0\x03\x01\x01\x01\xf0\x02\x21\x01\x04\xf0\x00\x21\x01\x04\xf0\x48\x01\x05\x0f\x38\x80\x0a\xf0\x0e\x04\x0b\x47\x01\xf0\x00\x04\x0b\x47\x01\xf0\x00\x04\x0b\x47\x01\x80\x07\xf0\x0e\x00\x01\x0b\x80\x0a\x80\x0a\x80\x0a\xd8\x00\x0a\x80\x0a\x80\x0a\x80\x0a\xf0\x04\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x0c\x0d\x01\x4b\x01\xf0\x00\x0d\x01\x4b\x01\xf0\x00\x0d\x01\x4b\x01\xf0\x22\x00\x23\x27\xd0\x00\x14\xd4\x00\x1f\xf0\x06\x00\x0c\x0d\x80\x08\xd8\x0b\x0c\x80\x08\xd8\x0b\x0c\x80\x08\xf0\x0a\x01\x01\x22\xf0\x00\x01\x01\x22\xf0\x00\x01\x01\x22\xf0\x00\x01\x01\x22\xf0\x00\x01\x01\x22\x88\x53\x8c\x5b\xa0\x43\xa4\x4b\xf0\x00\x01\x01\x22\xf1\x00\x01\x01\x22\xf4\x00\x01\x01\x22\xf0\x00\x01\x01\x22\xf0\x06\x01\x01\x25\xf0\x00\x01\x01\x25\xf0\x00\x01\x01\x25\xf0\x00\x01\x01\x25\xf0\x00\x01\x01\x25\x90\x03\x94\x0e\xa0\x06\xf1\x00\x01\x01\x25\xf4\x00\x01\x01\x25\xf0\x00\x01\x01\x25\xf0\x06\x01\x01\x2a\xf0\x00\x01\x01\x2a\xf0\x00\x01\x01\x2a\xf0\x00\x01\x01\x2a\xf0\x00\x01\x01\x2a\x90\x53\xd4\x15\x28\xa8\x26\xf1\x00\x01\x01\x2a\xf4\x00\x01\x01\x2a\xf0\x00\x01\x01\x2a\xf0\x06\x01\x01\x26\xf0\x00\x01\x01\x26\xf0\x00\x01\x01\x26\xf0\x00\x01\x01\x26\xf0\x00\x01\x01\x26\x90\x13\x94\x1f\xa0\x26\xf1\x00\x01\x01\x26\xf4\x00\x01\x01\x26\xf0\x00\x01\x01\x26\xf0\x06\x00\x01\x0a\xd7\x00\x12\xd2\x00\x12\x90\x36\xd1\x00\x1a\xd4\x00\x1a\xd0\x00\x1a\xe0\x0e\x15\x90\x7e\xa0\x7e\xb0\x7e\xd8\x0e\x1c\xf0\x03\x01\x0e\x1e\xf0\x00\x02\x01\x23\xf0\x00\x02\x01\x23\x80\x45\xe0\x04\x12\xd7\x04\x1b\xd2\x04\x1b\x98\x45\xd1\x04\x22\xd4\x04\x22\xd0\x04\x22\xd0\x04\x22\xe0\x0e\x16\x98\x0d\xd0\x0d\x26\xf0\x00\x01\x01\x1f\xf0\x00\x01\x01\x1f\x80\x45\xd8\x04\x0e\xd7\x04\x17\xd2\x04\x17\x98\x05\xd1\x04\x1e\xd4\x04\x1e\xd0\x04\x1e\xd0\x04\x1e\xd8\x04\x09\xf0\x04\x05\x01\x2a\xd8\x04\x25\xd0\x04\x25\xd0\x04\x25\xd0\x04\x25\xd0\x04\x25\xd0\x04\x25\xf0\x08\x00\x05\x0e\xd7\x04\x16\xd2\x04\x16\xd0\x17\x28\xd1\x04\x29\xd4\x04\x29\xd0\x04\x29\xd0\x04\x29\xd0\x04\x29\xf8\xf0\x07\x00\x08\x13\xf0\x00\x01\x01\x09\xf0\x00\x01\x01\x09\xf0\x00\x01\x01\x09\xd8\x04\x08\x80\x44\x80\x44\xf0\x03\x01\x01\x09\xf8\xf8\xf8",
+ .ob_sval = "\xf0\x03\x01\x01\x01\xf0\x02\x21\x01\x04\xf0\x00\x21\x01\x04\xf0\x48\x01\x05\x0f\x38\x80\x0a\xf0\x0e\x05\x0b\x50\x01\xf0\x00\x05\x0b\x50\x01\xf0\x00\x05\x0b\x50\x01\x80\x07\xf0\x10\x00\x01\x0b\x80\x0a\x80\x0a\x80\x0a\xd8\x00\x0a\x80\x0a\x80\x0a\x80\x0a\xf0\x04\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x00\x03\x01\x4a\x01\xf0\x0c\x0d\x01\x4b\x01\xf0\x00\x0d\x01\x4b\x01\xf0\x00\x0d\x01\x4b\x01\xf0\x22\x00\x23\x27\xd0\x00\x14\xd4\x00\x1f\xf0\x06\x00\x0c\x0d\x80\x08\xd8\x0b\x0c\x80\x08\xd8\x0b\x0c\x80\x08\xf0\x0a\x01\x01\x22\xf0\x00\x01\x01\x22\xf0\x00\x01\x01\x22\xf0\x00\x01\x01\x22\xf0\x00\x01\x01\x22\x88\x53\x8c\x5b\xa0\x43\xa4\x4b\xf0\x00\x01\x01\x22\xf1\x00\x01\x01\x22\xf4\x00\x01\x01\x22\xf0\x00\x01\x01\x22\xf0\x06\x01\x01\x25\xf0\x00\x01\x01\x25\xf0\x00\x01\x01\x25\xf0\x00\x01\x01\x25\xf0\x00\x01\x01\x25\x90\x03\x94\x0e\xa0\x06\xf1\x00\x01\x01\x25\xf4\x00\x01\x01\x25\xf0\x00\x01\x01\x25\xf0\x06\x01\x01\x2a\xf0\x00\x01\x01\x2a\xf0\x00\x01\x01\x2a\xf0\x00\x01\x01\x2a\xf0\x00\x01\x01\x2a\x90\x53\xd4\x15\x28\xa8\x26\xf1\x00\x01\x01\x2a\xf4\x00\x01\x01\x2a\xf0\x00\x01\x01\x2a\xf0\x06\x01\x01\x26\xf0\x00\x01\x01\x26\xf0\x00\x01\x01\x26\xf0\x00\x01\x01\x26\xf0\x00\x01\x01\x26\x90\x13\x94\x1f\xa0\x26\xf1\x00\x01\x01\x26\xf4\x00\x01\x01\x26\xf0\x00\x01\x01\x26\xf0\x06\x00\x01\x0a\xd7\x00\x12\xd2\x00\x12\x90\x36\xd1\x00\x1a\xd4\x00\x1a\xd0\x00\x1a\xe0\x0e\x15\x90\x7e\xa0\x7e\xb0\x7e\xd8\x0e\x1c\xf0\x03\x01\x0e\x1e\xf0\x00\x02\x01\x23\xf0\x00\x02\x01\x23\x80\x45\xe0\x04\x12\xd7\x04\x1b\xd2\x04\x1b\x98\x45\xd1\x04\x22\xd4\x04\x22\xd0\x04\x22\xd0\x04\x22\xe0\x0e\x16\x98\x0d\xd0\x0d\x26\xf0\x00\x01\x01\x1f\xf0\x00\x01\x01\x1f\x80\x45\xd8\x04\x0e\xd7\x04\x17\xd2\x04\x17\x98\x05\xd1\x04\x1e\xd4\x04\x1e\xd0\x04\x1e\xd0\x04\x1e\xd8\x04\x09\xf0\x04\x05\x01\x2a\xd8\x04\x25\xd0\x04\x25\xd0\x04\x25\xd0\x04\x25\xd0\x04\x25\xd0\x04\x25\xf0\x08\x00\x05\x0e\xd7\x04\x16\xd2\x04\x16\xd0\x17\x28\xd1\x04\x29\xd4\x04\x29\xd0\x04\x29\xd0\x04\x29\xd0\x04\x29\xf8\xf0\x07\x00\x08\x13\xf0\x00\x01\x01\x09\xf0\x00\x01\x01\x09\xf0\x00\x01\x01\x09\xd8\x04\x08\x80\x44\x80\x44\xf0\x03\x01\x01\x09\xf8\xf8\xf8",
};
static
struct {
diff --git a/contrib/tools/python3/src/Python/getargs.c b/contrib/tools/python3/src/Python/getargs.c
index 3105bd556c..e18d771992 100644
--- a/contrib/tools/python3/src/Python/getargs.c
+++ b/contrib/tools/python3/src/Python/getargs.c
@@ -522,7 +522,7 @@ converttuple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
}
else if (c == ':' || c == ';' || c == '\0')
break;
- else if (level == 0 && Py_ISALPHA(c))
+ else if (level == 0 && Py_ISALPHA(c) && c != 'e')
n++;
}
diff --git a/contrib/tools/python3/src/Python/import.c b/contrib/tools/python3/src/Python/import.c
index 3c3e76ca43..f1c9b478b2 100644
--- a/contrib/tools/python3/src/Python/import.c
+++ b/contrib/tools/python3/src/Python/import.c
@@ -951,11 +951,22 @@ PyImport_GetImporter(PyObject *path)
{
PyThreadState *tstate = _PyThreadState_GET();
PyObject *path_importer_cache = PySys_GetObject("path_importer_cache");
+ if (path_importer_cache == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "lost sys.path_importer_cache");
+ return NULL;
+ }
+ Py_INCREF(path_importer_cache);
PyObject *path_hooks = PySys_GetObject("path_hooks");
- if (path_importer_cache == NULL || path_hooks == NULL) {
+ if (path_hooks == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "lost sys.path_hooks");
+ Py_DECREF(path_importer_cache);
return NULL;
}
- return get_path_importer(tstate, path_importer_cache, path_hooks, path);
+ Py_INCREF(path_hooks);
+ PyObject *importer = get_path_importer(tstate, path_importer_cache, path_hooks, path);
+ Py_DECREF(path_hooks);
+ Py_DECREF(path_importer_cache);
+ return importer;
}
#if defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE)
diff --git a/contrib/tools/python3/src/Python/traceback.c b/contrib/tools/python3/src/Python/traceback.c
index c4f5ec877b..722f007459 100644
--- a/contrib/tools/python3/src/Python/traceback.c
+++ b/contrib/tools/python3/src/Python/traceback.c
@@ -112,6 +112,29 @@ tb_next_get(PyTracebackObject *self, void *Py_UNUSED(_))
}
static int
+tb_get_lineno(PyTracebackObject* tb) {
+ PyFrameObject* frame = tb->tb_frame;
+ assert(frame != NULL);
+ PyCodeObject *code = PyFrame_GetCode(frame);
+ int lineno = PyCode_Addr2Line(code, tb->tb_lasti);
+ Py_DECREF(code);
+ return lineno;
+}
+
+static PyObject *
+tb_lineno_get(PyTracebackObject *self, void *Py_UNUSED(_))
+{
+ int lineno = self->tb_lineno;
+ if (lineno == -1) {
+ lineno = tb_get_lineno(self);
+ if (lineno < 0) {
+ Py_RETURN_NONE;
+ }
+ }
+ return PyLong_FromLong(lineno);
+}
+
+static int
tb_next_set(PyTracebackObject *self, PyObject *new_next, void *Py_UNUSED(_))
{
if (!new_next) {
@@ -157,12 +180,12 @@ static PyMethodDef tb_methods[] = {
static PyMemberDef tb_memberlist[] = {
{"tb_frame", T_OBJECT, OFF(tb_frame), READONLY|PY_AUDIT_READ},
{"tb_lasti", T_INT, OFF(tb_lasti), READONLY},
- {"tb_lineno", T_INT, OFF(tb_lineno), READONLY},
{NULL} /* Sentinel */
};
static PyGetSetDef tb_getsetters[] = {
{"tb_next", (getter)tb_next_get, (setter)tb_next_set, NULL, NULL},
+ {"tb_lineno", (getter)tb_lineno_get, NULL, NULL, NULL},
{NULL} /* Sentinel */
};
@@ -241,8 +264,7 @@ _PyTraceBack_FromFrame(PyObject *tb_next, PyFrameObject *frame)
assert(tb_next == NULL || PyTraceBack_Check(tb_next));
assert(frame != NULL);
int addr = _PyInterpreterFrame_LASTI(frame->f_frame) * sizeof(_Py_CODEUNIT);
- return tb_create_raw((PyTracebackObject *)tb_next, frame, addr,
- PyFrame_GetLineNumber(frame));
+ return tb_create_raw((PyTracebackObject *)tb_next, frame, addr, -1);
}
@@ -907,8 +929,39 @@ tb_displayline(PyTracebackObject* tb, PyObject *f, PyObject *filename, int linen
goto done;
}
- if (print_error_location_carets(f, truncation, start_offset, end_offset,
- right_start_offset, left_end_offset,
+ // Convert all offsets to display offsets (e.g. the space they would take up if printed
+ // on the screen).
+ Py_ssize_t dp_start = _PyPegen_calculate_display_width(source_line, start_offset);
+ if (dp_start < 0) {
+ err = ignore_source_errors() < 0;
+ goto done;
+ }
+
+ Py_ssize_t dp_end = _PyPegen_calculate_display_width(source_line, end_offset);
+ if (dp_end < 0) {
+ err = ignore_source_errors() < 0;
+ goto done;
+ }
+
+ Py_ssize_t dp_left_end = -1;
+ Py_ssize_t dp_right_start = -1;
+ if (has_secondary_ranges) {
+ dp_left_end = _PyPegen_calculate_display_width(source_line, left_end_offset);
+ if (dp_left_end < 0) {
+ err = ignore_source_errors() < 0;
+ goto done;
+ }
+
+ dp_right_start = _PyPegen_calculate_display_width(source_line, right_start_offset);
+ if (dp_right_start < 0) {
+ err = ignore_source_errors() < 0;
+ goto done;
+ }
+ }
+
+
+ if (print_error_location_carets(f, truncation, dp_start, dp_end,
+ dp_right_start, dp_left_end,
primary_error_char, secondary_error_char) < 0) {
err = -1;
goto done;
@@ -959,9 +1012,13 @@ tb_printinternal(PyTracebackObject *tb, PyObject *f, long limit,
}
while (tb != NULL) {
code = PyFrame_GetCode(tb->tb_frame);
+ int tb_lineno = tb->tb_lineno;
+ if (tb_lineno == -1) {
+ tb_lineno = tb_get_lineno(tb);
+ }
if (last_file == NULL ||
code->co_filename != last_file ||
- last_line == -1 || tb->tb_lineno != last_line ||
+ last_line == -1 || tb_lineno != last_line ||
last_name == NULL || code->co_name != last_name) {
if (cnt > TB_RECURSIVE_CUTOFF) {
if (tb_print_line_repeated(f, cnt) < 0) {
@@ -969,13 +1026,13 @@ tb_printinternal(PyTracebackObject *tb, PyObject *f, long limit,
}
}
last_file = code->co_filename;
- last_line = tb->tb_lineno;
+ last_line = tb_lineno;
last_name = code->co_name;
cnt = 0;
}
cnt++;
if (cnt <= TB_RECURSIVE_CUTOFF) {
- if (tb_displayline(tb, f, code->co_filename, tb->tb_lineno,
+ if (tb_displayline(tb, f, code->co_filename, tb_lineno,
tb->tb_frame, code->co_name, indent, margin) < 0) {
goto error;
}
diff --git a/contrib/tools/python3/src/README.rst b/contrib/tools/python3/src/README.rst
index 1b82fa67d3..5910128874 100644
--- a/contrib/tools/python3/src/README.rst
+++ b/contrib/tools/python3/src/README.rst
@@ -1,4 +1,4 @@
-This is Python version 3.11.6
+This is Python version 3.11.7
=============================
.. image:: https://github.com/python/cpython/workflows/Tests/badge.svg
diff --git a/contrib/tools/python3/src/ya.make b/contrib/tools/python3/src/ya.make
index 1e940961c5..905419e2f4 100644
--- a/contrib/tools/python3/src/ya.make
+++ b/contrib/tools/python3/src/ya.make
@@ -2,9 +2,9 @@
LIBRARY()
-VERSION(3.11.6)
+VERSION(3.11.7)
-ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.11.6.tar.gz)
+ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.11.7.tar.gz)
LICENSE(Python-2.0)
diff --git a/contrib/tools/python3/ya.make b/contrib/tools/python3/ya.make
index 1841d07198..0cf5ca9b2e 100644
--- a/contrib/tools/python3/ya.make
+++ b/contrib/tools/python3/ya.make
@@ -2,9 +2,9 @@
PROGRAM()
-VERSION(3.11.6)
+VERSION(3.11.7)
-ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.11.6.tar.gz)
+ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.11.7.tar.gz)
LICENSE(Python-2.0)