From pypy.commits at gmail.com Sun Sep 1 04:07:05 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 01 Sep 2019 01:07:05 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix logic in _curses.get_wch (bb-3064, patch by Anthony Sottile) Message-ID: <5d6b7c29.1c69fb81.ea7a0.ae9a@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97360:1e244de6b3ad Date: 2019-09-01 08:29 +0300 http://bitbucket.org/pypy/pypy/changeset/1e244de6b3ad/ Log: fix logic in _curses.get_wch (bb-3064, patch by Anthony Sottile) diff --git a/lib_pypy/_curses.py b/lib_pypy/_curses.py --- a/lib_pypy/_curses.py +++ b/lib_pypy/_curses.py @@ -412,7 +412,10 @@ else: raise error("get_wch requires 0 or 2 arguments") _check_ERR(val, "get_wch") - return wch[0] + if val == lib.KEY_CODE_YES: + return wch[0] + else: + return chr(wch[0]) def getkey(self, *args): if len(args) == 0: diff --git a/lib_pypy/_curses_build.py b/lib_pypy/_curses_build.py --- a/lib_pypy/_curses_build.py +++ b/lib_pypy/_curses_build.py @@ -90,6 +90,7 @@ static const int ERR, OK; static const int TRUE, FALSE; static const int KEY_MIN, KEY_MAX; +static const int KEY_CODE_YES; static const int COLOR_BLACK; static const int COLOR_RED; From pypy.commits at gmail.com Sun Sep 1 11:13:47 2019 From: pypy.commits at gmail.com (rlamy) Date: Sun, 01 Sep 2019 08:13:47 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Correctly define ssl.HAS_TLSv1_3 Message-ID: <5d6be02b.1c69fb81.5b316.2497@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97361:adf9c8198875 Date: 2019-09-01 16:13 +0100 http://bitbucket.org/pypy/pypy/changeset/adf9c8198875/ Log: Correctly define ssl.HAS_TLSv1_3 diff --git a/lib_pypy/_cffi_ssl/_stdssl/__init__.py b/lib_pypy/_cffi_ssl/_stdssl/__init__.py --- a/lib_pypy/_cffi_ssl/_stdssl/__init__.py +++ b/lib_pypy/_cffi_ssl/_stdssl/__init__.py @@ -73,7 +73,7 @@ OP_NO_SSLv2 = lib.SSL_OP_NO_SSLv2 OP_NO_SSLv3 = lib.SSL_OP_NO_SSLv3 OP_NO_TLSv1_3 = lib.SSL_OP_NO_TLSv1_3 - + SSL_CLIENT = 0 SSL_SERVER = 1 @@ -90,7 +90,7 @@ PROTOCOL_SSLv3 = 1 lib.SSL_CTX_free(ctx) SSLv3_method_ok = True - + PROTOCOL_SSLv23 = 2 PROTOCOL_TLS = PROTOCOL_SSLv23 PROTOCOL_TLSv1 = 3 @@ -100,7 +100,7 @@ PROTOCOL_TLSv1_2 = 5 PROTOCOL_TLS_CLIENT = 0x10 PROTOCOL_TLS_SERVER = 0x11 -HAS_TLSv1_3 = False # XXX: temporary hack! +HAS_TLSv1_3 = bool(lib.Cryptography_HAS_TLSv1_3) _PROTOCOL_NAMES = (name for name in dir(lib) if name.startswith('PROTOCOL_')) From pypy.commits at gmail.com Sun Sep 1 13:08:17 2019 From: pypy.commits at gmail.com (rlamy) Date: Sun, 01 Sep 2019 10:08:17 -0700 (PDT) Subject: [pypy-commit] pypy py3.7: hg merge py3.6 Message-ID: <5d6bfb01.1c69fb81.fd725.5059@mx.google.com> Author: Ronan Lamy Branch: py3.7 Changeset: r97362:02225b17d8ee Date: 2019-09-01 16:14 +0100 http://bitbucket.org/pypy/pypy/changeset/02225b17d8ee/ Log: hg merge py3.6 diff --git a/lib_pypy/_cffi_ssl/_stdssl/__init__.py b/lib_pypy/_cffi_ssl/_stdssl/__init__.py --- a/lib_pypy/_cffi_ssl/_stdssl/__init__.py +++ b/lib_pypy/_cffi_ssl/_stdssl/__init__.py @@ -73,7 +73,7 @@ OP_NO_SSLv2 = lib.SSL_OP_NO_SSLv2 OP_NO_SSLv3 = lib.SSL_OP_NO_SSLv3 OP_NO_TLSv1_3 = lib.SSL_OP_NO_TLSv1_3 - + SSL_CLIENT = 0 SSL_SERVER = 1 @@ -90,7 +90,7 @@ PROTOCOL_SSLv3 = 1 lib.SSL_CTX_free(ctx) SSLv3_method_ok = True - + PROTOCOL_SSLv23 = 2 PROTOCOL_TLS = PROTOCOL_SSLv23 PROTOCOL_TLSv1 = 3 @@ -100,7 +100,7 @@ PROTOCOL_TLSv1_2 = 5 PROTOCOL_TLS_CLIENT = 0x10 PROTOCOL_TLS_SERVER = 0x11 -HAS_TLSv1_3 = False # XXX: temporary hack! +HAS_TLSv1_3 = bool(lib.Cryptography_HAS_TLSv1_3) _PROTOCOL_NAMES = (name for name in dir(lib) if name.startswith('PROTOCOL_')) diff --git a/lib_pypy/_curses.py b/lib_pypy/_curses.py --- a/lib_pypy/_curses.py +++ b/lib_pypy/_curses.py @@ -412,7 +412,10 @@ else: raise error("get_wch requires 0 or 2 arguments") _check_ERR(val, "get_wch") - return wch[0] + if val == lib.KEY_CODE_YES: + return wch[0] + else: + return chr(wch[0]) def getkey(self, *args): if len(args) == 0: diff --git a/lib_pypy/_curses_build.py b/lib_pypy/_curses_build.py --- a/lib_pypy/_curses_build.py +++ b/lib_pypy/_curses_build.py @@ -90,6 +90,7 @@ static const int ERR, OK; static const int TRUE, FALSE; static const int KEY_MIN, KEY_MAX; +static const int KEY_CODE_YES; static const int COLOR_BLACK; static const int COLOR_RED; From pypy.commits at gmail.com Sun Sep 1 13:08:19 2019 From: pypy.commits at gmail.com (rlamy) Date: Sun, 01 Sep 2019 10:08:19 -0700 (PDT) Subject: [pypy-commit] pypy py3.7: Add some constants to _ssl Message-ID: <5d6bfb03.1c69fb81.f6f6d.5ef9@mx.google.com> Author: Ronan Lamy Branch: py3.7 Changeset: r97363:c45e8e15bf26 Date: 2019-09-01 17:01 +0100 http://bitbucket.org/pypy/pypy/changeset/c45e8e15bf26/ Log: Add some constants to _ssl diff --git a/lib_pypy/_cffi_ssl/_stdssl/__init__.py b/lib_pypy/_cffi_ssl/_stdssl/__init__.py --- a/lib_pypy/_cffi_ssl/_stdssl/__init__.py +++ b/lib_pypy/_cffi_ssl/_stdssl/__init__.py @@ -8,10 +8,10 @@ _decode_certificate, _certificate_to_der) from _cffi_ssl._stdssl.utility import (_str_with_len, _bytes_with_len, _str_to_ffi_buffer, _str_from_buf, _cstr_decode_fs) -from _cffi_ssl._stdssl.error import (ssl_error, pyssl_error, - SSLError, SSLZeroReturnError, SSLWantReadError, - SSLWantWriteError, SSLSyscallError, - SSLEOFError) +from _cffi_ssl._stdssl.error import ( + ssl_error, pyssl_error, SSLError, SSLCertVerificationError, + SSLZeroReturnError, SSLWantReadError, SSLWantWriteError, SSLSyscallError, + SSLEOFError) from _cffi_ssl._stdssl.error import (SSL_ERROR_NONE, SSL_ERROR_SSL, SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITE, SSL_ERROR_WANT_X509_LOOKUP, SSL_ERROR_SYSCALL, @@ -100,8 +100,23 @@ PROTOCOL_TLSv1_2 = 5 PROTOCOL_TLS_CLIENT = 0x10 PROTOCOL_TLS_SERVER = 0x11 +HAS_SSLv2 = bool(lib.Cryptography_HAS_SSL2) +HAS_SSLv3 = SSLv3_method_ok +HAS_TLSv1 = True # XXX +HAS_TLSv1_1 = bool(lib.Cryptography_HAS_TLSv1_1) +HAS_TLSv1_2 = bool(lib.Cryptography_HAS_TLSv1_2) HAS_TLSv1_3 = bool(lib.Cryptography_HAS_TLSv1_3) +# Values brute-copied from CPython 3.7. They're documented as meaningless. +PROTO_MINIMUM_SUPPORTED = -2 +PROTO_MAXIMUM_SUPPORTED = -1 +PROTO_SSLv3 = 0x300 +PROTO_TLSv1 = 0x301 +PROTO_TLSv1_1 = 0x302 +PROTO_TLSv1_2 = 0x303 +PROTO_TLSv1_3 = 0x304 + + _PROTOCOL_NAMES = (name for name in dir(lib) if name.startswith('PROTOCOL_')) _IntEnum._convert('_SSLMethod', __name__, @@ -118,6 +133,9 @@ if hasattr(lib, lib_attr): globals()[attr] = getattr(lib, lib_attr) +# from CPython +_DEFAULT_CIPHERS = "DEFAULT:!aNULL:!eNULL:!MD5:!3DES:!DES:!RC4:!IDEA:!SEED:!aDSS:!SRP:!PSK" + # init open ssl lib.SSL_load_error_strings() lib.SSL_library_init() diff --git a/lib_pypy/_cffi_ssl/_stdssl/error.py b/lib_pypy/_cffi_ssl/_stdssl/error.py --- a/lib_pypy/_cffi_ssl/_stdssl/error.py +++ b/lib_pypy/_cffi_ssl/_stdssl/error.py @@ -33,7 +33,10 @@ 'SSL_ERROR_WANT_WRITE', 'SSL_ERROR_WANT_X509_LOOKUP', 'SSL_ERROR_SYSCALL', 'SSL_ERROR_SSL', 'SSL_ERROR_WANT_CONNECT', 'SSL_ERROR_EOF', 'SSL_ERROR_INVALID_ERROR_CODE' ]: - setattr(socket, v, locals()[v]) + setattr(socket, v, locals()[v]) + +class SSLCertVerificationError(SSLError, ValueError): + """A certificate could not be verified.""" class SSLZeroReturnError(SSLError): """ SSL/TLS session closed cleanly. """ diff --git a/lib_pypy/_ssl/__init__.py b/lib_pypy/_ssl/__init__.py --- a/lib_pypy/_ssl/__init__.py +++ b/lib_pypy/_ssl/__init__.py @@ -1,5 +1,6 @@ -from _cffi_ssl._stdssl import (_PROTOCOL_NAMES, _OPENSSL_API_VERSION, - _test_decode_cert, _SSLContext) +from _cffi_ssl._stdssl import ( + _PROTOCOL_NAMES, _OPENSSL_API_VERSION, _test_decode_cert, _SSLContext, + _DEFAULT_CIPHERS) from _cffi_ssl import _stdssl from _cffi_ssl._stdssl import * From pypy.commits at gmail.com Sun Sep 1 13:08:20 2019 From: pypy.commits at gmail.com (rlamy) Date: Sun, 01 Sep 2019 10:08:20 -0700 (PDT) Subject: [pypy-commit] pypy py3.7: Adapt to 3.7 refactoring of SSLSocket (bpo-24334) Message-ID: <5d6bfb04.1c69fb81.2abcd.b1e4@mx.google.com> Author: Ronan Lamy Branch: py3.7 Changeset: r97364:f3000526edef Date: 2019-09-01 18:07 +0100 http://bitbucket.org/pypy/pypy/changeset/f3000526edef/ Log: Adapt to 3.7 refactoring of SSLSocket (bpo-24334) diff --git a/lib_pypy/_cffi_ssl/_stdssl/__init__.py b/lib_pypy/_cffi_ssl/_stdssl/__init__.py --- a/lib_pypy/_cffi_ssl/_stdssl/__init__.py +++ b/lib_pypy/_cffi_ssl/_stdssl/__init__.py @@ -250,7 +250,8 @@ class _SSLSocket(object): @staticmethod - def _new__ssl_socket(sslctx, sock, socket_type, server_hostname, inbio, outbio): + def _new__ssl_socket(sslctx, sock, socket_type, server_hostname, owner, + session, inbio, outbio): self = _SSLSocket(sslctx) ctx = sslctx.ctx self.owner = None @@ -300,6 +301,11 @@ if sock: self.socket = weakref.ref(sock) + if owner is not None: + self.owner = owner + if session is not None: + self.session = session + return self def __init__(self, sslctx): @@ -399,7 +405,7 @@ self.handshake_done = 1 return None - def peer_certificate(self, binary_mode): + def getpeercert(self, binary_mode): if not self.handshake_done: raise ValueError("handshake not done yet") if self.peer_cert == ffi.NULL: @@ -1122,11 +1128,12 @@ lib.SSL_CTX_set_default_passwd_cb_userdata(self.ctx, ffi.NULL) - def _wrap_socket(self, sock, server_side, server_hostname=None): + def _wrap_socket(self, sock, server_side, server_hostname=None, *, + owner=None, session=None): if server_hostname: server_hostname = server_hostname.encode('idna') return _SSLSocket._new__ssl_socket(self, sock, server_side, - server_hostname, None, None) + server_hostname, owner, session, None, None) def load_verify_locations(self, cafile=None, capath=None, cadata=None): ffi.errno = 0 @@ -1355,14 +1362,17 @@ else: raise NotImplementedError("The NPN extension requires OpenSSL 1.0.1 or later.") - def _wrap_bio(self, incoming, outgoing, server_side, server_hostname): + def _wrap_bio(self, incoming, outgoing, server_side, server_hostname, *, + owner=None, session=None): # server_hostname is either None (or absent), or to be encoded # using the idna encoding. hostname = None if server_hostname is not None: hostname = server_hostname.encode("idna") - sock = _SSLSocket._new__ssl_socket(self, None, server_side, hostname, incoming, outgoing) + sock = _SSLSocket._new__ssl_socket( + self, None, server_side, hostname, owner, session, incoming, + outgoing) return sock From pypy.commits at gmail.com Sun Sep 1 14:42:52 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 01 Sep 2019 11:42:52 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: test, fix for return value when stdout, stderr could not be flushed at exit Message-ID: <5d6c112c.1c69fb81.d109.bff8@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97365:2c1cb3a4c2c5 Date: 2019-09-01 21:42 +0300 http://bitbucket.org/pypy/pypy/changeset/2c1cb3a4c2c5/ Log: test, fix for return value when stdout, stderr could not be flushed at exit diff --git a/pypy/goal/targetpypystandalone.py b/pypy/goal/targetpypystandalone.py --- a/pypy/goal/targetpypystandalone.py +++ b/pypy/goal/targetpypystandalone.py @@ -88,7 +88,11 @@ return 1 finally: try: - space.finish() + # the equivalent of Py_FinalizeEx + if space.finish() < 0: + # Value unlikely to be confused with a non-error exit status + # or other special meaning (from cpython/Modules/main.c) + exitcode = 120 except OperationError as e: debug("OperationError:") debug(" operror-type: " + e.w_type.getname(space)) diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py --- a/pypy/interpreter/baseobjspace.py +++ b/pypy/interpreter/baseobjspace.py @@ -459,15 +459,18 @@ w_mod.init(self) def finish(self): + ret = 0 self.wait_for_thread_shutdown() w_atexit = self.getbuiltinmodule('atexit') self.call_method(w_atexit, '_run_exitfuncs') self.sys.finalizing = True - self.sys.flush_std_files(self) + if self.sys.flush_std_files(self) < 0: + ret = -1 from pypy.interpreter.module import Module for w_mod in self.builtin_modules.values(): if isinstance(w_mod, Module) and w_mod.startup_called: w_mod.shutdown(self) + return ret def wait_for_thread_shutdown(self): """Wait until threading._shutdown() completes, provided the threading diff --git a/pypy/interpreter/test/test_app_main.py b/pypy/interpreter/test/test_app_main.py --- a/pypy/interpreter/test/test_app_main.py +++ b/pypy/interpreter/test/test_app_main.py @@ -749,7 +749,7 @@ monkeypatch.setenv('PYTHONWARNINGS_', "once,error") data = self.run('-W ignore -W default ' '-c "import sys; print(sys.warnoptions)"') - assert "['ignore', 'default', 'once', 'error']" in data + assert "['once', 'error', 'ignore', 'default']" in data def test_option_m(self, monkeypatch): if not hasattr(runpy, '_run_module_as_main'): diff --git a/pypy/interpreter/test/test_objspace.py b/pypy/interpreter/test/test_objspace.py --- a/pypy/interpreter/test/test_objspace.py +++ b/pypy/interpreter/test/test_objspace.py @@ -455,4 +455,14 @@ """) space.finish() # assert that we reach this point without getting interrupted - # by the OperationError(NameError) + + def test_exit_closed_std(self): + from pypy.tool.pytest.objspace import maketestobjspace + space = maketestobjspace() + space.appexec([], """(): + import sys, os + sys.stdout.write('x') + os.close(sys.stdout.fileno()) + """) + ret = space.finish() + assert ret < 0 diff --git a/pypy/interpreter/test/test_targetpypy.py b/pypy/interpreter/test/test_targetpypy.py --- a/pypy/interpreter/test/test_targetpypy.py +++ b/pypy/interpreter/test/test_targetpypy.py @@ -6,7 +6,7 @@ def test_run(self): config = get_pypy_config(translating=False) entry_point = get_entry_point(config)[0] - entry_point(['pypy3-c' , '-S', '-c', 'print 3']) + entry_point(['pypy3-c' , '-S', '-c', 'print(3)']) def test_execute_source(space): _, d = create_entry_point(space, None) From pypy.commits at gmail.com Sun Sep 1 16:44:18 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Sun, 01 Sep 2019 13:44:18 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Added global sigint event Message-ID: <5d6c2da2.1c69fb81.96373.b3a7@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97366:a8914535a9cb Date: 2019-09-01 21:42 +0100 http://bitbucket.org/pypy/pypy/changeset/a8914535a9cb/ Log: Added global sigint event diff --git a/pypy/module/__pypy__/test/test_signal.py b/pypy/module/__pypy__/test/test_signal.py --- a/pypy/module/__pypy__/test/test_signal.py +++ b/pypy/module/__pypy__/test/test_signal.py @@ -12,6 +12,14 @@ pass # assert did not crash +class AppTestSigIntEvent: + spaceconfig = dict(usemodules=['__pypy__', 'signal']) + + def test_sigint_event(self): + if sys.platform == 'win32': + pytest.skip("sigint event only on windows!") + import signal + class AppTestThreadSignal(GenericTestThread): spaceconfig = dict(usemodules=['__pypy__', 'thread', 'signal', 'time']) diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -6,16 +6,19 @@ TypeDef, generic_new_descr, GetSetProperty) from pypy.interpreter.gateway import WrappedDefault, interp2app, unwrap_spec from pypy.module._io.interp_iobase import (W_RawIOBase, DEFAULT_BUFFER_SIZE) +#from pypy.module.signal from pypy.interpreter.unicodehelper import fsdecode from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rlib._os_support import _preferred_traits from rpython.rlib import rwin32 from rpython.rlib.rwin32file import make_win32_traits +from rpython.rtyper.tool import rffi_platform as platform import unicodedata SMALLBUF = 4 BUFMAX = (32*1024*1024) +BUFSIZ = platform.ConstantInteger("BUFSIZ") def err_closed(space): raise oefmt(space.w_ValueError, @@ -26,7 +29,6 @@ raise oefmt(space.w_ValueError, "I/O operation on closed file") - def read_console_w(handle, maxlen, readlen): err = 0 sig = 0 @@ -37,8 +39,22 @@ off = 0 while off < maxlen: - n = rffi.cast(rwin32.DWORD, -1) - len = m + with lltype.scoped_alloc(rwin32.LPDWORD.TO, -1) as n: + len = min(maxlen - off, BUFSIZE) + rwin32.SetLastError_saved(0) + #res = rwin32.ReadConsoleW(handle, buf[off], len, n, rffi.NULL) + err = rwin32.GetLastError_saved() + if not res: + break + + if n == -1 and err == rwin32.ERROR_OPERATION_ABORTED: + break + + if n == 0: + if err != rwin32.ERROR_OPERATION_ABORTED: + break + err = 0 + #hInterruptEvent finally: lltype.free(buf, flavor='raw') diff --git a/pypy/module/signal/__init__.py b/pypy/module/signal/__init__.py --- a/pypy/module/signal/__init__.py +++ b/pypy/module/signal/__init__.py @@ -1,6 +1,7 @@ from pypy.interpreter.mixedmodule import MixedModule import os +import sys class Module(MixedModule): applevel_name = '_signal' @@ -35,6 +36,9 @@ interpleveldefs['SIG_BLOCK'] = 'space.wrap(interp_signal.SIG_BLOCK)' interpleveldefs['SIG_UNBLOCK'] = 'space.wrap(interp_signal.SIG_UNBLOCK)' interpleveldefs['SIG_SETMASK'] = 'space.wrap(interp_signal.SIG_SETMASK)' + + if sys.platform == 'win32': + interpleveldefs['sigintevent'] = 'interp_signal.sigintevent' appleveldefs = { } @@ -63,6 +67,8 @@ else: space.actionflag.__class__ = interp_signal.SignalActionFlag # xxx yes I know the previous line is a hack + if sys.platform == 'win32': + interp_signal.create_sigint_event() def startup(self, space): space.check_signal_action.startup(space) diff --git a/pypy/module/signal/interp_signal.py b/pypy/module/signal/interp_signal.py --- a/pypy/module/signal/interp_signal.py +++ b/pypy/module/signal/interp_signal.py @@ -16,10 +16,12 @@ from rpython.rlib.rarithmetic import intmask, widen from rpython.rlib.rsignal import * from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib import rwin32 +WIN32 = os.name == "nt" -WIN32 = sys.platform == 'win32' - +if WIN32: + _sigint_event = rwin32.INVALID_HANDLE_VALUE class SignalActionFlag(AbstractActionFlag): # This class uses the C-level pypysig_counter variable as the tick @@ -148,6 +150,9 @@ ec = space.getexecutioncontext() w_frame = ec.gettopframe_nohidden() space.call_function(w_handler, space.newint(n), w_frame) + if WIN32: + if n == SIGINT: + rwin32.SetEvent(_sigint_event) @unwrap_spec(signum=int) @@ -427,3 +432,15 @@ # if signals was unblocked, signal handlers have been called space.getexecutioncontext().checksignals() return _sigset_to_signals(space, previous) + +def create_sigint_event(): + _sigint_event = rwin32.CreateEvent(rffi.NULL, \ + rffi.cast(lltype.Signed, True), \ + rffi.cast(lltype.Signed, False), \ + rffi.NULL) + +def sigintevent(space): + if _sigint_event == rwin32.INVALID_HANDLE_VALUE: + return space.newint(-1) + else: + return space.newint(_sigint_event) \ No newline at end of file diff --git a/rpython/rlib/rwin32.py b/rpython/rlib/rwin32.py --- a/rpython/rlib/rwin32.py +++ b/rpython/rlib/rwin32.py @@ -577,8 +577,13 @@ 'GetNumberOfConsoleInputEvents', [HANDLE, LPDWORD], BOOL) ERROR_INSUFFICIENT_BUFFER = 122 + ERROR_OPERATION_ABORTED = 995 CP_UTF8 = 65001 WideCharToMultiByte = winexternal( 'WideCharToMultiByte', [rffi.UINT, DWORD, rffi.CWCHARP, rffi.INT, LPSTR, rffi.INT, rffi.CCHARP, LPBOOL], rffi.INT, save_err=rffi.RFFI_SAVE_LASTERROR) + + ReadConsoleW = winexternal( + 'ReadConsoleW', [HANDLE, LPVOID, DWORD, LPDWORD, LPVOID], BOOL, + save_err=rffi.RFFI_SAVE_LASTERROR) From pypy.commits at gmail.com Mon Sep 2 03:10:03 2019 From: pypy.commits at gmail.com (mattip) Date: Mon, 02 Sep 2019 00:10:03 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: test fix 2c1cb3a4c2c5 for non-error condition Message-ID: <5d6cc04b.1c69fb81.2edd5.d6e1@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97367:e21fdbdb7131 Date: 2019-09-02 10:09 +0300 http://bitbucket.org/pypy/pypy/changeset/e21fdbdb7131/ Log: test fix 2c1cb3a4c2c5 for non-error condition diff --git a/pypy/interpreter/test/test_objspace.py b/pypy/interpreter/test/test_objspace.py --- a/pypy/interpreter/test/test_objspace.py +++ b/pypy/interpreter/test/test_objspace.py @@ -453,7 +453,8 @@ import sys sys.exitfunc = lambda: this_is_an_unknown_name """) - space.finish() + ret = space.finish() + assert ret == 0 # assert that we reach this point without getting interrupted def test_exit_closed_std(self): diff --git a/pypy/module/sys/moduledef.py b/pypy/module/sys/moduledef.py --- a/pypy/module/sys/moduledef.py +++ b/pypy/module/sys/moduledef.py @@ -174,6 +174,7 @@ def flush_std_files(self, space): w_stdout = space.sys.getdictvalue(space, 'stdout') w_stderr = space.sys.getdictvalue(space, 'stderr') + ret = 0 for w_file in [w_stdout, w_stderr]: if not (space.is_none(w_file) or self._file_is_closed(space, w_file)): @@ -182,6 +183,8 @@ except OperationError as e: if w_file is w_stdout: e.write_unraisable(space, '', w_file) + ret = -1 + return ret def _file_is_closed(self, space, w_file): try: From pypy.commits at gmail.com Mon Sep 2 07:27:07 2019 From: pypy.commits at gmail.com (mattip) Date: Mon, 02 Sep 2019 04:27:07 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: sdterr replacement needs a flush method to pass space.finish and Py_FinalizeEx Message-ID: <5d6cfc8b.1c69fb81.e247c.59f1@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97368:ac58e8965428 Date: 2019-09-02 14:26 +0300 http://bitbucket.org/pypy/pypy/changeset/ac58e8965428/ Log: sdterr replacement needs a flush method to pass space.finish and Py_FinalizeEx diff --git a/pypy/module/imp/test/test_import.py b/pypy/module/imp/test/test_import.py --- a/pypy/module/imp/test/test_import.py +++ b/pypy/module/imp/test/test_import.py @@ -723,6 +723,8 @@ class StdErr(object): def write(self, line): output.append(line) + def flush(self): + return import sys, imp sys.stderr = StdErr() From pypy.commits at gmail.com Mon Sep 2 16:12:02 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 02 Sep 2019 13:12:02 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: two improvements around the print SyntaxError Message-ID: <5d6d7792.1c69fb81.ce309.73e1@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97369:8cebeebbf0a7 Date: 2019-09-02 21:56 +0200 http://bitbucket.org/pypy/pypy/changeset/8cebeebbf0a7/ Log: two improvements around the print SyntaxError - the old implementation shadowed the much better error messages around wrong parentheses that PyPy (and nowadays CPython) has - also provide the heuristics for giving a corrected print function call that Python 3.6 does diff --git a/pypy/interpreter/pyparser/test/test_pyparse.py b/pypy/interpreter/pyparser/test/test_pyparse.py --- a/pypy/interpreter/pyparser/test/test_pyparse.py +++ b/pypy/interpreter/pyparser/test/test_pyparse.py @@ -392,6 +392,8 @@ def test_error_print_without_parens(self): info = py.test.raises(SyntaxError, self.parse, "print 1") assert "Missing parentheses in call to 'print'" in info.value.msg + info = py.test.raises(SyntaxError, self.parse, "print 1)") + assert "unmatched" in info.value.msg class TestPythonParserRevDB(TestPythonParser): spaceconfig = {"translation.reverse_debugger": True} diff --git a/pypy/module/exceptions/interp_exceptions.py b/pypy/module/exceptions/interp_exceptions.py --- a/pypy/module/exceptions/interp_exceptions.py +++ b/pypy/module/exceptions/interp_exceptions.py @@ -814,6 +814,10 @@ # CPython Issue #21669: Custom error for 'print' & 'exec' as statements def _report_missing_parentheses(self, space): + if not space.text_w(self.w_msg).startswith("Missing parentheses in call to "): + # the parser identifies the correct places where the error should + # be produced + return text = space.utf8_w(self.w_text) if b'(' in text: # Use default error message for any line with an opening paren @@ -830,7 +834,7 @@ def _check_for_legacy_statements(self, space, text, start): # Ignore leading whitespace - while start < len(text) and text[start] == u' ': + while start < len(text) and text[start] == b' ': start += 1 # Checking against an empty or whitespace-only part of the string if start == len(text): @@ -839,7 +843,7 @@ text = text[start:] # Check for legacy print statements if text.startswith(b"print "): - self.w_msg = space.newtext("Missing parentheses in call to 'print'") + self._set_legacy_print_statement_msg(space, text) return True # Check for legacy exec statements if text.startswith(b"exec "): @@ -847,6 +851,22 @@ return True return False + def _set_legacy_print_statement_msg(self, space, text): + text = text[len("print"):] + if text.endswith(";"): + end = len(text) - 1 + assert end >= 0 + text = text[:end] + text = text.strip() + + maybe_end = "" + if text.endswith(","): + maybe_end = " end=\" \"" + + self.w_msg = space.newtext( + "Missing parentheses in call to 'print'. Did you mean print(%s%s)?" % ( + text, maybe_end)) + W_SyntaxError.typedef = TypeDef( 'SyntaxError', diff --git a/pypy/module/exceptions/test/test_exc.py b/pypy/module/exceptions/test/test_exc.py --- a/pypy/module/exceptions/test/test_exc.py +++ b/pypy/module/exceptions/test/test_exc.py @@ -443,6 +443,25 @@ assert (custom_msg not in exc.value.msg) == ( ('print (' in source or 'exec (' in source)) + def test_bug_print_heuristic_shadows_better_message(self): + def exec_(s): exec(s) + exc = raises(SyntaxError, exec_, "print [)") + assert "closing parenthesis ')' does not match opening parenthesis '['" in exc.value.msg + + def test_print_suggestions(self): + def exec_(s): exec(s) + def check(s, error): + exc = raises(SyntaxError, exec_, s) + print(exc.value.msg) + assert exc.value.msg == error + + check( + "print 1", + "Missing parentheses in call to 'print'. Did you mean print(1)?") + check( + "print 1, \t", + "Missing parentheses in call to 'print'. Did you mean print(1, end=\" \")?") + def test_importerror_kwarg_error(self): msg = "'invalid' is an invalid keyword argument for this function" exc = raises(TypeError, @@ -463,3 +482,4 @@ 'test', path='path', invalid='keyword') assert str(exc.value) == msg + From pypy.commits at gmail.com Tue Sep 3 08:09:49 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 03 Sep 2019 05:09:49 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix semicolon handling, only make repair suggestions that are valid syntax Message-ID: <5d6e580d.1c69fb81.dbf00.da4c@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97370:de78bcdc0fad Date: 2019-09-03 14:09 +0200 http://bitbucket.org/pypy/pypy/changeset/de78bcdc0fad/ Log: fix semicolon handling, only make repair suggestions that are valid syntax diff --git a/pypy/module/exceptions/interp_exceptions.py b/pypy/module/exceptions/interp_exceptions.py --- a/pypy/module/exceptions/interp_exceptions.py +++ b/pypy/module/exceptions/interp_exceptions.py @@ -853,19 +853,31 @@ def _set_legacy_print_statement_msg(self, space, text): text = text[len("print"):] + text = text.strip() if text.endswith(";"): end = len(text) - 1 assert end >= 0 - text = text[:end] - text = text.strip() + text = text[:end].strip() maybe_end = "" if text.endswith(","): maybe_end = " end=\" \"" - self.w_msg = space.newtext( - "Missing parentheses in call to 'print'. Did you mean print(%s%s)?" % ( - text, maybe_end)) + suggestion = "print(%s%s)" % ( + text, maybe_end) + + if "%" in suggestion: + import pdb; pdb.set_trace() + # try to see whether the suggestion would compile, otherwise discard it + compiler = space.createcompiler() + try: + compiler.compile(suggestion, '?', 'eval', 0) + except OperationError: + pass + else: + self.w_msg = space.newtext( + "Missing parentheses in call to 'print'. Did you mean %s?" % ( + suggestion, )) W_SyntaxError.typedef = TypeDef( diff --git a/pypy/module/exceptions/test/test_exc.py b/pypy/module/exceptions/test/test_exc.py --- a/pypy/module/exceptions/test/test_exc.py +++ b/pypy/module/exceptions/test/test_exc.py @@ -461,6 +461,15 @@ check( "print 1, \t", "Missing parentheses in call to 'print'. Did you mean print(1, end=\" \")?") + check( + "print 'a'\n;\t ", + "Missing parentheses in call to 'print'. Did you mean print('a')?") + check( + "print p;", + "Missing parentheses in call to 'print'. Did you mean print(p)?") + check("print %", "invalid syntax") + check("print 1 1", + "Missing parentheses in call to 'print'") def test_importerror_kwarg_error(self): msg = "'invalid' is an invalid keyword argument for this function" From pypy.commits at gmail.com Tue Sep 3 14:31:16 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 03 Sep 2019 11:31:16 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: test, fix for range.__bool__ Message-ID: <5d6eb174.1c69fb81.43c7.646d@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97371:6983e20a5d48 Date: 2019-09-03 12:13 +0200 http://bitbucket.org/pypy/pypy/changeset/6983e20a5d48/ Log: test, fix for range.__bool__ diff --git a/pypy/module/__builtin__/functional.py b/pypy/module/__builtin__/functional.py --- a/pypy/module/__builtin__/functional.py +++ b/pypy/module/__builtin__/functional.py @@ -582,6 +582,8 @@ w_tup = space.newtuple([self.w_length, self.w_start, self.w_step]) return space.hash(w_tup) + def descr_bool(self, space): + return space.call_method(self.w_length, '__bool__') W_Range.typedef = TypeDef("range", __new__ = interp2app(W_Range.descr_new.im_func), @@ -594,6 +596,7 @@ __contains__ = interp2app(W_Range.descr_contains), __eq__ = interp2app(W_Range.descr_eq), __hash__ = interp2app(W_Range.descr_hash), + __bool__ = interp2app(W_Range.descr_bool), count = interp2app(W_Range.descr_count), index = interp2app(W_Range.descr_index), start = interp_attrproperty_w('w_start', cls=W_Range), diff --git a/pypy/module/__builtin__/test/test_builtin.py b/pypy/module/__builtin__/test/test_builtin.py --- a/pypy/module/__builtin__/test/test_builtin.py +++ b/pypy/module/__builtin__/test/test_builtin.py @@ -402,6 +402,13 @@ raises(TypeError, range, 1, 2, '1') raises(TypeError, range, 1, 2, 3+2j) + def test_range_bool(self): + import sys + a = range(-sys.maxsize, sys.maxsize) + assert bool(a) is True + b = range(10, 0) + assert bool(b) is False + def test_sorted(self): l = [] sorted_l = sorted(l) From pypy.commits at gmail.com Tue Sep 3 14:31:18 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 03 Sep 2019 11:31:18 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: _sqlite.Cursor: add relevant part of __check_cursor to close() Message-ID: <5d6eb176.1c69fb81.89446.03e6@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97372:ff4600cfa35e Date: 2019-09-03 20:29 +0200 http://bitbucket.org/pypy/pypy/changeset/ff4600cfa35e/ Log: _sqlite.Cursor: add relevant part of __check_cursor to close() diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py --- a/lib_pypy/_sqlite3.py +++ b/lib_pypy/_sqlite3.py @@ -746,6 +746,8 @@ self.__initialized = True def close(self): + if not self.__initialized: + raise ProgrammingError("Base Cursor.__init__ not called.") self.__connection._check_thread() self.__connection._check_closed() if self.__statement: @@ -1043,6 +1045,7 @@ return list(self) def __get_connection(self): + self.__check_cursor() return self.__connection connection = property(__get_connection) From pypy.commits at gmail.com Tue Sep 3 16:01:37 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 03 Sep 2019 13:01:37 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: more print error message work, this one requiring a change to descroperation (in CPython it's done in abstract.c) Message-ID: <5d6ec6a1.1c69fb81.1d00c.691a@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97373:c0b2526268ab Date: 2019-09-03 22:00 +0200 http://bitbucket.org/pypy/pypy/changeset/c0b2526268ab/ Log: more print error message work, this one requiring a change to descroperation (in CPython it's done in abstract.c) diff --git a/pypy/module/exceptions/test/test_exc.py b/pypy/module/exceptions/test/test_exc.py --- a/pypy/module/exceptions/test/test_exc.py +++ b/pypy/module/exceptions/test/test_exc.py @@ -471,6 +471,14 @@ check("print 1 1", "Missing parentheses in call to 'print'") + def test_print_and_operators(self): + with raises(TypeError) as excinfo: + print >> 1, 5 + assert 'Did you mean "print(, file=)"?' in str(excinfo.value) + with raises(TypeError) as excinfo: + print -1 + assert 'Did you mean "print(<-number>)"?' in str(excinfo.value) + def test_importerror_kwarg_error(self): msg = "'invalid' is an invalid keyword argument for this function" exc = raises(TypeError, diff --git a/pypy/objspace/descroperation.py b/pypy/objspace/descroperation.py --- a/pypy/objspace/descroperation.py +++ b/pypy/objspace/descroperation.py @@ -506,6 +506,10 @@ return w_res return None +class PrintCache(object): + def __init__(self, space): + self.w_print = space.getattr(space.builtin, space.newtext("print")) + # regular methods def helpers @@ -515,6 +519,12 @@ symbol.replace('%', '%%'),) seq_bug_compat = (symbol == '+' or symbol == '*') + printerrormsg = None + if symbol == ">>": + printerrormsg = errormsg + '. Did you mean "print(, file=)"?' + if symbol == "-": + printerrormsg = errormsg + '. Did you mean "print(<-number>)"?' + def binop_impl(space, w_obj1, w_obj2): w_typ1 = space.type(w_obj1) w_typ2 = space.type(w_obj2) @@ -549,6 +559,8 @@ w_res = _invoke_binop(space, w_right_impl, w_obj2, w_obj1) if w_res is not None: return w_res + if printerrormsg is not None and w_obj1 is space.fromcache(PrintCache).w_print: + raise oefmt(space.w_TypeError, printerrormsg, w_typ1, w_typ2) raise oefmt(space.w_TypeError, errormsg, w_typ1, w_typ2) return func_with_new_name(binop_impl, "binop_%s_impl"%left.strip('_')) From pypy.commits at gmail.com Wed Sep 4 00:59:19 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 03 Sep 2019 21:59:19 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: pfff, seems I really need a pre-commit hook or something (pdb) Message-ID: <5d6f44a7.1c69fb81.4ef20.7027@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97375:a4c8fff52170 Date: 2019-09-04 06:56 +0200 http://bitbucket.org/pypy/pypy/changeset/a4c8fff52170/ Log: pfff, seems I really need a pre-commit hook or something (pdb) diff --git a/pypy/module/exceptions/interp_exceptions.py b/pypy/module/exceptions/interp_exceptions.py --- a/pypy/module/exceptions/interp_exceptions.py +++ b/pypy/module/exceptions/interp_exceptions.py @@ -866,8 +866,6 @@ suggestion = "print(%s%s)" % ( text, maybe_end) - if "%" in suggestion: - import pdb; pdb.set_trace() # try to see whether the suggestion would compile, otherwise discard it compiler = space.createcompiler() try: From pypy.commits at gmail.com Thu Sep 5 07:49:10 2019 From: pypy.commits at gmail.com (mattip) Date: Thu, 05 Sep 2019 04:49:10 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix bad merge Message-ID: <5d70f636.1c69fb81.f889c.9ddc@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97376:da6d272c73f5 Date: 2019-09-05 13:48 +0200 http://bitbucket.org/pypy/pypy/changeset/da6d272c73f5/ Log: fix bad merge diff --git a/lib-python/3/test/test_dis.py b/lib-python/3/test/test_dis.py --- a/lib-python/3/test/test_dis.py +++ b/lib-python/3/test/test_dis.py @@ -146,7 +146,7 @@ 1) pass -_bug1333982 = """\ +dis_bug1333982 = """\ %3d 0 LOAD_CONST 1 (0) 2 POP_JUMP_IF_TRUE 26 4 LOAD_GLOBAL 0 (AssertionError) From pypy.commits at gmail.com Thu Sep 5 09:24:05 2019 From: pypy.commits at gmail.com (arigo) Date: Thu, 05 Sep 2019 06:24:05 -0700 (PDT) Subject: [pypy-commit] pypy default: Simplify again sys._current_frames() from d48eaa036796. I *think* Message-ID: <5d710c75.1c69fb81.ed07c.fad3@mx.google.com> Author: Armin Rigo Branch: Changeset: r97377:6ef693fdb897 Date: 2019-09-05 15:23 +0200 http://bitbucket.org/pypy/pypy/changeset/6ef693fdb897/ Log: Simplify again sys._current_frames() from d48eaa036796. I *think* that by now it's not needed any more, and some basic testing seems to confirm that. diff --git a/pypy/module/sys/currentframes.py b/pypy/module/sys/currentframes.py --- a/pypy/module/sys/currentframes.py +++ b/pypy/module/sys/currentframes.py @@ -1,76 +1,27 @@ """ Implementation of the 'sys._current_frames()' routine. """ -from pypy.interpreter import gateway -app = gateway.applevel(''' -"NOT_RPYTHON" -import __builtin__ - -class fake_code(object): - co_name = "?" - co_filename = "?" - co_firstlineno = 0 - -class fake_frame(object): - f_back = None - f_builtins = __builtin__.__dict__ - f_code = fake_code() - f_exc_traceback = None - f_exc_type = None - f_exc_value = None - f_globals = {} - f_lasti = -1 - f_lineno = 0 - f_locals = {} - f_restricted = False - f_trace = None - - def __init__(self, f): - if f is not None: - for name in ["f_builtins", "f_code", "f_globals", "f_lasti", - "f_lineno"]: - setattr(self, name, getattr(f, name)) -''') def _current_frames(space): """_current_frames() -> dictionary Return a dictionary mapping each current thread T's thread id to T's - current stack "frame". Functions in the traceback module can build the + current stack frame. Functions in the traceback module can build the call stack given such a frame. - Note that in PyPy this returns fake frame objects, to avoid a runtime - penalty everywhere with the JIT. (So far these fake frames can be - completely uninformative depending on the JIT state; we could return - more with more efforts.) + Note that in PyPy with the JIT, calling this function causes a runtime + penalty in all threads, depending on the internal JIT state. In each + thread, the penalty should only be noticeable if this call was done + while in the middle of a long-running function. This function should be used for specialized purposes only.""" w_result = space.newdict() - w_fake_frame = app.wget(space, "fake_frame") ecs = space.threadlocals.getallvalues() for thread_ident, ec in ecs.items(): - vref = ec.topframeref - frames = [] - while not vref.virtual: - f = vref() - if f is None: - break - frames.append(f) - vref = f.f_backref - else: - frames.append(None) - - w_topframe = space.w_None - w_prevframe = None - for f in frames: - w_nextframe = space.call_function(w_fake_frame, space.wrap_none(f)) - if w_prevframe is None: - w_topframe = w_nextframe - else: - space.setattr(w_prevframe, space.newtext('f_back'), w_nextframe) - w_prevframe = w_nextframe - + w_topframe = ec.gettopframe_nohidden() + if w_topframe is None: + continue space.setitem(w_result, space.newint(thread_ident), w_topframe) From pypy.commits at gmail.com Thu Sep 5 09:29:58 2019 From: pypy.commits at gmail.com (arigo) Date: Thu, 05 Sep 2019 06:29:58 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: hg merge default Message-ID: <5d710dd6.1c69fb81.f889c.c10e@mx.google.com> Author: Armin Rigo Branch: py3.6 Changeset: r97378:47adf88a23bd Date: 2019-09-05 15:29 +0200 http://bitbucket.org/pypy/pypy/changeset/47adf88a23bd/ Log: hg merge default diff --git a/pypy/module/sys/currentframes.py b/pypy/module/sys/currentframes.py --- a/pypy/module/sys/currentframes.py +++ b/pypy/module/sys/currentframes.py @@ -1,76 +1,27 @@ """ Implementation of the 'sys._current_frames()' routine. """ -from pypy.interpreter import gateway -app = gateway.applevel(''' -"NOT_RPYTHON" -import builtins - -class fake_code(object): - co_name = "?" - co_filename = "?" - co_firstlineno = 0 - -class fake_frame(object): - f_back = None - f_builtins = builtins.__dict__ - f_code = fake_code() - f_exc_traceback = None - f_exc_type = None - f_exc_value = None - f_globals = {} - f_lasti = -1 - f_lineno = 0 - f_locals = {} - f_restricted = False - f_trace = None - - def __init__(self, f): - if f is not None: - for name in ["f_builtins", "f_code", "f_globals", "f_lasti", - "f_lineno"]: - setattr(self, name, getattr(f, name)) -''') def _current_frames(space): """_current_frames() -> dictionary Return a dictionary mapping each current thread T's thread id to T's - current stack "frame". Functions in the traceback module can build the + current stack frame. Functions in the traceback module can build the call stack given such a frame. - Note that in PyPy this returns fake frame objects, to avoid a runtime - penalty everywhere with the JIT. (So far these fake frames can be - completely uninformative depending on the JIT state; we could return - more with more efforts.) + Note that in PyPy with the JIT, calling this function causes a runtime + penalty in all threads, depending on the internal JIT state. In each + thread, the penalty should only be noticeable if this call was done + while in the middle of a long-running function. This function should be used for specialized purposes only.""" w_result = space.newdict() - w_fake_frame = app.wget(space, "fake_frame") ecs = space.threadlocals.getallvalues() for thread_ident, ec in ecs.items(): - vref = ec.topframeref - frames = [] - while not vref.virtual: - f = vref() - if f is None: - break - frames.append(f) - vref = f.f_backref - else: - frames.append(None) - - w_topframe = space.w_None - w_prevframe = None - for f in frames: - w_nextframe = space.call_function(w_fake_frame, space.wrap_none(f)) - if w_prevframe is None: - w_topframe = w_nextframe - else: - space.setattr(w_prevframe, space.newtext('f_back'), w_nextframe) - w_prevframe = w_nextframe - + w_topframe = ec.gettopframe_nohidden() + if w_topframe is None: + continue space.setitem(w_result, space.newint(thread_ident), w_topframe) From pypy.commits at gmail.com Thu Sep 5 10:20:26 2019 From: pypy.commits at gmail.com (arigo) Date: Thu, 05 Sep 2019 07:20:26 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: hg merge default Message-ID: <5d7119aa.1c69fb81.a9d88.af7b@mx.google.com> Author: Armin Rigo Branch: py3.6 Changeset: r97380:95bc2c5d41f8 Date: 2019-09-05 16:19 +0200 http://bitbucket.org/pypy/pypy/changeset/95bc2c5d41f8/ Log: hg merge default diff --git a/pypy/module/pypyjit/test_pypy_c/test_getframe.py b/pypy/module/pypyjit/test_pypy_c/test_getframe.py --- a/pypy/module/pypyjit/test_pypy_c/test_getframe.py +++ b/pypy/module/pypyjit/test_pypy_c/test_getframe.py @@ -23,3 +23,45 @@ --TICK-- jump(..., descr=...) """) + + def test_current_frames(self): + def main(): + import sys + import time + import thread + + lst = [0.0] * 1000 + lst[-33] = 3.0 + done = [] + + def h1(x): + time.sleep(lst[x]) + + def g1(x): + h1(x) + + def f1(): + for j in range(1000): + g1(j) + done.append('done') + + for k in range(3): + thread.start_new_thread(f1, ()) + + time.sleep(1) + d = sys._current_frames() + + time.sleep(3) + # the captured frames should be finished by now + + done.append(str(len(d))) + for key, value in d.items(): + while value is not None: + name = value.f_code.co_name + if len(name) == 2 and name[1] == '1': + done.append(name) + value = value.f_back + return repr('-'.join(done)) + + log = self.run(main, []) + assert log.result == 'done-done-done-4-h1-g1-f1-h1-g1-f1-h1-g1-f1' From pypy.commits at gmail.com Thu Sep 5 15:46:09 2019 From: pypy.commits at gmail.com (mattip) Date: Thu, 05 Sep 2019 12:46:09 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: test, fix ImportError.__reduce__ for new attributes Message-ID: <5d716601.1c69fb81.2e508.a354@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97381:a6c3470d8f75 Date: 2019-09-05 17:47 +0200 http://bitbucket.org/pypy/pypy/changeset/a6c3470d8f75/ Log: test, fix ImportError.__reduce__ for new attributes diff --git a/pypy/module/exceptions/interp_exceptions.py b/pypy/module/exceptions/interp_exceptions.py --- a/pypy/module/exceptions/interp_exceptions.py +++ b/pypy/module/exceptions/interp_exceptions.py @@ -342,6 +342,14 @@ self.w_msg = space.w_None W_Exception.descr_init(self, space, args_w) + def descr_reduce(self, space): + w_dct = space.newdict() + space.setitem(w_dct, space.newtext('name'), self.w_name) + space.setitem(w_dct, space.newtext('path'), self.w_path) + return space.newtuple([space.w_ImportError, + space.newtuple([self.w_msg]), + w_dct, + ]) W_ImportError.typedef = TypeDef( 'ImportError', @@ -353,6 +361,7 @@ name = readwrite_attrproperty_w('w_name', W_ImportError), path = readwrite_attrproperty_w('w_path', W_ImportError), msg = readwrite_attrproperty_w('w_msg', W_ImportError), + __reduce__ = interp2app(W_ImportError.descr_reduce), ) diff --git a/pypy/module/exceptions/test/test_exc.py b/pypy/module/exceptions/test/test_exc.py --- a/pypy/module/exceptions/test/test_exc.py +++ b/pypy/module/exceptions/test/test_exc.py @@ -303,6 +303,14 @@ assert ImportError("message", "foo").msg is None assert ImportError("message", "foo").args == ("message", "foo") + def test_importerror_reduce(self): + d = {'name': 'a', + 'path': 'b', + } + s = ImportError('c', **d).__reduce__() + e = s[0](*s[1], **s[2]) + for k, v in d.items(): + assert getattr(e, k) == v def test_modulenotfounderror(self): assert ModuleNotFoundError("message").name is None From pypy.commits at gmail.com Thu Sep 5 15:46:11 2019 From: pypy.commits at gmail.com (mattip) Date: Thu, 05 Sep 2019 12:46:11 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: test, fix for bpo-33786: handle generator exit in athrow() Message-ID: <5d716603.1c69fb81.8be36.8532@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97382:585e24d5f093 Date: 2019-09-05 21:45 +0200 http://bitbucket.org/pypy/pypy/changeset/585e24d5f093/ Log: test, fix for bpo-33786: handle generator exit in athrow() diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py --- a/pypy/interpreter/generator.py +++ b/pypy/interpreter/generator.py @@ -777,13 +777,12 @@ def handle_error(self, e): space = self.space self.state = self.ST_CLOSED - if e.match(space, space.w_StopAsyncIteration): + if (e.match(space, space.w_StopAsyncIteration) or + e.match(space, space.w_StopIteration)): if self.w_exc_type is None: # When aclose() is called we don't want to propagate - # StopAsyncIteration; just raise StopIteration, signalling - # that 'aclose()' is done. + # StopAsyncIteration or GeneratorExit; just raise + # StopIteration, signalling that this 'aclose()' await + # is done. raise OperationError(space.w_StopIteration, space.w_None) - if e.match(space, space.w_GeneratorExit): - # Ignore this error. - raise OperationError(space.w_StopIteration, space.w_None) raise e diff --git a/pypy/interpreter/test/test_generator.py b/pypy/interpreter/test/test_generator.py --- a/pypy/interpreter/test/test_generator.py +++ b/pypy/interpreter/test/test_generator.py @@ -539,6 +539,104 @@ raises(TypeError, g.send, 2) +class AppTestAsyncGenerator(object): + + def test_async_gen_exception_11(self): + """ + # bpo-33786 + def compare_generators(sync_gen, async_gen): + def sync_iterate(g): + res = [] + while True: + try: + res.append(g.__next__()) + except StopIteration: + res.append('STOP') + break + except Exception as ex: + res.append(str(type(ex))) + return res + + def async_iterate(g): + res = [] + while True: + an = g.__anext__() + try: + while True: + try: + an.__next__() + except StopIteration as ex: + if ex.args: + res.append(ex.args[0]) + break + else: + res.append('EMPTY StopIteration') + break + except StopAsyncIteration: + raise + except Exception as ex: + res.append(str(type(ex))) + break + except StopAsyncIteration: + res.append('STOP') + break + return res + + def async_iterate(g): + res = [] + while True: + try: + g.__anext__().__next__() + except StopAsyncIteration: + res.append('STOP') + break + except StopIteration as ex: + if ex.args: + res.append(ex.args[0]) + else: + res.append('EMPTY StopIteration') + break + except Exception as ex: + res.append(str(type(ex))) + return res + + sync_gen_result = sync_iterate(sync_gen) + async_gen_result = async_iterate(async_gen) + assert sync_gen_result == async_gen_result, "%s != %s" % (str(sync_gen_result), str(async_gen_result)) + return async_gen_result + + def sync_gen(): + yield 10 + yield 20 + + def sync_gen_wrapper(): + yield 1 + sg = sync_gen() + sg.send(None) + try: + sg.throw(GeneratorExit()) + except GeneratorExit: + yield 2 + yield 3 + + async def async_gen(): + yield 10 + yield 20 + + async def async_gen_wrapper(): + yield 1 + asg = async_gen() + await asg.asend(None) + try: + await asg.athrow(GeneratorExit()) + except GeneratorExit: + yield 2 + yield 3 + + compare_generators(sync_gen_wrapper(), async_gen_wrapper()) + """ + + def test_should_not_inline(space): from pypy.interpreter.generator import should_not_inline w_co = space.appexec([], '''(): From pypy.commits at gmail.com Fri Sep 6 00:57:19 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Thu, 05 Sep 2019 21:57:19 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: work in progress Message-ID: <5d71e72f.1c69fb81.a4c04.79b8@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97383:267f37b690fc Date: 2019-09-06 05:55 +0100 http://bitbucket.org/pypy/pypy/changeset/267f37b690fc/ Log: work in progress diff --git a/pypy/module/__pypy__/test/test_signal.py b/pypy/module/__pypy__/test/test_signal.py --- a/pypy/module/__pypy__/test/test_signal.py +++ b/pypy/module/__pypy__/test/test_signal.py @@ -11,14 +11,6 @@ with thread.signals_enabled: pass # assert did not crash - -class AppTestSigIntEvent: - spaceconfig = dict(usemodules=['__pypy__', 'signal']) - - def test_sigint_event(self): - if sys.platform == 'win32': - pytest.skip("sigint event only on windows!") - import signal class AppTestThreadSignal(GenericTestThread): diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -6,7 +6,7 @@ TypeDef, generic_new_descr, GetSetProperty) from pypy.interpreter.gateway import WrappedDefault, interp2app, unwrap_spec from pypy.module._io.interp_iobase import (W_RawIOBase, DEFAULT_BUFFER_SIZE) -#from pypy.module.signal +from pypy.module.signal.interp_signal import sigintevent from pypy.interpreter.unicodehelper import fsdecode from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rlib._os_support import _preferred_traits @@ -42,7 +42,7 @@ with lltype.scoped_alloc(rwin32.LPDWORD.TO, -1) as n: len = min(maxlen - off, BUFSIZE) rwin32.SetLastError_saved(0) - #res = rwin32.ReadConsoleW(handle, buf[off], len, n, rffi.NULL) + res = rwin32.ReadConsoleW(handle, buf[off], len, n, rffi.NULL) err = rwin32.GetLastError_saved() if not res: break @@ -54,7 +54,7 @@ if err != rwin32.ERROR_OPERATION_ABORTED: break err = 0 - #hInterruptEvent + hInterruptEvent = sigintevent() finally: lltype.free(buf, flavor='raw') diff --git a/pypy/module/signal/__init__.py b/pypy/module/signal/__init__.py --- a/pypy/module/signal/__init__.py +++ b/pypy/module/signal/__init__.py @@ -67,7 +67,9 @@ else: space.actionflag.__class__ = interp_signal.SignalActionFlag # xxx yes I know the previous line is a hack - if sys.platform == 'win32': + print "loading module" + if os.name == "nt": + print "creating sigint event" interp_signal.create_sigint_event() def startup(self, space): diff --git a/pypy/module/signal/interp_signal.py b/pypy/module/signal/interp_signal.py --- a/pypy/module/signal/interp_signal.py +++ b/pypy/module/signal/interp_signal.py @@ -21,7 +21,7 @@ WIN32 = os.name == "nt" if WIN32: - _sigint_event = rwin32.INVALID_HANDLE_VALUE + _sigint_event = rwin32.NULL_HANDLE class SignalActionFlag(AbstractActionFlag): # This class uses the C-level pypysig_counter variable as the tick @@ -440,7 +440,7 @@ rffi.NULL) def sigintevent(space): - if _sigint_event == rwin32.INVALID_HANDLE_VALUE: - return space.newint(-1) + if _sigint_event == rwin32.NULL_HANDLE: + return space.newint(0) else: return space.newint(_sigint_event) \ No newline at end of file diff --git a/pypy/module/signal/test/test_signal.py b/pypy/module/signal/test/test_signal.py --- a/pypy/module/signal/test/test_signal.py +++ b/pypy/module/signal/test/test_signal.py @@ -271,6 +271,17 @@ else: raise AssertionError("did not raise!") + def test_sigint_event(self): + import os + if os.name != 'nt': + pytest.skip("sigint event only on windows!") + import _signal + sigevent = _signal.sigintevent() + assert sigevent == 0 + _signal.__init__() + sigevent = _signal.sigintevent() + assert sigevent >= 0 + class AppTestSignalSocket: spaceconfig = dict(usemodules=['signal', '_socket']) From pypy.commits at gmail.com Fri Sep 6 05:08:50 2019 From: pypy.commits at gmail.com (cfbolz) Date: Fri, 06 Sep 2019 02:08:50 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix reduce some more and add setstate of ImportError Message-ID: <5d722222.1c69fb81.b7926.cb82@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97384:034134044fdc Date: 2019-09-06 11:02 +0200 http://bitbucket.org/pypy/pypy/changeset/034134044fdc/ Log: fix reduce some more and add setstate of ImportError diff --git a/pypy/module/exceptions/interp_exceptions.py b/pypy/module/exceptions/interp_exceptions.py --- a/pypy/module/exceptions/interp_exceptions.py +++ b/pypy/module/exceptions/interp_exceptions.py @@ -343,13 +343,25 @@ W_Exception.descr_init(self, space, args_w) def descr_reduce(self, space): - w_dct = space.newdict() - space.setitem(w_dct, space.newtext('name'), self.w_name) - space.setitem(w_dct, space.newtext('path'), self.w_path) - return space.newtuple([space.w_ImportError, - space.newtuple([self.w_msg]), - w_dct, - ]) + lst = [self.getclass(space), space.newtuple(self.args_w)] + if self.w_dict is not None and space.is_true(self.w_dict): + w_dict = space.call_method(self.w_dict, "copy") + else: + w_dict = space.newdict() + if not space.is_w(self.w_name, space.w_None): + space.setitem(w_dict, space.newtext("name"), self.w_name) + if not space.is_w(self.w_path, space.w_None): + space.setitem(w_dict, space.newtext("path"), self.w_path) + if space.is_true(w_dict): + lst.append(w_dict) + return space.newtuple(lst) + + def descr_setstate(self, space, w_dict): + self.w_name = space.call_method(w_dict, "pop", space.newtext("name"), space.w_None) + self.w_path = space.call_method(w_dict, "pop", space.newtext("path"), space.w_None) + w_olddict = self.getdict(space) + space.call_method(w_olddict, 'update', w_dict) + W_ImportError.typedef = TypeDef( 'ImportError', @@ -358,10 +370,11 @@ __module__ = 'builtins', __new__ = _new(W_ImportError), __init__ = interp2app(W_ImportError.descr_init), + __reduce__ = interp2app(W_ImportError.descr_reduce), + __setstate__ = interp2app(W_ImportError.descr_setstate), name = readwrite_attrproperty_w('w_name', W_ImportError), path = readwrite_attrproperty_w('w_path', W_ImportError), msg = readwrite_attrproperty_w('w_msg', W_ImportError), - __reduce__ = interp2app(W_ImportError.descr_reduce), ) diff --git a/pypy/module/exceptions/test/test_exc.py b/pypy/module/exceptions/test/test_exc.py --- a/pypy/module/exceptions/test/test_exc.py +++ b/pypy/module/exceptions/test/test_exc.py @@ -216,6 +216,8 @@ assert le.__reduce__() == (LookupError, (1, 2, "a"), {"xyz": (1, 2)}) ee = EnvironmentError(1, 2, "a") assert ee.__reduce__() == (PermissionError, (1, 2, "a")) + ee = ImportError("a", "b", "c", name="x", path="y") + assert ee.__reduce__() == (ImportError, ("a", "b", "c"), {"name": "x", "path": "y"}) def test_setstate(self): fw = FutureWarning() @@ -225,6 +227,14 @@ assert fw.z == 1 assert fw.xyz == (1, 2) + i = ImportError() + i.foo = "x" + i.__setstate__({"name": "x", "path": "y", "bar": 1}) + assert i.foo == "x" + assert i.name == "x" + assert i.path == "y" + assert i.bar == 1 + def test_unicode_error_uninitialized_str(self): assert str(UnicodeEncodeError.__new__(UnicodeEncodeError)) == "" assert str(UnicodeDecodeError.__new__(UnicodeDecodeError)) == "" From pypy.commits at gmail.com Fri Sep 6 06:36:05 2019 From: pypy.commits at gmail.com (rlamy) Date: Fri, 06 Sep 2019 03:36:05 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Merged in paugier/pypy/py3.6 (pull request #663) Message-ID: <5d723695.1c69fb81.819ec.7344@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97386:fbdb61ac5e0b Date: 2019-09-06 10:35 +0000 http://bitbucket.org/pypy/pypy/changeset/fbdb61ac5e0b/ Log: Merged in paugier/pypy/py3.6 (pull request #663) Add parentheses to an error message: "__prepare__() must return a mapping..." diff --git a/pypy/module/__builtin__/compiling.py b/pypy/module/__builtin__/compiling.py --- a/pypy/module/__builtin__/compiling.py +++ b/pypy/module/__builtin__/compiling.py @@ -133,11 +133,11 @@ if not space.ismapping_w(w_namespace): if isclass: raise oefmt(space.w_TypeError, - "%N.__prepare__ must return a mapping, not %T", + "%N.__prepare__() must return a mapping, not %T", w_meta, w_namespace) else: raise oefmt(space.w_TypeError, - ".__prepare__ must return a mapping, not %T", + ".__prepare__() must return a mapping, not %T", w_namespace) code = w_func.getcode() diff --git a/pypy/module/__builtin__/test/apptest_compile.py b/pypy/module/__builtin__/test/apptest_compile.py --- a/pypy/module/__builtin__/test/apptest_compile.py +++ b/pypy/module/__builtin__/test/apptest_compile.py @@ -179,3 +179,20 @@ assert 'module_doc' not in marshalled assert 'func_doc' not in marshalled assert 'class_doc' not in marshalled + +def test_build_class(): + """Test error message bad __prepare__""" + + class BadMeta(type): + @classmethod + def __prepare__(*args): + return None + + def func(): + class Foo(metaclass=BadMeta): + pass + + excinfo = raises(TypeError, func) + assert str(excinfo.value) == ( + r"BadMeta.__prepare__() must return a mapping, not NoneType" + ) From pypy.commits at gmail.com Fri Sep 6 06:36:16 2019 From: pypy.commits at gmail.com (paugier) Date: Fri, 06 Sep 2019 03:36:16 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Add parentheses to an error message: "__prepare__() must return a mapping..." Message-ID: <5d7236a0.1c69fb81.564d.9b6b@mx.google.com> Author: paugier Branch: py3.6 Changeset: r97385:a18f99a9128a Date: 2019-09-06 12:30 +0200 http://bitbucket.org/pypy/pypy/changeset/a18f99a9128a/ Log: Add parentheses to an error message: "__prepare__() must return a mapping..." diff --git a/pypy/module/__builtin__/compiling.py b/pypy/module/__builtin__/compiling.py --- a/pypy/module/__builtin__/compiling.py +++ b/pypy/module/__builtin__/compiling.py @@ -133,11 +133,11 @@ if not space.ismapping_w(w_namespace): if isclass: raise oefmt(space.w_TypeError, - "%N.__prepare__ must return a mapping, not %T", + "%N.__prepare__() must return a mapping, not %T", w_meta, w_namespace) else: raise oefmt(space.w_TypeError, - ".__prepare__ must return a mapping, not %T", + ".__prepare__() must return a mapping, not %T", w_namespace) code = w_func.getcode() diff --git a/pypy/module/__builtin__/test/apptest_compile.py b/pypy/module/__builtin__/test/apptest_compile.py --- a/pypy/module/__builtin__/test/apptest_compile.py +++ b/pypy/module/__builtin__/test/apptest_compile.py @@ -179,3 +179,20 @@ assert 'module_doc' not in marshalled assert 'func_doc' not in marshalled assert 'class_doc' not in marshalled + +def test_build_class(): + """Test error message bad __prepare__""" + + class BadMeta(type): + @classmethod + def __prepare__(*args): + return None + + def func(): + class Foo(metaclass=BadMeta): + pass + + excinfo = raises(TypeError, func) + assert str(excinfo.value) == ( + r"BadMeta.__prepare__() must return a mapping, not NoneType" + ) From pypy.commits at gmail.com Fri Sep 6 07:46:36 2019 From: pypy.commits at gmail.com (mattip) Date: Fri, 06 Sep 2019 04:46:36 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix 585e24d5f093, it changed too much Message-ID: <5d72471c.1c69fb81.35c26.c7cd@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97387:f6fd62b9bbed Date: 2019-09-06 13:45 +0200 http://bitbucket.org/pypy/pypy/changeset/f6fd62b9bbed/ Log: fix 585e24d5f093, it changed too much diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py --- a/pypy/interpreter/generator.py +++ b/pypy/interpreter/generator.py @@ -785,4 +785,7 @@ # StopIteration, signalling that this 'aclose()' await # is done. raise OperationError(space.w_StopIteration, space.w_None) + if e.match(space, space.w_GeneratorExit): + # Ignore this error. + raise OperationError(space.w_StopIteration, space.w_None) raise e From pypy.commits at gmail.com Fri Sep 6 09:09:34 2019 From: pypy.commits at gmail.com (rlamy) Date: Fri, 06 Sep 2019 06:09:34 -0700 (PDT) Subject: [pypy-commit] pypy py3.7: Look for 3.7 instead of 3.6 in -A tests Message-ID: <5d725a8e.1c69fb81.b6462.28fe@mx.google.com> Author: Ronan Lamy Branch: py3.7 Changeset: r97388:627350a3eb96 Date: 2019-09-06 15:08 +0200 http://bitbucket.org/pypy/pypy/changeset/627350a3eb96/ Log: Look for 3.7 instead of 3.6 in -A tests diff --git a/pypy/conftest.py b/pypy/conftest.py --- a/pypy/conftest.py +++ b/pypy/conftest.py @@ -5,7 +5,7 @@ # some tests fail otherwise sys.setrecursionlimit(2000) -LOOK_FOR_PYTHON3 = 'python3.6' +LOOK_FOR_PYTHON3 = 'python3.7' PYTHON3 = os.getenv('PYTHON3') or py.path.local.sysfind(LOOK_FOR_PYTHON3) if PYTHON3 is not None: PYTHON3 = str(PYTHON3) From pypy.commits at gmail.com Fri Sep 6 10:29:14 2019 From: pypy.commits at gmail.com (Yannick_Jadoul) Date: Fri, 06 Sep 2019 07:29:14 -0700 (PDT) Subject: [pypy-commit] pypy py3.7: Implemented __class_getitem__ from PEP 560 Message-ID: <5d726d3a.1c69fb81.3870.fccc@mx.google.com> Author: Yannick Jadoul Branch: py3.7 Changeset: r97389:4c3f7009c136 Date: 2019-09-06 15:33 +0200 http://bitbucket.org/pypy/pypy/changeset/4c3f7009c136/ Log: Implemented __class_getitem__ from PEP 560 diff --git a/pypy/objspace/descroperation.py b/pypy/objspace/descroperation.py --- a/pypy/objspace/descroperation.py +++ b/pypy/objspace/descroperation.py @@ -305,6 +305,8 @@ def getitem(space, w_obj, w_key): w_descr = space.lookup(w_obj, '__getitem__') + if w_descr is None and space.isinstance_w(w_obj, space.w_type): + w_descr = space.getattr(w_obj, space.newtext('__class_getitem__')) if w_descr is None: raise oefmt(space.w_TypeError, "'%T' object is not subscriptable (key %R)", diff --git a/pypy/objspace/std/test/test_typeobject.py b/pypy/objspace/std/test/test_typeobject.py --- a/pypy/objspace/std/test/test_typeobject.py +++ b/pypy/objspace/std/test/test_typeobject.py @@ -1400,6 +1400,39 @@ assert found == [1] """ + def test_class_getitem(self): + """ + class WithoutMetaclass: + def __getitem__(self, index): + return index + 1 + def __class_getitem__(cls, item): + return "{}[{}]".format(cls.__name__, item.__name__) + + class WithoutMetaclassSubclass(WithoutMetaclass): + def __getitem__(self, index): + return index + 1 + def __class_getitem__(cls, item): + return "{}[{}]".format(cls.__name__, item.__name__) + + assert WithoutMetaclass()[0] == 1 + assert WithoutMetaclass[int] == "WithoutMetaclass[int]" + assert WithoutMetaclassSubclass()[0] == 1 + assert WithoutMetaclassSubclass[int] == "WithoutMetaclassSubclass[int]" + + class Metaclass(type): + def __getitem__(self, item): + return "Metaclass[{}]".format(item.__name__) + + class WithMetaclass(metaclass=Metaclass): + def __getitem__(self, index): + return index + 1 + def __class_getitem__(cls, item): + return "{}[{}]".format(cls.__name__, item.__name__) + + assert WithMetaclass()[0] == 1 + assert WithMetaclass[int] == "Metaclass[int]" + """ + class AppTestWithMethodCacheCounter: spaceconfig = {"objspace.std.withmethodcachecounter": True} From pypy.commits at gmail.com Sat Sep 7 03:51:23 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 07 Sep 2019 00:51:23 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix translation Message-ID: <5d73617b.1c69fb81.7b85c.123f@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97390:02699fce1da0 Date: 2019-09-07 09:50 +0200 http://bitbucket.org/pypy/pypy/changeset/02699fce1da0/ Log: fix translation diff --git a/pypy/module/exceptions/interp_exceptions.py b/pypy/module/exceptions/interp_exceptions.py --- a/pypy/module/exceptions/interp_exceptions.py +++ b/pypy/module/exceptions/interp_exceptions.py @@ -353,7 +353,7 @@ if not space.is_w(self.w_path, space.w_None): space.setitem(w_dict, space.newtext("path"), self.w_path) if space.is_true(w_dict): - lst.append(w_dict) + lst = [lst[0], lst[1], w_dict] return space.newtuple(lst) def descr_setstate(self, space, w_dict): From pypy.commits at gmail.com Sat Sep 7 04:39:09 2019 From: pypy.commits at gmail.com (stevie_92) Date: Sat, 07 Sep 2019 01:39:09 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Simplified handling of rrc modern finalizers Message-ID: <5d736cad.1c69fb81.41bd8.418c@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97391:7bc15233822f Date: 2019-09-07 10:38 +0200 http://bitbucket.org/pypy/pypy/changeset/7bc15233822f/ Log: Simplified handling of rrc modern finalizers Added TODOs to improve pause times in rrc incmark Fixed bug in rrc mark diff --git a/rpython/memory/gc/rrc/base.py b/rpython/memory/gc/rrc/base.py --- a/rpython/memory/gc/rrc/base.py +++ b/rpython/memory/gc/rrc/base.py @@ -543,33 +543,10 @@ self.gc.trace(obj, self._collect_ref_rec, None) return True - def _check_finalizer(self): - # Check, if the cyclic isolate from the last collection cycle - # is reachable from outside, after the finalizers have been - # executed (and if all finalizers have been executed). - found_alive = self._gc_list_is_empty(self.pyobj_isolate_list) - if not found_alive: - found_alive = self._find_finalizer() - if not found_alive: - self._collect_roots(self.pyobj_old_list) - gchdr = self.pyobj_old_list.c_gc_next - while gchdr <> self.pyobj_old_list: - if (gchdr.c_gc_refs >> self.RAWREFCOUNT_REFS_SHIFT) > 0: - found_alive = True - break - gchdr = gchdr.c_gc_next - if found_alive: - self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) - return False - else: - self._gc_list_merge(self.pyobj_old_list, self.pyobj_dead_list) - return True - def _find_finalizer(self): gchdr = self.pyobj_old_list.c_gc_next while gchdr <> self.pyobj_old_list: - if self.finalizer_type(gchdr) == \ - self.RAWREFCOUNT_FINALIZER_MODERN: + if self.finalizer_type(gchdr) == self.RAWREFCOUNT_FINALIZER_MODERN: return True gchdr = gchdr.c_gc_next return False diff --git a/rpython/memory/gc/rrc/incmark.py b/rpython/memory/gc/rrc/incmark.py --- a/rpython/memory/gc/rrc/incmark.py +++ b/rpython/memory/gc/rrc/incmark.py @@ -13,35 +13,30 @@ return True if self.state == self.STATE_DEFAULT: - # First, untrack all tuples with only non-gc rrc objects and + # Merge all objects whose finalizer have been executed to the + # pyobj_list (to reprocess them again in the snapshot). Finalizers + # can only be executed once, so termination will eventually happen. + # Objects which have not been resurrected should be freed during + # this cycle. + if not self._gc_list_is_empty(self.pyobj_old_list): + self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) + + # Untrack all tuples with only non-gc rrc objects and # promote all other tuples to the pyobj_list self._untrack_tuples() - - merged_old_list = False - # check objects with finalizers from last collection cycle - if not self._gc_list_is_empty(self.pyobj_old_list): - merged_old_list = self._check_finalizer() - - # For all non-gc pyobjects which have a refcount > 0, - # mark all reachable objects on the pypy side - self.p_list_old.foreach(self._major_trace_nongc, False) + # TODO: execute incrementally? (before snapshot!) # Now take a snapshot self._take_snapshot(self.pyobj_list) # collect all rawrefcounted roots - self._collect_roots(self.pyobj_list) + self._collect_roots() + # TODO: execute incrementally (own phase, save index) - if merged_old_list: - # set all refcounts to zero for objects in dead list - # (might have been incremented) by fix_refcnt - gchdr = self.pyobj_dead_list.c_gc_next - while gchdr <> self.pyobj_dead_list: - if (gchdr.c_gc_refs > 0 and gchdr.c_gc_refs != - self.RAWREFCOUNT_REFS_UNTRACKED): - pyobj = self.snapshot_objs[gchdr.c_gc_refs - 1] - pyobj.refcnt_external = 0 - gchdr = gchdr.c_gc_next + # For all non-gc pyobjects which have a refcount > 0, + # mark all reachable objects on the pypy side + self.p_list_old.foreach(self._major_trace_nongc, False) + # TODO: execute incrementally self._debug_check_consistency(print_label="roots-marked") self.state = self.STATE_MARKING @@ -50,6 +45,7 @@ if self.state == self.STATE_MARKING: # mark all objects reachable from rawrefcounted roots all_rrc_marked = self._mark_rawrefcount() + # TODO: execute incrementally if (all_rrc_marked and not self.gc.objects_to_trace.non_empty() and not self.gc.more_objects_to_trace.non_empty()): @@ -136,7 +132,7 @@ self._debug_check_consistency(print_label="end-mark") return True - def _collect_roots(self, pygclist): + def _collect_roots(self): # Subtract all internal refcounts from the cyclic refcount # of rawrefcounted objects for i in range(0, self.total_objs): diff --git a/rpython/memory/gc/rrc/mark.py b/rpython/memory/gc/rrc/mark.py --- a/rpython/memory/gc/rrc/mark.py +++ b/rpython/memory/gc/rrc/mark.py @@ -4,6 +4,8 @@ class RawRefCountMarkGC(RawRefCountBaseGC): + use_refcntdict = False + def major_collection_trace_step(self): if not self.cycle_enabled: self._debug_check_consistency(print_label="begin-mark") @@ -18,28 +20,30 @@ # Only trace and mark rawrefcounted object if we are not doing # something special, like building gc.garbage. if self.state == self.STATE_MARKING and self.cycle_enabled: - merged_old_list = False - # check objects with finalizers from last collection cycle + # Merge all objects whose finalizer have been executed to the + # pyobj_list (to reprocess them again in the snapshot). Finalizers + # can only be executed once, so termination will eventually happen. + # Objects which have not been resurrected should be freed during + # this cycle. if not self._gc_list_is_empty(self.pyobj_old_list): - merged_old_list = self._check_finalizer() + self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) + # collect all rawrefcounted roots - self._collect_roots(self.pyobj_list) - if merged_old_list: - # set all refcounts to zero for objects in dead list - # (might have been incremented) by fix_refcnt - gchdr = self.pyobj_dead_list.c_gc_next - while gchdr <> self.pyobj_dead_list: - gchdr.c_gc_refs = 0 - gchdr = gchdr.c_gc_next + self._collect_roots() self._debug_check_consistency(print_label="roots-marked") + # mark all objects reachable from rawrefcounted roots self._mark_rawrefcount() self._debug_check_consistency(print_label="before-fin") + + # handle legacy finalizer self.state = self.STATE_GARBAGE_MARKING - if self._find_garbage(True): # handle legacy finalizers + if self._find_garbage(True): self._mark_garbage(True) self._debug_check_consistency(print_label="end-legacy-fin") self.state = self.STATE_MARKING + + # handle modern finalizer found_finalizer = self._find_finalizer() if found_finalizer: self._gc_list_move(self.pyobj_old_list, @@ -71,9 +75,9 @@ self._pyobj(pyobject).c_ob_pypy_link) return llmemory.cast_adr_to_ptr(obj, llmemory.GCREF) - def _collect_roots(self, pygclist): + def _collect_roots(self): # Initialize the cyclic refcount with the real refcount. - self._collect_roots_init_list(pygclist) + self._collect_roots_init_list(self.pyobj_list) # Save the real refcount of objects at border self.p_list_old.foreach(self._obj_save_refcnt, None) @@ -82,7 +86,7 @@ # Subtract all internal refcounts from the cyclic refcount # of rawrefcounted objects - self._collect_roots_subtract_internal(pygclist) + self._collect_roots_subtract_internal(self.pyobj_list) # For all non-gc pyobjects which have a refcount > 0, # mark all reachable objects on the pypy side From pypy.commits at gmail.com Sat Sep 7 04:53:47 2019 From: pypy.commits at gmail.com (stevie_92) Date: Sat, 07 Sep 2019 01:53:47 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Reverted handling of modern fin for rrc mark to improve termination Message-ID: <5d73701b.1c69fb81.4f60e.3e27@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97392:4afcd17db69f Date: 2019-09-07 10:53 +0200 http://bitbucket.org/pypy/pypy/changeset/4afcd17db69f/ Log: Reverted handling of modern fin for rrc mark to improve termination Added TODOs for rrc mark and incmark for modern finalizers diff --git a/rpython/memory/gc/rrc/base.py b/rpython/memory/gc/rrc/base.py --- a/rpython/memory/gc/rrc/base.py +++ b/rpython/memory/gc/rrc/base.py @@ -543,6 +543,36 @@ self.gc.trace(obj, self._collect_ref_rec, None) return True + def _check_finalizer(self): + # Check, if the cyclic isolate from the last collection cycle + # is reachable from outside, after the finalizers have been + # executed (and if all finalizers have been executed). Return + # True if some objects are reachable and thus have been resurrected. + + # check if the list has been fully processed since the last cycle + # (for safety) + found_alive = not self._gc_list_is_empty(self.pyobj_isolate_list) + + # check if all finalizers have actually been called (for safety) + if not found_alive: + found_alive = self._find_finalizer() + + # check if there are any objects with a reference count > 0 + if not found_alive: + gchdr = self.pyobj_old_list.c_gc_next + while gchdr <> self.pyobj_old_list: + if True: # TODO: check refcount or marked (see _collect_roots) + found_alive = True + break + gchdr = gchdr.c_gc_next + + if found_alive: + self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) + return True + else: + self._gc_list_merge(self.pyobj_old_list, self.pyobj_dead_list) + return False + def _find_finalizer(self): gchdr = self.pyobj_old_list.c_gc_next while gchdr <> self.pyobj_old_list: diff --git a/rpython/memory/gc/rrc/incmark.py b/rpython/memory/gc/rrc/incmark.py --- a/rpython/memory/gc/rrc/incmark.py +++ b/rpython/memory/gc/rrc/incmark.py @@ -13,6 +13,11 @@ return True if self.state == self.STATE_DEFAULT: + # For all non-gc pyobjects which have a refcount > 0, + # mark all reachable objects on the pypy side + self.p_list_old.foreach(self._major_trace_nongc, False) + # TODO: execute incrementally (own phase) + # Merge all objects whose finalizer have been executed to the # pyobj_list (to reprocess them again in the snapshot). Finalizers # can only be executed once, so termination will eventually happen. @@ -20,11 +25,13 @@ # this cycle. if not self._gc_list_is_empty(self.pyobj_old_list): self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) + # TODO: take snapshot of pyobj_old_list and perform _collect_roots + # incrementally (own phase) # Untrack all tuples with only non-gc rrc objects and # promote all other tuples to the pyobj_list self._untrack_tuples() - # TODO: execute incrementally? (before snapshot!) + # TODO: execute incrementally? (before snapshot!, own phase) # Now take a snapshot self._take_snapshot(self.pyobj_list) @@ -33,11 +40,6 @@ self._collect_roots() # TODO: execute incrementally (own phase, save index) - # For all non-gc pyobjects which have a refcount > 0, - # mark all reachable objects on the pypy side - self.p_list_old.foreach(self._major_trace_nongc, False) - # TODO: execute incrementally - self._debug_check_consistency(print_label="roots-marked") self.state = self.STATE_MARKING return False diff --git a/rpython/memory/gc/rrc/mark.py b/rpython/memory/gc/rrc/mark.py --- a/rpython/memory/gc/rrc/mark.py +++ b/rpython/memory/gc/rrc/mark.py @@ -20,18 +20,25 @@ # Only trace and mark rawrefcounted object if we are not doing # something special, like building gc.garbage. if self.state == self.STATE_MARKING and self.cycle_enabled: - # Merge all objects whose finalizer have been executed to the - # pyobj_list (to reprocess them again in the snapshot). Finalizers - # can only be executed once, so termination will eventually happen. - # Objects which have not been resurrected should be freed during - # this cycle. + + # check if objects with finalizers from last collection cycle + # have been resurrected + dead_list_empty = True if not self._gc_list_is_empty(self.pyobj_old_list): - self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) + dead_list_empty = self._check_finalizer() # collect all rawrefcounted roots self._collect_roots() self._debug_check_consistency(print_label="roots-marked") + if not dead_list_empty: + # set all refcounts to zero for objects in dead list + # (might have been incremented) by fix_refcnt + gchdr = self.pyobj_dead_list.c_gc_next + while gchdr <> self.pyobj_dead_list: + gchdr.c_gc_refs = 0 + gchdr = gchdr.c_gc_next + # mark all objects reachable from rawrefcounted roots self._mark_rawrefcount() self._debug_check_consistency(print_label="before-fin") From pypy.commits at gmail.com Sat Sep 7 05:15:33 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 07 Sep 2019 02:15:33 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: re-enable accidentally disabled test Message-ID: <5d737535.1c69fb81.86d9a.0948@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97393:fd59acda554b Date: 2019-09-07 10:17 +0200 http://bitbucket.org/pypy/pypy/changeset/fd59acda554b/ Log: re-enable accidentally disabled test diff --git a/pypy/interpreter/test/test_pyframe.py b/pypy/interpreter/test/test_pyframe.py --- a/pypy/interpreter/test/test_pyframe.py +++ b/pypy/interpreter/test/test_pyframe.py @@ -62,7 +62,7 @@ jump_out_of_block_forwards.jump = (3, 5) jump_out_of_block_forwards.output = [2, 5] - #run_test(jump_out_of_block_forwards) + run_test(jump_out_of_block_forwards) def jump_out_of_block_backwards(output): output.append(1) From pypy.commits at gmail.com Sat Sep 7 05:15:34 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 07 Sep 2019 02:15:34 -0700 (PDT) Subject: [pypy-commit] pypy py3.6-fix-set-lineno: branch to try to fix the bugs in setting line number of a frame Message-ID: <5d737536.1c69fb81.fdd80.2433@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6-fix-set-lineno Changeset: r97394:577840a9fd64 Date: 2019-09-07 11:14 +0200 http://bitbucket.org/pypy/pypy/changeset/577840a9fd64/ Log: branch to try to fix the bugs in setting line number of a frame diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py --- a/pypy/interpreter/pyframe.py +++ b/pypy/interpreter/pyframe.py @@ -6,24 +6,23 @@ from rpython.rlib.debug import make_sure_not_resized, check_nonneg from rpython.rlib.debug import ll_assert_not_none from rpython.rlib.jit import hint -from rpython.rlib.objectmodel import instantiate, specialize, we_are_translated +from rpython.rlib.objectmodel import instantiate, we_are_translated from rpython.rlib.objectmodel import not_rpython -from rpython.rlib.rarithmetic import intmask, r_uint +from rpython.rlib.rarithmetic import r_uint from rpython.tool.pairtype import extendabletype from pypy.interpreter import pycode, pytraceback from pypy.interpreter.argument import Arguments from pypy.interpreter.astcompiler import consts from pypy.interpreter.baseobjspace import W_Root -from pypy.interpreter.error import ( - OperationError, get_cleared_operation_error, oefmt) +from pypy.interpreter.error import OperationError, oefmt from pypy.interpreter.executioncontext import ExecutionContext from pypy.interpreter.nestedscope import Cell from pypy.tool import stdlib_opcode # Define some opcodes used for op in '''DUP_TOP POP_TOP SETUP_LOOP SETUP_EXCEPT SETUP_FINALLY SETUP_WITH -SETUP_ASYNC_WITH POP_BLOCK END_FINALLY'''.split(): +SETUP_ASYNC_WITH POP_BLOCK END_FINALLY RETURN_VALUE'''.split(): globals()[op] = stdlib_opcode.opmap[op] class FrameDebugData(object): @@ -684,6 +683,7 @@ raise oefmt(space.w_ValueError, "can't jump to 'except' line as there's no exception") + import pdb; pdb.set_trace() # Don't jump inside or out of an except or a finally block. # Note that CPython doesn't check except blocks, # but that results in crashes (tested on 3.5.2+). @@ -705,6 +705,12 @@ setup_op = ord(code[blockstack.pop()]) if setup_op != SETUP_LOOP: endblock.append(addr) + elif op == RETURN_VALUE: + if len(blockstack) != 0: + # jump to finally block + setup_op = ord(code[blockstack.pop()]) + assert setup_op == SETUP_FINALLY + endblock.append(addr) elif op == END_FINALLY: if len(endblock) <= 1: raise oefmt(space.w_SystemError, diff --git a/pypy/interpreter/test/test_pyframe.py b/pypy/interpreter/test/test_pyframe.py --- a/pypy/interpreter/test/test_pyframe.py +++ b/pypy/interpreter/test/test_pyframe.py @@ -48,7 +48,13 @@ tracer = JumpTracer(func) sys.settrace(tracer.trace) output = [] - func(output) + if getattr(func, "error", None) is None: + func(output) + else: + try: + func(output) + except BaseException as e: + assert type(e) is func.error sys.settrace(None) assert func.output == output @@ -77,6 +83,20 @@ jump_out_of_block_backwards.output = [1, 3, 5, 1, 3, 5, 6, 7] run_test(jump_out_of_block_backwards) + def jump_in_nested_finally_2(output): + try: + output.append(2) + 1/0 + return + finally: + output.append(6) + output.append(7) + output.append(8) + jump_in_nested_finally_2.jump = (6, 7) + jump_in_nested_finally_2.output = [2, 7] + jump_in_nested_finally_2.error = ZeroDivisionError + run_test(jump_in_nested_finally_2) + def test_f_back_hidden(self): if not hasattr(self, 'call_further'): skip("not for runappdirect testing") From pypy.commits at gmail.com Sat Sep 7 07:58:56 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 07 Sep 2019 04:58:56 -0700 (PDT) Subject: [pypy-commit] pypy codec_errorhandler: add failing codec errorhandler test Message-ID: <5d739b80.1c69fb81.63f0.12e4@mx.google.com> Author: Matti Picus Branch: codec_errorhandler Changeset: r97396:a6ee1c3084ed Date: 2019-09-06 08:06 +0200 http://bitbucket.org/pypy/pypy/changeset/a6ee1c3084ed/ Log: add failing codec errorhandler test diff --git a/pypy/module/_codecs/test/test_codecs.py b/pypy/module/_codecs/test/test_codecs.py --- a/pypy/module/_codecs/test/test_codecs.py +++ b/pypy/module/_codecs/test/test_codecs.py @@ -1006,6 +1006,22 @@ 1, 1 + n, "ouch") ) == (s[:1], 1 + n) + def test_replace_with_long(self): + #bpo-32583 + import codecs + def replace_with_long(exc): + if isinstance(exc, UnicodeDecodeError): + exc.object = b"\x00" * 8 + return ('\ufffd', exc.start) + else: + raise TypeError("don't know how to handle %r" % exc) + codecs.register_error("test.rep_w_long", replace_with_long) + + ret = b'\x00'.decode('utf-16', 'test.rep_w_long') + assert ret == '\ufffd\x00\x00\x00\x00' + ret = b'\x00'.decode('utf-32', 'test.rep_w_long') + assert ret == '\ufffd\x00\x00' + def test_badhandler(self): import codecs results = ( 42, u"foo", (1,2,3), (u"foo", 1, 3), (u"foo", None), (u"foo",), ("foo", 1, 3), ("foo", None), ("foo",) ) From pypy.commits at gmail.com Sat Sep 7 07:58:58 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 07 Sep 2019 04:58:58 -0700 (PDT) Subject: [pypy-commit] pypy codec_errorhandler: disallow changing the exc.object since we cannot modify the input bytes in-place Message-ID: <5d739b82.1c69fb81.b7262.bdeb@mx.google.com> Author: Matti Picus Branch: codec_errorhandler Changeset: r97397:2935e5510fa8 Date: 2019-09-07 12:01 +0200 http://bitbucket.org/pypy/pypy/changeset/2935e5510fa8/ Log: disallow changing the exc.object since we cannot modify the input bytes in-place diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -1180,7 +1180,7 @@ result.append(r) r = result.build() lgt = rutf8.check_utf8(r, True) - return result.build(), lgt, pos, bo + return r, lgt, pos, bo def _STORECHAR(result, CH, byteorder): hi = chr(((CH) >> 8) & 0xff) diff --git a/pypy/module/_codecs/interp_codecs.py b/pypy/module/_codecs/interp_codecs.py --- a/pypy/module/_codecs/interp_codecs.py +++ b/pypy/module/_codecs/interp_codecs.py @@ -83,6 +83,15 @@ msg = ("encoding error handler must return " "(str/bytes, int) tuple") raise OperationError(space.w_TypeError, space.newtext(msg)) + # PyPy does not support modifying the input string (the exc.object) + # CPython copies back the un-decoded part, since it can modify the + # input in-place + inputobj = space.bytes_w(space.getattr(w_exc, + space.newtext('object'))) + if input != inputobj + raise oefmt(space.w_RuntimeError, + "PyPy does not support modifying the exc.object " + "in an error handler") try: newpos = space.int_w(w_newpos) except OperationError as e: diff --git a/pypy/module/_codecs/test/test_codecs.py b/pypy/module/_codecs/test/test_codecs.py --- a/pypy/module/_codecs/test/test_codecs.py +++ b/pypy/module/_codecs/test/test_codecs.py @@ -1006,7 +1006,7 @@ 1, 1 + n, "ouch") ) == (s[:1], 1 + n) - def test_replace_with_long(self): + def test_replace_with_longer(self): #bpo-32583 import codecs def replace_with_long(exc): From pypy.commits at gmail.com Sat Sep 7 07:58:59 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 07 Sep 2019 04:58:59 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: maybe fix 585e24d5f093 Message-ID: <5d739b83.1c69fb81.29842.60a4@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97398:14e8383d83e7 Date: 2019-09-07 13:57 +0200 http://bitbucket.org/pypy/pypy/changeset/14e8383d83e7/ Log: maybe fix 585e24d5f093 diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py --- a/pypy/interpreter/generator.py +++ b/pypy/interpreter/generator.py @@ -786,6 +786,7 @@ # is done. raise OperationError(space.w_StopIteration, space.w_None) if e.match(space, space.w_GeneratorExit): - # Ignore this error. - raise OperationError(space.w_StopIteration, space.w_None) + if self.w_exc_type is None: + # Ignore this error. + raise OperationError(space.w_StopIteration, space.w_None) raise e From pypy.commits at gmail.com Sat Sep 7 08:06:44 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 07 Sep 2019 05:06:44 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: tests should gc.collect before checking weakrefs Message-ID: <5d739d54.1c69fb81.8ca0.d722@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97399:831c8760bfbd Date: 2019-09-07 14:06 +0200 http://bitbucket.org/pypy/pypy/changeset/831c8760bfbd/ Log: tests should gc.collect before checking weakrefs diff --git a/lib-python/3/test/test_concurrent_futures.py b/lib-python/3/test/test_concurrent_futures.py --- a/lib-python/3/test/test_concurrent_futures.py +++ b/lib-python/3/test/test_concurrent_futures.py @@ -428,6 +428,7 @@ futures_list.remove(future) wr = weakref.ref(future) del future + test.support.gc_collect() self.assertIsNone(wr()) futures_list[0].set_result("test") @@ -435,6 +436,7 @@ futures_list.remove(future) wr = weakref.ref(future) del future + test.support.gc_collect() self.assertIsNone(wr()) if futures_list: futures_list[0].set_result("test") @@ -533,6 +535,7 @@ for obj in self.executor.map(make_dummy_object, range(10)): wr = weakref.ref(obj) del obj + test.support.gc_collect() self.assertIsNone(wr()) From pypy.commits at gmail.com Sat Sep 7 08:12:29 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 07 Sep 2019 05:12:29 -0700 (PDT) Subject: [pypy-commit] pypy py3.6-fix-set-lineno: one further test that I am not managing to pass Message-ID: <5d739ead.1c69fb81.d051a.a962@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6-fix-set-lineno Changeset: r97400:fbbc3ef982ba Date: 2019-09-07 14:11 +0200 http://bitbucket.org/pypy/pypy/changeset/fbbc3ef982ba/ Log: one further test that I am not managing to pass diff --git a/pypy/interpreter/test/test_pyframe.py b/pypy/interpreter/test/test_pyframe.py --- a/pypy/interpreter/test/test_pyframe.py +++ b/pypy/interpreter/test/test_pyframe.py @@ -44,6 +44,17 @@ self.done = True return self.trace + def jump_test(jumpFrom, jumpTo, expected, error=None, event='line'): + """Decorator that creates a test that makes a jump + from one place to another in the following code. + """ + def decorator(func): + func.jump = (jumpFrom, jumpTo) + func.output = expected + func.error = error + return func + return decorator + def run_test(func): tracer = JumpTracer(func) sys.settrace(tracer.trace) @@ -97,6 +108,19 @@ jump_in_nested_finally_2.error = ZeroDivisionError run_test(jump_in_nested_finally_2) + @jump_test(3, 6, [1, 6, 8, 9]) + def jump_over_return_in_try_finally_block(output): + output.append(1) + try: + output.append(3) + if not output: # always false + return + output.append(6) + finally: + output.append(8) + output.append(9) + run_test(jump_over_return_in_try_finally_block) + def test_f_back_hidden(self): if not hasattr(self, 'call_further'): skip("not for runappdirect testing") From pypy.commits at gmail.com Sat Sep 7 11:58:21 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 07 Sep 2019 08:58:21 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix up the position of AST nodes of the expressions with an f-string Message-ID: <5d73d39d.1c69fb81.3ce60.ec36@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97401:ce93612a2d0c Date: 2019-09-07 17:56 +0200 http://bitbucket.org/pypy/pypy/changeset/ce93612a2d0c/ Log: fix up the position of AST nodes of the expressions with an f-string diff --git a/pypy/interpreter/astcompiler/ast.py b/pypy/interpreter/astcompiler/ast.py --- a/pypy/interpreter/astcompiler/ast.py +++ b/pypy/interpreter/astcompiler/ast.py @@ -2740,9 +2740,9 @@ w_metavar = get_field(space, w_node, 'metavar', False) w_lineno = get_field(space, w_node, 'lineno', False) w_col_offset = get_field(space, w_node, 'col_offset', False) - _metavar = space.int_w(w_metavar) - _lineno = space.int_w(w_lineno) - _col_offset = space.int_w(w_col_offset) + _metavar = obj_to_int(space, w_metavar, False) + _lineno = obj_to_int(space, w_lineno, False) + _col_offset = obj_to_int(space, w_col_offset, False) return RevDBMetaVar(_metavar, _lineno, _col_offset) State.ast_type('RevDBMetaVar', 'expr', ['metavar']) diff --git a/pypy/interpreter/astcompiler/fstring.py b/pypy/interpreter/astcompiler/fstring.py --- a/pypy/interpreter/astcompiler/fstring.py +++ b/pypy/interpreter/astcompiler/fstring.py @@ -25,7 +25,7 @@ def f_constant_string(astbuilder, joined_pieces, w_u, atom_node): add_constant_string(astbuilder, joined_pieces, w_u, atom_node) -def f_string_compile(astbuilder, source, atom_node): +def f_string_compile(astbuilder, source, atom_node, fstr): # Note: a f-string is kept as a single literal up to here. # At this point only, we recursively call the AST compiler # on all the '{expr}' parts. The 'expr' part is not parsed @@ -44,16 +44,43 @@ astbuilder.error("internal error: parser not available for parsing " "the expressions inside the f-string", atom_node) assert isinstance(source, str) # utf-8 encoded - source = '(%s)' % source + + paren_source = '(%s)' % source # to deal with whitespace at the start of source + + lineno = 0 + column_offset = 0 + if fstr.stnode: + stnode = fstr.stnode + lineno = stnode.get_lineno() - 1 # one-based + # CPython has an equivalent hack :-( + column_offset = stnode.value.find(source) + stnode.get_column() info = pyparse.CompileInfo("", "eval", consts.PyCF_SOURCE_IS_UTF8 | consts.PyCF_IGNORE_COOKIE, optimize=astbuilder.compile_info.optimize) parser = astbuilder.recursive_parser - parse_tree = parser.parse_source(source, info) - return ast_from_node(astbuilder.space, parse_tree, info, - recursive_parser=parser) + parse_tree = parser.parse_source(paren_source, info) + + return fixup_fstring_positions( + ast_from_node(astbuilder.space, parse_tree, info, + recursive_parser=parser), + lineno, column_offset) + +def fixup_fstring_positions(ast, line_offset, column_offset): + visitor = FixPosVisitor(line_offset, column_offset) + return ast.mutate_over(visitor) + +class FixPosVisitor(ast.ASTVisitor): + def __init__(self, line_offset, column_offset): + self.line_offset = line_offset + self.column_offset = column_offset + + def default_visitor(self, node): + if isinstance(node, ast.stmt) or isinstance(node, ast.expr): + node.lineno += self.line_offset + node.col_offset += self.column_offset + return node def unexpected_end_of_string(astbuilder, atom_node): @@ -177,7 +204,7 @@ # Compile the expression as soon as possible, so we show errors # related to the expression before errors related to the # conversion or format_spec. - expr = f_string_compile(astbuilder, s[expr_start:i], atom_node) + expr = f_string_compile(astbuilder, s[expr_start:i], atom_node, fstr) assert isinstance(expr, ast.Expression) # Check for a conversion char, if present. @@ -345,7 +372,7 @@ child = atom_node.get_child(i) try: w_next = parsestring.parsestr( - space, encoding, child.get_value()) + space, encoding, child.get_value(), child) if not isinstance(w_next, parsestring.W_FString): add_constant_string(astbuilder, joined_pieces, w_next, atom_node) diff --git a/pypy/interpreter/astcompiler/test/test_astbuilder.py b/pypy/interpreter/astcompiler/test/test_astbuilder.py --- a/pypy/interpreter/astcompiler/test/test_astbuilder.py +++ b/pypy/interpreter/astcompiler/test/test_astbuilder.py @@ -22,7 +22,7 @@ flags = consts.CO_FUTURE_WITH_STATEMENT info = pyparse.CompileInfo("", p_mode, flags) tree = self.parser.parse_source(source, info) - ast_node = ast_from_node(self.space, tree, info) + ast_node = ast_from_node(self.space, tree, info, self.parser) return ast_node def get_first_expr(self, source, p_mode=None, flags=None): @@ -1476,3 +1476,8 @@ " bytes in position 0-1: truncated \\xXX escape") assert exc.lineno == 2 assert exc.offset == 6 + + def test_fstring_lineno(self): + mod = self.get_ast('x=1\nf"{ x + 1}"') + assert mod.body[1].value.values[0].value.lineno == 2 + assert mod.body[1].value.values[0].value.col_offset == 8 diff --git a/pypy/interpreter/pyparser/parsestring.py b/pypy/interpreter/pyparser/parsestring.py --- a/pypy/interpreter/pyparser/parsestring.py +++ b/pypy/interpreter/pyparser/parsestring.py @@ -7,14 +7,15 @@ class W_FString(W_Root): - def __init__(self, unparsed, raw_mode): + def __init__(self, unparsed, raw_mode, stnode): assert isinstance(unparsed, str) # utf-8 encoded string self.unparsed = unparsed # but the quotes are removed self.raw_mode = raw_mode self.current_index = 0 # for astcompiler.fstring + self.stnode = stnode -def parsestr(space, encoding, s): +def parsestr(space, encoding, s, stnode=None): """Parses a string or unicode literal, and return usually a wrapped value. If we get an f-string, then instead return an unparsed but unquoted W_FString instance. @@ -88,7 +89,7 @@ if unicode_literal and not rawmode: # XXX Py_UnicodeFlag is ignored for now assert 0 <= ps <= q if saw_f: - return W_FString(s[ps:q], rawmode) + return W_FString(s[ps:q], rawmode, stnode) if encoding is None: substr = s[ps:q] else: @@ -112,7 +113,7 @@ if not unicode_literal: return space.newbytes(substr) elif saw_f: - return W_FString(substr, rawmode) + return W_FString(substr, rawmode, stnode) else: v = unicodehelper.str_decode_utf8(substr, 'strict', True, None) return space.newtext(*v) From pypy.commits at gmail.com Sat Sep 7 12:30:05 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 07 Sep 2019 09:30:05 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix translation? Message-ID: <5d73db0d.1c69fb81.39c22.471f@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97402:154e8302eb39 Date: 2019-09-07 18:29 +0200 http://bitbucket.org/pypy/pypy/changeset/154e8302eb39/ Log: fix translation? diff --git a/pypy/interpreter/astcompiler/fstring.py b/pypy/interpreter/astcompiler/fstring.py --- a/pypy/interpreter/astcompiler/fstring.py +++ b/pypy/interpreter/astcompiler/fstring.py @@ -53,7 +53,9 @@ stnode = fstr.stnode lineno = stnode.get_lineno() - 1 # one-based # CPython has an equivalent hack :-( - column_offset = stnode.value.find(source) + stnode.get_column() + value = stnode.get_value() + if value is not None: + column_offset = value.find(source) + stnode.get_column() info = pyparse.CompileInfo("", "eval", consts.PyCF_SOURCE_IS_UTF8 | From pypy.commits at gmail.com Sat Sep 7 13:57:37 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 07 Sep 2019 10:57:37 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: do visitor differently Message-ID: <5d73ef91.1c69fb81.91aff.0835@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97403:6be03434acd9 Date: 2019-09-07 19:57 +0200 http://bitbucket.org/pypy/pypy/changeset/6be03434acd9/ Log: do visitor differently diff --git a/pypy/interpreter/astcompiler/ast.py b/pypy/interpreter/astcompiler/ast.py --- a/pypy/interpreter/astcompiler/ast.py +++ b/pypy/interpreter/astcompiler/ast.py @@ -4291,19 +4291,27 @@ class GenericASTVisitor(ASTVisitor): + def visited(self, node): + pass # base implementation + def visit_Module(self, node): + self.visited(node) self.visit_sequence(node.body) def visit_Interactive(self, node): + self.visited(node) self.visit_sequence(node.body) def visit_Expression(self, node): + self.visited(node) node.body.walkabout(self) def visit_Suite(self, node): + self.visited(node) self.visit_sequence(node.body) def visit_FunctionDef(self, node): + self.visited(node) node.args.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.decorator_list) @@ -4311,6 +4319,7 @@ node.returns.walkabout(self) def visit_AsyncFunctionDef(self, node): + self.visited(node) node.args.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.decorator_list) @@ -4318,214 +4327,269 @@ node.returns.walkabout(self) def visit_ClassDef(self, node): + self.visited(node) self.visit_sequence(node.bases) self.visit_sequence(node.keywords) self.visit_sequence(node.body) self.visit_sequence(node.decorator_list) def visit_Return(self, node): + self.visited(node) if node.value: node.value.walkabout(self) def visit_Delete(self, node): + self.visited(node) self.visit_sequence(node.targets) def visit_Assign(self, node): + self.visited(node) self.visit_sequence(node.targets) node.value.walkabout(self) def visit_AugAssign(self, node): + self.visited(node) node.target.walkabout(self) node.value.walkabout(self) def visit_AnnAssign(self, node): + self.visited(node) node.target.walkabout(self) node.annotation.walkabout(self) if node.value: node.value.walkabout(self) def visit_For(self, node): + self.visited(node) node.target.walkabout(self) node.iter.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.orelse) def visit_AsyncFor(self, node): + self.visited(node) node.target.walkabout(self) node.iter.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.orelse) def visit_While(self, node): + self.visited(node) node.test.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.orelse) def visit_If(self, node): + self.visited(node) node.test.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.orelse) def visit_With(self, node): + self.visited(node) self.visit_sequence(node.items) self.visit_sequence(node.body) def visit_AsyncWith(self, node): + self.visited(node) self.visit_sequence(node.items) self.visit_sequence(node.body) def visit_Raise(self, node): + self.visited(node) if node.exc: node.exc.walkabout(self) if node.cause: node.cause.walkabout(self) def visit_Try(self, node): + self.visited(node) self.visit_sequence(node.body) self.visit_sequence(node.handlers) self.visit_sequence(node.orelse) self.visit_sequence(node.finalbody) def visit_Assert(self, node): + self.visited(node) node.test.walkabout(self) if node.msg: node.msg.walkabout(self) def visit_Import(self, node): + self.visited(node) self.visit_sequence(node.names) def visit_ImportFrom(self, node): + self.visited(node) self.visit_sequence(node.names) def visit_Global(self, node): + self.visited(node) pass def visit_Nonlocal(self, node): + self.visited(node) pass def visit_Expr(self, node): + self.visited(node) node.value.walkabout(self) def visit_Pass(self, node): + self.visited(node) pass def visit_Break(self, node): + self.visited(node) pass def visit_Continue(self, node): + self.visited(node) pass def visit_BoolOp(self, node): + self.visited(node) self.visit_sequence(node.values) def visit_BinOp(self, node): + self.visited(node) node.left.walkabout(self) node.right.walkabout(self) def visit_UnaryOp(self, node): + self.visited(node) node.operand.walkabout(self) def visit_Lambda(self, node): + self.visited(node) node.args.walkabout(self) node.body.walkabout(self) def visit_IfExp(self, node): + self.visited(node) node.test.walkabout(self) node.body.walkabout(self) node.orelse.walkabout(self) def visit_Dict(self, node): + self.visited(node) self.visit_sequence(node.keys) self.visit_sequence(node.values) def visit_Set(self, node): + self.visited(node) self.visit_sequence(node.elts) def visit_ListComp(self, node): + self.visited(node) node.elt.walkabout(self) self.visit_sequence(node.generators) def visit_SetComp(self, node): + self.visited(node) node.elt.walkabout(self) self.visit_sequence(node.generators) def visit_DictComp(self, node): + self.visited(node) node.key.walkabout(self) node.value.walkabout(self) self.visit_sequence(node.generators) def visit_GeneratorExp(self, node): + self.visited(node) node.elt.walkabout(self) self.visit_sequence(node.generators) def visit_Await(self, node): + self.visited(node) node.value.walkabout(self) def visit_Yield(self, node): + self.visited(node) if node.value: node.value.walkabout(self) def visit_YieldFrom(self, node): + self.visited(node) node.value.walkabout(self) def visit_Compare(self, node): + self.visited(node) node.left.walkabout(self) self.visit_sequence(node.comparators) def visit_Call(self, node): + self.visited(node) node.func.walkabout(self) self.visit_sequence(node.args) self.visit_sequence(node.keywords) def visit_Num(self, node): + self.visited(node) pass def visit_Str(self, node): + self.visited(node) pass def visit_RevDBMetaVar(self, node): + self.visited(node) pass def visit_FormattedValue(self, node): + self.visited(node) node.value.walkabout(self) if node.format_spec: node.format_spec.walkabout(self) def visit_JoinedStr(self, node): + self.visited(node) self.visit_sequence(node.values) def visit_Bytes(self, node): + self.visited(node) pass def visit_NameConstant(self, node): + self.visited(node) pass def visit_Ellipsis(self, node): + self.visited(node) pass def visit_Constant(self, node): + self.visited(node) pass def visit_Attribute(self, node): + self.visited(node) node.value.walkabout(self) def visit_Subscript(self, node): + self.visited(node) node.value.walkabout(self) node.slice.walkabout(self) def visit_Starred(self, node): + self.visited(node) node.value.walkabout(self) def visit_Name(self, node): + self.visited(node) pass def visit_List(self, node): + self.visited(node) self.visit_sequence(node.elts) def visit_Tuple(self, node): + self.visited(node) self.visit_sequence(node.elts) def visit_Slice(self, node): + self.visited(node) if node.lower: node.lower.walkabout(self) if node.upper: @@ -4534,22 +4598,27 @@ node.step.walkabout(self) def visit_ExtSlice(self, node): + self.visited(node) self.visit_sequence(node.dims) def visit_Index(self, node): + self.visited(node) node.value.walkabout(self) def visit_comprehension(self, node): + self.visited(node) node.target.walkabout(self) node.iter.walkabout(self) self.visit_sequence(node.ifs) def visit_ExceptHandler(self, node): + self.visited(node) if node.type: node.type.walkabout(self) self.visit_sequence(node.body) def visit_arguments(self, node): + self.visited(node) self.visit_sequence(node.args) if node.vararg: node.vararg.walkabout(self) @@ -4560,16 +4629,20 @@ self.visit_sequence(node.defaults) def visit_arg(self, node): + self.visited(node) if node.annotation: node.annotation.walkabout(self) def visit_keyword(self, node): + self.visited(node) node.value.walkabout(self) def visit_alias(self, node): + self.visited(node) pass def visit_withitem(self, node): + self.visited(node) node.context_expr.walkabout(self) if node.optional_vars: node.optional_vars.walkabout(self) diff --git a/pypy/interpreter/astcompiler/fstring.py b/pypy/interpreter/astcompiler/fstring.py --- a/pypy/interpreter/astcompiler/fstring.py +++ b/pypy/interpreter/astcompiler/fstring.py @@ -64,25 +64,24 @@ parser = astbuilder.recursive_parser parse_tree = parser.parse_source(paren_source, info) - return fixup_fstring_positions( - ast_from_node(astbuilder.space, parse_tree, info, - recursive_parser=parser), - lineno, column_offset) + ast = ast_from_node(astbuilder.space, parse_tree, info, + recursive_parser=parser) + fixup_fstring_positions(ast, lineno, column_offset) + return ast def fixup_fstring_positions(ast, line_offset, column_offset): visitor = FixPosVisitor(line_offset, column_offset) - return ast.mutate_over(visitor) + ast.walkabout(visitor) -class FixPosVisitor(ast.ASTVisitor): +class FixPosVisitor(ast.GenericASTVisitor): def __init__(self, line_offset, column_offset): self.line_offset = line_offset self.column_offset = column_offset - def default_visitor(self, node): + def visited(self, node): if isinstance(node, ast.stmt) or isinstance(node, ast.expr): node.lineno += self.line_offset node.col_offset += self.column_offset - return node def unexpected_end_of_string(astbuilder, atom_node): diff --git a/pypy/interpreter/astcompiler/tools/asdl_py.py b/pypy/interpreter/astcompiler/tools/asdl_py.py --- a/pypy/interpreter/astcompiler/tools/asdl_py.py +++ b/pypy/interpreter/astcompiler/tools/asdl_py.py @@ -341,6 +341,9 @@ def visitModule(self, mod): self.emit("class GenericASTVisitor(ASTVisitor):") self.emit("") + self.emit("def visited(self, node):", 1) + self.emit("pass # base implementation", 2) + self.emit("") super(GenericASTVisitorVisitor, self).visitModule(mod) self.emit("") @@ -357,6 +360,7 @@ def make_visitor(self, name, fields): self.emit("def visit_%s(self, node):" % (name,), 1) + self.emit("self.visited(node)", 2) have_body = False for field in fields: if self.visitField(field): From pypy.commits at gmail.com Sat Sep 7 18:04:37 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Sat, 07 Sep 2019 15:04:37 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Implemented read_console_w Message-ID: <5d742975.1c69fb81.e9c25.f6b1@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97404:b164d0841d7d Date: 2019-09-07 23:02 +0100 http://bitbucket.org/pypy/pypy/changeset/b164d0841d7d/ Log: Implemented read_console_w diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -29,7 +29,7 @@ raise oefmt(space.w_ValueError, "I/O operation on closed file") -def read_console_w(handle, maxlen, readlen): +def read_console_w(space, handle, maxlen, readlen): err = 0 sig = 0 buf = lltype.malloc(rwin32.CWCHARP, maxlen, flavor='raw') @@ -39,7 +39,8 @@ off = 0 while off < maxlen: - with lltype.scoped_alloc(rwin32.LPDWORD.TO, -1) as n: + with lltype.scoped_alloc(rwin32.LPDWORD.TO, 1) as n: + n[0] = -1 len = min(maxlen - off, BUFSIZE) rwin32.SetLastError_saved(0) res = rwin32.ReadConsoleW(handle, buf[off], len, n, rffi.NULL) @@ -55,11 +56,43 @@ break err = 0 hInterruptEvent = sigintevent() + if rwin32.WaitForSingleObjectEx(hInterruptEvent, 100, False) == rwin32.WAIT_OBJECT_0: + rwin32.ResetEvent(hInterruptEvent) + space.getexecutioncontext().checksignals() + + readlen += n + + # We didn't manage to read the whole buffer + # don't try again as it will just block + if n < len: + break + + # We read a new line + if buf[readlen -1] == '\n': + break + + with lltype.scoped_alloc(rwin32.LPWORD.TO, 1) as char_type: + if off + BUFSIZ >= maxlen and \ + rwin32.GetStringTypeW(rwin32.CT_CTYPE3, buf[readlen - 1], 1, char_type) and \ + char_type == rwin32.C3_HIGHSURROGATE: + maxlen += 1 + newbuf = lltype.malloc(rwin32.CWCHARP, maxlen, flavor='raw') + lltype.free(buf, flavor='raw') + buf = newbuf + off += n + continue + off += BUFSIZ + if err: + return None + + if readlen > 0 and buf[0] == '\x1a': + lltype.free(buf, flavor='raw') + buf = lltype.malloc(rwin32.CWCHARP, 1, flavor='raw') + buf[0] = '\0' + readlen = 0 finally: lltype.free(buf, flavor='raw') - - - + def _get_console_type(handle): mode = lltype.malloc(rwin32.LPDWORD.TO,0,flavor='raw') @@ -338,7 +371,7 @@ return space.newint(read_len) with lltype.scoped_alloc(rwin32.LPDWORD.TO, 1) as n: - wbuf = read_console_w(self.handle, wlen , n) + wbuf = read_console_w(space, self.handle, wlen , n) if not wbuf: return space.newint(-1) From pypy.commits at gmail.com Sun Sep 8 03:25:47 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 08 Sep 2019 00:25:47 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fwiw, we do not acutally probe for ndbm, and always use the Berkeley db one Message-ID: <5d74acfb.1c69fb81.41bd8.e1cb@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97405:901a4cb8be49 Date: 2019-09-08 09:25 +0200 http://bitbucket.org/pypy/pypy/changeset/901a4cb8be49/ Log: fwiw, we do not acutally probe for ndbm, and always use the Berkeley db one diff --git a/lib_pypy/_dbm.py b/lib_pypy/_dbm.py --- a/lib_pypy/_dbm.py +++ b/lib_pypy/_dbm.py @@ -149,7 +149,7 @@ lib = CDLL("/usr/lib/libdbm.dylib") # OS X _platform = 'osx' -library = "GNU gdbm" +library = "Berkeley DB" funcs = {} _init_func('open', (c_char_p, c_int, c_int), restype=c_void_p) From pypy.commits at gmail.com Sun Sep 8 07:13:02 2019 From: pypy.commits at gmail.com (Julian Berman) Date: Sun, 08 Sep 2019 04:13:02 -0700 (PDT) Subject: [pypy-commit] pypy openssl-for-macos: Allow force-rebuilding modules in build_cffi_imports even if they're built. Message-ID: <5d74e23e.1c69fb81.7b85c.ca8a@mx.google.com> Author: Julian Berman Branch: openssl-for-macos Changeset: r97406:8871b37604ae Date: 2019-09-08 07:08 -0400 http://bitbucket.org/pypy/pypy/changeset/8871b37604ae/ Log: Allow force-rebuilding modules in build_cffi_imports even if they're built. diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py --- a/pypy/tool/build_cffi_imports.py +++ b/pypy/tool/build_cffi_imports.py @@ -134,7 +134,7 @@ def create_cffi_import_libraries(pypy_c, options, basedir, only=None, - embed_dependencies=False): + embed_dependencies=False, rebuild=False): from rpython.tool.runsubprocess import run_subprocess shutil.rmtree(str(join(basedir,'lib_pypy','__pycache__')), @@ -153,12 +153,13 @@ continue if module is None or getattr(options, 'no_' + key, False): continue - # the key is the module name, has it already been built? - status, stdout, stderr = run_subprocess(str(pypy_c), ['-c', 'import %s' % key]) - if status == 0: - print('*', ' %s already built' % key, file=sys.stderr) - continue - + if not rebuild: + # the key is the module name, has it already been built? + status, stdout, stderr = run_subprocess(str(pypy_c), ['-c', 'import %s' % key]) + if status == 0: + print('*', ' %s already built' % key, file=sys.stderr) + continue + if module.endswith('.py'): args = [module] cwd = str(join(basedir,'lib_pypy')) @@ -237,6 +238,8 @@ parser.add_argument('--exefile', dest='exefile', default=sys.executable, help='instead of executing sys.executable' \ ' you can specify an alternative pypy vm here') + parser.add_argument('--rebuild', dest='rebuild', action='store_true', + help='Rebuild the module even if it already appears to have been built.') parser.add_argument('--only', dest='only', default=None, help='Only build the modules delimited by a colon. E.g. _ssl,sqlite') parser.add_argument('--embed-dependencies', dest='embed_dependencies', action='store_true', @@ -258,7 +261,8 @@ else: only = set(args.only.split(',')) failures = create_cffi_import_libraries(exename, options, basedir, only=only, - embed_dependencies=args.embed_dependencies) + embed_dependencies=args.embed_dependencies, + rebuild=args.rebuild) if len(failures) > 0: print('*** failed to build the CFFI modules %r' % ( [f[1] for f in failures],), file=sys.stderr) From pypy.commits at gmail.com Sun Sep 8 08:23:46 2019 From: pypy.commits at gmail.com (Julian Berman) Date: Sun, 08 Sep 2019 05:23:46 -0700 (PDT) Subject: [pypy-commit] pypy openssl-for-macos: Old LibreSSL -> OpenSSL on macOS. Message-ID: <5d74f2d2.1c69fb81.9c923.88d6@mx.google.com> Author: Julian Berman Branch: openssl-for-macos Changeset: r97407:89c76ee0eafd Date: 2019-09-08 08:23 -0400 http://bitbucket.org/pypy/pypy/changeset/89c76ee0eafd/ Log: Old LibreSSL -> OpenSSL on macOS. Ditch the old patch (which was for LibreSSL) but leave support for applying patches in general still here in case stuff needs it in the future. Also this still doesn't run for me locally using a pre-built pypy since basedir is wrong and then can't find lib_pypy, so will need to figure that out next... diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py --- a/pypy/tool/build_cffi_imports.py +++ b/pypy/tool/build_cffi_imports.py @@ -22,9 +22,8 @@ # for distribution, we may want to fetch dependencies not provided by # the OS, such as a recent openssl/libressl. cffi_dependencies = { - '_ssl': ('http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.6.2.tar.gz', - 'b029d2492b72a9ba5b5fcd9f3d602c9fd0baa087912f2aaecc28f52f567ec478', - ['--without-openssldir']), + '_ssl': ('https://www.openssl.org/source/openssl-1.1.1c.tar.gz', + 'f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90'), '_gdbm': ('http://ftp.gnu.org/gnu/gdbm/gdbm-1.13.tar.gz', '9d252cbd7d793f7b12bcceaddda98d257c14f4d1890d851c386c37207000a253', ['--without-readline']), @@ -176,18 +175,7 @@ shutil.rmtree(destdir, ignore_errors=True) os.makedirs(destdir) - if key == '_ssl' and sys.platform == 'darwin': - # this patch is loosely inspired by an Apple and adds - # a fallback to the OS X roots when none are available - patches = [ - os.path.join(curdir, - '../../lib_pypy/_cffi_ssl/osx-roots.diff'), - ] - else: - patches = [] - - status, stdout, stderr = _build_dependency(key, destdir, - patches=patches) + status, stdout, stderr = _build_dependency(key, destdir) if status != 0: failures.append((key, module)) @@ -201,10 +189,6 @@ '-I{}/usr/include {}'.format(destdir, env.get('CPPFLAGS', '')) env['LDFLAGS'] = \ '-L{}/usr/lib {}'.format(destdir, env.get('LDFLAGS', '')) - - if key == '_ssl' and sys.platform == 'darwin': - # needed for our roots patch - env['LDFLAGS'] += ' -framework CoreFoundation -framework Security' elif sys.platform == 'win32': env['INCLUDE'] = r'..\externals\include;' + env.get('INCLUDE', '') env['LIB'] = r'..\externals\lib;' + env.get('LIB', '') From pypy.commits at gmail.com Sun Sep 8 17:18:01 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Sun, 08 Sep 2019 14:18:01 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Added additional read methods Message-ID: <5d757009.1c69fb81.68ca8.3d7c@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97408:82be22839499 Date: 2019-09-08 22:16 +0100 http://bitbucket.org/pypy/pypy/changeset/82be22839499/ Log: Added additional read methods diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -90,6 +90,7 @@ buf = lltype.malloc(rwin32.CWCHARP, 1, flavor='raw') buf[0] = '\0' readlen = 0 + return buf finally: lltype.free(buf, flavor='raw') @@ -120,7 +121,6 @@ return '\0' return _get_console_type(handle) - return None decoded = space.fsdecode_w(w_path_or_fd) if not decoded: return '\0' @@ -190,9 +190,16 @@ # pass def _copyfrombuf(self, buf, len): - # TODO implement me. - pass - + n = 0 + while self.buf[0] and len: + buf[n] = self.buf[0] + for i in range(1, SMALLBUF): + self.buf[i-1] = self.buf[i] + self.buf[SMALLBUF-1] = 0 + len -= 1 + n += 1 + return n + @unwrap_spec(w_mode=WrappedDefault("r"), w_closefd=WrappedDefault(True), w_opener=WrappedDefault(None)) def descr_init(self, space, w_nameobj, w_mode, w_closefd, w_opener): return None @@ -415,7 +422,58 @@ return space.newint(read_len) - + def read_w(self, space): + if self.handle == rwin32.INVALID_HANDLE_VALUE: + err_closed() + if !self.readable: + return err_mode("reading") + + if size < 0: + return self.readall_w(space) + + if size > BUFMAX: + raise oefmt(space.w_ValueError, + "Cannot read more than %d bytes", + BUFMAX) + + w_buffer = space.call_function(space.w_bytearray, w_size) + w_bytes_size = self.readinto_w(space, w_buffer) + if w_bytes_size < 0: + return None + space.delslice(w_buffer, w_bytes_size, space.len(w_buffer)) + + return space.w_bytes(w_buffer) + + def readall_w(self, space): + if self.handle == rwin32.INVALID_HANDLE_VALUE: + err_closed() + + bufsize = BUFSIZE + buf = lltype.malloc(rwin32.CWCHARP, bufsize + 1, flavor='raw') + len = 0 + n = lltype.malloc(rwin32.CWCHARP, 1, flavor='raw') + n[0] = 0 + + try: + while True: + if len >= bufsize: + if len > BUFMAX: + break + newsize = len + if newsize < bufsize: + raise oefmt(space.w_OverflowError, + "unbounded read returned more bytes " + "than a Python bytes object can hold") + bufsize = newsize + lltype.free(buf, flavor='raw') + buf = lltype.malloc(rwin32.CWCHARP, bufsize + 1, flavor='raw') + subbuf = read_console_w(self.handle, bufsize - len, n) + + finally: + lltype.free(buf, flavor='raw') + + pass + def get_blksize(self,space): return space.newint(self.blksize) @@ -427,7 +485,9 @@ readable = interp2app(W_WinConsoleIO.readable_w), writable = interp2app(W_WinConsoleIO.writable_w), - isatty = interp2app(W_WinConsoleIO.isatty_w), + isatty = interp2app(W_WinConsoleIO.isatty_w), + read = interp2app(W_WinConsoleIO.read_w), + readall = interp2app(W_WinConsoleIO.readall_w), readinto = interp2app(W_WinConsoleIO.readinto_w), _blksize = GetSetProperty(W_WinConsoleIO.get_blksize), From pypy.commits at gmail.com Tue Sep 10 01:59:33 2019 From: pypy.commits at gmail.com (jose...@gmail.com) Date: Mon, 09 Sep 2019 22:59:33 -0700 (PDT) Subject: [pypy-commit] pypy compile_ncurses_tcl_tk_suse_latest: Some linux distributions place ncurses under /usr/include/ncurses and tcl/tk under /usr/lib64. Message-ID: <5d773bc5.1c69fb81.5937e.7dee@mx.google.com> Author: joserubiovidales at gmail.com Branch: compile_ncurses_tcl_tk_suse_latest Changeset: r97409:4e47fdc746fb Date: 2019-09-09 07:53 +0200 http://bitbucket.org/pypy/pypy/changeset/4e47fdc746fb/ Log: Some linux distributions place ncurses under /usr/include/ncurses and tcl/tk under /usr/lib64. Added more paths to include and link ncurses and tcl-tk. diff --git a/lib_pypy/_curses_build.py b/lib_pypy/_curses_build.py --- a/lib_pypy/_curses_build.py +++ b/lib_pypy/_curses_build.py @@ -1,4 +1,15 @@ from cffi import FFI +import os + +# On some systems, the ncurses library is +# located at /usr/include/ncurses, so we must check this case. +# Let's iterate over well known paths +incdirs = [] +for _path in ['/usr/include/ncurses']: + if os.path.isfile(os.path.join(_path, 'panel.h')): + incdirs.append(_path) + break + ffi = FFI() @@ -10,6 +21,13 @@ #define NCURSES_OPAQUE 0 #endif + +/* ncurses 6 change behaviour and makes all pointers opaque, + lets define backward compatibility. It doesn't harm + previous versions */ + +#define NCURSES_INTERNALS 1 +#define NCURSES_REENTRANT 0 #include #include #include @@ -41,7 +59,8 @@ void _m_getsyx(int *yx) { getsyx(yx[0], yx[1]); } -""", libraries=['ncurses', 'panel']) +""", include_dirs=incdirs, + libraries=['ncurses', 'panel']) ffi.cdef(""" diff --git a/lib_pypy/_tkinter/tklib_build.py b/lib_pypy/_tkinter/tklib_build.py --- a/lib_pypy/_tkinter/tklib_build.py +++ b/lib_pypy/_tkinter/tklib_build.py @@ -36,8 +36,11 @@ for _ver in ['8.6', '8.5', '']: incdirs = [] linklibs = ['tcl' + _ver, 'tk' + _ver] - if os.path.isfile(''.join(['/usr/lib/lib', linklibs[1], '.so'])): - found = True + for lib in ['/usr/lib/lib', '/usr/lib64/lib' ]: + if os.path.isfile(''.join([ lib, linklibs[1], '.so'])): + found = True + break + if found: break if not found: sys.stderr.write("*** TCL libraries not found! Falling back...\n") From pypy.commits at gmail.com Tue Sep 10 01:59:34 2019 From: pypy.commits at gmail.com (jose...@gmail.com) Date: Mon, 09 Sep 2019 22:59:34 -0700 (PDT) Subject: [pypy-commit] pypy compile_ncurses_tcl_tk_suse_latest: lib_pypy: Add /usr/include path and fix superfluous space to tk and ncurses build scripts. Message-ID: <5d773bc6.1c69fb81.6e166.66da@mx.google.com> Author: joserubiovidales at gmail.com Branch: compile_ncurses_tcl_tk_suse_latest Changeset: r97410:1575e31d4fef Date: 2019-09-09 14:53 +0200 http://bitbucket.org/pypy/pypy/changeset/1575e31d4fef/ Log: lib_pypy: Add /usr/include path and fix superfluous space to tk and ncurses build scripts. diff --git a/lib_pypy/_curses_build.py b/lib_pypy/_curses_build.py --- a/lib_pypy/_curses_build.py +++ b/lib_pypy/_curses_build.py @@ -5,7 +5,7 @@ # located at /usr/include/ncurses, so we must check this case. # Let's iterate over well known paths incdirs = [] -for _path in ['/usr/include/ncurses']: +for _path in ['/usr/include', '/usr/include/ncurses']: if os.path.isfile(os.path.join(_path, 'panel.h')): incdirs.append(_path) break diff --git a/lib_pypy/_tkinter/tklib_build.py b/lib_pypy/_tkinter/tklib_build.py --- a/lib_pypy/_tkinter/tklib_build.py +++ b/lib_pypy/_tkinter/tklib_build.py @@ -36,7 +36,7 @@ for _ver in ['8.6', '8.5', '']: incdirs = [] linklibs = ['tcl' + _ver, 'tk' + _ver] - for lib in ['/usr/lib/lib', '/usr/lib64/lib' ]: + for lib in ['/usr/lib/lib', '/usr/lib64/lib']: if os.path.isfile(''.join([ lib, linklibs[1], '.so'])): found = True break From pypy.commits at gmail.com Tue Sep 10 01:59:36 2019 From: pypy.commits at gmail.com (mattip) Date: Mon, 09 Sep 2019 22:59:36 -0700 (PDT) Subject: [pypy-commit] pypy compile_ncurses_tcl_tk_suse_latest: close branch to be merged Message-ID: <5d773bc8.1c69fb81.12d87.fff6@mx.google.com> Author: Matti Picus Branch: compile_ncurses_tcl_tk_suse_latest Changeset: r97411:295e9e2d5447 Date: 2019-09-10 08:33 +0300 http://bitbucket.org/pypy/pypy/changeset/295e9e2d5447/ Log: close branch to be merged diff --git a/lib_pypy/_tkinter/tklib_build.py b/lib_pypy/_tkinter/tklib_build.py --- a/lib_pypy/_tkinter/tklib_build.py +++ b/lib_pypy/_tkinter/tklib_build.py @@ -37,7 +37,7 @@ incdirs = [] linklibs = ['tcl' + _ver, 'tk' + _ver] for lib in ['/usr/lib/lib', '/usr/lib64/lib']: - if os.path.isfile(''.join([ lib, linklibs[1], '.so'])): + if os.path.isfile(''.join([lib, linklibs[1], '.so'])): found = True break if found: diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -66,3 +66,7 @@ .. branch: cryptograhpt-2.7 Update vendored cryptography used for _ssl to 2.7 + +.. branch: compile_ncurses_tcl_tk_suse_latest + +Check for headers and runtime libraries in more locations to support other linuxes From pypy.commits at gmail.com Tue Sep 10 01:59:38 2019 From: pypy.commits at gmail.com (mattip) Date: Mon, 09 Sep 2019 22:59:38 -0700 (PDT) Subject: [pypy-commit] pypy default: merge compile_ncurses_tcl_tk_suse_latest which adds other locations to search Message-ID: <5d773bca.1c69fb81.a0ccd.b0a8@mx.google.com> Author: Matti Picus Branch: Changeset: r97412:6ff327526dc7 Date: 2019-09-10 08:34 +0300 http://bitbucket.org/pypy/pypy/changeset/6ff327526dc7/ Log: merge compile_ncurses_tcl_tk_suse_latest which adds other locations to search diff --git a/lib_pypy/_curses_build.py b/lib_pypy/_curses_build.py --- a/lib_pypy/_curses_build.py +++ b/lib_pypy/_curses_build.py @@ -1,4 +1,15 @@ from cffi import FFI +import os + +# On some systems, the ncurses library is +# located at /usr/include/ncurses, so we must check this case. +# Let's iterate over well known paths +incdirs = [] +for _path in ['/usr/include', '/usr/include/ncurses']: + if os.path.isfile(os.path.join(_path, 'panel.h')): + incdirs.append(_path) + break + ffi = FFI() @@ -10,6 +21,13 @@ #define NCURSES_OPAQUE 0 #endif + +/* ncurses 6 change behaviour and makes all pointers opaque, + lets define backward compatibility. It doesn't harm + previous versions */ + +#define NCURSES_INTERNALS 1 +#define NCURSES_REENTRANT 0 #include #include #include @@ -41,7 +59,8 @@ void _m_getsyx(int *yx) { getsyx(yx[0], yx[1]); } -""", libraries=['ncurses', 'panel']) +""", include_dirs=incdirs, + libraries=['ncurses', 'panel']) ffi.cdef(""" diff --git a/lib_pypy/_tkinter/tklib_build.py b/lib_pypy/_tkinter/tklib_build.py --- a/lib_pypy/_tkinter/tklib_build.py +++ b/lib_pypy/_tkinter/tklib_build.py @@ -36,8 +36,11 @@ for _ver in ['8.6', '8.5', '']: incdirs = [] linklibs = ['tcl' + _ver, 'tk' + _ver] - if os.path.isfile(''.join(['/usr/lib/lib', linklibs[1], '.so'])): - found = True + for lib in ['/usr/lib/lib', '/usr/lib64/lib']: + if os.path.isfile(''.join([lib, linklibs[1], '.so'])): + found = True + break + if found: break if not found: sys.stderr.write("*** TCL libraries not found! Falling back...\n") diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -66,3 +66,7 @@ .. branch: cryptograhpt-2.7 Update vendored cryptography used for _ssl to 2.7 + +.. branch: compile_ncurses_tcl_tk_suse_latest + +Check for headers and runtime libraries in more locations to support other linuxes From pypy.commits at gmail.com Tue Sep 10 06:53:59 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 10 Sep 2019 03:53:59 -0700 (PDT) Subject: [pypy-commit] pypy openssl-for-macos: always rebuild for packaging Message-ID: <5d7780c7.1c69fb81.7c68.0e41@mx.google.com> Author: Matti Picus Branch: openssl-for-macos Changeset: r97413:e7dd1ccfdb32 Date: 2019-09-10 13:53 +0300 http://bitbucket.org/pypy/pypy/changeset/e7dd1ccfdb32/ Log: always rebuild for packaging diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py --- a/pypy/tool/release/package.py +++ b/pypy/tool/release/package.py @@ -86,6 +86,7 @@ failures = create_cffi_import_libraries( str(pypy_c), options, str(basedir), embed_dependencies=options.embed_dependencies, + rebuild=True, ) for key, module in failures: From pypy.commits at gmail.com Tue Sep 10 07:19:37 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 10 Sep 2019 04:19:37 -0700 (PDT) Subject: [pypy-commit] pypy default: two comments Message-ID: <5d7786c9.1c69fb81.bc6f2.f388@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97414:e32eb9a73d7e Date: 2019-09-10 11:15 +0200 http://bitbucket.org/pypy/pypy/changeset/e32eb9a73d7e/ Log: two comments diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py --- a/rpython/rlib/rutf8.py +++ b/rpython/rlib/rutf8.py @@ -486,6 +486,7 @@ length += 1 return length + @jit.elidable def surrogate_in_utf8(value): """Check if the UTF-8 byte string 'value' contains a surrogate. @@ -592,9 +593,12 @@ """ if bytepos < 0: return bytepos + # binary search on elements of storage index_min = 0 index_max = len(storage) - 1 while index_min < index_max: + # this addition can't overflow because storage has a length that is + # 1/64 of the length of a string index_middle = (index_min + index_max + 1) // 2 base_bytepos = storage[index_middle].baseindex if bytepos < base_bytepos: From pypy.commits at gmail.com Tue Sep 10 07:19:38 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 10 Sep 2019 04:19:38 -0700 (PDT) Subject: [pypy-commit] pypy default: stop using codepoints_in_utf8 for the result of find Message-ID: <5d7786ca.1c69fb81.9df44.cb20@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97415:b2971d2576c1 Date: 2019-09-10 13:18 +0200 http://bitbucket.org/pypy/pypy/changeset/b2971d2576c1/ Log: stop using codepoints_in_utf8 for the result of find even for very small strings it's a lot slower than using binary search diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -891,6 +891,15 @@ return end - start return rutf8.codepoints_in_utf8(self._utf8, start, end) + def _byte_to_index(self, bytepos): + """ this returns index such that self._index_to_byte(index) == bytepos + NB: this is slow! roughly logarithmic with a big constant + """ + if self.is_ascii(): + return bytepos + return rutf8.codepoint_index_at_byte_position( + self._utf8, self._get_index_storage(), bytepos) + @always_inline def _unwrap_and_search(self, space, w_sub, w_start, w_end, forward=True): w_sub = self.convert_arg_to_w_unicode(space, w_sub) @@ -912,16 +921,14 @@ res_index = self._utf8.find(w_sub._utf8, start_index, end_index) if res_index < 0: return None - skip = self._codepoints_in_utf8(start_index, res_index) - res = start + skip + res = self._byte_to_index(res_index) assert res >= 0 return space.newint(res) else: res_index = self._utf8.rfind(w_sub._utf8, start_index, end_index) if res_index < 0: return None - skip = self._codepoints_in_utf8(res_index, end_index) - res = end - skip + res = self._byte_to_index(res_index) assert res >= 0 return space.newint(res) From pypy.commits at gmail.com Tue Sep 10 10:23:19 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 10 Sep 2019 07:23:19 -0700 (PDT) Subject: [pypy-commit] pypy default: optimize codepoint_index_at_byte_position by using the index structure more, Message-ID: <5d77b1d7.1c69fb81.ef24d.e0ce@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97416:7b5414be06fa Date: 2019-09-10 15:31 +0200 http://bitbucket.org/pypy/pypy/changeset/7b5414be06fa/ Log: optimize codepoint_index_at_byte_position by using the index structure more, instead of calling next_codepoint_pos up to 64 times. gives a speedup of about 2x on average diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py --- a/pypy/module/_sre/interp_sre.py +++ b/pypy/module/_sre/interp_sre.py @@ -566,7 +566,8 @@ if isinstance(ctx, rsre_utf8.Utf8MatchContext): index_storage = ctx.w_unicode_obj._get_index_storage() return rutf8.codepoint_index_at_byte_position( - ctx.w_unicode_obj._utf8, index_storage, bytepos) + ctx.w_unicode_obj._utf8, index_storage, bytepos, + ctx.w_unicode_obj._len()) else: return bytepos diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -898,7 +898,7 @@ if self.is_ascii(): return bytepos return rutf8.codepoint_index_at_byte_position( - self._utf8, self._get_index_storage(), bytepos) + self._utf8, self._get_index_storage(), bytepos, self._len()) @always_inline def _unwrap_and_search(self, space, w_sub, w_start, w_end, forward=True): diff --git a/rpython/jit/metainterp/test/test_ajit.py b/rpython/jit/metainterp/test/test_ajit.py --- a/rpython/jit/metainterp/test/test_ajit.py +++ b/rpython/jit/metainterp/test/test_ajit.py @@ -134,7 +134,7 @@ u = U(x, len(x)) st = u._get_index_storage() return rutf8.codepoint_index_at_byte_position( - u.u, st, 1) + u.u, st, 1, len(x)) self.interp_operations(m, [123232]) diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py --- a/rpython/rlib/rutf8.py +++ b/rpython/rlib/rutf8.py @@ -584,7 +584,7 @@ return codepoint_at_pos(utf8, bytepos) @jit.elidable -def codepoint_index_at_byte_position(utf8, storage, bytepos): +def codepoint_index_at_byte_position(utf8, storage, bytepos, num_codepoints): """ Return the character index for which codepoint_position_at_index(index) == bytepos. This is a relatively slow operation in that it runs in a time @@ -596,6 +596,7 @@ # binary search on elements of storage index_min = 0 index_max = len(storage) - 1 + i = 0 while index_min < index_max: # this addition can't overflow because storage has a length that is # 1/64 of the length of a string @@ -605,8 +606,27 @@ index_max = index_middle - 1 else: index_min = index_middle - bytepos1 = storage[index_min].baseindex + i += 1 + + baseindex = storage[index_min].baseindex + if baseindex == bytepos: + return index_min << 6 + + # use ofs to get closer to the correct character index result = index_min << 6 + bytepos1 = baseindex + if index_min == len(storage) - 1: + maxindex = ((num_codepoints - 1) >> 2) & 0x0F + else: + maxindex = 16 + for i in range(maxindex): + x = baseindex + ord(storage[index_min].ofs[i]) + if x >= bytepos: + break + bytepos1 = x + result = (index_min << 6) + (i << 2) + 1 + + # this loop should runs at most four times while bytepos1 < bytepos: bytepos1 = next_codepoint_pos(utf8, bytepos1) result += 1 diff --git a/rpython/rlib/test/test_rutf8.py b/rpython/rlib/test/test_rutf8.py --- a/rpython/rlib/test/test_rutf8.py +++ b/rpython/rlib/test/test_rutf8.py @@ -1,3 +1,4 @@ +#encoding: utf-8 import pytest import sys from hypothesis import given, strategies, settings, example @@ -133,12 +134,24 @@ @given(strategies.text()) @example(u'x' * 64 * 5) @example(u'x' * (64 * 5 - 1)) + at example(u'ä' + u'x«' * 1000 + u'–' + u'y' * 100) def test_codepoint_index_at_byte_position(u): - storage = rutf8.create_utf8_index_storage(u.encode('utf8'), len(u)) + b = u.encode('utf8') + storage = rutf8.create_utf8_index_storage(b, len(u)) for i in range(len(u) + 1): bytepos = len(u[:i].encode('utf8')) assert rutf8.codepoint_index_at_byte_position( - u.encode('utf8'), storage, bytepos) == i + b, storage, bytepos, len(u)) == i + + at given(strategies.text(average_size=128)) +def test_codepoint_position_at_index_inverse(u): + print u + b = u.encode('utf8') + storage = rutf8.create_utf8_index_storage(b, len(u)) + for i in range(len(u) + 1): + bytepos = rutf8.codepoint_position_at_index(b, storage, i) + assert rutf8.codepoint_index_at_byte_position( + b, storage, bytepos, len(u)) == i repr_func = rutf8.make_utf8_escape_function(prefix='u', pass_printable=False, From pypy.commits at gmail.com Tue Sep 10 10:23:21 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 10 Sep 2019 07:23:21 -0700 (PDT) Subject: [pypy-commit] pypy default: remove unused index Message-ID: <5d77b1d9.1c69fb81.1f3f6.6274@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97417:d91ea5e3d27e Date: 2019-09-10 16:22 +0200 http://bitbucket.org/pypy/pypy/changeset/d91ea5e3d27e/ Log: remove unused index diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py --- a/rpython/rlib/rutf8.py +++ b/rpython/rlib/rutf8.py @@ -596,7 +596,6 @@ # binary search on elements of storage index_min = 0 index_max = len(storage) - 1 - i = 0 while index_min < index_max: # this addition can't overflow because storage has a length that is # 1/64 of the length of a string @@ -606,7 +605,6 @@ index_max = index_middle - 1 else: index_min = index_middle - i += 1 baseindex = storage[index_min].baseindex if baseindex == bytepos: From pypy.commits at gmail.com Tue Sep 10 12:50:09 2019 From: pypy.commits at gmail.com (rlamy) Date: Tue, 10 Sep 2019 09:50:09 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Update pymacro.h to match CPython 3.6.9 Message-ID: <5d77d441.1c69fb81.93527.1d50@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97419:e4a6d51f7bf2 Date: 2019-09-10 17:48 +0100 http://bitbucket.org/pypy/pypy/changeset/e4a6d51f7bf2/ Log: Update pymacro.h to match CPython 3.6.9 diff --git a/pypy/module/cpyext/include/pymacro.h b/pypy/module/cpyext/include/pymacro.h --- a/pypy/module/cpyext/include/pymacro.h +++ b/pypy/module/cpyext/include/pymacro.h @@ -1,6 +1,29 @@ #ifndef Py_PYMACRO_H #define Py_PYMACRO_H +/* Minimum value between x and y */ +#define Py_MIN(x, y) (((x) > (y)) ? (y) : (x)) + +/* Maximum value between x and y */ +#define Py_MAX(x, y) (((x) > (y)) ? (x) : (y)) + +/* Absolute value of the number x */ +#define Py_ABS(x) ((x) < 0 ? -(x) : (x)) + +#define _Py_XSTRINGIFY(x) #x + +/* Convert the argument to a string. For example, Py_STRINGIFY(123) is replaced + with "123" by the preprocessor. Defines are also replaced by their value. + For example Py_STRINGIFY(__LINE__) is replaced by the line number, not + by "__LINE__". */ +#define Py_STRINGIFY(x) _Py_XSTRINGIFY(x) + +/* Get the size of a structure member in bytes */ +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) + +/* Argument must be a char or an int in [-128, 127] or [0, 255]. */ +#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff)) + /* Assert a build-time dependency, as an expression. Your compile will fail if the condition isn't true, or can't be evaluated @@ -16,6 +39,10 @@ #define Py_BUILD_ASSERT_EXPR(cond) \ (sizeof(char [1 - 2*!(cond)]) - 1) +#define Py_BUILD_ASSERT(cond) do { \ + (void)Py_BUILD_ASSERT_EXPR(cond); \ + } while(0) + /* Get the number of elements in a visible array This does not work on pointers, or arrays declared as [], or function @@ -38,4 +65,34 @@ (sizeof(array) / sizeof((array)[0])) #endif + +/* Define macros for inline documentation. */ +#define PyDoc_VAR(name) static char name[] +#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str) +#ifdef WITH_DOC_STRINGS +#define PyDoc_STR(str) str +#else +#define PyDoc_STR(str) "" +#endif + +/* Below "a" is a power of 2. */ +/* Round down size "n" to be a multiple of "a". */ +#define _Py_SIZE_ROUND_DOWN(n, a) ((size_t)(n) & ~(size_t)((a) - 1)) +/* Round up size "n" to be a multiple of "a". */ +#define _Py_SIZE_ROUND_UP(n, a) (((size_t)(n) + \ + (size_t)((a) - 1)) & ~(size_t)((a) - 1)) +/* Round pointer "p" down to the closest "a"-aligned address <= "p". */ +#define _Py_ALIGN_DOWN(p, a) ((void *)((uintptr_t)(p) & ~(uintptr_t)((a) - 1))) +/* Round pointer "p" up to the closest "a"-aligned address >= "p". */ +#define _Py_ALIGN_UP(p, a) ((void *)(((uintptr_t)(p) + \ + (uintptr_t)((a) - 1)) & ~(uintptr_t)((a) - 1))) +/* Check if pointer "p" is aligned to "a"-bytes boundary. */ +#define _Py_IS_ALIGNED(p, a) (!((uintptr_t)(p) & (uintptr_t)((a) - 1))) + +#ifdef __GNUC__ +#define Py_UNUSED(name) _unused_ ## name __attribute__((unused)) +#else +#define Py_UNUSED(name) _unused_ ## name +#endif + #endif /* Py_PYMACRO_H */ From pypy.commits at gmail.com Tue Sep 10 15:33:09 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 10 Sep 2019 12:33:09 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: re-add support for unmarshalling TYPE_INT64, since there's now a test for it in Message-ID: <5d77fa75.1c69fb81.455f1.5364@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97422:5ec0fce493e7 Date: 2019-09-10 21:32 +0200 http://bitbucket.org/pypy/pypy/changeset/5ec0fce493e7/ Log: re-add support for unmarshalling TYPE_INT64, since there's now a test for it in the CPython test suite diff --git a/pypy/module/marshal/test/test_marshal.py b/pypy/module/marshal/test/test_marshal.py --- a/pypy/module/marshal/test/test_marshal.py +++ b/pypy/module/marshal/test/test_marshal.py @@ -250,6 +250,21 @@ raises(ValueError, marshal.loads, s) run_tests(2**20, check) + def test_int64(self): + # another CPython test + + import marshal + res = marshal.loads(b'I\xff\xff\xff\xff\xff\xff\xff\x7f') + assert res == 0x7fffffffffffffff + res = marshal.loads(b'I\xfe\xdc\xba\x98\x76\x54\x32\x10') + assert res == 0x1032547698badcfe + res = marshal.loads(b'I\x01\x23\x45\x67\x89\xab\xcd\xef') + assert res == -0x1032547698badcff + res = marshal.loads(b'I\x08\x19\x2a\x3b\x4c\x5d\x6e\x7f') + assert res == 0x7f6e5d4c3b2a1908 + res = marshal.loads(b'I\xf7\xe6\xd5\xc4\xb3\xa2\x91\x80') + assert res == -0x7f6e5d4c3b2a1909 + @pytest.mark.skipif('config.option.runappdirect or sys.maxint > 2 ** 32') class AppTestSmallLong(AppTestMarshal): spaceconfig = AppTestMarshal.spaceconfig.copy() diff --git a/pypy/objspace/std/marshal_impl.py b/pypy/objspace/std/marshal_impl.py --- a/pypy/objspace/std/marshal_impl.py +++ b/pypy/objspace/std/marshal_impl.py @@ -50,6 +50,8 @@ FLAG_REF = 0x80 # bit added to mean "add obj to index" FLAG_DONE = '\x00' +TYPE_INT64 = 'I' # no longer generated + # the following typecodes have been added in version 4. TYPE_ASCII = 'a' # never generated so far by pypy TYPE_ASCII_INTERNED = 'A' # never generated so far by pypy @@ -174,6 +176,20 @@ def unmarshal_int(space, u, tc): return space.newint(u.get_int()) + at unmarshaller(TYPE_INT64) +def unmarshal_int64(space, u, tc): + from rpython.rlib.rbigint import rbigint + # no longer generated, but we still support unmarshalling + lo = u.get_int() # get the first 32 bits + hi = u.get_int() # get the next 32 bits + if LONG_BIT >= 64: + x = (hi << 32) | (lo & (2**32-1)) # result fits in an int + return space.newint(x) + else: + x = (r_longlong(hi) << 32) | r_longlong(r_uint(lo)) # get a r_longlong + result = rbigint.fromrarith_int(x) + return space.newlong_from_rbigint(result) + @marshaller(W_AbstractLongObject) def marshal_long(space, w_long, m): From pypy.commits at gmail.com Tue Sep 10 15:58:00 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 10 Sep 2019 12:58:00 -0700 (PDT) Subject: [pypy-commit] pypy openssl-for-macos: add no-shared to _ssl, separate "make" from "make install" Message-ID: <5d780048.1c69fb81.7ad75.655b@mx.google.com> Author: Matti Picus Branch: openssl-for-macos Changeset: r97423:cf76a77c4734 Date: 2019-09-10 22:57 +0300 http://bitbucket.org/pypy/pypy/changeset/cf76a77c4734/ Log: add no-shared to _ssl, separate "make" from "make install" diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py --- a/pypy/tool/build_cffi_imports.py +++ b/pypy/tool/build_cffi_imports.py @@ -24,7 +24,7 @@ cffi_dependencies = { '_ssl': ('https://www.openssl.org/source/openssl-1.1.1c.tar.gz', 'f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90', - []), + ['no-shared']), '_gdbm': ('http://ftp.gnu.org/gnu/gdbm/gdbm-1.13.tar.gz', '9d252cbd7d793f7b12bcceaddda98d257c14f4d1890d851c386c37207000a253', ['--without-readline']), @@ -109,9 +109,6 @@ './config', [ '--prefix=/usr', - '--disable-shared', - '--enable-silent-rules', - '--disable-dependency-tracking', ] + args, cwd=sources, ) @@ -125,11 +122,20 @@ 'make', [ '-s', '-j' + str(multiprocessing.cpu_count()), + ], + cwd=sources, + ) + if status != 0: + return status, stdout, stderr + + print('installing to', destdir, file=sys.stderr) + status, stdout, stderr = run_subprocess( + 'make', + [ 'install', 'DESTDIR={}/'.format(destdir), ], cwd=sources, ) - return status, stdout, stderr From pypy.commits at gmail.com Tue Sep 10 18:13:33 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Tue, 10 Sep 2019 15:13:33 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Implemented a bit more of readall. Fixed memory allocation in Message-ID: <5d78200d.1c69fb81.55be2.9b09@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97424:38ba22b576dd Date: 2019-09-10 22:54 +0100 http://bitbucket.org/pypy/pypy/changeset/38ba22b576dd/ Log: Implemented a bit more of readall. Fixed memory allocation in read_console_w diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -33,6 +33,7 @@ err = 0 sig = 0 buf = lltype.malloc(rwin32.CWCHARP, maxlen, flavor='raw') + try: if not buf: return None @@ -83,6 +84,7 @@ continue off += BUFSIZ if err: + lltype.free(buf, flavor='raw') return None if readlen > 0 and buf[0] == '\x1a': @@ -91,7 +93,7 @@ buf[0] = '\0' readlen = 0 return buf - finally: + except: lltype.free(buf, flavor='raw') @@ -422,10 +424,11 @@ return space.newint(read_len) - def read_w(self, space): + def read_w(self, space, w_size=None): + size = convert_size(space, w_size) if self.handle == rwin32.INVALID_HANDLE_VALUE: err_closed() - if !self.readable: + if not self.readable: return err_mode("reading") if size < 0: @@ -468,6 +471,21 @@ lltype.free(buf, flavor='raw') buf = lltype.malloc(rwin32.CWCHARP, bufsize + 1, flavor='raw') subbuf = read_console_w(self.handle, bufsize - len, n) + + if n > 0: + rwin32.wcsncpy_s(buf[len], bufsize - len +1, subbuf, n) + + lltype.free(subbuf, flavor='raw') + + if n == 0; + break + + len += n + + if len == 0 and _buflen(self) == 0: + return None + + finally: lltype.free(buf, flavor='raw') diff --git a/rpython/rlib/rwin32.py b/rpython/rlib/rwin32.py --- a/rpython/rlib/rwin32.py +++ b/rpython/rlib/rwin32.py @@ -255,7 +255,9 @@ fd = _open_osfhandle(handle, flags) with FdValidator(fd): return fd - + + wcsncpy_s = rffi.llexternal('wcsncpy_s', + [rffi.WCHARP, rffi.SIZE_T, rffi.CWCHARP, rffi.SIZE_T], rffi.INT) wcsicmp = rffi.llexternal('_wcsicmp', [rffi.CWCHARP, rffi.CWCHARP], rffi.INT) def build_winerror_to_errno(): From pypy.commits at gmail.com Tue Sep 10 18:13:35 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Tue, 10 Sep 2019 15:13:35 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Fix translation Message-ID: <5d78200f.1c69fb81.e5fc8.3b5d@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97425:b4f36c7acc15 Date: 2019-09-10 23:11 +0100 http://bitbucket.org/pypy/pypy/changeset/b4f36c7acc15/ Log: Fix translation diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -5,7 +5,7 @@ from pypy.interpreter.typedef import ( TypeDef, generic_new_descr, GetSetProperty) from pypy.interpreter.gateway import WrappedDefault, interp2app, unwrap_spec -from pypy.module._io.interp_iobase import (W_RawIOBase, DEFAULT_BUFFER_SIZE) +from pypy.module._io.interp_iobase import (W_RawIOBase, convert_size, DEFAULT_BUFFER_SIZE) from pypy.module.signal.interp_signal import sigintevent from pypy.interpreter.unicodehelper import fsdecode from rpython.rtyper.lltypesystem import lltype, rffi @@ -477,7 +477,7 @@ lltype.free(subbuf, flavor='raw') - if n == 0; + if n == 0: break len += n @@ -485,8 +485,6 @@ if len == 0 and _buflen(self) == 0: return None - - finally: lltype.free(buf, flavor='raw') diff --git a/rpython/rlib/rwin32.py b/rpython/rlib/rwin32.py --- a/rpython/rlib/rwin32.py +++ b/rpython/rlib/rwin32.py @@ -257,7 +257,7 @@ return fd wcsncpy_s = rffi.llexternal('wcsncpy_s', - [rffi.WCHARP, rffi.SIZE_T, rffi.CWCHARP, rffi.SIZE_T], rffi.INT) + [rffi.CWCHARP, rffi.SIZE_T, rffi.CWCHARP, rffi.SIZE_T], rffi.INT) wcsicmp = rffi.llexternal('_wcsicmp', [rffi.CWCHARP, rffi.CWCHARP], rffi.INT) def build_winerror_to_errno(): From pypy.commits at gmail.com Wed Sep 11 01:43:45 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 10 Sep 2019 22:43:45 -0700 (PDT) Subject: [pypy-commit] pypy openssl-for-macos: close branch to be merged Message-ID: <5d788991.1c69fb81.dcfef.657d@mx.google.com> Author: Matti Picus Branch: openssl-for-macos Changeset: r97426:eb707e329a18 Date: 2019-09-11 08:39 +0300 http://bitbucket.org/pypy/pypy/changeset/eb707e329a18/ Log: close branch to be merged diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -66,3 +66,7 @@ .. branch: cryptograhpt-2.7 Update vendored cryptography used for _ssl to 2.7 + +.. branch: openssl-for-macos + +Update _ssl on macos to statically link to openssl-1.1.1c diff --git a/pypy/goal/targetpypystandalone.py b/pypy/goal/targetpypystandalone.py --- a/pypy/goal/targetpypystandalone.py +++ b/pypy/goal/targetpypystandalone.py @@ -351,7 +351,7 @@ ''' Use cffi to compile cffi interfaces to modules''' filename = os.path.join(pypydir, 'tool', 'build_cffi_imports.py') status, out, err = run_subprocess(str(driver.compute_exe_name()), - [filename]) + [filename, '--embed-dependencies']) sys.stdout.write(out) sys.stderr.write(err) # otherwise, ignore errors From pypy.commits at gmail.com Wed Sep 11 01:43:47 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 10 Sep 2019 22:43:47 -0700 (PDT) Subject: [pypy-commit] pypy default: merge openssl-for-macos which updates _ssl to openssl-1.1.1c and binds statically Message-ID: <5d788993.1c69fb81.46621.4a3e@mx.google.com> Author: Matti Picus Branch: Changeset: r97427:849070e3fadb Date: 2019-09-11 08:43 +0300 http://bitbucket.org/pypy/pypy/changeset/849070e3fadb/ Log: merge openssl-for-macos which updates _ssl to openssl-1.1.1c and binds statically also always rebuild cffi modules when packaging diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -70,3 +70,7 @@ .. branch: compile_ncurses_tcl_tk_suse_latest Check for headers and runtime libraries in more locations to support other linuxes + +.. branch: openssl-for-macos + +Update _ssl on macos to statically link to openssl-1.1.1c \ No newline at end of file diff --git a/pypy/goal/targetpypystandalone.py b/pypy/goal/targetpypystandalone.py --- a/pypy/goal/targetpypystandalone.py +++ b/pypy/goal/targetpypystandalone.py @@ -351,7 +351,7 @@ ''' Use cffi to compile cffi interfaces to modules''' filename = os.path.join(pypydir, 'tool', 'build_cffi_imports.py') status, out, err = run_subprocess(str(driver.compute_exe_name()), - [filename]) + [filename, '--embed-dependencies']) sys.stdout.write(out) sys.stderr.write(err) # otherwise, ignore errors diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py --- a/pypy/tool/build_cffi_imports.py +++ b/pypy/tool/build_cffi_imports.py @@ -22,9 +22,9 @@ # for distribution, we may want to fetch dependencies not provided by # the OS, such as a recent openssl/libressl. cffi_dependencies = { - '_ssl': ('http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.6.2.tar.gz', - 'b029d2492b72a9ba5b5fcd9f3d602c9fd0baa087912f2aaecc28f52f567ec478', - ['--without-openssldir']), + '_ssl': ('https://www.openssl.org/source/openssl-1.1.1c.tar.gz', + 'f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90', + ['no-shared']), '_gdbm': ('http://ftp.gnu.org/gnu/gdbm/gdbm-1.13.tar.gz', '9d252cbd7d793f7b12bcceaddda98d257c14f4d1890d851c386c37207000a253', ['--without-readline']), @@ -106,12 +106,9 @@ # configure & build it status, stdout, stderr = run_subprocess( - './configure', + './config', [ '--prefix=/usr', - '--disable-shared', - '--enable-silent-rules', - '--disable-dependency-tracking', ] + args, cwd=sources, ) @@ -125,16 +122,25 @@ 'make', [ '-s', '-j' + str(multiprocessing.cpu_count()), + ], + cwd=sources, + ) + if status != 0: + return status, stdout, stderr + + print('installing to', destdir, file=sys.stderr) + status, stdout, stderr = run_subprocess( + 'make', + [ 'install', 'DESTDIR={}/'.format(destdir), ], cwd=sources, ) - return status, stdout, stderr def create_cffi_import_libraries(pypy_c, options, basedir, only=None, - embed_dependencies=False): + embed_dependencies=False, rebuild=False): from rpython.tool.runsubprocess import run_subprocess shutil.rmtree(str(join(basedir,'lib_pypy','__pycache__')), @@ -153,12 +159,13 @@ continue if module is None or getattr(options, 'no_' + key, False): continue - # the key is the module name, has it already been built? - status, stdout, stderr = run_subprocess(str(pypy_c), ['-c', 'import %s' % key]) - if status == 0: - print('*', ' %s already built' % key, file=sys.stderr) - continue - + if not rebuild: + # the key is the module name, has it already been built? + status, stdout, stderr = run_subprocess(str(pypy_c), ['-c', 'import %s' % key]) + if status == 0: + print('*', ' %s already built' % key, file=sys.stderr) + continue + if module.endswith('.py'): args = [module] cwd = str(join(basedir,'lib_pypy')) @@ -175,18 +182,7 @@ shutil.rmtree(destdir, ignore_errors=True) os.makedirs(destdir) - if key == '_ssl' and sys.platform == 'darwin': - # this patch is loosely inspired by an Apple and adds - # a fallback to the OS X roots when none are available - patches = [ - os.path.join(curdir, - '../../lib_pypy/_cffi_ssl/osx-roots.diff'), - ] - else: - patches = [] - - status, stdout, stderr = _build_dependency(key, destdir, - patches=patches) + status, stdout, stderr = _build_dependency(key, destdir) if status != 0: failures.append((key, module)) @@ -200,10 +196,6 @@ '-I{}/usr/include {}'.format(destdir, env.get('CPPFLAGS', '')) env['LDFLAGS'] = \ '-L{}/usr/lib {}'.format(destdir, env.get('LDFLAGS', '')) - - if key == '_ssl' and sys.platform == 'darwin': - # needed for our roots patch - env['LDFLAGS'] += ' -framework CoreFoundation -framework Security' elif sys.platform == 'win32': env['INCLUDE'] = r'..\externals\include;' + env.get('INCLUDE', '') env['LIB'] = r'..\externals\lib;' + env.get('LIB', '') @@ -237,6 +229,8 @@ parser.add_argument('--exefile', dest='exefile', default=sys.executable, help='instead of executing sys.executable' \ ' you can specify an alternative pypy vm here') + parser.add_argument('--rebuild', dest='rebuild', action='store_true', + help='Rebuild the module even if it already appears to have been built.') parser.add_argument('--only', dest='only', default=None, help='Only build the modules delimited by a colon. E.g. _ssl,sqlite') parser.add_argument('--embed-dependencies', dest='embed_dependencies', action='store_true', @@ -258,7 +252,8 @@ else: only = set(args.only.split(',')) failures = create_cffi_import_libraries(exename, options, basedir, only=only, - embed_dependencies=args.embed_dependencies) + embed_dependencies=args.embed_dependencies, + rebuild=args.rebuild) if len(failures) > 0: print('*** failed to build the CFFI modules %r' % ( [f[1] for f in failures],), file=sys.stderr) diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py --- a/pypy/tool/release/package.py +++ b/pypy/tool/release/package.py @@ -86,6 +86,7 @@ failures = create_cffi_import_libraries( str(pypy_c), options, str(basedir), embed_dependencies=options.embed_dependencies, + rebuild=True, ) for key, module in failures: From pypy.commits at gmail.com Wed Sep 11 02:00:26 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 10 Sep 2019 23:00:26 -0700 (PDT) Subject: [pypy-commit] pypy default: in hypothesis 3.51 average_size was deprecated, removed in hypothesis 4.0 Message-ID: <5d788d7a.1c69fb81.9c393.f8a8@mx.google.com> Author: Matti Picus Branch: Changeset: r97428:904f23b7e13b Date: 2019-09-11 08:53 +0300 http://bitbucket.org/pypy/pypy/changeset/904f23b7e13b/ Log: in hypothesis 3.51 average_size was deprecated, removed in hypothesis 4.0 diff --git a/rpython/rlib/test/test_rutf8.py b/rpython/rlib/test/test_rutf8.py --- a/rpython/rlib/test/test_rutf8.py +++ b/rpython/rlib/test/test_rutf8.py @@ -143,7 +143,7 @@ assert rutf8.codepoint_index_at_byte_position( b, storage, bytepos, len(u)) == i - at given(strategies.text(average_size=128)) + at given(strategies.text()) def test_codepoint_position_at_index_inverse(u): print u b = u.encode('utf8') From pypy.commits at gmail.com Wed Sep 11 02:05:11 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 10 Sep 2019 23:05:11 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Merge with default Message-ID: <5d788e97.1c69fb81.34a82.979c@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97429:6cbd0f9d8052 Date: 2019-09-11 08:58 +0300 http://bitbucket.org/pypy/pypy/changeset/6cbd0f9d8052/ Log: Merge with default diff --git a/lib_pypy/_curses_build.py b/lib_pypy/_curses_build.py --- a/lib_pypy/_curses_build.py +++ b/lib_pypy/_curses_build.py @@ -34,6 +34,13 @@ #define NCURSES_OPAQUE 0 #endif + +/* ncurses 6 change behaviour and makes all pointers opaque, + lets define backward compatibility. It doesn't harm + previous versions */ + +#define NCURSES_INTERNALS 1 +#define NCURSES_REENTRANT 0 #include #include #include diff --git a/lib_pypy/_tkinter/tklib_build.py b/lib_pypy/_tkinter/tklib_build.py --- a/lib_pypy/_tkinter/tklib_build.py +++ b/lib_pypy/_tkinter/tklib_build.py @@ -36,8 +36,11 @@ for _ver in ['8.6', '8.5', '']: incdirs = [] linklibs = ['tcl' + _ver, 'tk' + _ver] - if os.path.isfile(''.join(['/usr/lib/lib', linklibs[1], '.so'])): - found = True + for lib in ['/usr/lib/lib', '/usr/lib64/lib']: + if os.path.isfile(''.join([lib, linklibs[1], '.so'])): + found = True + break + if found: break if not found: sys.stderr.write("*** TCL libraries not found! Falling back...\n") diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -70,3 +70,11 @@ .. branch: cryptograhpt-2.7 Update vendored cryptography used for _ssl to 2.7 + +.. branch: compile_ncurses_tcl_tk_suse_latest + +Check for headers and runtime libraries in more locations to support other linuxes + +.. branch: openssl-for-macos + +Update _ssl on macos to statically link to openssl-1.1.1c \ No newline at end of file diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py --- a/pypy/module/_sre/interp_sre.py +++ b/pypy/module/_sre/interp_sre.py @@ -702,7 +702,8 @@ if isinstance(ctx, rsre_utf8.Utf8MatchContext): index_storage = ctx.w_unicode_obj._get_index_storage() return rutf8.codepoint_index_at_byte_position( - ctx.w_unicode_obj._utf8, index_storage, bytepos) + ctx.w_unicode_obj._utf8, index_storage, bytepos, + ctx.w_unicode_obj._len()) else: return bytepos diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -1047,6 +1047,15 @@ return end - start return rutf8.codepoints_in_utf8(self._utf8, start, end) + def _byte_to_index(self, bytepos): + """ this returns index such that self._index_to_byte(index) == bytepos + NB: this is slow! roughly logarithmic with a big constant + """ + if self.is_ascii(): + return bytepos + return rutf8.codepoint_index_at_byte_position( + self._utf8, self._get_index_storage(), bytepos, self._len()) + @always_inline def _unwrap_and_search(self, space, w_sub, w_start, w_end, forward=True): w_sub = self.convert_arg_to_w_unicode(space, w_sub) @@ -1068,16 +1077,14 @@ res_index = self._utf8.find(w_sub._utf8, start_index, end_index) if res_index < 0: return None - skip = self._codepoints_in_utf8(start_index, res_index) - res = start + skip + res = self._byte_to_index(res_index) assert res >= 0 return space.newint(res) else: res_index = self._utf8.rfind(w_sub._utf8, start_index, end_index) if res_index < 0: return None - skip = self._codepoints_in_utf8(res_index, end_index) - res = end - skip + res = self._byte_to_index(res_index) assert res >= 0 return space.newint(res) diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py --- a/pypy/tool/build_cffi_imports.py +++ b/pypy/tool/build_cffi_imports.py @@ -29,9 +29,9 @@ 'lzma': ('https://tukaani.org/xz/xz-5.2.3.tar.gz', '71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb', []), - '_ssl': ('http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.6.2.tar.gz', - 'b029d2492b72a9ba5b5fcd9f3d602c9fd0baa087912f2aaecc28f52f567ec478', - ['--without-openssldir']), + '_ssl': ('https://www.openssl.org/source/openssl-1.1.1c.tar.gz', + 'f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90', + ['no-shared']), '_gdbm': ('http://ftp.gnu.org/gnu/gdbm/gdbm-1.13.tar.gz', '9d252cbd7d793f7b12bcceaddda98d257c14f4d1890d851c386c37207000a253', ['--without-readline']), @@ -113,12 +113,9 @@ # configure & build it status, stdout, stderr = run_subprocess( - './configure', + './config', [ '--prefix=/usr', - '--disable-shared', - '--enable-silent-rules', - '--disable-dependency-tracking', ] + args, cwd=sources, ) @@ -132,16 +129,25 @@ 'make', [ '-s', '-j' + str(multiprocessing.cpu_count()), + ], + cwd=sources, + ) + if status != 0: + return status, stdout, stderr + + print('installing to', destdir, file=sys.stderr) + status, stdout, stderr = run_subprocess( + 'make', + [ 'install', 'DESTDIR={}/'.format(destdir), ], cwd=sources, ) - return status, stdout, stderr def create_cffi_import_libraries(pypy_c, options, basedir, only=None, - embed_dependencies=False): + embed_dependencies=False, rebuild=False): from rpython.tool.runsubprocess import run_subprocess shutil.rmtree(str(join(basedir,'lib_pypy','__pycache__')), @@ -160,12 +166,13 @@ continue if module is None or getattr(options, 'no_' + key, False): continue - # the key is the module name, has it already been built? - status, stdout, stderr = run_subprocess(str(pypy_c), ['-c', 'import %s' % key]) - if status == 0: - print('*', ' %s already built' % key, file=sys.stderr) - continue - + if not rebuild: + # the key is the module name, has it already been built? + status, stdout, stderr = run_subprocess(str(pypy_c), ['-c', 'import %s' % key]) + if status == 0: + print('*', ' %s already built' % key, file=sys.stderr) + continue + if module.endswith('.py'): args = [module] cwd = str(join(basedir,'lib_pypy')) @@ -182,18 +189,7 @@ shutil.rmtree(destdir, ignore_errors=True) os.makedirs(destdir) - if key == '_ssl' and sys.platform == 'darwin': - # this patch is loosely inspired by an Apple and adds - # a fallback to the OS X roots when none are available - patches = [ - os.path.join(curdir, - '../../lib_pypy/_cffi_ssl/osx-roots.diff'), - ] - else: - patches = [] - - status, stdout, stderr = _build_dependency(key, destdir, - patches=patches) + status, stdout, stderr = _build_dependency(key, destdir) if status != 0: failures.append((key, module)) @@ -207,10 +203,6 @@ '-I{}/usr/include {}'.format(destdir, env.get('CPPFLAGS', '')) env['LDFLAGS'] = \ '-L{}/usr/lib {}'.format(destdir, env.get('LDFLAGS', '')) - - if key == '_ssl' and sys.platform == 'darwin': - # needed for our roots patch - env['LDFLAGS'] += ' -framework CoreFoundation -framework Security' elif sys.platform == 'win32': env['INCLUDE'] = r'..\externals\include;' + env.get('INCLUDE', '') env['LIB'] = r'..\externals\lib;' + env.get('LIB', '') @@ -247,6 +239,8 @@ parser.add_argument('--exefile', dest='exefile', default=sys.executable, help='instead of executing sys.executable' \ ' you can specify an alternative pypy vm here') + parser.add_argument('--rebuild', dest='rebuild', action='store_true', + help='Rebuild the module even if it already appears to have been built.') parser.add_argument('--only', dest='only', default=None, help='Only build the modules delimited by a colon. E.g. _ssl,sqlite') parser.add_argument('--embed-dependencies', dest='embed_dependencies', action='store_true', @@ -268,7 +262,8 @@ else: only = set(args.only.split(',')) failures = create_cffi_import_libraries(exename, options, basedir, only=only, - embed_dependencies=args.embed_dependencies) + embed_dependencies=args.embed_dependencies, + rebuild=args.rebuild) if len(failures) > 0: print('*** failed to build the CFFI modules %r' % ( [f[1] for f in failures],), file=sys.stderr) diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py --- a/pypy/tool/release/package.py +++ b/pypy/tool/release/package.py @@ -87,6 +87,7 @@ failures = create_cffi_import_libraries( str(pypy_c), options, str(basedir), embed_dependencies=options.embed_dependencies, + rebuild=True, ) for key, module in failures: diff --git a/rpython/jit/metainterp/test/test_ajit.py b/rpython/jit/metainterp/test/test_ajit.py --- a/rpython/jit/metainterp/test/test_ajit.py +++ b/rpython/jit/metainterp/test/test_ajit.py @@ -134,7 +134,7 @@ u = U(x, len(x)) st = u._get_index_storage() return rutf8.codepoint_index_at_byte_position( - u.u, st, 1) + u.u, st, 1, len(x)) self.interp_operations(m, [123232]) diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py --- a/rpython/rlib/rutf8.py +++ b/rpython/rlib/rutf8.py @@ -486,6 +486,7 @@ length += 1 return length + @jit.elidable def surrogate_in_utf8(value): """Check if the UTF-8 byte string 'value' contains a surrogate. @@ -583,7 +584,7 @@ return codepoint_at_pos(utf8, bytepos) @jit.elidable -def codepoint_index_at_byte_position(utf8, storage, bytepos): +def codepoint_index_at_byte_position(utf8, storage, bytepos, num_codepoints): """ Return the character index for which codepoint_position_at_index(index) == bytepos. This is a relatively slow operation in that it runs in a time @@ -592,17 +593,38 @@ """ if bytepos < 0: return bytepos + # binary search on elements of storage index_min = 0 index_max = len(storage) - 1 while index_min < index_max: + # this addition can't overflow because storage has a length that is + # 1/64 of the length of a string index_middle = (index_min + index_max + 1) // 2 base_bytepos = storage[index_middle].baseindex if bytepos < base_bytepos: index_max = index_middle - 1 else: index_min = index_middle - bytepos1 = storage[index_min].baseindex + + baseindex = storage[index_min].baseindex + if baseindex == bytepos: + return index_min << 6 + + # use ofs to get closer to the correct character index result = index_min << 6 + bytepos1 = baseindex + if index_min == len(storage) - 1: + maxindex = ((num_codepoints - 1) >> 2) & 0x0F + else: + maxindex = 16 + for i in range(maxindex): + x = baseindex + ord(storage[index_min].ofs[i]) + if x >= bytepos: + break + bytepos1 = x + result = (index_min << 6) + (i << 2) + 1 + + # this loop should runs at most four times while bytepos1 < bytepos: bytepos1 = next_codepoint_pos(utf8, bytepos1) result += 1 diff --git a/rpython/rlib/test/test_rutf8.py b/rpython/rlib/test/test_rutf8.py --- a/rpython/rlib/test/test_rutf8.py +++ b/rpython/rlib/test/test_rutf8.py @@ -1,3 +1,4 @@ +#encoding: utf-8 import pytest import sys from hypothesis import given, strategies, settings, example @@ -133,12 +134,24 @@ @given(strategies.text()) @example(u'x' * 64 * 5) @example(u'x' * (64 * 5 - 1)) + at example(u'ä' + u'x«' * 1000 + u'–' + u'y' * 100) def test_codepoint_index_at_byte_position(u): - storage = rutf8.create_utf8_index_storage(u.encode('utf8'), len(u)) + b = u.encode('utf8') + storage = rutf8.create_utf8_index_storage(b, len(u)) for i in range(len(u) + 1): bytepos = len(u[:i].encode('utf8')) assert rutf8.codepoint_index_at_byte_position( - u.encode('utf8'), storage, bytepos) == i + b, storage, bytepos, len(u)) == i + + at given(strategies.text()) +def test_codepoint_position_at_index_inverse(u): + print u + b = u.encode('utf8') + storage = rutf8.create_utf8_index_storage(b, len(u)) + for i in range(len(u) + 1): + bytepos = rutf8.codepoint_position_at_index(b, storage, i) + assert rutf8.codepoint_index_at_byte_position( + b, storage, bytepos, len(u)) == i repr_func = rutf8.make_utf8_escape_function(prefix='u', pass_printable=False, From pypy.commits at gmail.com Wed Sep 11 02:05:12 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 10 Sep 2019 23:05:12 -0700 (PDT) Subject: [pypy-commit] pypy default: only embed on darwin (backport from py3.6) Message-ID: <5d788e98.1c69fb81.7c68.3ab0@mx.google.com> Author: Matti Picus Branch: Changeset: r97430:38e941ce6bc8 Date: 2019-09-11 09:04 +0300 http://bitbucket.org/pypy/pypy/changeset/38e941ce6bc8/ Log: only embed on darwin (backport from py3.6) diff --git a/pypy/goal/targetpypystandalone.py b/pypy/goal/targetpypystandalone.py --- a/pypy/goal/targetpypystandalone.py +++ b/pypy/goal/targetpypystandalone.py @@ -350,8 +350,12 @@ def task_build_cffi_imports(self): ''' Use cffi to compile cffi interfaces to modules''' filename = os.path.join(pypydir, 'tool', 'build_cffi_imports.py') + if sys.platform == 'darwin': + argv = [filename, '--embed-dependencies'] + else: + argv = [filename,] status, out, err = run_subprocess(str(driver.compute_exe_name()), - [filename, '--embed-dependencies']) + argv) sys.stdout.write(out) sys.stderr.write(err) # otherwise, ignore errors From pypy.commits at gmail.com Wed Sep 11 08:15:31 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 11 Sep 2019 05:15:31 -0700 (PDT) Subject: [pypy-commit] pypy more-cpyext: change order for cpython compatibility, be more verbose in compilation Message-ID: <5d78e563.1c69fb81.189bc.71c7@mx.google.com> Author: Matti Picus Branch: more-cpyext Changeset: r97431:3eae4033694d Date: 2019-09-11 12:33 +0300 http://bitbucket.org/pypy/pypy/changeset/3eae4033694d/ Log: change order for cpython compatibility, be more verbose in compilation diff --git a/lib_pypy/_pypy_testcapi.py b/lib_pypy/_pypy_testcapi.py --- a/lib_pypy/_pypy_testcapi.py +++ b/lib_pypy/_pypy_testcapi.py @@ -61,6 +61,8 @@ assert output_dir is not None from distutils.ccompiler import new_compiler + from distutils import log + log.set_verbosity(3) compiler = new_compiler() compiler.output_dir = output_dir @@ -72,7 +74,8 @@ ccflags = ['-fPIC', '-Wimplicit-function-declaration'] res = compiler.compile([os.path.join(thisdir, csource)], include_dirs=[include_dir], - extra_preargs=ccflags) + extra_preargs=ccflags, + ) object_filename = res[0] # set link options diff --git a/pypy/module/cpyext/parse/cpyext_object.h b/pypy/module/cpyext/parse/cpyext_object.h --- a/pypy/module/cpyext/parse/cpyext_object.h +++ b/pypy/module/cpyext/parse/cpyext_object.h @@ -67,13 +67,12 @@ Py_ssize_t *shape; Py_ssize_t *strides; Py_ssize_t *suboffsets; /* alway NULL for app-level objects*/ + void *internal; /* always NULL for app-level objects */ + + /* Only in PyPY, in CPython thes are allocated/deleted */ unsigned char _format[Py_MAX_FMT]; Py_ssize_t _strides[Py_MAX_NDIMS]; Py_ssize_t _shape[Py_MAX_NDIMS]; - /* static store for shape and strides of - mono-dimensional buffers. */ - /* Py_ssize_t smalltable[2]; */ - void *internal; /* always NULL for app-level objects */ } Py_buffer; typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); From pypy.commits at gmail.com Wed Sep 11 08:15:33 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 11 Sep 2019 05:15:33 -0700 (PDT) Subject: [pypy-commit] pypy more-cpyext: copy in cpython's implementation of pytime.c, adjust headers as needed Message-ID: <5d78e565.1c69fb81.4e419.85d6@mx.google.com> Author: Matti Picus Branch: more-cpyext Changeset: r97432:c421c4bc8247 Date: 2019-09-11 15:13 +0300 http://bitbucket.org/pypy/pypy/changeset/c421c4bc8247/ Log: copy in cpython's implementation of pytime.c, adjust headers as needed diff --git a/lib_pypy/_testcapimodule.c b/lib_pypy/_testcapimodule.c --- a/lib_pypy/_testcapimodule.c +++ b/lib_pypy/_testcapimodule.c @@ -3009,6 +3009,8 @@ return PyLong_FromLong(r); } +#endif /* PYPY_VERSION */ + static int check_time_rounding(int round) { @@ -3069,6 +3071,8 @@ return Py_BuildValue("Nl", _PyLong_FromTime_t(sec), nsec); } +#ifndef PYPY_VERSION + static void slot_tp_del(PyObject *self) { @@ -3902,8 +3906,6 @@ Py_RETURN_NONE; } -#ifndef PYPY_VERSION - static PyObject * test_pytime_fromseconds(PyObject *self, PyObject *args) { @@ -4022,6 +4024,8 @@ return _PyTime_AsNanosecondsObject(ms); } +#ifndef PYPY_VERSION + static PyObject* get_recursion_depth(PyObject *self, PyObject *args) { @@ -4515,7 +4519,6 @@ return_null_without_error, METH_NOARGS}, {"return_result_with_error", return_result_with_error, METH_NOARGS}, -#ifndef PYPY_VERSION {"PyTime_FromSeconds", test_pytime_fromseconds, METH_VARARGS}, {"PyTime_FromSecondsObject", test_pytime_fromsecondsobject, METH_VARARGS}, {"PyTime_AsSecondsDouble", test_pytime_assecondsdouble, METH_VARARGS}, @@ -4525,6 +4528,7 @@ #endif {"PyTime_AsMilliseconds", test_PyTime_AsMilliseconds, METH_VARARGS}, {"PyTime_AsMicroseconds", test_PyTime_AsMicroseconds, METH_VARARGS}, +#ifndef PYPY_VERSION {"get_recursion_depth", get_recursion_depth, METH_NOARGS}, {"pymem_buffer_overflow", pymem_buffer_overflow, METH_NOARGS}, {"pymem_api_misuse", pymem_api_misuse, METH_NOARGS}, @@ -4538,10 +4542,10 @@ {"pyobject_fastcalldict", test_pyobject_fastcalldict, METH_VARARGS}, {"pyobject_fastcallkeywords", test_pyobject_fastcallkeywords, METH_VARARGS}, {"raise_SIGINT_then_send_None", raise_SIGINT_then_send_None, METH_VARARGS}, +#endif #ifdef W_STOPCODE {"W_STOPCODE", py_w_stopcode, METH_VARARGS}, #endif -#endif /* PYPY_VERSION */ {NULL, NULL} /* sentinel */ }; diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py --- a/pypy/module/cpyext/api.py +++ b/pypy/module/cpyext/api.py @@ -1520,6 +1520,7 @@ source_dir / "pythread.c", source_dir / "missing.c", source_dir / "pymem.c", + source_dir / "pytime.c", source_dir / "bytesobject.c", source_dir / "import.c", source_dir / "_warnings.c", diff --git a/pypy/module/cpyext/include/Python.h b/pypy/module/cpyext/include/Python.h --- a/pypy/module/cpyext/include/Python.h +++ b/pypy/module/cpyext/include/Python.h @@ -89,6 +89,7 @@ #include "abstract.h" #include "pymath.h" #include "pyport.h" +#include "pytime.h" #include "pymacro.h" #include "warnings.h" diff --git a/pypy/module/cpyext/include/pyconfig.h b/pypy/module/cpyext/include/pyconfig.h --- a/pypy/module/cpyext/include/pyconfig.h +++ b/pypy/module/cpyext/include/pyconfig.h @@ -28,6 +28,7 @@ #ifndef _WIN32 #define VA_LIST_IS_ARRAY +#define HAVE_CLOCK_GETTIME #endif #ifndef Py_BUILD_CORE /* not building the core - must be an ext */ diff --git a/pypy/module/cpyext/include/pymath.h b/pypy/module/cpyext/include/pymath.h --- a/pypy/module/cpyext/include/pymath.h +++ b/pypy/module/cpyext/include/pymath.h @@ -110,10 +110,21 @@ #pragma float_control (pop) #define Py_NAN __icc_nan() #else /* ICC_NAN_RELAXED as default for Intel Compiler */ - static union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f}; + static const union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f}; #define Py_NAN (__nan_store.__icc_nan) #endif /* ICC_NAN_STRICT */ #endif /* __INTEL_COMPILER */ #endif +/* Return whether integral type *type* is signed or not. */ +#define _Py_IntegralTypeSigned(type) ((type)(-1) < 0) +/* Return the maximum value of integral type *type*. */ +#define _Py_IntegralTypeMax(type) ((_Py_IntegralTypeSigned(type)) ? (((((type)1 << (sizeof(type)*CHAR_BIT - 2)) - 1) << 1) + 1) : ~(type)0) +/* Return the minimum value of integral type *type*. */ +#define _Py_IntegralTypeMin(type) ((_Py_IntegralTypeSigned(type)) ? -_Py_IntegralTypeMax(type) - 1 : 0) +/* Check whether *v* is in the range of integral type *type*. This is most + * useful if *v* is floating-point, since demoting a floating-point *v* to an + * integral type that cannot represent *v*'s integral part is undefined + * behavior. */ +#define _Py_InIntegralTypeRange(type, v) (_Py_IntegralTypeMin(type) <= v && v <= _Py_IntegralTypeMax(type)) #endif /* Py_PYMATH_H */ diff --git a/pypy/module/cpyext/include/pyport.h b/pypy/module/cpyext/include/pyport.h --- a/pypy/module/cpyext/include/pyport.h +++ b/pypy/module/cpyext/include/pyport.h @@ -41,6 +41,7 @@ /* CPython needs this for the c-extension datetime, which is pure python on PyPy downstream packages assume it is here (Pandas for instance) */ +#include #include /* uintptr_t is the C9X name for an unsigned integral type such that a diff --git a/pypy/module/cpyext/src/pytime.c b/pypy/module/cpyext/src/pytime.c new file mode 100644 --- /dev/null +++ b/pypy/module/cpyext/src/pytime.c @@ -0,0 +1,854 @@ +#include "Python.h" +#ifdef MS_WINDOWS +#include +#endif + +#if defined(__APPLE__) +#include /* mach_absolute_time(), mach_timebase_info() */ +#endif + +#define _PyTime_check_mul_overflow(a, b) \ + (assert(b > 0), \ + (_PyTime_t)(a) < _PyTime_MIN / (_PyTime_t)(b) \ + || _PyTime_MAX / (_PyTime_t)(b) < (_PyTime_t)(a)) + +/* To millisecond (10^-3) */ +#define SEC_TO_MS 1000 + +/* To microseconds (10^-6) */ +#define MS_TO_US 1000 +#define SEC_TO_US (SEC_TO_MS * MS_TO_US) + +/* To nanoseconds (10^-9) */ +#define US_TO_NS 1000 +#define MS_TO_NS (MS_TO_US * US_TO_NS) +#define SEC_TO_NS (SEC_TO_MS * MS_TO_NS) + +/* Conversion from nanoseconds */ +#define NS_TO_MS (1000 * 1000) +#define NS_TO_US (1000) + +static void +error_time_t_overflow(void) +{ + PyErr_SetString(PyExc_OverflowError, + "timestamp out of range for platform time_t"); +} + +time_t +_PyLong_AsTime_t(PyObject *obj) +{ +#if SIZEOF_TIME_T == SIZEOF_LONG_LONG + long long val; + val = PyLong_AsLongLong(obj); +#else + long val; + Py_BUILD_ASSERT(sizeof(time_t) <= sizeof(long)); + val = PyLong_AsLong(obj); +#endif + if (val == -1 && PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + error_time_t_overflow(); + return -1; + } + return (time_t)val; +} + +PyObject * +_PyLong_FromTime_t(time_t t) +{ +#if SIZEOF_TIME_T == SIZEOF_LONG_LONG + return PyLong_FromLongLong((long long)t); +#else + Py_BUILD_ASSERT(sizeof(time_t) <= sizeof(long)); + return PyLong_FromLong((long)t); +#endif +} + +/* Round to nearest with ties going to nearest even integer + (_PyTime_ROUND_HALF_EVEN) */ +static double +_PyTime_RoundHalfEven(double x) +{ + double rounded = round(x); + if (fabs(x-rounded) == 0.5) + /* halfway case: round to even */ + rounded = 2.0*round(x/2.0); + return rounded; +} + +static double +_PyTime_Round(double x, _PyTime_round_t round) +{ + /* volatile avoids optimization changing how numbers are rounded */ + volatile double d; + + d = x; + if (round == _PyTime_ROUND_HALF_EVEN){ + d = _PyTime_RoundHalfEven(d); + } + else if (round == _PyTime_ROUND_CEILING){ + d = ceil(d); + } + else if (round == _PyTime_ROUND_FLOOR) { + d = floor(d); + } + else { + assert(round == _PyTime_ROUND_UP); + d = (d >= 0.0) ? ceil(d) : floor(d); + } + return d; +} + +static int +_PyTime_DoubleToDenominator(double d, time_t *sec, long *numerator, + double denominator, _PyTime_round_t round) +{ + double intpart; + /* volatile avoids optimization changing how numbers are rounded */ + volatile double floatpart; + + floatpart = modf(d, &intpart); + + floatpart *= denominator; + floatpart = _PyTime_Round(floatpart, round); + if (floatpart >= denominator) { + floatpart -= denominator; + intpart += 1.0; + } + else if (floatpart < 0) { + floatpart += denominator; + intpart -= 1.0; + } + assert(0.0 <= floatpart && floatpart < denominator); + + if (!_Py_InIntegralTypeRange(time_t, intpart)) { + error_time_t_overflow(); + return -1; + } + *sec = (time_t)intpart; + *numerator = (long)floatpart; + + return 0; +} + +static int +_PyTime_ObjectToDenominator(PyObject *obj, time_t *sec, long *numerator, + double denominator, _PyTime_round_t round) +{ + assert(denominator <= (double)LONG_MAX); + + if (PyFloat_Check(obj)) { + double d = PyFloat_AsDouble(obj); + if (Py_IS_NAN(d)) { + *numerator = 0; + PyErr_SetString(PyExc_ValueError, "Invalid value NaN (not a number)"); + return -1; + } + return _PyTime_DoubleToDenominator(d, sec, numerator, + denominator, round); + } + else { + *sec = _PyLong_AsTime_t(obj); + *numerator = 0; + if (*sec == (time_t)-1 && PyErr_Occurred()) + return -1; + return 0; + } +} + +int +_PyTime_ObjectToTime_t(PyObject *obj, time_t *sec, _PyTime_round_t round) +{ + if (PyFloat_Check(obj)) { + double intpart; + /* volatile avoids optimization changing how numbers are rounded */ + volatile double d; + + d = PyFloat_AsDouble(obj); + if (Py_IS_NAN(d)) { + PyErr_SetString(PyExc_ValueError, "Invalid value NaN (not a number)"); + return -1; + } + + d = _PyTime_Round(d, round); + (void)modf(d, &intpart); + + if (!_Py_InIntegralTypeRange(time_t, intpart)) { + error_time_t_overflow(); + return -1; + } + *sec = (time_t)intpart; + return 0; + } + else { + *sec = _PyLong_AsTime_t(obj); + if (*sec == (time_t)-1 && PyErr_Occurred()) + return -1; + return 0; + } +} + +int +_PyTime_ObjectToTimespec(PyObject *obj, time_t *sec, long *nsec, + _PyTime_round_t round) +{ + int res; + res = _PyTime_ObjectToDenominator(obj, sec, nsec, 1e9, round); + if (res == 0) { + assert(0 <= *nsec && *nsec < SEC_TO_NS); + } + return res; +} + +int +_PyTime_ObjectToTimeval(PyObject *obj, time_t *sec, long *usec, + _PyTime_round_t round) +{ + int res; + res = _PyTime_ObjectToDenominator(obj, sec, usec, 1e6, round); + if (res == 0) { + assert(0 <= *usec && *usec < SEC_TO_US); + } + return res; +} + +static void +_PyTime_overflow(void) +{ + PyErr_SetString(PyExc_OverflowError, + "timestamp too large to convert to C _PyTime_t"); +} + +_PyTime_t +_PyTime_FromSeconds(int seconds) +{ + _PyTime_t t; + t = (_PyTime_t)seconds; + /* ensure that integer overflow cannot happen, int type should have 32 + bits, whereas _PyTime_t type has at least 64 bits (SEC_TO_MS takes 30 + bits). */ + Py_BUILD_ASSERT(INT_MAX <= _PyTime_MAX / SEC_TO_NS); + Py_BUILD_ASSERT(INT_MIN >= _PyTime_MIN / SEC_TO_NS); + assert((t >= 0 && t <= _PyTime_MAX / SEC_TO_NS) + || (t < 0 && t >= _PyTime_MIN / SEC_TO_NS)); + t *= SEC_TO_NS; + return t; +} + +_PyTime_t +_PyTime_FromNanoseconds(long long ns) +{ + _PyTime_t t; + Py_BUILD_ASSERT(sizeof(long long) <= sizeof(_PyTime_t)); + t = Py_SAFE_DOWNCAST(ns, long long, _PyTime_t); + return t; +} + +#ifdef HAVE_CLOCK_GETTIME +static int +_PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts, int raise) +{ + _PyTime_t t; + int res = 0; + + Py_BUILD_ASSERT(sizeof(ts->tv_sec) <= sizeof(_PyTime_t)); + t = (_PyTime_t)ts->tv_sec; + + if (_PyTime_check_mul_overflow(t, SEC_TO_NS)) { + if (raise) + _PyTime_overflow(); + res = -1; + } + t = t * SEC_TO_NS; + + t += ts->tv_nsec; + + *tp = t; + return res; +} +#elif !defined(MS_WINDOWS) +static int +_PyTime_FromTimeval(_PyTime_t *tp, struct timeval *tv, int raise) +{ + _PyTime_t t; + int res = 0; + + Py_BUILD_ASSERT(sizeof(tv->tv_sec) <= sizeof(_PyTime_t)); + t = (_PyTime_t)tv->tv_sec; + + if (_PyTime_check_mul_overflow(t, SEC_TO_NS)) { + if (raise) + _PyTime_overflow(); + res = -1; + } + t = t * SEC_TO_NS; + + t += (_PyTime_t)tv->tv_usec * US_TO_NS; + + *tp = t; + return res; +} +#endif + +static int +_PyTime_FromFloatObject(_PyTime_t *t, double value, _PyTime_round_t round, + long unit_to_ns) +{ + /* volatile avoids optimization changing how numbers are rounded */ + volatile double d; + + /* convert to a number of nanoseconds */ + d = value; + d *= (double)unit_to_ns; + d = _PyTime_Round(d, round); + + if (!_Py_InIntegralTypeRange(_PyTime_t, d)) { + _PyTime_overflow(); + return -1; + } + *t = (_PyTime_t)d; + return 0; +} + +static int +_PyTime_FromObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round, + long unit_to_ns) +{ + if (PyFloat_Check(obj)) { + double d; + d = PyFloat_AsDouble(obj); + if (Py_IS_NAN(d)) { + PyErr_SetString(PyExc_ValueError, "Invalid value NaN (not a number)"); + return -1; + } + return _PyTime_FromFloatObject(t, d, round, unit_to_ns); + } + else { + long long sec; + Py_BUILD_ASSERT(sizeof(long long) <= sizeof(_PyTime_t)); + + sec = PyLong_AsLongLong(obj); + if (sec == -1 && PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + _PyTime_overflow(); + return -1; + } + + if (_PyTime_check_mul_overflow(sec, unit_to_ns)) { + _PyTime_overflow(); + return -1; + } + *t = sec * unit_to_ns; + return 0; + } +} + +int +_PyTime_FromSecondsObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round) +{ + return _PyTime_FromObject(t, obj, round, SEC_TO_NS); +} + +int +_PyTime_FromMillisecondsObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round) +{ + return _PyTime_FromObject(t, obj, round, MS_TO_NS); +} + +double +_PyTime_AsSecondsDouble(_PyTime_t t) +{ + /* volatile avoids optimization changing how numbers are rounded */ + volatile double d; + + if (t % SEC_TO_NS == 0) { + _PyTime_t secs; + /* Divide using integers to avoid rounding issues on the integer part. + 1e-9 cannot be stored exactly in IEEE 64-bit. */ + secs = t / SEC_TO_NS; + d = (double)secs; + } + else { + d = (double)t; + d /= 1e9; + } + return d; +} + +PyObject * +_PyTime_AsNanosecondsObject(_PyTime_t t) +{ + Py_BUILD_ASSERT(sizeof(long long) >= sizeof(_PyTime_t)); + return PyLong_FromLongLong((long long)t); +} + +static _PyTime_t +_PyTime_Divide(const _PyTime_t t, const _PyTime_t k, + const _PyTime_round_t round) +{ + assert(k > 1); + if (round == _PyTime_ROUND_HALF_EVEN) { + _PyTime_t x, r, abs_r; + x = t / k; + r = t % k; + abs_r = Py_ABS(r); + if (abs_r > k / 2 || (abs_r == k / 2 && (Py_ABS(x) & 1))) { + if (t >= 0) + x++; + else + x--; + } + return x; + } + else if (round == _PyTime_ROUND_CEILING) { + if (t >= 0){ + return (t + k - 1) / k; + } + else{ + return t / k; + } + } + else if (round == _PyTime_ROUND_FLOOR){ + if (t >= 0) { + return t / k; + } + else{ + return (t - (k - 1)) / k; + } + } + else { + assert(round == _PyTime_ROUND_UP); + if (t >= 0) { + return (t + k - 1) / k; + } + else { + return (t - (k - 1)) / k; + } + } +} + +_PyTime_t +_PyTime_AsMilliseconds(_PyTime_t t, _PyTime_round_t round) +{ + return _PyTime_Divide(t, NS_TO_MS, round); +} + +_PyTime_t +_PyTime_AsMicroseconds(_PyTime_t t, _PyTime_round_t round) +{ + return _PyTime_Divide(t, NS_TO_US, round); +} + +static int +_PyTime_AsTimeval_impl(_PyTime_t t, _PyTime_t *p_secs, int *p_us, + _PyTime_round_t round) +{ + _PyTime_t secs, ns; + int usec; + int res = 0; + + secs = t / SEC_TO_NS; + ns = t % SEC_TO_NS; + + usec = (int)_PyTime_Divide(ns, US_TO_NS, round); + if (usec < 0) { + usec += SEC_TO_US; + if (secs != _PyTime_MIN) + secs -= 1; + else + res = -1; + } + else if (usec >= SEC_TO_US) { + usec -= SEC_TO_US; + if (secs != _PyTime_MAX) + secs += 1; + else + res = -1; + } + assert(0 <= usec && usec < SEC_TO_US); + + *p_secs = secs; + *p_us = usec; + + return res; +} + +static int +_PyTime_AsTimevalStruct_impl(_PyTime_t t, struct timeval *tv, + _PyTime_round_t round, int raise) +{ + _PyTime_t secs, secs2; + int us; + int res; + + res = _PyTime_AsTimeval_impl(t, &secs, &us, round); + +#ifdef MS_WINDOWS + tv->tv_sec = (long)secs; +#else + tv->tv_sec = secs; +#endif + tv->tv_usec = us; + + secs2 = (_PyTime_t)tv->tv_sec; + if (res < 0 || secs2 != secs) { + if (raise) + error_time_t_overflow(); + return -1; + } + return 0; +} + +int +_PyTime_AsTimeval(_PyTime_t t, struct timeval *tv, _PyTime_round_t round) +{ + return _PyTime_AsTimevalStruct_impl(t, tv, round, 1); +} + +int +_PyTime_AsTimeval_noraise(_PyTime_t t, struct timeval *tv, _PyTime_round_t round) +{ + return _PyTime_AsTimevalStruct_impl(t, tv, round, 0); +} + +int +_PyTime_AsTimevalTime_t(_PyTime_t t, time_t *p_secs, int *us, + _PyTime_round_t round) +{ + _PyTime_t secs; + int res; + + res = _PyTime_AsTimeval_impl(t, &secs, us, round); + + *p_secs = secs; + + if (res < 0 || (_PyTime_t)*p_secs != secs) { + error_time_t_overflow(); + return -1; + } + return 0; +} + + +#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE) +int +_PyTime_AsTimespec(_PyTime_t t, struct timespec *ts) +{ + _PyTime_t secs, nsec; + + secs = t / SEC_TO_NS; + nsec = t % SEC_TO_NS; + if (nsec < 0) { + nsec += SEC_TO_NS; + secs -= 1; + } + ts->tv_sec = (time_t)secs; + assert(0 <= nsec && nsec < SEC_TO_NS); + ts->tv_nsec = nsec; + + if ((_PyTime_t)ts->tv_sec != secs) { + error_time_t_overflow(); + return -1; + } + return 0; +} +#endif + +static int +pygettimeofday(_PyTime_t *tp, _Py_clock_info_t *info, int raise) +{ +#ifdef MS_WINDOWS + FILETIME system_time; + ULARGE_INTEGER large; + + assert(info == NULL || raise); + + GetSystemTimeAsFileTime(&system_time); + large.u.LowPart = system_time.dwLowDateTime; + large.u.HighPart = system_time.dwHighDateTime; + /* 11,644,473,600,000,000,000: number of nanoseconds between + the 1st january 1601 and the 1st january 1970 (369 years + 89 leap + days). */ + *tp = large.QuadPart * 100 - 11644473600000000000; + if (info) { + DWORD timeAdjustment, timeIncrement; + BOOL isTimeAdjustmentDisabled, ok; + + info->implementation = "GetSystemTimeAsFileTime()"; + info->monotonic = 0; + ok = GetSystemTimeAdjustment(&timeAdjustment, &timeIncrement, + &isTimeAdjustmentDisabled); + if (!ok) { + PyErr_SetFromWindowsErr(0); + return -1; + } + info->resolution = timeIncrement * 1e-7; + info->adjustable = 1; + } + +#else /* MS_WINDOWS */ + int err; +#ifdef HAVE_CLOCK_GETTIME + struct timespec ts; +#else + struct timeval tv; +#endif + + assert(info == NULL || raise); + +#ifdef HAVE_CLOCK_GETTIME + err = clock_gettime(CLOCK_REALTIME, &ts); + if (err) { + if (raise) + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + if (_PyTime_FromTimespec(tp, &ts, raise) < 0) + return -1; + + if (info) { + struct timespec res; + info->implementation = "clock_gettime(CLOCK_REALTIME)"; + info->monotonic = 0; + info->adjustable = 1; + if (clock_getres(CLOCK_REALTIME, &res) == 0) + info->resolution = res.tv_sec + res.tv_nsec * 1e-9; + else + info->resolution = 1e-9; + } +#else /* HAVE_CLOCK_GETTIME */ + + /* test gettimeofday() */ +#ifdef GETTIMEOFDAY_NO_TZ + err = gettimeofday(&tv); +#else + err = gettimeofday(&tv, (struct timezone *)NULL); +#endif + if (err) { + if (raise) + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + if (_PyTime_FromTimeval(tp, &tv, raise) < 0) + return -1; + + if (info) { + info->implementation = "gettimeofday()"; + info->resolution = 1e-6; + info->monotonic = 0; + info->adjustable = 1; + } +#endif /* !HAVE_CLOCK_GETTIME */ +#endif /* !MS_WINDOWS */ + return 0; +} + +_PyTime_t +_PyTime_GetSystemClock(void) +{ + _PyTime_t t; + if (pygettimeofday(&t, NULL, 0) < 0) { + /* should not happen, _PyTime_Init() checked the clock at startup */ + assert(0); + + /* use a fixed value instead of a random value from the stack */ + t = 0; + } + return t; +} + +int +_PyTime_GetSystemClockWithInfo(_PyTime_t *t, _Py_clock_info_t *info) +{ + return pygettimeofday(t, info, 1); +} + +static int +pymonotonic(_PyTime_t *tp, _Py_clock_info_t *info, int raise) +{ +#if defined(MS_WINDOWS) + ULONGLONG ticks; + _PyTime_t t; + + assert(info == NULL || raise); + + ticks = GetTickCount64(); + Py_BUILD_ASSERT(sizeof(ticks) <= sizeof(_PyTime_t)); + t = (_PyTime_t)ticks; + + if (_PyTime_check_mul_overflow(t, MS_TO_NS)) { + if (raise) { + _PyTime_overflow(); + return -1; + } + /* Hello, time traveler! */ + assert(0); + } + *tp = t * MS_TO_NS; + + if (info) { + DWORD timeAdjustment, timeIncrement; + BOOL isTimeAdjustmentDisabled, ok; + info->implementation = "GetTickCount64()"; + info->monotonic = 1; + ok = GetSystemTimeAdjustment(&timeAdjustment, &timeIncrement, + &isTimeAdjustmentDisabled); + if (!ok) { + PyErr_SetFromWindowsErr(0); + return -1; + } + info->resolution = timeIncrement * 1e-7; + info->adjustable = 0; + } + +#elif defined(__APPLE__) + static mach_timebase_info_data_t timebase; + uint64_t time; + + if (timebase.denom == 0) { + /* According to the Technical Q&A QA1398, mach_timebase_info() cannot + fail: https://developer.apple.com/library/mac/#qa/qa1398/ */ + (void)mach_timebase_info(&timebase); + } + + time = mach_absolute_time(); + + /* apply timebase factor */ + time *= timebase.numer; + time /= timebase.denom; + + *tp = time; + + if (info) { + info->implementation = "mach_absolute_time()"; + info->resolution = (double)timebase.numer / timebase.denom * 1e-9; + info->monotonic = 1; + info->adjustable = 0; + } + +#else + struct timespec ts; +#ifdef CLOCK_HIGHRES + const clockid_t clk_id = CLOCK_HIGHRES; + const char *implementation = "clock_gettime(CLOCK_HIGHRES)"; +#else + const clockid_t clk_id = CLOCK_MONOTONIC; + const char *implementation = "clock_gettime(CLOCK_MONOTONIC)"; +#endif + + assert(info == NULL || raise); + + if (clock_gettime(clk_id, &ts) != 0) { + if (raise) { + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + return -1; + } + + if (info) { + struct timespec res; + info->monotonic = 1; + info->implementation = implementation; + info->adjustable = 0; + if (clock_getres(clk_id, &res) != 0) { + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + info->resolution = res.tv_sec + res.tv_nsec * 1e-9; + } + if (_PyTime_FromTimespec(tp, &ts, raise) < 0) + return -1; +#endif + return 0; +} + +_PyTime_t +_PyTime_GetMonotonicClock(void) +{ + _PyTime_t t; + if (pymonotonic(&t, NULL, 0) < 0) { + /* should not happen, _PyTime_Init() checked that monotonic clock at + startup */ + assert(0); + + /* use a fixed value instead of a random value from the stack */ + t = 0; + } + return t; +} + +int +_PyTime_GetMonotonicClockWithInfo(_PyTime_t *tp, _Py_clock_info_t *info) +{ + return pymonotonic(tp, info, 1); +} + +int +_PyTime_Init(void) +{ + _PyTime_t t; + + /* ensure that the system clock works */ + if (_PyTime_GetSystemClockWithInfo(&t, NULL) < 0) + return -1; + + /* ensure that the operating system provides a monotonic clock */ + if (_PyTime_GetMonotonicClockWithInfo(&t, NULL) < 0) + return -1; + + return 0; +} + +int +_PyTime_localtime(time_t t, struct tm *tm) +{ +#ifdef MS_WINDOWS + int error; + + error = localtime_s(tm, &t); + if (error != 0) { + errno = error; + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + return 0; +#else /* !MS_WINDOWS */ + if (localtime_r(&t, tm) == NULL) { +#ifdef EINVAL + if (errno == 0) + errno = EINVAL; +#endif + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + return 0; +#endif /* MS_WINDOWS */ +} + +int +_PyTime_gmtime(time_t t, struct tm *tm) +{ +#ifdef MS_WINDOWS + int error; + + error = gmtime_s(tm, &t); + if (error != 0) { + errno = error; + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + return 0; +#else /* !MS_WINDOWS */ + if (gmtime_r(&t, tm) == NULL) { +#ifdef EINVAL + if (errno == 0) + errno = EINVAL; +#endif + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + return 0; +#endif /* MS_WINDOWS */ +} From pypy.commits at gmail.com Wed Sep 11 08:37:44 2019 From: pypy.commits at gmail.com (cfbolz) Date: Wed, 11 Sep 2019 05:37:44 -0700 (PDT) Subject: [pypy-commit] pypy default: backport d84985e571ba to default: Message-ID: <5d78ea98.1c69fb81.2d599.97aa@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97433:69bb930ed884 Date: 2019-09-11 11:09 +0200 http://bitbucket.org/pypy/pypy/changeset/69bb930ed884/ Log: backport d84985e571ba to default: optimize W_TextIOWrapper._readline by not doing a slice for every single character :-(. Still more work to be done diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -294,6 +294,7 @@ class DecodeBuffer(object): def __init__(self, text=None): + # self.text is a valid utf-8 string self.text = text self.pos = 0 self.upos = 0 @@ -310,6 +311,7 @@ self.upos = 0 def get_chars(self, size): + """ returns a tuple (utf8, lgt) """ if self.text is None or size == 0: return "" @@ -323,7 +325,7 @@ start = self.pos ret = [] pos = start - for i in range(size): + for i in range(size): pos = next_codepoint_pos(self.text, pos) self.upos += 1 assert start >= 0 @@ -372,22 +374,22 @@ limit = sys.maxint scanned = 0 while scanned < limit: - try: - ch = self.next_char() - scanned += 1 - except StopIteration: + if self.exhausted(): return False + ch = self.text[self.pos] + self._advance_codepoint() + scanned += 1 if ch == '\n': return True if ch == '\r': if scanned >= limit: return False - try: - ch = self.peek_char() - except StopIteration: + if self.exhausted(): + # don't split potential \r\n return False + ch = self.text[self.pos] if ch == '\n': - self.next_char() + self._advance_codepoint() return True else: return True @@ -398,39 +400,48 @@ limit = sys.maxint scanned = 0 while scanned < limit: - try: - ch = self.next_char() - except StopIteration: + if self.exhausted(): return False + ch = self.text[self.pos] + self._advance_codepoint() scanned += 1 if ch == '\r': if scanned >= limit: return False - try: - if self.peek_char() == '\n': - self.next_char() - return True - except StopIteration: - # This is the tricky case: we found a \r right at the end + if self.exhausted(): + # This is the tricky case: we found a \r right at the end, + # un-consume it self.pos -= 1 self.upos -= 1 return False + if self.text[self.pos] == '\n': + self._advance_codepoint() + return True return False def find_char(self, marker, limit): + # only works for ascii markers! + assert 0 <= ord(marker) < 128 if limit < 0: limit = sys.maxint scanned = 0 while scanned < limit: - try: - ch = self.next_char() - except StopIteration: + # don't use next_char here, since that computes a slice etc + if self.exhausted(): return False - if ch == marker: + # this is never true if self.text[pos] is part of a larger char + found = self.text[self.pos] == marker + self._advance_codepoint() + if found: return True scanned += 1 return False + def _advance_codepoint(self): + # must only be called after checking self.exhausted()! + self.pos = next_codepoint_pos(self.text, self.pos) + self.upos += 1 + def check_decoded(space, w_decoded): if not space.isinstance_w(w_decoded, space.w_unicode): @@ -739,28 +750,32 @@ self._writeflush(space) limit = convert_size(space, w_limit) + text, lgt = self._readline(space, limit) + return space.newutf8(text, lgt) + + def _readline(self, space, limit): + # This is a separate function so that readline_w() can be jitted. remnant = None - builder = StringBuilder() - # XXX maybe use Utf8StringBuilder instead? + builder = Utf8StringBuilder() while True: # First, get some data if necessary has_data = self._ensure_data(space) if not has_data: # end of file if remnant: - builder.append(remnant) + builder.append(remnant) # XXX break if remnant: assert not self.readtranslate and self.readnl == '\r\n' assert self.decoded.pos == 0 if remnant == '\r' and self.decoded.text[0] == '\n': - builder.append('\r\n') + builder.append_utf8('\r\n', 2) self.decoded.pos = 1 remnant = None break else: - builder.append(remnant) + builder.append(remnant) # XXX remnant = None continue @@ -770,12 +785,14 @@ else: remaining = -1 start = self.decoded.pos + ustart = self.decoded.upos assert start >= 0 found = self._scan_line_ending(remaining) end_scan = self.decoded.pos + uend_scan = self.decoded.upos if end_scan > start: s = self.decoded.text[start:end_scan] - builder.append(s) + builder.append_utf8(s, uend_scan - ustart) if found or (limit >= 0 and builder.getlength() >= limit): break @@ -788,8 +805,8 @@ self.decoded.reset() result = builder.build() - lgt = get_utf8_length(result) - return space.newutf8(result, lgt) + lgt = builder.getlength() + return (result, lgt) # _____________________________________________________________ # write methods From pypy.commits at gmail.com Wed Sep 11 08:37:45 2019 From: pypy.commits at gmail.com (cfbolz) Date: Wed, 11 Sep 2019 05:37:45 -0700 (PDT) Subject: [pypy-commit] pypy default: backport eee2717be5e2 to default: Message-ID: <5d78ea99.1c69fb81.2eca8.3207@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97434:2352eded240c Date: 2019-09-11 13:42 +0200 http://bitbucket.org/pypy/pypy/changeset/2352eded240c/ Log: backport eee2717be5e2 to default: more improvement to the performance of _io: make get_chars track the number of unicode codepoints. also fix a bug in W_TextIOWrapper._read that assumed ascii diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -293,14 +293,18 @@ class DecodeBuffer(object): - def __init__(self, text=None): + def __init__(self, text=None, ulen=-1): # self.text is a valid utf-8 string + if text is not None: + assert ulen >= 0 self.text = text self.pos = 0 self.upos = 0 + self.ulen = ulen def set(self, space, w_decoded): check_decoded(space, w_decoded) + self.ulen = space.len_w(w_decoded) self.text = space.utf8_w(w_decoded) self.pos = 0 self.upos = 0 @@ -309,13 +313,14 @@ self.text = None self.pos = 0 self.upos = 0 + self.ulen = -1 def get_chars(self, size): """ returns a tuple (utf8, lgt) """ if self.text is None or size == 0: - return "" + return "", 0 - lgt = codepoints_in_utf8(self.text) + lgt = self.ulen available = lgt - self.upos if size < 0 or size > available: size = available @@ -323,7 +328,6 @@ if self.pos > 0 or size < available: start = self.pos - ret = [] pos = start for i in range(size): pos = next_codepoint_pos(self.text, pos) @@ -336,8 +340,9 @@ chars = self.text self.pos = len(self.text) self.upos = lgt + size = lgt - return chars + return chars, size def has_data(self): return (self.text is not None and not self.exhausted()) @@ -709,8 +714,7 @@ w_bytes = space.call_method(self.w_buffer, "read") w_decoded = space.call_method(self.w_decoder, "decode", w_bytes, space.w_True) check_decoded(space, w_decoded) - chars = self.decoded.get_chars(-1) - lgt = get_utf8_length(chars) + chars, lgt = self.decoded.get_chars(-1) w_result = space.newutf8(chars, lgt) w_final = space.add(w_result, w_decoded) self.snapshot = None @@ -723,9 +727,9 @@ while remaining > 0: if not self._ensure_data(space): break - data = self.decoded.get_chars(remaining) - builder.append(data) - remaining -= len(data) + data, size = self.decoded.get_chars(remaining) + builder.append_utf8(data, size) + remaining -= size return space.newutf8(builder.build(), builder.getlength()) @@ -756,6 +760,7 @@ def _readline(self, space, limit): # This is a separate function so that readline_w() can be jitted. remnant = None + remnant_ulen = -1 builder = Utf8StringBuilder() while True: # First, get some data if necessary @@ -763,7 +768,7 @@ if not has_data: # end of file if remnant: - builder.append(remnant) # XXX + builder.append_utf8(remnant, remnant_ulen) break if remnant: @@ -772,11 +777,14 @@ if remnant == '\r' and self.decoded.text[0] == '\n': builder.append_utf8('\r\n', 2) self.decoded.pos = 1 + self.decoded.upos = 1 remnant = None + remnant_ulen = -1 break else: - builder.append(remnant) # XXX + builder.append_utf8(remnant, remnant_ulen) remnant = None + remnant_ulen = -1 continue if limit >= 0: @@ -800,7 +808,7 @@ # There may be some remaining chars we'll have to prepend to the # next chunk of data if not self.decoded.exhausted(): - remnant = self.decoded.get_chars(-1) + remnant, remnant_ulen = self.decoded.get_chars(-1) # We have consumed the buffer self.decoded.reset() diff --git a/pypy/module/_io/test/test_interp_textio.py b/pypy/module/_io/test/test_interp_textio.py --- a/pypy/module/_io/test/test_interp_textio.py +++ b/pypy/module/_io/test/test_interp_textio.py @@ -58,27 +58,31 @@ @given(st.text()) def test_read_buffer(text): - buf = DecodeBuffer(text.encode('utf-8')) - assert buf.get_chars(-1) == text.encode('utf-8') + buf = DecodeBuffer(text.encode('utf8'), len(text)) + chars, size = buf.get_chars(-1) + assert chars.decode('utf8') == text + assert len(text) == size assert buf.exhausted() @given(st.text(), st.lists(st.integers(min_value=0))) @example(u'\x80', [1]) def test_readn_buffer(text, sizes): - buf = DecodeBuffer(text.encode('utf-8')) + buf = DecodeBuffer(text.encode('utf8'), len(text)) strings = [] for n in sizes: - s = buf.get_chars(n) + chars, size = buf.get_chars(n) + s = chars.decode('utf8') + assert size == len(s) if not buf.exhausted(): - assert len(s.decode('utf-8')) == n + assert len(s) == n else: - assert len(s.decode('utf-8')) <= n + assert len(s) <= n strings.append(s) - assert ''.join(strings) == text[:sum(sizes)].encode('utf-8') + assert ''.join(strings) == text[:sum(sizes)] @given(st.text()) def test_next_char(text): - buf = DecodeBuffer(text.encode('utf-8')) + buf = DecodeBuffer(text.encode('utf8'), len(text)) for i in range(len(text)): ch = buf.next_char() assert ch == text[i].encode('utf-8') diff --git a/pypy/module/_io/test/test_textio.py b/pypy/module/_io/test/test_textio.py --- a/pypy/module/_io/test/test_textio.py +++ b/pypy/module/_io/test/test_textio.py @@ -1,3 +1,5 @@ +#encoding: utf-8 + class AppTestTextIO: spaceconfig = dict(usemodules=['_io', '_locale']) @@ -103,6 +105,16 @@ reads += t.readline() assert reads == u"abc\ndef\n" + def test_read_bug_unicode(self): + import _io + inp = b"\xc3\xa4bc\ndef\n" + r = _io.BytesIO(inp) + t = _io.TextIOWrapper(r, encoding="utf-8") + reads = t.read(4) + assert reads == inp[:5].decode("utf-8") + reads += t.readline() + assert reads == inp.decode("utf-8") + def test_encoded_writes(self): import _io data = u"1234567890" From pypy.commits at gmail.com Wed Sep 11 08:39:34 2019 From: pypy.commits at gmail.com (cfbolz) Date: Wed, 11 Sep 2019 05:39:34 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: optimize W_TextIOWrapper._readline by not doing a slice for every single Message-ID: <5d78eb06.1c69fb81.4cb6b.fcfc@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97435:11abdafa1ff7 Date: 2019-09-11 11:09 +0200 http://bitbucket.org/pypy/pypy/changeset/11abdafa1ff7/ Log: optimize W_TextIOWrapper._readline by not doing a slice for every single character :-(. Still more work to be done diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -309,7 +309,8 @@ class DecodeBuffer(object): def __init__(self, text=None): - self.text = text + # self.text is a valid utf-8 string + self.text = None self.pos = 0 self.upos = 0 @@ -325,6 +326,7 @@ self.upos = 0 def get_chars(self, size): + """ returns a tuple (utf8, lgt) """ if self.text is None or size == 0: return "" @@ -337,7 +339,7 @@ if self.pos > 0 or size < available: start = self.pos pos = start - for i in range(size): + for i in range(size): pos = next_codepoint_pos(self.text, pos) self.upos += 1 assert start >= 0 @@ -386,22 +388,22 @@ limit = sys.maxint scanned = 0 while scanned < limit: - try: - ch = self.next_char() - scanned += 1 - except StopIteration: + if self.exhausted(): return False + ch = self.text[self.pos] + self._advance_codepoint() + scanned += 1 if ch == '\n': return True if ch == '\r': if scanned >= limit: return False - try: - ch = self.peek_char() - except StopIteration: + if self.exhausted(): + # don't split potential \r\n return False + ch = self.text[self.pos] if ch == '\n': - self.next_char() + self._advance_codepoint() return True else: return True @@ -412,39 +414,48 @@ limit = sys.maxint scanned = 0 while scanned < limit: - try: - ch = self.next_char() - except StopIteration: + if self.exhausted(): return False + ch = self.text[self.pos] + self._advance_codepoint() scanned += 1 if ch == '\r': if scanned >= limit: return False - try: - if self.peek_char() == '\n': - self.next_char() - return True - except StopIteration: - # This is the tricky case: we found a \r right at the end + if self.exhausted(): + # This is the tricky case: we found a \r right at the end, + # un-consume it self.pos -= 1 self.upos -= 1 return False + if self.text[self.pos] == '\n': + self._advance_codepoint() + return True return False def find_char(self, marker, limit): + # only works for ascii markers! + assert 0 <= ord(marker) < 128 if limit < 0: limit = sys.maxint scanned = 0 while scanned < limit: - try: - ch = self.next_char() - except StopIteration: + # don't use next_char here, since that computes a slice etc + if self.exhausted(): return False - if ch == marker: + # this is never true if self.text[pos] is part of a larger char + found = self.text[self.pos] == marker + self._advance_codepoint() + if found: return True scanned += 1 return False + def _advance_codepoint(self): + # must only be called after checking self.exhausted()! + self.pos = next_codepoint_pos(self.text, self.pos) + self.upos += 1 + def check_decoded(space, w_decoded): if not space.isinstance_w(w_decoded, space.w_unicode): @@ -787,32 +798,32 @@ self._check_closed(space) self._writeflush(space) limit = convert_size(space, w_limit) - return space.newtext(*self._readline(space, limit)) + text, lgt = self._readline(space, limit) + return space.newutf8(text, lgt) def _readline(self, space, limit): # This is a separate function so that readline_w() can be jitted. remnant = None - builder = StringBuilder() - # XXX maybe use Utf8StringBuilder instead? + builder = Utf8StringBuilder() while True: # First, get some data if necessary has_data = self._ensure_data(space) if not has_data: # end of file if remnant: - builder.append(remnant) + builder.append(remnant) # XXX break if remnant: assert not self.readtranslate and self.readnl == '\r\n' assert self.decoded.pos == 0 if remnant == '\r' and self.decoded.text[0] == '\n': - builder.append('\r\n') + builder.append_utf8('\r\n', 2) self.decoded.pos = 1 remnant = None break else: - builder.append(remnant) + builder.append(remnant) # XXX remnant = None continue @@ -822,12 +833,14 @@ else: remaining = -1 start = self.decoded.pos + ustart = self.decoded.upos assert start >= 0 found = self._scan_line_ending(remaining) end_scan = self.decoded.pos + uend_scan = self.decoded.upos if end_scan > start: s = self.decoded.text[start:end_scan] - builder.append(s) + builder.append_utf8(s, uend_scan - ustart) if found or (limit >= 0 and builder.getlength() >= limit): break @@ -840,8 +853,8 @@ self.decoded.reset() result = builder.build() - lgt = get_utf8_length(result) - return (result, lgt, lgt) + lgt = builder.getlength() + return (result, lgt) # _____________________________________________________________ # write methods From pypy.commits at gmail.com Wed Sep 11 08:39:35 2019 From: pypy.commits at gmail.com (cfbolz) Date: Wed, 11 Sep 2019 05:39:35 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: more improvement to the performance of _io: Message-ID: <5d78eb07.1c69fb81.d4c68.0f2b@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97436:7c591df76a01 Date: 2019-09-11 13:42 +0200 http://bitbucket.org/pypy/pypy/changeset/7c591df76a01/ Log: more improvement to the performance of _io: make get_chars track the number of unicode codepoints. also fix a bug in W_TextIOWrapper._read that assumed ascii diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -308,14 +308,18 @@ class DecodeBuffer(object): - def __init__(self, text=None): + def __init__(self, text=None, ulen=-1): # self.text is a valid utf-8 string - self.text = None + if text is not None: + assert ulen >= 0 + self.text = text self.pos = 0 self.upos = 0 + self.ulen = ulen def set(self, space, w_decoded): check_decoded(space, w_decoded) + self.ulen = space.len_w(w_decoded) self.text = space.utf8_w(w_decoded) self.pos = 0 self.upos = 0 @@ -324,13 +328,14 @@ self.text = None self.pos = 0 self.upos = 0 + self.ulen = -1 def get_chars(self, size): """ returns a tuple (utf8, lgt) """ if self.text is None or size == 0: - return "" + return "", 0 - lgt = codepoints_in_utf8(self.text) + lgt = self.ulen available = lgt - self.upos if size < 0 or size > available: size = available @@ -350,8 +355,9 @@ chars = self.text self.pos = len(self.text) self.upos = lgt + size = lgt - return chars + return chars, size def has_data(self): return (self.text is not None and not self.exhausted()) @@ -758,7 +764,7 @@ w_bytes = space.call_method(self.w_buffer, "read") w_decoded = space.call_method(self.w_decoder, "decode", w_bytes, space.w_True) check_decoded(space, w_decoded) - w_result = space.newtext(self.decoded.get_chars(-1)) + w_result = space.newutf8(*self.decoded.get_chars(-1)) w_final = space.add(w_result, w_decoded) self.decoded.reset() self.snapshot = None @@ -766,15 +772,15 @@ def _read(self, space, size): remaining = size - builder = StringBuilder(size) + builder = Utf8StringBuilder(size) # Keep reading chunks until we have n characters to return while remaining > 0: if not self._ensure_data(space): break - data = self.decoded.get_chars(remaining) - builder.append(data) - remaining -= len(data) + data, size = self.decoded.get_chars(remaining) + builder.append_utf8(data, size) + remaining -= size return space.newutf8(builder.build(), builder.getlength()) @@ -804,6 +810,7 @@ def _readline(self, space, limit): # This is a separate function so that readline_w() can be jitted. remnant = None + remnant_ulen = -1 builder = Utf8StringBuilder() while True: # First, get some data if necessary @@ -811,7 +818,7 @@ if not has_data: # end of file if remnant: - builder.append(remnant) # XXX + builder.append_utf8(remnant, remnant_ulen) break if remnant: @@ -820,11 +827,14 @@ if remnant == '\r' and self.decoded.text[0] == '\n': builder.append_utf8('\r\n', 2) self.decoded.pos = 1 + self.decoded.upos = 1 remnant = None + remnant_ulen = -1 break else: - builder.append(remnant) # XXX + builder.append_utf8(remnant, remnant_ulen) remnant = None + remnant_ulen = -1 continue if limit >= 0: @@ -848,7 +858,7 @@ # There may be some remaining chars we'll have to prepend to the # next chunk of data if not self.decoded.exhausted(): - remnant = self.decoded.get_chars(-1) + remnant, remnant_ulen = self.decoded.get_chars(-1) # We have consumed the buffer self.decoded.reset() diff --git a/pypy/module/_io/test/test_interp_textio.py b/pypy/module/_io/test/test_interp_textio.py --- a/pypy/module/_io/test/test_interp_textio.py +++ b/pypy/module/_io/test/test_interp_textio.py @@ -58,17 +58,21 @@ @given(st.text()) def test_read_buffer(text): - buf = DecodeBuffer(text.encode('utf8')) - assert buf.get_chars(-1).decode('utf8') == text + buf = DecodeBuffer(text.encode('utf8'), len(text)) + chars, size = buf.get_chars(-1) + assert chars.decode('utf8') == text + assert len(text) == size assert buf.exhausted() @given(st.text(), st.lists(st.integers(min_value=0))) @example(u'\x80', [1]) def test_readn_buffer(text, sizes): - buf = DecodeBuffer(text.encode('utf8')) + buf = DecodeBuffer(text.encode('utf8'), len(text)) strings = [] for n in sizes: - s = buf.get_chars(n).decode('utf8') + chars, size = buf.get_chars(n) + s = chars.decode('utf8') + assert size == len(s) if not buf.exhausted(): assert len(s) == n else: @@ -79,7 +83,7 @@ @given(st.text()) @example(u'\x800') def test_next_char(text): - buf = DecodeBuffer(text.encode('utf8')) + buf = DecodeBuffer(text.encode('utf8'), len(text)) chars = [] try: while True: diff --git a/pypy/module/_io/test/test_textio.py b/pypy/module/_io/test/test_textio.py --- a/pypy/module/_io/test/test_textio.py +++ b/pypy/module/_io/test/test_textio.py @@ -1,3 +1,5 @@ +#encoding: utf-8 + class AppTestTextIO: spaceconfig = dict(usemodules=['_io', '_locale', 'array']) @@ -141,6 +143,15 @@ reads += t.readline() assert reads == "abc\ndef\n" + def test_read_bug_unicode(self): + import _io + r = _io.BytesIO(b"\xc3\xa4bc\ndef\n") + t = _io.TextIOWrapper(r, encoding="utf-8") + reads = t.read(4) + assert reads == "äbc\n" + reads += t.readline() + assert reads == "äbc\ndef\n" + def test_encoded_writes(self): import _io data = "1234567890" From pypy.commits at gmail.com Wed Sep 11 08:39:37 2019 From: pypy.commits at gmail.com (cfbolz) Date: Wed, 11 Sep 2019 05:39:37 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: be explicit Message-ID: <5d78eb09.1c69fb81.c17d5.03c5@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97437:ea8b601d6d05 Date: 2019-09-11 14:30 +0200 http://bitbucket.org/pypy/pypy/changeset/ea8b601d6d05/ Log: be explicit diff --git a/pypy/module/_io/test/test_textio.py b/pypy/module/_io/test/test_textio.py --- a/pypy/module/_io/test/test_textio.py +++ b/pypy/module/_io/test/test_textio.py @@ -148,9 +148,9 @@ r = _io.BytesIO(b"\xc3\xa4bc\ndef\n") t = _io.TextIOWrapper(r, encoding="utf-8") reads = t.read(4) - assert reads == "äbc\n" + assert reads == u"äbc\n" reads += t.readline() - assert reads == "äbc\ndef\n" + assert reads == u"äbc\ndef\n" def test_encoded_writes(self): import _io From pypy.commits at gmail.com Wed Sep 11 08:42:31 2019 From: pypy.commits at gmail.com (cfbolz) Date: Wed, 11 Sep 2019 05:42:31 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default Message-ID: <5d78ebb7.1c69fb81.58735.9b80@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97438:6c178b391f40 Date: 2019-09-11 14:41 +0200 http://bitbucket.org/pypy/pypy/changeset/6c178b391f40/ Log: merge default From pypy.commits at gmail.com Wed Sep 11 09:02:34 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 11 Sep 2019 06:02:34 -0700 (PDT) Subject: [pypy-commit] pypy more-cpyext: fixes for c421c4bc8247 Message-ID: <5d78f06a.1c69fb81.74afa.ed75@mx.google.com> Author: Matti Picus Branch: more-cpyext Changeset: r97439:52a33358db70 Date: 2019-09-11 16:01 +0300 http://bitbucket.org/pypy/pypy/changeset/52a33358db70/ Log: fixes for c421c4bc8247 diff --git a/pypy/module/cpyext/include/pyport.h b/pypy/module/cpyext/include/pyport.h --- a/pypy/module/cpyext/include/pyport.h +++ b/pypy/module/cpyext/include/pyport.h @@ -41,7 +41,9 @@ /* CPython needs this for the c-extension datetime, which is pure python on PyPy downstream packages assume it is here (Pandas for instance) */ +#ifdef HAVE_CLOCK_GETTIME #include +#endif #include /* uintptr_t is the C9X name for an unsigned integral type such that a diff --git a/pytime.h b/pytime.h new file mode 100644 --- /dev/null +++ b/pytime.h @@ -0,0 +1,211 @@ +#ifndef Py_LIMITED_API +#ifndef Py_PYTIME_H +#define Py_PYTIME_H + +#include "pyconfig.h" /* include for defines */ +#include "object.h" + +/************************************************************************** +Symbols and macros to supply platform-independent interfaces to time related +functions and constants +**************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + +/* _PyTime_t: Python timestamp with subsecond precision. It can be used to + store a duration, and so indirectly a date (related to another date, like + UNIX epoch). */ +typedef int64_t _PyTime_t; +#define _PyTime_MIN PY_LLONG_MIN +#define _PyTime_MAX PY_LLONG_MAX + +typedef enum { + /* Round towards minus infinity (-inf). + For example, used to read a clock. */ + _PyTime_ROUND_FLOOR=0, + /* Round towards infinity (+inf). + For example, used for timeout to wait "at least" N seconds. */ + _PyTime_ROUND_CEILING=1, + /* Round to nearest with ties going to nearest even integer. + For example, used to round from a Python float. */ + _PyTime_ROUND_HALF_EVEN=2, + /* Round away from zero + For example, used for timeout. _PyTime_ROUND_CEILING rounds + -1e-9 to 0 milliseconds which causes bpo-31786 issue. + _PyTime_ROUND_UP rounds -1e-9 to -1 millisecond which keeps + the timeout sign as expected. select.poll(timeout) must block + for negative values." */ + _PyTime_ROUND_UP=3, + /* _PyTime_ROUND_TIMEOUT (an alias for _PyTime_ROUND_UP) should be + used for timeouts. */ + _PyTime_ROUND_TIMEOUT = _PyTime_ROUND_UP +} _PyTime_round_t; + + +/* Convert a time_t to a PyLong. */ +PyAPI_FUNC(PyObject *) _PyLong_FromTime_t( + time_t sec); + +/* Convert a PyLong to a time_t. */ +PyAPI_FUNC(time_t) _PyLong_AsTime_t( + PyObject *obj); + +/* Convert a number of seconds, int or float, to time_t. */ +PyAPI_FUNC(int) _PyTime_ObjectToTime_t( + PyObject *obj, + time_t *sec, + _PyTime_round_t); + +/* Convert a number of seconds, int or float, to a timeval structure. + usec is in the range [0; 999999] and rounded towards zero. + For example, -1.2 is converted to (-2, 800000). */ +PyAPI_FUNC(int) _PyTime_ObjectToTimeval( + PyObject *obj, + time_t *sec, + long *usec, + _PyTime_round_t); + +/* Convert a number of seconds, int or float, to a timespec structure. + nsec is in the range [0; 999999999] and rounded towards zero. + For example, -1.2 is converted to (-2, 800000000). */ +PyAPI_FUNC(int) _PyTime_ObjectToTimespec( + PyObject *obj, + time_t *sec, + long *nsec, + _PyTime_round_t); + + +/* Create a timestamp from a number of seconds. */ +PyAPI_FUNC(_PyTime_t) _PyTime_FromSeconds(int seconds); + +/* Macro to create a timestamp from a number of seconds, no integer overflow. + Only use the macro for small values, prefer _PyTime_FromSeconds(). */ +#define _PYTIME_FROMSECONDS(seconds) \ + ((_PyTime_t)(seconds) * (1000 * 1000 * 1000)) + +/* Create a timestamp from a number of nanoseconds. */ +PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(long long ns); + +/* Convert a number of seconds (Python float or int) to a timetamp. + Raise an exception and return -1 on error, return 0 on success. */ +PyAPI_FUNC(int) _PyTime_FromSecondsObject(_PyTime_t *t, + PyObject *obj, + _PyTime_round_t round); + +/* Convert a number of milliseconds (Python float or int, 10^-3) to a timetamp. + Raise an exception and return -1 on error, return 0 on success. */ +PyAPI_FUNC(int) _PyTime_FromMillisecondsObject(_PyTime_t *t, + PyObject *obj, + _PyTime_round_t round); + +/* Convert a timestamp to a number of seconds as a C double. */ +PyAPI_FUNC(double) _PyTime_AsSecondsDouble(_PyTime_t t); + +/* Convert timestamp to a number of milliseconds (10^-3 seconds). */ +PyAPI_FUNC(_PyTime_t) _PyTime_AsMilliseconds(_PyTime_t t, + _PyTime_round_t round); + +/* Convert timestamp to a number of microseconds (10^-6 seconds). */ +PyAPI_FUNC(_PyTime_t) _PyTime_AsMicroseconds(_PyTime_t t, + _PyTime_round_t round); + +/* Convert timestamp to a number of nanoseconds (10^-9 seconds) as a Python int + object. */ +PyAPI_FUNC(PyObject *) _PyTime_AsNanosecondsObject(_PyTime_t t); + +/* Convert a timestamp to a timeval structure (microsecond resolution). + tv_usec is always positive. + Raise an exception and return -1 if the conversion overflowed, + return 0 on success. */ +PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t, + struct timeval *tv, + _PyTime_round_t round); + +/* Similar to _PyTime_AsTimeval(), but don't raise an exception on error. */ +PyAPI_FUNC(int) _PyTime_AsTimeval_noraise(_PyTime_t t, + struct timeval *tv, + _PyTime_round_t round); + +/* Convert a timestamp to a number of seconds (secs) and microseconds (us). + us is always positive. This function is similar to _PyTime_AsTimeval() + except that secs is always a time_t type, whereas the timeval structure + uses a C long for tv_sec on Windows. + Raise an exception and return -1 if the conversion overflowed, + return 0 on success. */ +PyAPI_FUNC(int) _PyTime_AsTimevalTime_t( + _PyTime_t t, + time_t *secs, + int *us, + _PyTime_round_t round); + +#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE) +/* Convert a timestamp to a timespec structure (nanosecond resolution). + tv_nsec is always positive. + Raise an exception and return -1 on error, return 0 on success. */ +PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts); +#endif + +/* Get the current time from the system clock. + + The function cannot fail. _PyTime_Init() ensures that the system clock + works. */ +PyAPI_FUNC(_PyTime_t) _PyTime_GetSystemClock(void); + +/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards. + The clock is not affected by system clock updates. The reference point of + the returned value is undefined, so that only the difference between the + results of consecutive calls is valid. + + The function cannot fail. _PyTime_Init() ensures that a monotonic clock + is available and works. */ +PyAPI_FUNC(_PyTime_t) _PyTime_GetMonotonicClock(void); + + +/* Structure used by time.get_clock_info() */ +typedef struct { + const char *implementation; + int monotonic; + int adjustable; + double resolution; +} _Py_clock_info_t; + +/* Get the current time from the system clock. + * Fill clock information if info is not NULL. + * Raise an exception and return -1 on error, return 0 on success. + */ +PyAPI_FUNC(int) _PyTime_GetSystemClockWithInfo( + _PyTime_t *t, + _Py_clock_info_t *info); + +/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards. + The clock is not affected by system clock updates. The reference point of + the returned value is undefined, so that only the difference between the + results of consecutive calls is valid. + + Fill info (if set) with information of the function used to get the time. + + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_GetMonotonicClockWithInfo( + _PyTime_t *t, + _Py_clock_info_t *info); + + +/* Initialize time. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_Init(void); + +/* Converts a timestamp to the Gregorian time, using the local time zone. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm); + +/* Converts a timestamp to the Gregorian time, assuming UTC. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm); + +#ifdef __cplusplus +} +#endif + +#endif /* Py_PYTIME_H */ +#endif /* Py_LIMITED_API */ From pypy.commits at gmail.com Wed Sep 11 09:11:25 2019 From: pypy.commits at gmail.com (cfbolz) Date: Wed, 11 Sep 2019 06:11:25 -0700 (PDT) Subject: [pypy-commit] pypy default: make sure that ByteBuffer.getslice is optimized Message-ID: <5d78f27d.1c69fb81.325c.f83c@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97440:5a6cb24984c1 Date: 2019-09-11 15:01 +0200 http://bitbucket.org/pypy/pypy/changeset/5a6cb24984c1/ Log: make sure that ByteBuffer.getslice is optimized diff --git a/rpython/rlib/buffer.py b/rpython/rlib/buffer.py --- a/rpython/rlib/buffer.py +++ b/rpython/rlib/buffer.py @@ -123,7 +123,7 @@ class RawBuffer(Buffer): """ - A buffer which is baked by a raw, non-movable memory area. It implementes + A buffer which is backed by a raw, non-movable memory area. It implementes typed_read and typed_write in terms of get_raw_address(), llop.raw_load, llop.raw_store. @@ -157,7 +157,7 @@ class GCBuffer(Buffer): """ - Base class for a buffer which is baked by a GC-managed memory area. You + Base class for a buffer which is backed by a GC-managed memory area. You MUST also decorate the class with @GCBuffer.decorate: it implements typed_read and typed_write in terms of llop.gc_load_indexed and llop.gc_store_indexed. @@ -250,6 +250,14 @@ def setitem(self, index, char): self.data[index] = char + def getslice(self, start, stop, step, size): + if step == 1: + assert 0 <= start <= stop + if start == 0 and stop == len(self.data): + return "".join(self.data) + return "".join(self.data[start:stop]) + return Buffer.getslice(self, start, stop, step, size) + def get_raw_address(self): return nonmoving_raw_ptr_for_resizable_list(self.data) diff --git a/rpython/rlib/test/test_buffer.py b/rpython/rlib/test/test_buffer.py --- a/rpython/rlib/test/test_buffer.py +++ b/rpython/rlib/test/test_buffer.py @@ -197,6 +197,12 @@ assert buf.typed_read(rffi.USHORT, 0) == 0x1234 assert buf.typed_read(rffi.USHORT, 2) == 0x5678 + def test_getslice_shortcut(self): + buf = ByteBuffer(4) + buf.setslice(0, b"data") + buf.getitem = None + assert buf.getslice(0, 2, 1, 2) == b"da" # no crash! + class TestJIT(LLJitMixin): From pypy.commits at gmail.com Wed Sep 11 10:52:43 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 11 Sep 2019 07:52:43 -0700 (PDT) Subject: [pypy-commit] pypy more-cpyext: add PyErr_SetFromWindowsErr, test needed Message-ID: <5d790a3b.1c69fb81.eadc0.a1e6@mx.google.com> Author: Matti Picus Branch: more-cpyext Changeset: r97441:64d4dfe78eb4 Date: 2019-09-11 17:53 +0300 http://bitbucket.org/pypy/pypy/changeset/64d4dfe78eb4/ Log: add PyErr_SetFromWindowsErr, test needed diff --git a/pytime.h b/pypy/module/cpyext/include/pytime.h rename from pytime.h rename to pypy/module/cpyext/include/pytime.h diff --git a/pypy/module/cpyext/pyerrors.py b/pypy/module/cpyext/pyerrors.py --- a/pypy/module/cpyext/pyerrors.py +++ b/pypy/module/cpyext/pyerrors.py @@ -64,6 +64,11 @@ """This is a shorthand for PyErr_SetObject(type, Py_None).""" PyErr_SetObject(space, w_type, space.w_None) +if os.name == 'nt': + @cpython_api([rffi.INT_real], lltype.Void, error=CANNOT_FAIL) + def PyErr_SetFromWindowsErr(space, err): + PyErr_SetObject(space, space.w_OSError, space.newint(err)) + @cpython_api([], PyObject, result_borrowed=True) def PyErr_Occurred(space): state = space.fromcache(State) From pypy.commits at gmail.com Wed Sep 11 11:06:11 2019 From: pypy.commits at gmail.com (arigo) Date: Wed, 11 Sep 2019 08:06:11 -0700 (PDT) Subject: [pypy-commit] pypy default: CPython issue #38106 Message-ID: <5d790d63.1c69fb81.a10bb.8da0@mx.google.com> Author: Armin Rigo Branch: Changeset: r97442:6cd7a0d1a940 Date: 2019-09-11 17:05 +0200 http://bitbucket.org/pypy/pypy/changeset/6cd7a0d1a940/ Log: CPython issue #38106 On OS X, call pthread_cond_signal() before pthread_mutex_unlock(). This should not make a difference, but does if another thread notices that the lock is released and frees the lock---this is possible at any time after the pthread_mutex_unlock(). We can't rely on the condition variable 'lock->lock_released' to remain in existence. This can't occur on top of Python lock objects because of the GC, but can occur by direct calls to the C API functions via cpyext. diff --git a/rpython/translator/c/src/thread_pthread.c b/rpython/translator/c/src/thread_pthread.c --- a/rpython/translator/c/src/thread_pthread.c +++ b/rpython/translator/c/src/thread_pthread.c @@ -454,13 +454,13 @@ lock->locked = 0; - status = pthread_mutex_unlock( &lock->mut ); - CHECK_STATUS("pthread_mutex_unlock[3]"); - /* wake up someone (anyone, if any) waiting on the lock */ status = pthread_cond_signal( &lock->lock_released ); CHECK_STATUS("pthread_cond_signal"); + status = pthread_mutex_unlock( &lock->mut ); + CHECK_STATUS("pthread_mutex_unlock[3]"); + return result; } From pypy.commits at gmail.com Wed Sep 11 11:15:29 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 11 Sep 2019 08:15:29 -0700 (PDT) Subject: [pypy-commit] pypy more-cpyext: cpython compatibility Message-ID: <5d790f91.1c69fb81.90644.913f@mx.google.com> Author: Matti Picus Branch: more-cpyext Changeset: r97443:454d7d902ed4 Date: 2019-09-11 10:11 -0500 http://bitbucket.org/pypy/pypy/changeset/454d7d902ed4/ Log: cpython compatibility diff --git a/pypy/module/cpyext/include/Python.h b/pypy/module/cpyext/include/Python.h --- a/pypy/module/cpyext/include/Python.h +++ b/pypy/module/cpyext/include/Python.h @@ -62,14 +62,6 @@ #define Py_USING_UNICODE -/* Convert a possibly signed character to a nonnegative int */ -/* XXX This assumes characters are 8 bits wide */ -#ifdef __CHAR_UNSIGNED__ -#define Py_CHARMASK(c) (c) -#else -#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff)) -#endif - #define statichere static #define Py_MEMCPY memcpy From pypy.commits at gmail.com Wed Sep 11 11:15:31 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 11 Sep 2019 08:15:31 -0700 (PDT) Subject: [pypy-commit] pypy more-cpyext: close branch to be merged Message-ID: <5d790f93.1c69fb81.7ad75.3409@mx.google.com> Author: Matti Picus Branch: more-cpyext Changeset: r97444:2bb6d725ad61 Date: 2019-09-11 10:13 -0500 http://bitbucket.org/pypy/pypy/changeset/2bb6d725ad61/ Log: close branch to be merged diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -77,4 +77,8 @@ .. branch: openssl-for-macos -Update _ssl on macos to statically link to openssl-1.1.1c \ No newline at end of file +Update _ssl on macos to statically link to openssl-1.1.1c + +.. branch: more-cpyext + +Add more datetime C functions and definitions From pypy.commits at gmail.com Wed Sep 11 11:15:32 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 11 Sep 2019 08:15:32 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge more-cpyext which adds many more datetime c functions via pytime.c Message-ID: <5d790f94.1c69fb81.3c129.d4f1@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97445:4b18478c878b Date: 2019-09-11 10:14 -0500 http://bitbucket.org/pypy/pypy/changeset/4b18478c878b/ Log: merge more-cpyext which adds many more datetime c functions via pytime.c diff --git a/lib_pypy/_pypy_testcapi.py b/lib_pypy/_pypy_testcapi.py --- a/lib_pypy/_pypy_testcapi.py +++ b/lib_pypy/_pypy_testcapi.py @@ -61,6 +61,8 @@ assert output_dir is not None from distutils.ccompiler import new_compiler + from distutils import log + log.set_verbosity(3) compiler = new_compiler() compiler.output_dir = output_dir @@ -72,7 +74,8 @@ ccflags = ['-fPIC', '-Wimplicit-function-declaration'] res = compiler.compile([os.path.join(thisdir, csource)], include_dirs=[include_dir], - extra_preargs=ccflags) + extra_preargs=ccflags, + ) object_filename = res[0] # set link options diff --git a/lib_pypy/_testcapimodule.c b/lib_pypy/_testcapimodule.c --- a/lib_pypy/_testcapimodule.c +++ b/lib_pypy/_testcapimodule.c @@ -3009,6 +3009,8 @@ return PyLong_FromLong(r); } +#endif /* PYPY_VERSION */ + static int check_time_rounding(int round) { @@ -3069,6 +3071,8 @@ return Py_BuildValue("Nl", _PyLong_FromTime_t(sec), nsec); } +#ifndef PYPY_VERSION + static void slot_tp_del(PyObject *self) { @@ -3902,8 +3906,6 @@ Py_RETURN_NONE; } -#ifndef PYPY_VERSION - static PyObject * test_pytime_fromseconds(PyObject *self, PyObject *args) { @@ -4022,6 +4024,8 @@ return _PyTime_AsNanosecondsObject(ms); } +#ifndef PYPY_VERSION + static PyObject* get_recursion_depth(PyObject *self, PyObject *args) { @@ -4515,7 +4519,6 @@ return_null_without_error, METH_NOARGS}, {"return_result_with_error", return_result_with_error, METH_NOARGS}, -#ifndef PYPY_VERSION {"PyTime_FromSeconds", test_pytime_fromseconds, METH_VARARGS}, {"PyTime_FromSecondsObject", test_pytime_fromsecondsobject, METH_VARARGS}, {"PyTime_AsSecondsDouble", test_pytime_assecondsdouble, METH_VARARGS}, @@ -4525,6 +4528,7 @@ #endif {"PyTime_AsMilliseconds", test_PyTime_AsMilliseconds, METH_VARARGS}, {"PyTime_AsMicroseconds", test_PyTime_AsMicroseconds, METH_VARARGS}, +#ifndef PYPY_VERSION {"get_recursion_depth", get_recursion_depth, METH_NOARGS}, {"pymem_buffer_overflow", pymem_buffer_overflow, METH_NOARGS}, {"pymem_api_misuse", pymem_api_misuse, METH_NOARGS}, @@ -4538,10 +4542,10 @@ {"pyobject_fastcalldict", test_pyobject_fastcalldict, METH_VARARGS}, {"pyobject_fastcallkeywords", test_pyobject_fastcallkeywords, METH_VARARGS}, {"raise_SIGINT_then_send_None", raise_SIGINT_then_send_None, METH_VARARGS}, +#endif #ifdef W_STOPCODE {"W_STOPCODE", py_w_stopcode, METH_VARARGS}, #endif -#endif /* PYPY_VERSION */ {NULL, NULL} /* sentinel */ }; diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -77,4 +77,8 @@ .. branch: openssl-for-macos -Update _ssl on macos to statically link to openssl-1.1.1c \ No newline at end of file +Update _ssl on macos to statically link to openssl-1.1.1c + +.. branch: more-cpyext + +Add more datetime C functions and definitions diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py --- a/pypy/module/cpyext/api.py +++ b/pypy/module/cpyext/api.py @@ -1520,6 +1520,7 @@ source_dir / "pythread.c", source_dir / "missing.c", source_dir / "pymem.c", + source_dir / "pytime.c", source_dir / "bytesobject.c", source_dir / "import.c", source_dir / "_warnings.c", diff --git a/pypy/module/cpyext/include/Python.h b/pypy/module/cpyext/include/Python.h --- a/pypy/module/cpyext/include/Python.h +++ b/pypy/module/cpyext/include/Python.h @@ -62,14 +62,6 @@ #define Py_USING_UNICODE -/* Convert a possibly signed character to a nonnegative int */ -/* XXX This assumes characters are 8 bits wide */ -#ifdef __CHAR_UNSIGNED__ -#define Py_CHARMASK(c) (c) -#else -#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff)) -#endif - #define statichere static #define Py_MEMCPY memcpy @@ -89,6 +81,7 @@ #include "abstract.h" #include "pymath.h" #include "pyport.h" +#include "pytime.h" #include "pymacro.h" #include "warnings.h" diff --git a/pypy/module/cpyext/include/pyconfig.h b/pypy/module/cpyext/include/pyconfig.h --- a/pypy/module/cpyext/include/pyconfig.h +++ b/pypy/module/cpyext/include/pyconfig.h @@ -28,6 +28,7 @@ #ifndef _WIN32 #define VA_LIST_IS_ARRAY +#define HAVE_CLOCK_GETTIME #endif #ifndef Py_BUILD_CORE /* not building the core - must be an ext */ diff --git a/pypy/module/cpyext/include/pymath.h b/pypy/module/cpyext/include/pymath.h --- a/pypy/module/cpyext/include/pymath.h +++ b/pypy/module/cpyext/include/pymath.h @@ -110,10 +110,21 @@ #pragma float_control (pop) #define Py_NAN __icc_nan() #else /* ICC_NAN_RELAXED as default for Intel Compiler */ - static union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f}; + static const union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f}; #define Py_NAN (__nan_store.__icc_nan) #endif /* ICC_NAN_STRICT */ #endif /* __INTEL_COMPILER */ #endif +/* Return whether integral type *type* is signed or not. */ +#define _Py_IntegralTypeSigned(type) ((type)(-1) < 0) +/* Return the maximum value of integral type *type*. */ +#define _Py_IntegralTypeMax(type) ((_Py_IntegralTypeSigned(type)) ? (((((type)1 << (sizeof(type)*CHAR_BIT - 2)) - 1) << 1) + 1) : ~(type)0) +/* Return the minimum value of integral type *type*. */ +#define _Py_IntegralTypeMin(type) ((_Py_IntegralTypeSigned(type)) ? -_Py_IntegralTypeMax(type) - 1 : 0) +/* Check whether *v* is in the range of integral type *type*. This is most + * useful if *v* is floating-point, since demoting a floating-point *v* to an + * integral type that cannot represent *v*'s integral part is undefined + * behavior. */ +#define _Py_InIntegralTypeRange(type, v) (_Py_IntegralTypeMin(type) <= v && v <= _Py_IntegralTypeMax(type)) #endif /* Py_PYMATH_H */ diff --git a/pypy/module/cpyext/include/pyport.h b/pypy/module/cpyext/include/pyport.h --- a/pypy/module/cpyext/include/pyport.h +++ b/pypy/module/cpyext/include/pyport.h @@ -41,6 +41,9 @@ /* CPython needs this for the c-extension datetime, which is pure python on PyPy downstream packages assume it is here (Pandas for instance) */ +#ifdef HAVE_CLOCK_GETTIME +#include +#endif #include /* uintptr_t is the C9X name for an unsigned integral type such that a diff --git a/pypy/module/cpyext/include/pytime.h b/pypy/module/cpyext/include/pytime.h new file mode 100644 --- /dev/null +++ b/pypy/module/cpyext/include/pytime.h @@ -0,0 +1,211 @@ +#ifndef Py_LIMITED_API +#ifndef Py_PYTIME_H +#define Py_PYTIME_H + +#include "pyconfig.h" /* include for defines */ +#include "object.h" + +/************************************************************************** +Symbols and macros to supply platform-independent interfaces to time related +functions and constants +**************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + +/* _PyTime_t: Python timestamp with subsecond precision. It can be used to + store a duration, and so indirectly a date (related to another date, like + UNIX epoch). */ +typedef int64_t _PyTime_t; +#define _PyTime_MIN PY_LLONG_MIN +#define _PyTime_MAX PY_LLONG_MAX + +typedef enum { + /* Round towards minus infinity (-inf). + For example, used to read a clock. */ + _PyTime_ROUND_FLOOR=0, + /* Round towards infinity (+inf). + For example, used for timeout to wait "at least" N seconds. */ + _PyTime_ROUND_CEILING=1, + /* Round to nearest with ties going to nearest even integer. + For example, used to round from a Python float. */ + _PyTime_ROUND_HALF_EVEN=2, + /* Round away from zero + For example, used for timeout. _PyTime_ROUND_CEILING rounds + -1e-9 to 0 milliseconds which causes bpo-31786 issue. + _PyTime_ROUND_UP rounds -1e-9 to -1 millisecond which keeps + the timeout sign as expected. select.poll(timeout) must block + for negative values." */ + _PyTime_ROUND_UP=3, + /* _PyTime_ROUND_TIMEOUT (an alias for _PyTime_ROUND_UP) should be + used for timeouts. */ + _PyTime_ROUND_TIMEOUT = _PyTime_ROUND_UP +} _PyTime_round_t; + + +/* Convert a time_t to a PyLong. */ +PyAPI_FUNC(PyObject *) _PyLong_FromTime_t( + time_t sec); + +/* Convert a PyLong to a time_t. */ +PyAPI_FUNC(time_t) _PyLong_AsTime_t( + PyObject *obj); + +/* Convert a number of seconds, int or float, to time_t. */ +PyAPI_FUNC(int) _PyTime_ObjectToTime_t( + PyObject *obj, + time_t *sec, + _PyTime_round_t); + +/* Convert a number of seconds, int or float, to a timeval structure. + usec is in the range [0; 999999] and rounded towards zero. + For example, -1.2 is converted to (-2, 800000). */ +PyAPI_FUNC(int) _PyTime_ObjectToTimeval( + PyObject *obj, + time_t *sec, + long *usec, + _PyTime_round_t); + +/* Convert a number of seconds, int or float, to a timespec structure. + nsec is in the range [0; 999999999] and rounded towards zero. + For example, -1.2 is converted to (-2, 800000000). */ +PyAPI_FUNC(int) _PyTime_ObjectToTimespec( + PyObject *obj, + time_t *sec, + long *nsec, + _PyTime_round_t); + + +/* Create a timestamp from a number of seconds. */ +PyAPI_FUNC(_PyTime_t) _PyTime_FromSeconds(int seconds); + +/* Macro to create a timestamp from a number of seconds, no integer overflow. + Only use the macro for small values, prefer _PyTime_FromSeconds(). */ +#define _PYTIME_FROMSECONDS(seconds) \ + ((_PyTime_t)(seconds) * (1000 * 1000 * 1000)) + +/* Create a timestamp from a number of nanoseconds. */ +PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(long long ns); + +/* Convert a number of seconds (Python float or int) to a timetamp. + Raise an exception and return -1 on error, return 0 on success. */ +PyAPI_FUNC(int) _PyTime_FromSecondsObject(_PyTime_t *t, + PyObject *obj, + _PyTime_round_t round); + +/* Convert a number of milliseconds (Python float or int, 10^-3) to a timetamp. + Raise an exception and return -1 on error, return 0 on success. */ +PyAPI_FUNC(int) _PyTime_FromMillisecondsObject(_PyTime_t *t, + PyObject *obj, + _PyTime_round_t round); + +/* Convert a timestamp to a number of seconds as a C double. */ +PyAPI_FUNC(double) _PyTime_AsSecondsDouble(_PyTime_t t); + +/* Convert timestamp to a number of milliseconds (10^-3 seconds). */ +PyAPI_FUNC(_PyTime_t) _PyTime_AsMilliseconds(_PyTime_t t, + _PyTime_round_t round); + +/* Convert timestamp to a number of microseconds (10^-6 seconds). */ +PyAPI_FUNC(_PyTime_t) _PyTime_AsMicroseconds(_PyTime_t t, + _PyTime_round_t round); + +/* Convert timestamp to a number of nanoseconds (10^-9 seconds) as a Python int + object. */ +PyAPI_FUNC(PyObject *) _PyTime_AsNanosecondsObject(_PyTime_t t); + +/* Convert a timestamp to a timeval structure (microsecond resolution). + tv_usec is always positive. + Raise an exception and return -1 if the conversion overflowed, + return 0 on success. */ +PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t, + struct timeval *tv, + _PyTime_round_t round); + +/* Similar to _PyTime_AsTimeval(), but don't raise an exception on error. */ +PyAPI_FUNC(int) _PyTime_AsTimeval_noraise(_PyTime_t t, + struct timeval *tv, + _PyTime_round_t round); + +/* Convert a timestamp to a number of seconds (secs) and microseconds (us). + us is always positive. This function is similar to _PyTime_AsTimeval() + except that secs is always a time_t type, whereas the timeval structure + uses a C long for tv_sec on Windows. + Raise an exception and return -1 if the conversion overflowed, + return 0 on success. */ +PyAPI_FUNC(int) _PyTime_AsTimevalTime_t( + _PyTime_t t, + time_t *secs, + int *us, + _PyTime_round_t round); + +#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE) +/* Convert a timestamp to a timespec structure (nanosecond resolution). + tv_nsec is always positive. + Raise an exception and return -1 on error, return 0 on success. */ +PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts); +#endif + +/* Get the current time from the system clock. + + The function cannot fail. _PyTime_Init() ensures that the system clock + works. */ +PyAPI_FUNC(_PyTime_t) _PyTime_GetSystemClock(void); + +/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards. + The clock is not affected by system clock updates. The reference point of + the returned value is undefined, so that only the difference between the + results of consecutive calls is valid. + + The function cannot fail. _PyTime_Init() ensures that a monotonic clock + is available and works. */ +PyAPI_FUNC(_PyTime_t) _PyTime_GetMonotonicClock(void); + + +/* Structure used by time.get_clock_info() */ +typedef struct { + const char *implementation; + int monotonic; + int adjustable; + double resolution; +} _Py_clock_info_t; + +/* Get the current time from the system clock. + * Fill clock information if info is not NULL. + * Raise an exception and return -1 on error, return 0 on success. + */ +PyAPI_FUNC(int) _PyTime_GetSystemClockWithInfo( + _PyTime_t *t, + _Py_clock_info_t *info); + +/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards. + The clock is not affected by system clock updates. The reference point of + the returned value is undefined, so that only the difference between the + results of consecutive calls is valid. + + Fill info (if set) with information of the function used to get the time. + + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_GetMonotonicClockWithInfo( + _PyTime_t *t, + _Py_clock_info_t *info); + + +/* Initialize time. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_Init(void); + +/* Converts a timestamp to the Gregorian time, using the local time zone. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm); + +/* Converts a timestamp to the Gregorian time, assuming UTC. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm); + +#ifdef __cplusplus +} +#endif + +#endif /* Py_PYTIME_H */ +#endif /* Py_LIMITED_API */ diff --git a/pypy/module/cpyext/parse/cpyext_object.h b/pypy/module/cpyext/parse/cpyext_object.h --- a/pypy/module/cpyext/parse/cpyext_object.h +++ b/pypy/module/cpyext/parse/cpyext_object.h @@ -67,13 +67,12 @@ Py_ssize_t *shape; Py_ssize_t *strides; Py_ssize_t *suboffsets; /* alway NULL for app-level objects*/ + void *internal; /* always NULL for app-level objects */ + + /* Only in PyPY, in CPython thes are allocated/deleted */ unsigned char _format[Py_MAX_FMT]; Py_ssize_t _strides[Py_MAX_NDIMS]; Py_ssize_t _shape[Py_MAX_NDIMS]; - /* static store for shape and strides of - mono-dimensional buffers. */ - /* Py_ssize_t smalltable[2]; */ - void *internal; /* always NULL for app-level objects */ } Py_buffer; typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); diff --git a/pypy/module/cpyext/pyerrors.py b/pypy/module/cpyext/pyerrors.py --- a/pypy/module/cpyext/pyerrors.py +++ b/pypy/module/cpyext/pyerrors.py @@ -64,6 +64,11 @@ """This is a shorthand for PyErr_SetObject(type, Py_None).""" PyErr_SetObject(space, w_type, space.w_None) +if os.name == 'nt': + @cpython_api([rffi.INT_real], lltype.Void, error=CANNOT_FAIL) + def PyErr_SetFromWindowsErr(space, err): + PyErr_SetObject(space, space.w_OSError, space.newint(err)) + @cpython_api([], PyObject, result_borrowed=True) def PyErr_Occurred(space): state = space.fromcache(State) diff --git a/pypy/module/cpyext/src/pytime.c b/pypy/module/cpyext/src/pytime.c new file mode 100644 --- /dev/null +++ b/pypy/module/cpyext/src/pytime.c @@ -0,0 +1,854 @@ +#include "Python.h" +#ifdef MS_WINDOWS +#include +#endif + +#if defined(__APPLE__) +#include /* mach_absolute_time(), mach_timebase_info() */ +#endif + +#define _PyTime_check_mul_overflow(a, b) \ + (assert(b > 0), \ + (_PyTime_t)(a) < _PyTime_MIN / (_PyTime_t)(b) \ + || _PyTime_MAX / (_PyTime_t)(b) < (_PyTime_t)(a)) + +/* To millisecond (10^-3) */ +#define SEC_TO_MS 1000 + +/* To microseconds (10^-6) */ +#define MS_TO_US 1000 +#define SEC_TO_US (SEC_TO_MS * MS_TO_US) + +/* To nanoseconds (10^-9) */ +#define US_TO_NS 1000 +#define MS_TO_NS (MS_TO_US * US_TO_NS) +#define SEC_TO_NS (SEC_TO_MS * MS_TO_NS) + +/* Conversion from nanoseconds */ +#define NS_TO_MS (1000 * 1000) +#define NS_TO_US (1000) + +static void +error_time_t_overflow(void) +{ + PyErr_SetString(PyExc_OverflowError, + "timestamp out of range for platform time_t"); +} + +time_t +_PyLong_AsTime_t(PyObject *obj) +{ +#if SIZEOF_TIME_T == SIZEOF_LONG_LONG + long long val; + val = PyLong_AsLongLong(obj); +#else + long val; + Py_BUILD_ASSERT(sizeof(time_t) <= sizeof(long)); + val = PyLong_AsLong(obj); +#endif + if (val == -1 && PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + error_time_t_overflow(); + return -1; + } + return (time_t)val; +} + +PyObject * +_PyLong_FromTime_t(time_t t) +{ +#if SIZEOF_TIME_T == SIZEOF_LONG_LONG + return PyLong_FromLongLong((long long)t); +#else + Py_BUILD_ASSERT(sizeof(time_t) <= sizeof(long)); + return PyLong_FromLong((long)t); +#endif +} + +/* Round to nearest with ties going to nearest even integer + (_PyTime_ROUND_HALF_EVEN) */ +static double +_PyTime_RoundHalfEven(double x) +{ + double rounded = round(x); + if (fabs(x-rounded) == 0.5) + /* halfway case: round to even */ + rounded = 2.0*round(x/2.0); + return rounded; +} + +static double +_PyTime_Round(double x, _PyTime_round_t round) +{ + /* volatile avoids optimization changing how numbers are rounded */ + volatile double d; + + d = x; + if (round == _PyTime_ROUND_HALF_EVEN){ + d = _PyTime_RoundHalfEven(d); + } + else if (round == _PyTime_ROUND_CEILING){ + d = ceil(d); + } + else if (round == _PyTime_ROUND_FLOOR) { + d = floor(d); + } + else { + assert(round == _PyTime_ROUND_UP); + d = (d >= 0.0) ? ceil(d) : floor(d); + } + return d; +} + +static int +_PyTime_DoubleToDenominator(double d, time_t *sec, long *numerator, + double denominator, _PyTime_round_t round) +{ + double intpart; + /* volatile avoids optimization changing how numbers are rounded */ + volatile double floatpart; + + floatpart = modf(d, &intpart); + + floatpart *= denominator; + floatpart = _PyTime_Round(floatpart, round); + if (floatpart >= denominator) { + floatpart -= denominator; + intpart += 1.0; + } + else if (floatpart < 0) { + floatpart += denominator; + intpart -= 1.0; + } + assert(0.0 <= floatpart && floatpart < denominator); + + if (!_Py_InIntegralTypeRange(time_t, intpart)) { + error_time_t_overflow(); + return -1; + } + *sec = (time_t)intpart; + *numerator = (long)floatpart; + + return 0; +} + +static int +_PyTime_ObjectToDenominator(PyObject *obj, time_t *sec, long *numerator, + double denominator, _PyTime_round_t round) +{ + assert(denominator <= (double)LONG_MAX); + + if (PyFloat_Check(obj)) { + double d = PyFloat_AsDouble(obj); + if (Py_IS_NAN(d)) { + *numerator = 0; + PyErr_SetString(PyExc_ValueError, "Invalid value NaN (not a number)"); + return -1; + } + return _PyTime_DoubleToDenominator(d, sec, numerator, + denominator, round); + } + else { + *sec = _PyLong_AsTime_t(obj); + *numerator = 0; + if (*sec == (time_t)-1 && PyErr_Occurred()) + return -1; + return 0; + } +} + +int +_PyTime_ObjectToTime_t(PyObject *obj, time_t *sec, _PyTime_round_t round) +{ + if (PyFloat_Check(obj)) { + double intpart; + /* volatile avoids optimization changing how numbers are rounded */ + volatile double d; + + d = PyFloat_AsDouble(obj); + if (Py_IS_NAN(d)) { + PyErr_SetString(PyExc_ValueError, "Invalid value NaN (not a number)"); + return -1; + } + + d = _PyTime_Round(d, round); + (void)modf(d, &intpart); + + if (!_Py_InIntegralTypeRange(time_t, intpart)) { + error_time_t_overflow(); + return -1; + } + *sec = (time_t)intpart; + return 0; + } + else { + *sec = _PyLong_AsTime_t(obj); + if (*sec == (time_t)-1 && PyErr_Occurred()) + return -1; + return 0; + } +} + +int +_PyTime_ObjectToTimespec(PyObject *obj, time_t *sec, long *nsec, + _PyTime_round_t round) +{ + int res; + res = _PyTime_ObjectToDenominator(obj, sec, nsec, 1e9, round); + if (res == 0) { + assert(0 <= *nsec && *nsec < SEC_TO_NS); + } + return res; +} + +int +_PyTime_ObjectToTimeval(PyObject *obj, time_t *sec, long *usec, + _PyTime_round_t round) +{ + int res; + res = _PyTime_ObjectToDenominator(obj, sec, usec, 1e6, round); + if (res == 0) { + assert(0 <= *usec && *usec < SEC_TO_US); + } + return res; +} + +static void +_PyTime_overflow(void) +{ + PyErr_SetString(PyExc_OverflowError, + "timestamp too large to convert to C _PyTime_t"); +} + +_PyTime_t +_PyTime_FromSeconds(int seconds) +{ + _PyTime_t t; + t = (_PyTime_t)seconds; + /* ensure that integer overflow cannot happen, int type should have 32 + bits, whereas _PyTime_t type has at least 64 bits (SEC_TO_MS takes 30 + bits). */ + Py_BUILD_ASSERT(INT_MAX <= _PyTime_MAX / SEC_TO_NS); + Py_BUILD_ASSERT(INT_MIN >= _PyTime_MIN / SEC_TO_NS); + assert((t >= 0 && t <= _PyTime_MAX / SEC_TO_NS) + || (t < 0 && t >= _PyTime_MIN / SEC_TO_NS)); + t *= SEC_TO_NS; + return t; +} + +_PyTime_t +_PyTime_FromNanoseconds(long long ns) +{ + _PyTime_t t; + Py_BUILD_ASSERT(sizeof(long long) <= sizeof(_PyTime_t)); + t = Py_SAFE_DOWNCAST(ns, long long, _PyTime_t); + return t; +} + +#ifdef HAVE_CLOCK_GETTIME +static int +_PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts, int raise) +{ + _PyTime_t t; + int res = 0; + + Py_BUILD_ASSERT(sizeof(ts->tv_sec) <= sizeof(_PyTime_t)); + t = (_PyTime_t)ts->tv_sec; + + if (_PyTime_check_mul_overflow(t, SEC_TO_NS)) { + if (raise) + _PyTime_overflow(); + res = -1; + } + t = t * SEC_TO_NS; + + t += ts->tv_nsec; + + *tp = t; + return res; +} +#elif !defined(MS_WINDOWS) +static int +_PyTime_FromTimeval(_PyTime_t *tp, struct timeval *tv, int raise) +{ + _PyTime_t t; + int res = 0; + + Py_BUILD_ASSERT(sizeof(tv->tv_sec) <= sizeof(_PyTime_t)); + t = (_PyTime_t)tv->tv_sec; + + if (_PyTime_check_mul_overflow(t, SEC_TO_NS)) { + if (raise) + _PyTime_overflow(); + res = -1; + } + t = t * SEC_TO_NS; + + t += (_PyTime_t)tv->tv_usec * US_TO_NS; + + *tp = t; + return res; +} +#endif + +static int +_PyTime_FromFloatObject(_PyTime_t *t, double value, _PyTime_round_t round, + long unit_to_ns) +{ + /* volatile avoids optimization changing how numbers are rounded */ + volatile double d; + + /* convert to a number of nanoseconds */ + d = value; + d *= (double)unit_to_ns; + d = _PyTime_Round(d, round); + + if (!_Py_InIntegralTypeRange(_PyTime_t, d)) { + _PyTime_overflow(); + return -1; + } + *t = (_PyTime_t)d; + return 0; +} + +static int +_PyTime_FromObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round, + long unit_to_ns) +{ + if (PyFloat_Check(obj)) { + double d; + d = PyFloat_AsDouble(obj); + if (Py_IS_NAN(d)) { + PyErr_SetString(PyExc_ValueError, "Invalid value NaN (not a number)"); + return -1; + } + return _PyTime_FromFloatObject(t, d, round, unit_to_ns); + } + else { + long long sec; + Py_BUILD_ASSERT(sizeof(long long) <= sizeof(_PyTime_t)); + + sec = PyLong_AsLongLong(obj); + if (sec == -1 && PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + _PyTime_overflow(); + return -1; + } + + if (_PyTime_check_mul_overflow(sec, unit_to_ns)) { + _PyTime_overflow(); + return -1; + } + *t = sec * unit_to_ns; + return 0; + } +} + +int +_PyTime_FromSecondsObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round) +{ + return _PyTime_FromObject(t, obj, round, SEC_TO_NS); +} + +int +_PyTime_FromMillisecondsObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round) +{ + return _PyTime_FromObject(t, obj, round, MS_TO_NS); +} + +double +_PyTime_AsSecondsDouble(_PyTime_t t) +{ + /* volatile avoids optimization changing how numbers are rounded */ + volatile double d; + + if (t % SEC_TO_NS == 0) { + _PyTime_t secs; + /* Divide using integers to avoid rounding issues on the integer part. + 1e-9 cannot be stored exactly in IEEE 64-bit. */ + secs = t / SEC_TO_NS; + d = (double)secs; + } + else { + d = (double)t; + d /= 1e9; + } + return d; +} + +PyObject * +_PyTime_AsNanosecondsObject(_PyTime_t t) +{ + Py_BUILD_ASSERT(sizeof(long long) >= sizeof(_PyTime_t)); + return PyLong_FromLongLong((long long)t); +} + +static _PyTime_t +_PyTime_Divide(const _PyTime_t t, const _PyTime_t k, + const _PyTime_round_t round) +{ + assert(k > 1); + if (round == _PyTime_ROUND_HALF_EVEN) { + _PyTime_t x, r, abs_r; + x = t / k; + r = t % k; + abs_r = Py_ABS(r); + if (abs_r > k / 2 || (abs_r == k / 2 && (Py_ABS(x) & 1))) { + if (t >= 0) + x++; + else + x--; + } + return x; + } + else if (round == _PyTime_ROUND_CEILING) { + if (t >= 0){ + return (t + k - 1) / k; + } + else{ + return t / k; + } + } + else if (round == _PyTime_ROUND_FLOOR){ + if (t >= 0) { + return t / k; + } + else{ + return (t - (k - 1)) / k; + } + } + else { + assert(round == _PyTime_ROUND_UP); + if (t >= 0) { + return (t + k - 1) / k; + } + else { + return (t - (k - 1)) / k; + } + } +} + +_PyTime_t +_PyTime_AsMilliseconds(_PyTime_t t, _PyTime_round_t round) +{ + return _PyTime_Divide(t, NS_TO_MS, round); +} + +_PyTime_t +_PyTime_AsMicroseconds(_PyTime_t t, _PyTime_round_t round) +{ + return _PyTime_Divide(t, NS_TO_US, round); +} + +static int +_PyTime_AsTimeval_impl(_PyTime_t t, _PyTime_t *p_secs, int *p_us, + _PyTime_round_t round) +{ + _PyTime_t secs, ns; + int usec; + int res = 0; + + secs = t / SEC_TO_NS; + ns = t % SEC_TO_NS; + + usec = (int)_PyTime_Divide(ns, US_TO_NS, round); + if (usec < 0) { + usec += SEC_TO_US; + if (secs != _PyTime_MIN) + secs -= 1; + else + res = -1; + } + else if (usec >= SEC_TO_US) { + usec -= SEC_TO_US; + if (secs != _PyTime_MAX) + secs += 1; + else + res = -1; + } + assert(0 <= usec && usec < SEC_TO_US); + + *p_secs = secs; + *p_us = usec; + + return res; +} + +static int +_PyTime_AsTimevalStruct_impl(_PyTime_t t, struct timeval *tv, + _PyTime_round_t round, int raise) +{ + _PyTime_t secs, secs2; + int us; + int res; + + res = _PyTime_AsTimeval_impl(t, &secs, &us, round); + +#ifdef MS_WINDOWS + tv->tv_sec = (long)secs; +#else + tv->tv_sec = secs; +#endif + tv->tv_usec = us; + + secs2 = (_PyTime_t)tv->tv_sec; + if (res < 0 || secs2 != secs) { + if (raise) + error_time_t_overflow(); + return -1; + } + return 0; +} + +int +_PyTime_AsTimeval(_PyTime_t t, struct timeval *tv, _PyTime_round_t round) +{ + return _PyTime_AsTimevalStruct_impl(t, tv, round, 1); +} + +int +_PyTime_AsTimeval_noraise(_PyTime_t t, struct timeval *tv, _PyTime_round_t round) +{ + return _PyTime_AsTimevalStruct_impl(t, tv, round, 0); +} + +int +_PyTime_AsTimevalTime_t(_PyTime_t t, time_t *p_secs, int *us, + _PyTime_round_t round) +{ + _PyTime_t secs; + int res; + + res = _PyTime_AsTimeval_impl(t, &secs, us, round); + + *p_secs = secs; + + if (res < 0 || (_PyTime_t)*p_secs != secs) { + error_time_t_overflow(); + return -1; + } + return 0; +} + + +#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE) +int +_PyTime_AsTimespec(_PyTime_t t, struct timespec *ts) +{ + _PyTime_t secs, nsec; + + secs = t / SEC_TO_NS; + nsec = t % SEC_TO_NS; + if (nsec < 0) { + nsec += SEC_TO_NS; + secs -= 1; + } + ts->tv_sec = (time_t)secs; + assert(0 <= nsec && nsec < SEC_TO_NS); + ts->tv_nsec = nsec; + + if ((_PyTime_t)ts->tv_sec != secs) { + error_time_t_overflow(); + return -1; + } + return 0; +} +#endif + +static int +pygettimeofday(_PyTime_t *tp, _Py_clock_info_t *info, int raise) +{ +#ifdef MS_WINDOWS + FILETIME system_time; + ULARGE_INTEGER large; + + assert(info == NULL || raise); + + GetSystemTimeAsFileTime(&system_time); + large.u.LowPart = system_time.dwLowDateTime; + large.u.HighPart = system_time.dwHighDateTime; + /* 11,644,473,600,000,000,000: number of nanoseconds between + the 1st january 1601 and the 1st january 1970 (369 years + 89 leap + days). */ + *tp = large.QuadPart * 100 - 11644473600000000000; + if (info) { + DWORD timeAdjustment, timeIncrement; + BOOL isTimeAdjustmentDisabled, ok; + + info->implementation = "GetSystemTimeAsFileTime()"; + info->monotonic = 0; + ok = GetSystemTimeAdjustment(&timeAdjustment, &timeIncrement, + &isTimeAdjustmentDisabled); + if (!ok) { + PyErr_SetFromWindowsErr(0); + return -1; + } + info->resolution = timeIncrement * 1e-7; + info->adjustable = 1; + } + +#else /* MS_WINDOWS */ + int err; +#ifdef HAVE_CLOCK_GETTIME + struct timespec ts; +#else + struct timeval tv; +#endif + + assert(info == NULL || raise); + +#ifdef HAVE_CLOCK_GETTIME + err = clock_gettime(CLOCK_REALTIME, &ts); + if (err) { + if (raise) + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + if (_PyTime_FromTimespec(tp, &ts, raise) < 0) + return -1; + + if (info) { + struct timespec res; + info->implementation = "clock_gettime(CLOCK_REALTIME)"; + info->monotonic = 0; + info->adjustable = 1; + if (clock_getres(CLOCK_REALTIME, &res) == 0) + info->resolution = res.tv_sec + res.tv_nsec * 1e-9; + else + info->resolution = 1e-9; + } +#else /* HAVE_CLOCK_GETTIME */ + + /* test gettimeofday() */ +#ifdef GETTIMEOFDAY_NO_TZ + err = gettimeofday(&tv); +#else + err = gettimeofday(&tv, (struct timezone *)NULL); +#endif + if (err) { + if (raise) + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + if (_PyTime_FromTimeval(tp, &tv, raise) < 0) + return -1; + + if (info) { + info->implementation = "gettimeofday()"; + info->resolution = 1e-6; + info->monotonic = 0; + info->adjustable = 1; + } +#endif /* !HAVE_CLOCK_GETTIME */ +#endif /* !MS_WINDOWS */ + return 0; +} + +_PyTime_t +_PyTime_GetSystemClock(void) +{ + _PyTime_t t; + if (pygettimeofday(&t, NULL, 0) < 0) { + /* should not happen, _PyTime_Init() checked the clock at startup */ + assert(0); + + /* use a fixed value instead of a random value from the stack */ + t = 0; + } + return t; +} + +int +_PyTime_GetSystemClockWithInfo(_PyTime_t *t, _Py_clock_info_t *info) +{ + return pygettimeofday(t, info, 1); +} + +static int +pymonotonic(_PyTime_t *tp, _Py_clock_info_t *info, int raise) +{ +#if defined(MS_WINDOWS) + ULONGLONG ticks; + _PyTime_t t; + + assert(info == NULL || raise); + + ticks = GetTickCount64(); + Py_BUILD_ASSERT(sizeof(ticks) <= sizeof(_PyTime_t)); + t = (_PyTime_t)ticks; + + if (_PyTime_check_mul_overflow(t, MS_TO_NS)) { + if (raise) { + _PyTime_overflow(); + return -1; + } + /* Hello, time traveler! */ + assert(0); + } + *tp = t * MS_TO_NS; + + if (info) { + DWORD timeAdjustment, timeIncrement; + BOOL isTimeAdjustmentDisabled, ok; + info->implementation = "GetTickCount64()"; + info->monotonic = 1; + ok = GetSystemTimeAdjustment(&timeAdjustment, &timeIncrement, + &isTimeAdjustmentDisabled); + if (!ok) { + PyErr_SetFromWindowsErr(0); + return -1; + } + info->resolution = timeIncrement * 1e-7; + info->adjustable = 0; + } + +#elif defined(__APPLE__) + static mach_timebase_info_data_t timebase; + uint64_t time; + + if (timebase.denom == 0) { + /* According to the Technical Q&A QA1398, mach_timebase_info() cannot + fail: https://developer.apple.com/library/mac/#qa/qa1398/ */ + (void)mach_timebase_info(&timebase); + } + + time = mach_absolute_time(); + + /* apply timebase factor */ + time *= timebase.numer; + time /= timebase.denom; + + *tp = time; + + if (info) { + info->implementation = "mach_absolute_time()"; + info->resolution = (double)timebase.numer / timebase.denom * 1e-9; + info->monotonic = 1; + info->adjustable = 0; + } + +#else + struct timespec ts; +#ifdef CLOCK_HIGHRES + const clockid_t clk_id = CLOCK_HIGHRES; + const char *implementation = "clock_gettime(CLOCK_HIGHRES)"; +#else + const clockid_t clk_id = CLOCK_MONOTONIC; + const char *implementation = "clock_gettime(CLOCK_MONOTONIC)"; +#endif + + assert(info == NULL || raise); + + if (clock_gettime(clk_id, &ts) != 0) { + if (raise) { + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + return -1; + } + + if (info) { + struct timespec res; + info->monotonic = 1; + info->implementation = implementation; + info->adjustable = 0; + if (clock_getres(clk_id, &res) != 0) { + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + info->resolution = res.tv_sec + res.tv_nsec * 1e-9; + } + if (_PyTime_FromTimespec(tp, &ts, raise) < 0) + return -1; +#endif + return 0; +} + +_PyTime_t +_PyTime_GetMonotonicClock(void) +{ + _PyTime_t t; + if (pymonotonic(&t, NULL, 0) < 0) { + /* should not happen, _PyTime_Init() checked that monotonic clock at + startup */ + assert(0); + + /* use a fixed value instead of a random value from the stack */ + t = 0; + } + return t; +} + +int +_PyTime_GetMonotonicClockWithInfo(_PyTime_t *tp, _Py_clock_info_t *info) +{ + return pymonotonic(tp, info, 1); +} + +int +_PyTime_Init(void) +{ + _PyTime_t t; + + /* ensure that the system clock works */ + if (_PyTime_GetSystemClockWithInfo(&t, NULL) < 0) + return -1; + + /* ensure that the operating system provides a monotonic clock */ + if (_PyTime_GetMonotonicClockWithInfo(&t, NULL) < 0) + return -1; + + return 0; +} + +int +_PyTime_localtime(time_t t, struct tm *tm) +{ +#ifdef MS_WINDOWS + int error; + + error = localtime_s(tm, &t); + if (error != 0) { + errno = error; + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + return 0; +#else /* !MS_WINDOWS */ + if (localtime_r(&t, tm) == NULL) { +#ifdef EINVAL + if (errno == 0) + errno = EINVAL; +#endif + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + return 0; +#endif /* MS_WINDOWS */ +} + +int +_PyTime_gmtime(time_t t, struct tm *tm) +{ +#ifdef MS_WINDOWS + int error; + + error = gmtime_s(tm, &t); + if (error != 0) { + errno = error; + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + return 0; +#else /* !MS_WINDOWS */ + if (gmtime_r(&t, tm) == NULL) { +#ifdef EINVAL + if (errno == 0) + errno = EINVAL; +#endif + PyErr_SetFromErrno(PyExc_OSError); + return -1; + } + return 0; +#endif /* MS_WINDOWS */ +} From pypy.commits at gmail.com Wed Sep 11 13:16:51 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 11 Sep 2019 10:16:51 -0700 (PDT) Subject: [pypy-commit] pypy default: do not rebuild unconditionally during packaging, it doesn't work on windows Message-ID: <5d792c03.1c69fb81.99d0b.564b@mx.google.com> Author: Matti Picus Branch: Changeset: r97446:67f9b04c3662 Date: 2019-09-11 19:43 +0300 http://bitbucket.org/pypy/pypy/changeset/67f9b04c3662/ Log: do not rebuild unconditionally during packaging, it doesn't work on windows diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py --- a/pypy/tool/release/package.py +++ b/pypy/tool/release/package.py @@ -86,7 +86,6 @@ failures = create_cffi_import_libraries( str(pypy_c), options, str(basedir), embed_dependencies=options.embed_dependencies, - rebuild=True, ) for key, module in failures: From pypy.commits at gmail.com Wed Sep 11 13:16:53 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 11 Sep 2019 10:16:53 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default into branch Message-ID: <5d792c05.1c69fb81.44462.ac16@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97447:26d040d0bd1f Date: 2019-09-11 19:57 +0300 http://bitbucket.org/pypy/pypy/changeset/26d040d0bd1f/ Log: merge default into branch diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py --- a/pypy/tool/release/package.py +++ b/pypy/tool/release/package.py @@ -87,7 +87,6 @@ failures = create_cffi_import_libraries( str(pypy_c), options, str(basedir), embed_dependencies=options.embed_dependencies, - rebuild=True, ) for key, module in failures: diff --git a/rpython/rlib/buffer.py b/rpython/rlib/buffer.py --- a/rpython/rlib/buffer.py +++ b/rpython/rlib/buffer.py @@ -123,7 +123,7 @@ class RawBuffer(Buffer): """ - A buffer which is baked by a raw, non-movable memory area. It implementes + A buffer which is backed by a raw, non-movable memory area. It implementes typed_read and typed_write in terms of get_raw_address(), llop.raw_load, llop.raw_store. @@ -157,7 +157,7 @@ class GCBuffer(Buffer): """ - Base class for a buffer which is baked by a GC-managed memory area. You + Base class for a buffer which is backed by a GC-managed memory area. You MUST also decorate the class with @GCBuffer.decorate: it implements typed_read and typed_write in terms of llop.gc_load_indexed and llop.gc_store_indexed. @@ -250,6 +250,14 @@ def setitem(self, index, char): self.data[index] = char + def getslice(self, start, stop, step, size): + if step == 1: + assert 0 <= start <= stop + if start == 0 and stop == len(self.data): + return "".join(self.data) + return "".join(self.data[start:stop]) + return Buffer.getslice(self, start, stop, step, size) + def get_raw_address(self): return nonmoving_raw_ptr_for_resizable_list(self.data) diff --git a/rpython/rlib/test/test_buffer.py b/rpython/rlib/test/test_buffer.py --- a/rpython/rlib/test/test_buffer.py +++ b/rpython/rlib/test/test_buffer.py @@ -197,6 +197,12 @@ assert buf.typed_read(rffi.USHORT, 0) == 0x1234 assert buf.typed_read(rffi.USHORT, 2) == 0x5678 + def test_getslice_shortcut(self): + buf = ByteBuffer(4) + buf.setslice(0, b"data") + buf.getitem = None + assert buf.getslice(0, 2, 1, 2) == b"da" # no crash! + class TestJIT(LLJitMixin): diff --git a/rpython/translator/c/src/thread_pthread.c b/rpython/translator/c/src/thread_pthread.c --- a/rpython/translator/c/src/thread_pthread.c +++ b/rpython/translator/c/src/thread_pthread.c @@ -454,13 +454,13 @@ lock->locked = 0; - status = pthread_mutex_unlock( &lock->mut ); - CHECK_STATUS("pthread_mutex_unlock[3]"); - /* wake up someone (anyone, if any) waiting on the lock */ status = pthread_cond_signal( &lock->lock_released ); CHECK_STATUS("pthread_cond_signal"); + status = pthread_mutex_unlock( &lock->mut ); + CHECK_STATUS("pthread_mutex_unlock[3]"); + return result; } From pypy.commits at gmail.com Wed Sep 11 15:53:56 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 11 Sep 2019 12:53:56 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: enable more capi tests; test, fix exception compatibility Message-ID: <5d7950d4.1c69fb81.be99e.fe55@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97450:930650622627 Date: 2019-09-11 22:52 +0300 http://bitbucket.org/pypy/pypy/changeset/930650622627/ Log: enable more capi tests; test, fix exception compatibility diff --git a/lib_pypy/_testcapimodule.c b/lib_pypy/_testcapimodule.c --- a/lib_pypy/_testcapimodule.c +++ b/lib_pypy/_testcapimodule.c @@ -4449,9 +4449,11 @@ {"crash_no_current_thread", (PyCFunction)crash_no_current_thread, METH_NOARGS}, #ifndef PYPY_VERSION {"run_in_subinterp", run_in_subinterp, METH_VARARGS}, +#endif {"pytime_object_to_time_t", test_pytime_object_to_time_t, METH_VARARGS}, {"pytime_object_to_timeval", test_pytime_object_to_timeval, METH_VARARGS}, {"pytime_object_to_timespec", test_pytime_object_to_timespec, METH_VARARGS}, +#ifndef PYPY_VERSION {"with_tp_del", with_tp_del, METH_VARARGS}, #endif {"create_cfunction", create_cfunction, METH_NOARGS}, diff --git a/pypy/module/time/interp_time.py b/pypy/module/time/interp_time.py --- a/pypy/module/time/interp_time.py +++ b/pypy/module/time/interp_time.py @@ -528,6 +528,9 @@ seconds = pytime.time() else: seconds = space.float_w(w_seconds) + if math.isnan(seconds): + raise oefmt(space.w_ValueError, + "Invalid value Nan (not a number)") # t = rffi.cast(rffi.TIME_T, seconds) # diff --git a/pypy/module/time/test/test_time.py b/pypy/module/time/test/test_time.py --- a/pypy/module/time/test/test_time.py +++ b/pypy/module/time/test/test_time.py @@ -111,6 +111,11 @@ else: time.localtime(-1) + def test_localtime_invalid(self): + from time import localtime + exc = raises(ValueError, localtime, float('nan')) + assert 'Invalid value' in str(exc.value) + def test_mktime(self): import time import os, sys From pypy.commits at gmail.com Wed Sep 11 17:19:00 2019 From: pypy.commits at gmail.com (cfbolz) Date: Wed, 11 Sep 2019 14:19:00 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default Message-ID: <5d7964c4.1c69fb81.782a6.1270@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97453:6e81e44fab5b Date: 2019-09-11 23:18 +0200 http://bitbucket.org/pypy/pypy/changeset/6e81e44fab5b/ Log: merge default diff --git a/pypy/module/_codecs/interp_codecs.py b/pypy/module/_codecs/interp_codecs.py --- a/pypy/module/_codecs/interp_codecs.py +++ b/pypy/module/_codecs/interp_codecs.py @@ -715,6 +715,8 @@ @unwrap_spec(errors='text_or_none') def utf_8_encode(space, w_obj, errors="strict"): utf8, lgt = space.utf8_len_w(w_obj) + if lgt == len(utf8): # ascii + return space.newtuple([space.newbytes(utf8), space.newint(lgt)]) if errors is None: errors = 'strict' state = space.fromcache(CodecState) diff --git a/pypy/module/_io/interp_iobase.py b/pypy/module/_io/interp_iobase.py --- a/pypy/module/_io/interp_iobase.py +++ b/pypy/module/_io/interp_iobase.py @@ -56,7 +56,7 @@ # `__IOBase_closed` and call flush() by itself, but it is redundant # with whatever behaviour a non-trivial derived class will implement. self.space = space - self.w_dict = space.newdict() + self.w_dict = space.newdict(instance=True) self.__IOBase_closed = False if add_to_autoflusher: get_autoflusher(space).add(self) diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -928,9 +928,13 @@ return space.newint(textlen) def _writeflush(self, space): + # jit inlinable fast path if not self.pending_bytes: return + self._really_flush(space) + + def _really_flush(self, space): pending_bytes = ''.join(self.pending_bytes) self.pending_bytes = None self.pending_bytes_count = 0 From pypy.commits at gmail.com Thu Sep 12 03:50:28 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 12 Sep 2019 00:50:28 -0700 (PDT) Subject: [pypy-commit] pypy default: add an ascii fastpath Message-ID: <5d79f8c4.1c69fb81.ecbc7.18e7@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97454:2881d923dbb6 Date: 2019-09-12 09:30 +0200 http://bitbucket.org/pypy/pypy/changeset/2881d923dbb6/ Log: add an ascii fastpath diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -427,8 +427,24 @@ def find_char(self, marker, limit): # only works for ascii markers! assert 0 <= ord(marker) < 128 + # ascii fast path + if self.ulen == len(self.text): + if limit < 0: + end = len(self.text) + else: + end = self.pos + limit + pos = self.text.find(marker, self.pos, end) + if pos >= 0: + self.pos = self.upos = pos + 1 + return True + else: + self.pos = self.upos = end + return False + if limit < 0: limit = sys.maxint + # XXX it might be better to search for the marker quickly, then compute + # the new upos afterwards. scanned = 0 while scanned < limit: # don't use next_char here, since that computes a slice etc From pypy.commits at gmail.com Thu Sep 12 04:55:03 2019 From: pypy.commits at gmail.com (arigo) Date: Thu, 12 Sep 2019 01:55:03 -0700 (PDT) Subject: [pypy-commit] pypy default: #3072 Message-ID: <5d7a07e7.1c69fb81.5b973.1f41@mx.google.com> Author: Armin Rigo Branch: Changeset: r97455:a9d36d6af872 Date: 2019-09-12 10:54 +0200 http://bitbucket.org/pypy/pypy/changeset/a9d36d6af872/ Log: #3072 Destroy the condition variable before the mutex diff --git a/rpython/translator/c/src/thread_pthread.c b/rpython/translator/c/src/thread_pthread.c --- a/rpython/translator/c/src/thread_pthread.c +++ b/rpython/translator/c/src/thread_pthread.c @@ -369,12 +369,12 @@ if (lock->next) lock->next->prev = lock->prev; + status = pthread_cond_destroy(&lock->lock_released); + CHECK_STATUS("pthread_cond_destroy"); + status = pthread_mutex_destroy(&lock->mut); CHECK_STATUS("pthread_mutex_destroy"); - status = pthread_cond_destroy(&lock->lock_released); - CHECK_STATUS("pthread_cond_destroy"); - /* 'error' is ignored; CHECK_STATUS already printed an error message */ } From pypy.commits at gmail.com Thu Sep 12 05:12:52 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 12 Sep 2019 02:12:52 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default Message-ID: <5d7a0c14.1c69fb81.1f3d2.5f31@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97456:41c694d4618d Date: 2019-09-12 11:12 +0200 http://bitbucket.org/pypy/pypy/changeset/41c694d4618d/ Log: merge default diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -442,8 +442,24 @@ def find_char(self, marker, limit): # only works for ascii markers! assert 0 <= ord(marker) < 128 + # ascii fast path + if self.ulen == len(self.text): + if limit < 0: + end = len(self.text) + else: + end = self.pos + limit + pos = self.text.find(marker, self.pos, end) + if pos >= 0: + self.pos = self.upos = pos + 1 + return True + else: + self.pos = self.upos = end + return False + if limit < 0: limit = sys.maxint + # XXX it might be better to search for the marker quickly, then compute + # the new upos afterwards. scanned = 0 while scanned < limit: # don't use next_char here, since that computes a slice etc From pypy.commits at gmail.com Thu Sep 12 05:59:05 2019 From: pypy.commits at gmail.com (arigo) Date: Thu, 12 Sep 2019 02:59:05 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: A large speedup to the own test 'test_recompiler' in py3.6 Message-ID: <5d7a16e9.1c69fb81.78cf2.1302@mx.google.com> Author: Armin Rigo Branch: py3.6 Changeset: r97457:2d88bbee870d Date: 2019-09-12 11:57 +0200 http://bitbucket.org/pypy/pypy/changeset/2d88bbee870d/ Log: A large speedup to the own test 'test_recompiler' in py3.6 diff --git a/pypy/module/_cffi_backend/test/test_recompiler.py b/pypy/module/_cffi_backend/test/test_recompiler.py --- a/pypy/module/_cffi_backend/test/test_recompiler.py +++ b/pypy/module/_cffi_backend/test/test_recompiler.py @@ -75,8 +75,12 @@ args_w = [space.wrap(module_name), space.wrap(so_file)] w_res = space.appexec(args_w, """(modulename, filename): - import imp - mod = imp.load_dynamic(modulename, filename) + import _imp + class Spec: pass + spec = Spec() + spec.name = modulename + spec.origin = filename + mod = _imp.create_dynamic(spec) assert mod.__name__ == modulename return (mod.ffi, mod.lib) """) From pypy.commits at gmail.com Thu Sep 12 10:25:10 2019 From: pypy.commits at gmail.com (rlamy) Date: Thu, 12 Sep 2019 07:25:10 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Add missing constants to stat and kill _stat (#3073) Message-ID: <5d7a5546.1c69fb81.9c393.f364@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97459:f245f35c61eb Date: 2019-09-12 15:24 +0100 http://bitbucket.org/pypy/pypy/changeset/f245f35c61eb/ Log: Add missing constants to stat and kill _stat (#3073) diff --git a/lib-python/3/stat.py b/lib-python/3/stat.py --- a/lib-python/3/stat.py +++ b/lib-python/3/stat.py @@ -40,6 +40,10 @@ S_IFIFO = 0o010000 # fifo (named pipe) S_IFLNK = 0o120000 # symbolic link S_IFSOCK = 0o140000 # socket file +# Fallbacks for uncommon platform-specific constants +S_IFDOOR = 0 +S_IFPORT = 0 +S_IFWHT = 0 # Functions to test for each file type @@ -71,6 +75,18 @@ """Return True if mode is from a socket.""" return S_IFMT(mode) == S_IFSOCK +def S_ISDOOR(mode): + """Return True if mode is from a door.""" + return False + +def S_ISPORT(mode): + """Return True if mode is from an event port.""" + return False + +def S_ISWHT(mode): + """Return True if mode is from a whiteout.""" + return False + # Names for permission bits S_ISUID = 0o4000 # set UID bit diff --git a/lib_pypy/_stat.py b/lib_pypy/_stat.py deleted file mode 100644 --- a/lib_pypy/_stat.py +++ /dev/null @@ -1,6 +0,0 @@ -# Assume not Solaris - -S_IFDOOR = 0 - -def S_ISDOOR(mode): - return False From pypy.commits at gmail.com Thu Sep 12 10:53:53 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 12 Sep 2019 07:53:53 -0700 (PDT) Subject: [pypy-commit] pypy default: fix translation Message-ID: <5d7a5c01.1c69fb81.b002c.2480@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97460:ba849ddc5eaf Date: 2019-09-12 15:50 +0200 http://bitbucket.org/pypy/pypy/changeset/ba849ddc5eaf/ Log: fix translation diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -433,7 +433,10 @@ end = len(self.text) else: end = self.pos + limit - pos = self.text.find(marker, self.pos, end) + pos = self.pos + assert pos >= 0 + assert end >= 0 + pos = self.text.find(marker, pos, end) if pos >= 0: self.pos = self.upos = pos + 1 return True From pypy.commits at gmail.com Thu Sep 12 10:53:55 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 12 Sep 2019 07:53:55 -0700 (PDT) Subject: [pypy-commit] pypy default: speed up rutf8.has_surrogates Message-ID: <5d7a5c03.1c69fb81.39c22.775a@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97461:ae6546a86d6e Date: 2019-09-12 15:50 +0200 http://bitbucket.org/pypy/pypy/changeset/ae6546a86d6e/ Log: speed up rutf8.has_surrogates diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -60,12 +60,6 @@ return encode_object(space, w_data, encoding, errors) -def _has_surrogate(u): - for c in u: - if 0xD800 <= ord(c) <= 0xDFFF: - return True - return False - # These functions take and return unwrapped rpython strings def decode_unicode_escape(space, string): from pypy.module._codecs import interp_codecs diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -874,11 +874,6 @@ def is_ascii(self): return self._length == len(self._utf8) - def _has_surrogates(self): - if self.is_ascii(): - return False - return rutf8.has_surrogates(self._utf8) - def _index_to_byte(self, index): if self.is_ascii(): assert index >= 0 diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py --- a/rpython/rlib/rutf8.py +++ b/rpython/rlib/rutf8.py @@ -435,10 +435,17 @@ return result def has_surrogates(utf8): - # XXX write a faster version maybe - for ch in Utf8StringIterator(utf8): - if 0xD800 <= ch <= 0xDBFF: + # a surrogate starts with 0xed in utf-8 encoding + pos = 0 + while True: + pos = utf8.find("\xed", pos) + if pos < 0: + return False + assert pos <= len(utf8) - 1 # otherwise invalid utf-8 + ordch2 = ord(utf8[pos + 1]) + if _invalid_byte_2_of_3(0xed, ordch2, allow_surrogates=False): return True + pos += 1 return False def reencode_utf8_with_surrogates(utf8): diff --git a/rpython/rlib/test/test_rutf8.py b/rpython/rlib/test/test_rutf8.py --- a/rpython/rlib/test/test_rutf8.py +++ b/rpython/rlib/test/test_rutf8.py @@ -238,3 +238,17 @@ assert pos == i i = rutf8.next_codepoint_pos(utf8s, i) assert list(arg) == l + + + at given(strategies.text(), strategies.integers(0xd800, 0xdfff)) +def test_has_surrogates(arg, surrogate): + b = (arg + unichr(surrogate) + arg).encode("utf-8") + assert not rutf8.has_surrogates(arg.encode("utf-8")) + assert rutf8.has_surrogates(unichr(surrogate).encode("utf-8")) + assert rutf8.has_surrogates(b) + +def test_has_surrogate_xed_no_surrogate(): + u = unichr(55217) + unichr(54990) + b = u.encode("utf-8") + assert b.startswith(b"\xed") + assert not rutf8.has_surrogates(b) From pypy.commits at gmail.com Thu Sep 12 10:53:57 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 12 Sep 2019 07:53:57 -0700 (PDT) Subject: [pypy-commit] pypy default: merge heads Message-ID: <5d7a5c05.1c69fb81.cec2f.13c9@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97462:5e5857c2fae6 Date: 2019-09-12 16:52 +0200 http://bitbucket.org/pypy/pypy/changeset/5e5857c2fae6/ Log: merge heads diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -60,12 +60,6 @@ return encode_object(space, w_data, encoding, errors) -def _has_surrogate(u): - for c in u: - if 0xD800 <= ord(c) <= 0xDFFF: - return True - return False - # These functions take and return unwrapped rpython strings def decode_unicode_escape(space, string): from pypy.module._codecs import interp_codecs diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -433,7 +433,10 @@ end = len(self.text) else: end = self.pos + limit - pos = self.text.find(marker, self.pos, end) + pos = self.pos + assert pos >= 0 + assert end >= 0 + pos = self.text.find(marker, pos, end) if pos >= 0: self.pos = self.upos = pos + 1 return True diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -874,11 +874,6 @@ def is_ascii(self): return self._length == len(self._utf8) - def _has_surrogates(self): - if self.is_ascii(): - return False - return rutf8.has_surrogates(self._utf8) - def _index_to_byte(self, index): if self.is_ascii(): assert index >= 0 diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py --- a/rpython/rlib/rutf8.py +++ b/rpython/rlib/rutf8.py @@ -435,10 +435,17 @@ return result def has_surrogates(utf8): - # XXX write a faster version maybe - for ch in Utf8StringIterator(utf8): - if 0xD800 <= ch <= 0xDBFF: + # a surrogate starts with 0xed in utf-8 encoding + pos = 0 + while True: + pos = utf8.find("\xed", pos) + if pos < 0: + return False + assert pos <= len(utf8) - 1 # otherwise invalid utf-8 + ordch2 = ord(utf8[pos + 1]) + if _invalid_byte_2_of_3(0xed, ordch2, allow_surrogates=False): return True + pos += 1 return False def reencode_utf8_with_surrogates(utf8): diff --git a/rpython/rlib/test/test_rutf8.py b/rpython/rlib/test/test_rutf8.py --- a/rpython/rlib/test/test_rutf8.py +++ b/rpython/rlib/test/test_rutf8.py @@ -238,3 +238,17 @@ assert pos == i i = rutf8.next_codepoint_pos(utf8s, i) assert list(arg) == l + + + at given(strategies.text(), strategies.integers(0xd800, 0xdfff)) +def test_has_surrogates(arg, surrogate): + b = (arg + unichr(surrogate) + arg).encode("utf-8") + assert not rutf8.has_surrogates(arg.encode("utf-8")) + assert rutf8.has_surrogates(unichr(surrogate).encode("utf-8")) + assert rutf8.has_surrogates(b) + +def test_has_surrogate_xed_no_surrogate(): + u = unichr(55217) + unichr(54990) + b = u.encode("utf-8") + assert b.startswith(b"\xed") + assert not rutf8.has_surrogates(b) From pypy.commits at gmail.com Thu Sep 12 11:10:17 2019 From: pypy.commits at gmail.com (rlamy) Date: Thu, 12 Sep 2019 08:10:17 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Leave internal state unchanged if _random.Random.setstate() raises an exception (bpo-29960) Message-ID: <5d7a5fd9.1c69fb81.ecbc7.b852@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97463:2cbe9ff66003 Date: 2019-09-12 16:09 +0100 http://bitbucket.org/pypy/pypy/changeset/2cbe9ff66003/ Log: Leave internal state unchanged if _random.Random.setstate() raises an exception (bpo-29960) diff --git a/pypy/module/_random/interp_random.py b/pypy/module/_random/interp_random.py --- a/pypy/module/_random/interp_random.py +++ b/pypy/module/_random/interp_random.py @@ -70,15 +70,17 @@ # independent of platfrom, since the below condition is only # true on 32 bit platforms anyway w_add = space.pow(space.newint(2), space.newint(32), space.w_None) + _state = [r_uint(0)] * rrandom.N for i in range(rrandom.N): w_item = space.getitem(w_state, space.newint(i)) if space.is_true(space.lt(w_item, w_zero)): w_item = space.add(w_item, w_add) - self._rnd.state[i] = space.uint_w(w_item) + _state[i] = space.uint_w(w_item) w_item = space.getitem(w_state, space.newint(rrandom.N)) index = space.int_w(w_item) if index < 0 or index > rrandom.N: raise oefmt(space.w_ValueError, "invalid state") + self._rnd.state = _state self._rnd.index = index @unwrap_spec(k=int) diff --git a/pypy/module/_random/test/test_random.py b/pypy/module/_random/test/test_random.py --- a/pypy/module/_random/test/test_random.py +++ b/pypy/module/_random/test/test_random.py @@ -41,6 +41,18 @@ # does not crash rnd1.setstate((-1, ) * 624 + (0, )) + def test_failed_setstate(self): + import _random + rnd = _random.Random() + rnd.seed() + start_state = rnd.getstate() + raises(TypeError, rnd.setstate, None) + raises(ValueError, rnd.setstate, (1, 2, 3)) + raises(TypeError, rnd.setstate, ('a',)*624 + (1,)) + raises(ValueError, rnd.setstate, (1,)*624 + (625,)) + # None of these failed calls should have changed the state + assert rnd.getstate() == start_state + def test_state_repr(self): # since app-level jumpahead salts with repr(state), # it is important the repr is consistent with cpython From pypy.commits at gmail.com Thu Sep 12 13:11:46 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 12 Sep 2019 10:11:46 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: now I get to what I actually wanted to achieve: a fast path in Message-ID: <5d7a7c52.1c69fb81.a17ce.1b9a@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97468:bd340e819dcd Date: 2019-09-12 18:48 +0200 http://bitbucket.org/pypy/pypy/changeset/bd340e819dcd/ Log: now I get to what I actually wanted to achieve: a fast path in utf8_encode_utf_8 for the common case where no surrogates are present diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -212,27 +212,38 @@ self.old = old def utf8_encode_utf_8(s, errors, errorhandler, allow_surrogates=False): - assert isinstance(s, str) size = len(s) if size == 0: return '' + + # two fast paths + if allow_surrogates: + # already valid utf-8 with surrogates, surrogates are allowed, so just + # return + return s + if not rutf8.has_surrogates(s): + # already valid utf-8 and doesn't contain surrogates, so we don't need + # to do anything + return s + # annoying slow path + return _utf8_encode_utf_8_deal_with_surrogates(s, errors, errorhandler) + +def _utf8_encode_utf_8_deal_with_surrogates(s, errors, errorhandler): pos = 0 upos = 0 + size = len(s) result = StringBuilder(size) while pos < size: try: - lgt = rutf8.check_utf8(s, allow_surrogates=allow_surrogates, start=pos) - if pos == 0: - # fast path - return s - for ch in s[pos:]: - result.append(ch) + rutf8.check_utf8(s, allow_surrogates=False, start=pos) + # otherwise the fast path above would have triggered + assert pos != 0 + result.append_slice(s, pos, len(s)) break except rutf8.CheckError as e: end = e.pos assert end >= 0 - for ch in s[pos:end]: - result.append(ch) + result.append_slice(s, pos, end) upos += rutf8.codepoints_in_utf8(s, start=pos, end=end) pos = end # Try to get collect surrogates in one pass From pypy.commits at gmail.com Fri Sep 13 05:22:36 2019 From: pypy.commits at gmail.com (cfbolz) Date: Fri, 13 Sep 2019 02:22:36 -0700 (PDT) Subject: [pypy-commit] pypy default: fix corner case about readline with limit that goes beyond the end of the string Message-ID: <5d7b5fdc.1c69fb81.5dfbf.f54a@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97471:6e25c50447f0 Date: 2019-09-13 11:21 +0200 http://bitbucket.org/pypy/pypy/changeset/6e25c50447f0/ Log: fix corner case about readline with limit that goes beyond the end of the string diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -429,10 +429,9 @@ assert 0 <= ord(marker) < 128 # ascii fast path if self.ulen == len(self.text): - if limit < 0: - end = len(self.text) - else: - end = self.pos + limit + end = len(self.text) + if limit >= 0: + end = min(end, self.pos + limit) pos = self.pos assert pos >= 0 assert end >= 0 diff --git a/pypy/module/_io/test/test_interp_textio.py b/pypy/module/_io/test/test_interp_textio.py --- a/pypy/module/_io/test/test_interp_textio.py +++ b/pypy/module/_io/test/test_interp_textio.py @@ -35,6 +35,7 @@ @given(data=st_readline(), mode=st.sampled_from(['\r', '\n', '\r\n', ''])) @settings(deadline=None, database=None) + at example(data=(u'\n\r\n', [0, -1, 2, -1, 0, -1]), mode='\r') def test_readline(space, data, mode): txt, limits = data w_stream = W_BytesIO(space) From pypy.commits at gmail.com Fri Sep 13 07:01:10 2019 From: pypy.commits at gmail.com (cfbolz) Date: Fri, 13 Sep 2019 04:01:10 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default Message-ID: <5d7b76f6.1c69fb81.a6d7e.3f39@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97472:6e832892a7f7 Date: 2019-09-13 13:00 +0200 http://bitbucket.org/pypy/pypy/changeset/6e832892a7f7/ Log: merge default diff --git a/pypy/config/test/test_pypyoption.py b/pypy/config/test/test_pypyoption.py --- a/pypy/config/test/test_pypyoption.py +++ b/pypy/config/test/test_pypyoption.py @@ -8,14 +8,13 @@ def test_required(): conf = get_pypy_config() assert not conf.translating - assert conf.objspace.usemodules.gc def test_conflicting_gcrootfinder(): conf = get_pypy_config() conf.translation.gc = "boehm" - py.test.raises(ConfigError, "conf.translation.gcrootfinder = 'asmgcc'") - + with py.test.raises(ConfigError): + conf.translation.gcrootfinder = 'asmgcc' def test_frameworkgc(): for name in ["minimark", "semispace"]: diff --git a/pypy/interpreter/test/apptest_pyframe.py b/pypy/interpreter/test/apptest_pyframe.py --- a/pypy/interpreter/test/apptest_pyframe.py +++ b/pypy/interpreter/test/apptest_pyframe.py @@ -13,7 +13,8 @@ import sys f = sys._getframe() assert f.f_globals is globals() - pytest.raises(AttributeError, "f.f_globals = globals()") + with pytest.raises(AttributeError): + f.f_globals = globals() def test_f_builtins(): import sys, builtins diff --git a/pypy/interpreter/test/test_function.py b/pypy/interpreter/test/test_function.py --- a/pypy/interpreter/test/test_function.py +++ b/pypy/interpreter/test/test_function.py @@ -160,7 +160,8 @@ return 41 assert f() == 42 assert g() == 41 - raises(TypeError, "f.__code__ = 1") + with raises(TypeError): + f.__code__ = 1 f.__code__ = g.__code__ assert f() == 41 def get_h(f=f): @@ -168,14 +169,17 @@ return f() # a closure return h h = get_h() - raises(ValueError, "f.__code__ = h.__code__") + with raises(ValueError): + f.__code__ = h.__code__ @pytest.mark.skipif("config.option.runappdirect") def test_write_code_builtin_forbidden(self): def f(*args): return 42 - raises(TypeError, "dir.__code__ = f.__code__") - raises(TypeError, "list.append.__code__ = f.__code__") + with raises(TypeError): + dir.__code__ = f.__code__ + with raises(TypeError): + list.append.__code__ = f.__code__ def test_set_module_to_name_eagerly(self): skip("fails on PyPy but works on CPython. Unsure we want to care") @@ -313,19 +317,10 @@ def func(self, **kw): return self, kw func = A().func - - # don't want the extra argument passing of raises - try: + with raises(TypeError): func(self=23) - assert False - except TypeError: - pass - - try: + with raises(TypeError): func(**{'self': 23}) - assert False - except TypeError: - pass def test_kwargs_confusing_name(self): def func(self): # 'self' conflicts with the interp-level diff --git a/pypy/interpreter/test/test_nestedscope.py b/pypy/interpreter/test/test_nestedscope.py --- a/pypy/interpreter/test/test_nestedscope.py +++ b/pypy/interpreter/test/test_nestedscope.py @@ -99,7 +99,8 @@ x = 1 g = f() - raises(ValueError, "g.__closure__[0].cell_contents") + with raises(ValueError): + g.__closure__[0].cell_contents def test_compare_cells(self): def f(n): diff --git a/pypy/interpreter/test/test_raise.py b/pypy/interpreter/test/test_raise.py --- a/pypy/interpreter/test/test_raise.py +++ b/pypy/interpreter/test/test_raise.py @@ -2,9 +2,8 @@ class AppTestRaise: def test_arg_as_string(self): - def f(): + with raises(TypeError): raise "test" - raises(TypeError, f) def test_control_flow(self): try: @@ -36,9 +35,8 @@ assert isinstance(e, IndexError) def test_raise_cls(self): - def f(): + with raises(IndexError): raise IndexError - raises(IndexError, f) def test_raise_cls_catch(self): def f(r): @@ -46,7 +44,8 @@ raise r except LookupError: return 1 - raises(Exception, f, Exception) + with raises(Exception): + f(Exception) assert f(IndexError) == 1 def test_raise_wrong(self): @@ -99,7 +98,7 @@ assert sys.exc_info() == (None, None, None) def test_reraise_1(self): - raises(IndexError, """ + with raises(IndexError): import sys try: raise ValueError @@ -109,10 +108,10 @@ finally: assert sys.exc_info()[0] is IndexError raise - """) + def test_reraise_2(self): - raises(IndexError, """ + with raises(IndexError): def foo(): import sys assert sys.exc_info()[0] is IndexError @@ -124,10 +123,10 @@ raise IndexError finally: foo() - """) + def test_reraise_3(self): - raises(IndexError, """ + with raises(IndexError): def spam(): import sys try: @@ -142,7 +141,6 @@ raise IndexError finally: spam() - """) def test_reraise_4(self): import sys @@ -156,7 +154,7 @@ assert ok def test_reraise_5(self): - raises(IndexError, """ + with raises(IndexError): import sys try: raise ValueError @@ -170,17 +168,16 @@ finally: assert sys.exc_info()[0] is IndexError assert sys.exc_info()[2].tb_next is some_traceback - """) def test_nested_reraise(self): - raises(TypeError, """ + with raises(TypeError): def nested_reraise(): raise try: raise TypeError("foo") except: nested_reraise() - """) + def test_with_reraise_1(self): class Context: @@ -196,7 +193,8 @@ with Context(): pass raise - raises(ValueError, "fn()") + with raises(ValueError): + fn() def test_with_reraise_2(self): @@ -213,23 +211,20 @@ with Context(): raise KeyError("caught") raise - raises(ValueError, "fn()") + with raises(ValueError): + fn() def test_userclass(self): # new-style classes can't be raised unless they inherit from # BaseException - class A(object): def __init__(self, x=None): self.x = x - - def f(): + + with raises(TypeError): raise A - raises(TypeError, f) - - def f(): + with raises(TypeError): raise A(42) - raises(TypeError, f) def test_userclass_catch(self): # classes can't be caught unless they inherit from BaseException @@ -259,7 +254,7 @@ def test_catch_tuple(self): class A(Exception): pass - + try: raise ValueError except (ValueError, A): @@ -307,7 +302,9 @@ class MyException(Exception): def __new__(cls, *args): return object() - raises(TypeError, "raise MyException") + + with raises(TypeError): + raise MyException def test_with_exit_True(self): class X: diff --git a/pypy/interpreter/test/test_syntax.py b/pypy/interpreter/test/test_syntax.py --- a/pypy/interpreter/test/test_syntax.py +++ b/pypy/interpreter/test/test_syntax.py @@ -344,9 +344,6 @@ class AppTestWith: def test_with_simple(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -360,78 +357,28 @@ acontext = Context() with acontext: pass - """ - ns = {} - exec(s, ns) - acontext = ns['acontext'] assert acontext.calls == '__enter__ __exit__'.split() def test_compound_with(self): - s = """class Context: - def __init__(self, var): - self.record = [] - self.var = var - def __enter__(self): - self.record.append(("__enter__", self.var)) - return self.var - def __exit__(self, tp, value, tb): - self.record.append(("__exit__", self.var)) -c1 = Context("blah") -c2 = Context("bling") -with c1 as v1, c2 as v2: - pass - """ - ns = {} - exec(s, ns) - assert ns["v1"] == "blah" - assert ns["v2"] == "bling" - assert ns["c1"].record == [("__enter__", "blah"), ("__exit__", "blah")] - assert ns["c2"].record == [("__enter__", "bling"), - ("__exit__", "bling")] - - - def test_start_with_blank_line(self): - s = """ -if 1: class Context: - def __init__(self): - self.calls = list() - + def __init__(self, var): + self.record = [] + self.var = var def __enter__(self): - self.calls.append('__enter__') - - def __exit__(self, exc_type, exc_value, exc_tb): - self.calls.append('__exit__') - - acontext = Context() - with acontext: + self.record.append(("__enter__", self.var)) + return self.var + def __exit__(self, tp, value, tb): + self.record.append(("__exit__", self.var)) + c1 = Context("blah") + c2 = Context("bling") + with c1 as v1, c2 as v2: pass -""" - ns = {} - exec(s, ns) - acontext = ns['acontext'] - assert acontext.calls == '__enter__ __exit__'.split() - - def test_raw_doc_string(self): - s = """r'doc' -class Context(object): - def __enter__(self): - global enter - enter = True - def __exit__(self, *exc): - global exit - exit = True -with Context() as w: - pass""" - ns = {} - exec(s, ns) - assert ns['enter'] - assert ns['exit'] + assert v1 == "blah" + assert v2 == "bling" + assert c1.record == [("__enter__", "blah"), ("__exit__", "blah")] + assert c2.record == [("__enter__", "bling"), ("__exit__", "bling")] def test_with_as_var(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -448,17 +395,10 @@ with acontextfact as avar: avar.append('__body__') pass - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] assert acontextfact.exit_params == (None, None, None) assert acontextfact.calls == '__enter__ __body__ __exit__'.split() def test_with_raise_exception(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -482,20 +422,12 @@ pass else: raise AssertionError('With did not raise RuntimeError') - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] - error = ns['error'] assert acontextfact.calls == '__enter__ __body__ __exit__'.split() assert acontextfact.exit_params[0:2] == (RuntimeError, error) import types assert isinstance(acontextfact.exit_params[2], types.TracebackType) def test_with_swallow_exception(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -515,11 +447,6 @@ avar.append('__body__') raise error avar.append('__after_raise__') - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] - error = ns['error'] assert acontextfact.calls == '__enter__ __body__ __exit__'.split() assert acontextfact.exit_params[0:2] == (RuntimeError, error) import types @@ -544,9 +471,6 @@ assert c.calls == ['exit'] def test_with_break(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -568,17 +492,10 @@ avar.append('__after_break__') else: raise AssertionError('Break failed with With, reached else clause') - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] assert acontextfact.calls == '__enter__ __body__ __exit__'.split() assert acontextfact.exit_params == (None, None, None) def test_with_continue(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -600,16 +517,10 @@ avar.append('__after_continue__') else: avar.append('__continue__') - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] assert acontextfact.calls == '__enter__ __body__ __exit__ __continue__'.split() assert acontextfact.exit_params == (None, None, None) def test_with_return(self): - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -630,28 +541,16 @@ return '__return__' avar.append('__after_return__') acontextfact.calls.append(g(acontextfact)) - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] assert acontextfact.calls == '__enter__ __body__ __exit__ __return__'.split() assert acontextfact.exit_params == (None, None, None) def test_with_as_keyword(self): - try: + with raises(SyntaxError): exec("with = 9") - except SyntaxError: - pass - else: - assert False, 'Assignment to with did not raise SyntaxError' def test_with_as_keyword_compound(self): - try: + with raises(SyntaxError): exec("from __future__ import generators, with_statement\nwith = 9") - except SyntaxError: - pass - else: - assert False, 'Assignment to with did not raise SyntaxError' def test_missing_as_SyntaxError(self): snippets = [ @@ -662,21 +561,10 @@ pass """] for snippet in snippets: - try: + with raises(SyntaxError): exec(snippet) - except SyntaxError: - pass - else: - assert False, "%s: did not raise SyntaxError" % snippet - def test_with_propagate_compileflag(self): - s = """ -if 1: - compile('''with x: - pass''', '', 'exec') - """ - exec(s) class AppTestFunctionAnnotations: @@ -707,7 +595,6 @@ pass f1() """ - class AppTestSyntaxError: def test_tokenizer_error_location(self): @@ -752,7 +639,8 @@ # -*- coding: uft-8 -*- pass """ - raises(SyntaxError, exec, program) + with raises(SyntaxError): + exec(program) ''' def test_exception_target_in_nested_scope(self): @@ -798,24 +686,3 @@ raise AssertionError("should have raised") """ - -if __name__ == '__main__': - # only to check on top of CPython (you need 2.4) - from py.test import raises - for s in VALID: - try: - compile(s, '?', 'exec') - except Exception as e: - print '-'*20, 'FAILED TO COMPILE:', '-'*20 - print s - print '%s: %s' % (e.__class__, e) - print '-'*60 - for s in INVALID: - try: - raises(SyntaxError, compile, s, '?', 'exec') - except Exception as e: - print '-'*20, 'UNEXPECTEDLY COMPILED:', '-'*20 - print s - print '%s: %s' % (e.__class__, e) - print '-'*60 - diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -444,10 +444,9 @@ assert 0 <= ord(marker) < 128 # ascii fast path if self.ulen == len(self.text): - if limit < 0: - end = len(self.text) - else: - end = self.pos + limit + end = len(self.text) + if limit >= 0: + end = min(end, self.pos + limit) pos = self.pos assert pos >= 0 assert end >= 0 @@ -868,8 +867,7 @@ end_scan = self.decoded.pos uend_scan = self.decoded.upos if end_scan > start: - s = self.decoded.text[start:end_scan] - builder.append_utf8(s, uend_scan - ustart) + builder.append_utf8_slice(self.decoded.text, start, end_scan, uend_scan - ustart) if found or (limit >= 0 and builder.getlength() >= limit): break diff --git a/pypy/module/_io/test/test_interp_textio.py b/pypy/module/_io/test/test_interp_textio.py --- a/pypy/module/_io/test/test_interp_textio.py +++ b/pypy/module/_io/test/test_interp_textio.py @@ -35,6 +35,7 @@ @given(data=st_readline(), mode=st.sampled_from(['\r', '\n', '\r\n', ''])) @settings(deadline=None, database=None) + at example(data=(u'\n\r\n', [0, -1, 2, -1, 0, -1]), mode='\r') def test_readline(space, data, mode): txt, limits = data w_stream = W_BytesIO(space) diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py --- a/rpython/rlib/rutf8.py +++ b/rpython/rlib/rutf8.py @@ -772,6 +772,13 @@ self._lgt += length @always_inline + def append_utf8_slice(self, utf8, start, end, slicelength): + self._s.append_slice(utf8, start, end) + self._lgt += slicelength + if not we_are_translated(): + assert len(utf8[start: end].decode("utf-8")) == slicelength + + @always_inline def append_multiple_char(self, utf8, times): self._s.append(utf8 * times) self._lgt += times diff --git a/rpython/rlib/test/test_rutf8.py b/rpython/rlib/test/test_rutf8.py --- a/rpython/rlib/test/test_rutf8.py +++ b/rpython/rlib/test/test_rutf8.py @@ -211,6 +211,10 @@ s.append_code(0xD800) assert s.getlength() == 5 + s.append_utf8_slice(u"äöüß".encode("utf-8"), 2, 6, 2) + assert s.getlength() == 7 + assert s.build().decode("utf-8") == u"abc\u1234\ud800öü" + def test_utf8_string_builder_bad_code(): s = rutf8.Utf8StringBuilder() with pytest.raises(rutf8.OutOfRange): From pypy.commits at gmail.com Fri Sep 13 14:32:07 2019 From: pypy.commits at gmail.com (arigo) Date: Fri, 13 Sep 2019 11:32:07 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Emit warnings from unrelated older tests before catching the warnings from this precise test Message-ID: <5d7be0a7.1c69fb81.b79c5.b700@mx.google.com> Author: Armin Rigo Branch: py3.6 Changeset: r97473:b8f000ca2554 Date: 2019-09-13 20:31 +0200 http://bitbucket.org/pypy/pypy/changeset/b8f000ca2554/ Log: Emit warnings from unrelated older tests before catching the warnings from this precise test diff --git a/pypy/interpreter/test/apptest_coroutine.py b/pypy/interpreter/test/apptest_coroutine.py --- a/pypy/interpreter/test/apptest_coroutine.py +++ b/pypy/interpreter/test/apptest_coroutine.py @@ -202,6 +202,7 @@ import gc, warnings # XXX: importing warnings is expensive untranslated async def foobaz(): pass + gc.collect() # emit warnings from unrelated older tests with warnings.catch_warnings(record=True) as l: foobaz() gc.collect() From pypy.commits at gmail.com Sat Sep 14 09:09:19 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 14 Sep 2019 06:09:19 -0700 (PDT) Subject: [pypy-commit] pypy default: allow complete build configuration for embedded dependencies Message-ID: <5d7ce67f.1c69fb81.8e93f.37bf@mx.google.com> Author: Matti Picus Branch: Changeset: r97474:817e5e54c414 Date: 2019-09-14 12:18 +0300 http://bitbucket.org/pypy/pypy/changeset/817e5e54c414/ Log: allow complete build configuration for embedded dependencies diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py --- a/pypy/tool/build_cffi_imports.py +++ b/pypy/tool/build_cffi_imports.py @@ -1,6 +1,7 @@ from __future__ import print_function import sys, shutil, os, tempfile, hashlib from os.path import join +import multiprocessing class MissingDependenciesError(Exception): pass @@ -21,13 +22,21 @@ # for distribution, we may want to fetch dependencies not provided by # the OS, such as a recent openssl/libressl. +curdir = os.path.abspath(os.path.dirname(__file__)) +deps_destdir = os.path.join(curdir, 'dest') cffi_dependencies = { '_ssl': ('https://www.openssl.org/source/openssl-1.1.1c.tar.gz', - 'f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90', - ['no-shared']), + 'f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90', + [['./config', 'no-shared'], + ['make', '-s', '-j', str(multiprocessing.cpu_count())], + ['make', 'install', 'DESTDIR={}/'.format(deps_destdir)], + ]), '_gdbm': ('http://ftp.gnu.org/gnu/gdbm/gdbm-1.13.tar.gz', '9d252cbd7d793f7b12bcceaddda98d257c14f4d1890d851c386c37207000a253', - ['--without-readline']), + [['./config', '--without-readline'], + ['make', '-s', '-j', str(multiprocessing.cpu_count())], + ['make', 'install', 'DESTDIR={}/'.format(deps_destdir)], + ]), } @@ -53,8 +62,7 @@ return dgst.hexdigest() -def _build_dependency(name, destdir, patches=[]): - import multiprocessing +def _build_dependency(name, patches=[]): import shutil import subprocess @@ -66,7 +74,7 @@ from urllib import urlretrieve try: - url, dgst, args = cffi_dependencies[name] + url, dgst, build_cmds = cffi_dependencies[name] except KeyError: return 0, None, None @@ -82,15 +90,12 @@ print('fetching archive', url, file=sys.stderr) urlretrieve(url, archive) - # extract the archive into our destination directory + # extract the into our destination directory print('unpacking archive', archive, file=sys.stderr) - _unpack_tarfile(archive, destdir) + _unpack_tarfile(archive, deps_destdir) - sources = os.path.join( - destdir, - os.path.basename(archive)[:-7], - ) - + sources = os.path.join(deps_destdir, os.path.basename(archive)[:-7]) + # apply any patches if patches: for patch in patches: @@ -101,44 +106,14 @@ if status != 0: return status, stdout, stderr - - print('configuring', sources, file=sys.stderr) - - # configure & build it - status, stdout, stderr = run_subprocess( - './config', - [ - '--prefix=/usr', - ] + args, - cwd=sources, - ) - - if status != 0: + for args in build_cmds: + print('running', ' '.join(args), 'in', sources, file=sys.stderr) + status, stdout, stderr = run_subprocess(args[0], args[1:], + cwd=sources,) + if status != 0: + break return status, stdout, stderr - print('building', sources, file=sys.stderr) - - status, stdout, stderr = run_subprocess( - 'make', - [ - '-s', '-j' + str(multiprocessing.cpu_count()), - ], - cwd=sources, - ) - if status != 0: - return status, stdout, stderr - - print('installing to', destdir, file=sys.stderr) - status, stdout, stderr = run_subprocess( - 'make', - [ - 'install', 'DESTDIR={}/'.format(destdir), - ], - cwd=sources, - ) - return status, stdout, stderr - - def create_cffi_import_libraries(pypy_c, options, basedir, only=None, embed_dependencies=False, rebuild=False): from rpython.tool.runsubprocess import run_subprocess @@ -176,13 +151,12 @@ print('*', ' '.join(args), file=sys.stderr) if embed_dependencies: - curdir = os.path.abspath(os.path.dirname(__file__)) - destdir = os.path.join(curdir, 'dest') + destdir = deps_destdir shutil.rmtree(destdir, ignore_errors=True) os.makedirs(destdir) - status, stdout, stderr = _build_dependency(key, destdir) + status, stdout, stderr = _build_dependency(key) if status != 0: failures.append((key, module)) From pypy.commits at gmail.com Sat Sep 14 09:09:21 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 14 Sep 2019 06:09:21 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge and fix build script Message-ID: <5d7ce681.1c69fb81.bec3a.9c9c@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97475:f29a87447d84 Date: 2019-09-14 15:27 +0300 http://bitbucket.org/pypy/pypy/changeset/f29a87447d84/ Log: merge and fix build script diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py --- a/pypy/tool/build_cffi_imports.py +++ b/pypy/tool/build_cffi_imports.py @@ -1,6 +1,7 @@ from __future__ import print_function import sys, shutil, os, tempfile, hashlib from os.path import join +import multiprocessing class MissingDependenciesError(Exception): pass @@ -24,17 +25,34 @@ } # for distribution, we may want to fetch dependencies not provided by -# the OS, such as a recent openssl/libressl or liblzma/xz. +# the OS, such as a recent openssl/libressl. +curdir = os.path.abspath(os.path.dirname(__file__)) +deps_destdir = os.path.join(curdir, 'dest') +configure_args = ['./configure', + '--prefix=/usr', + '--disable-shared', + '--enable-silent-rules', + '--disable-dependency-tracking', + ] cffi_dependencies = { 'lzma': ('https://tukaani.org/xz/xz-5.2.3.tar.gz', '71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb', - []), + [configure_args, + ['make', '-s', '-j', str(multiprocessing.cpu_count())], + ['make', 'install', 'DESTDIR={}/'.format(deps_destdir)], + ]), '_ssl': ('https://www.openssl.org/source/openssl-1.1.1c.tar.gz', - 'f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90', - ['no-shared']), + 'f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90', + [['./config', 'no-shared'], + ['make', '-s', '-j', str(multiprocessing.cpu_count())], + ['make', 'install', 'DESTDIR={}/'.format(deps_destdir)], + ]), '_gdbm': ('http://ftp.gnu.org/gnu/gdbm/gdbm-1.13.tar.gz', '9d252cbd7d793f7b12bcceaddda98d257c14f4d1890d851c386c37207000a253', - ['--without-readline']), + [configure_args, + ['make', '-s', '-j', str(multiprocessing.cpu_count())], + ['make', 'install', 'DESTDIR={}/'.format(deps_destdir)], + ]), } @@ -60,8 +78,7 @@ return dgst.hexdigest() -def _build_dependency(name, destdir, patches=[]): - import multiprocessing +def _build_dependency(name, patches=[]): import shutil import subprocess @@ -73,7 +90,7 @@ from urllib import urlretrieve try: - url, dgst, args = cffi_dependencies[name] + url, dgst, build_cmds = cffi_dependencies[name] except KeyError: return 0, None, None @@ -91,13 +108,10 @@ # extract the archive into our destination directory print('unpacking archive', archive, file=sys.stderr) - _unpack_tarfile(archive, destdir) + _unpack_tarfile(archive, deps_destdir) - sources = os.path.join( - destdir, - os.path.basename(archive)[:-7], - ) - + sources = os.path.join(deps_destdir, os.path.basename(archive)[:-7]) + # apply any patches if patches: for patch in patches: @@ -108,44 +122,14 @@ if status != 0: return status, stdout, stderr - - print('configuring', sources, file=sys.stderr) - - # configure & build it - status, stdout, stderr = run_subprocess( - './config', - [ - '--prefix=/usr', - ] + args, - cwd=sources, - ) - - if status != 0: - return status, stdout, stderr - - print('building', sources, file=sys.stderr) - - status, stdout, stderr = run_subprocess( - 'make', - [ - '-s', '-j' + str(multiprocessing.cpu_count()), - ], - cwd=sources, - ) - if status != 0: - return status, stdout, stderr - - print('installing to', destdir, file=sys.stderr) - status, stdout, stderr = run_subprocess( - 'make', - [ - 'install', 'DESTDIR={}/'.format(destdir), - ], - cwd=sources, - ) + for args in build_cmds: + print('running', ' '.join(args), 'in', sources, file=sys.stderr) + status, stdout, stderr = run_subprocess(args[0], args[1:], + cwd=sources,) + if status != 0: + break return status, stdout, stderr - def create_cffi_import_libraries(pypy_c, options, basedir, only=None, embed_dependencies=False, rebuild=False): from rpython.tool.runsubprocess import run_subprocess @@ -183,13 +167,12 @@ print('*', ' '.join(args), file=sys.stderr) if embed_dependencies: - curdir = os.path.abspath(os.path.dirname(__file__)) - destdir = os.path.join(curdir, 'dest') + destdir = deps_destdir shutil.rmtree(destdir, ignore_errors=True) os.makedirs(destdir) - status, stdout, stderr = _build_dependency(key, destdir) + status, stdout, stderr = _build_dependency(key) if status != 0: failures.append((key, module)) From pypy.commits at gmail.com Sat Sep 14 09:09:22 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 14 Sep 2019 06:09:22 -0700 (PDT) Subject: [pypy-commit] pypy default: fix indent Message-ID: <5d7ce682.1c69fb81.3b4f0.6cd4@mx.google.com> Author: Matti Picus Branch: Changeset: r97476:7d1812d13cdf Date: 2019-09-14 15:32 +0300 http://bitbucket.org/pypy/pypy/changeset/7d1812d13cdf/ Log: fix indent diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py --- a/pypy/tool/build_cffi_imports.py +++ b/pypy/tool/build_cffi_imports.py @@ -112,7 +112,7 @@ cwd=sources,) if status != 0: break - return status, stdout, stderr + return status, stdout, stderr def create_cffi_import_libraries(pypy_c, options, basedir, only=None, embed_dependencies=False, rebuild=False): From pypy.commits at gmail.com Sat Sep 14 09:09:24 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 14 Sep 2019 06:09:24 -0700 (PDT) Subject: [pypy-commit] pypy default: preserve dest dir Message-ID: <5d7ce684.1c69fb81.a09a3.27ce@mx.google.com> Author: Matti Picus Branch: Changeset: r97477:1a5d83a05509 Date: 2019-09-14 16:08 +0300 http://bitbucket.org/pypy/pypy/changeset/1a5d83a05509/ Log: preserve dest dir diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py --- a/pypy/tool/build_cffi_imports.py +++ b/pypy/tool/build_cffi_imports.py @@ -90,6 +90,9 @@ print('fetching archive', url, file=sys.stderr) urlretrieve(url, archive) + shutil.rmtree(deps_destdir, ignore_errors=True) + os.makedirs(deps_destdir) + # extract the into our destination directory print('unpacking archive', archive, file=sys.stderr) _unpack_tarfile(archive, deps_destdir) @@ -151,13 +154,7 @@ print('*', ' '.join(args), file=sys.stderr) if embed_dependencies: - destdir = deps_destdir - - shutil.rmtree(destdir, ignore_errors=True) - os.makedirs(destdir) - status, stdout, stderr = _build_dependency(key) - if status != 0: failures.append((key, module)) print("stdout:") @@ -167,9 +164,9 @@ continue env['CPPFLAGS'] = \ - '-I{}/usr/include {}'.format(destdir, env.get('CPPFLAGS', '')) + '-I{}/usr/include {}'.format(deps_destdir, env.get('CPPFLAGS', '')) env['LDFLAGS'] = \ - '-L{}/usr/lib {}'.format(destdir, env.get('LDFLAGS', '')) + '-L{}/usr/lib {}'.format(deps_destdir, env.get('LDFLAGS', '')) elif sys.platform == 'win32': env['INCLUDE'] = r'..\externals\include;' + env.get('INCLUDE', '') env['LIB'] = r'..\externals\lib;' + env.get('LIB', '') From pypy.commits at gmail.com Sun Sep 15 06:38:49 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 15 Sep 2019 03:38:49 -0700 (PDT) Subject: [pypy-commit] pypy default: fix prefix Message-ID: <5d7e14b9.1c69fb81.37d20.b859@mx.google.com> Author: Matti Picus Branch: Changeset: r97478:424cd7425b6d Date: 2019-09-15 13:35 +0300 http://bitbucket.org/pypy/pypy/changeset/424cd7425b6d/ Log: fix prefix diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py --- a/pypy/tool/build_cffi_imports.py +++ b/pypy/tool/build_cffi_imports.py @@ -27,7 +27,7 @@ cffi_dependencies = { '_ssl': ('https://www.openssl.org/source/openssl-1.1.1c.tar.gz', 'f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90', - [['./config', 'no-shared'], + [['./config', '--prefix=/usr', 'no-shared'], ['make', '-s', '-j', str(multiprocessing.cpu_count())], ['make', 'install', 'DESTDIR={}/'.format(deps_destdir)], ]), From pypy.commits at gmail.com Sun Sep 15 06:38:51 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 15 Sep 2019 03:38:51 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default into branch Message-ID: <5d7e14bb.1c69fb81.e644a.76bd@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97479:3b65d3fa00a4 Date: 2019-09-15 13:38 +0300 http://bitbucket.org/pypy/pypy/changeset/3b65d3fa00a4/ Log: merge default into branch diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py --- a/pypy/tool/build_cffi_imports.py +++ b/pypy/tool/build_cffi_imports.py @@ -43,7 +43,7 @@ ]), '_ssl': ('https://www.openssl.org/source/openssl-1.1.1c.tar.gz', 'f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90', - [['./config', 'no-shared'], + [['./config', '--prefix=/usr', 'no-shared'], ['make', '-s', '-j', str(multiprocessing.cpu_count())], ['make', 'install', 'DESTDIR={}/'.format(deps_destdir)], ]), @@ -106,7 +106,10 @@ print('fetching archive', url, file=sys.stderr) urlretrieve(url, archive) - # extract the archive into our destination directory + shutil.rmtree(deps_destdir, ignore_errors=True) + os.makedirs(deps_destdir) + + # extract the into our destination directory print('unpacking archive', archive, file=sys.stderr) _unpack_tarfile(archive, deps_destdir) @@ -167,13 +170,7 @@ print('*', ' '.join(args), file=sys.stderr) if embed_dependencies: - destdir = deps_destdir - - shutil.rmtree(destdir, ignore_errors=True) - os.makedirs(destdir) - status, stdout, stderr = _build_dependency(key) - if status != 0: failures.append((key, module)) print("stdout:") @@ -183,9 +180,9 @@ continue env['CPPFLAGS'] = \ - '-I{}/usr/include {}'.format(destdir, env.get('CPPFLAGS', '')) + '-I{}/usr/include {}'.format(deps_destdir, env.get('CPPFLAGS', '')) env['LDFLAGS'] = \ - '-L{}/usr/lib {}'.format(destdir, env.get('LDFLAGS', '')) + '-L{}/usr/lib {}'.format(deps_destdir, env.get('LDFLAGS', '')) elif sys.platform == 'win32': env['INCLUDE'] = r'..\externals\include;' + env.get('INCLUDE', '') env['LIB'] = r'..\externals\lib;' + env.get('LIB', '') From pypy.commits at gmail.com Sun Sep 15 08:03:06 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sun, 15 Sep 2019 05:03:06 -0700 (PDT) Subject: [pypy-commit] pypy default: two optimizations of the jitting of unicode indexing/slicing: Message-ID: <5d7e287a.1c69fb81.5dfbf.c46b@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97480:f6dcc827f8b0 Date: 2019-09-15 14:01 +0200 http://bitbucket.org/pypy/pypy/changeset/f6dcc827f8b0/ Log: two optimizations of the jitting of unicode indexing/slicing: - don't make a bridge for all four sizes of codepoints each! - fast paths in the jit for small constant indices to not create an index structure diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py b/pypy/module/pypyjit/test_pypy_c/test_string.py --- a/pypy/module/pypyjit/test_pypy_c/test_string.py +++ b/pypy/module/pypyjit/test_pypy_c/test_string.py @@ -31,9 +31,6 @@ i89 = strgetitem(p55, i83) i24 = int_ge(i83, i12) guard_false(i24, descr=...) - i87 = strgetitem(p13, i83) - i91 = int_le(i87, 127) - guard_true(i91, descr=...) i93 = int_add(i83, 1) i94 = int_gt(i93, i56) guard_false(i94, descr=...) @@ -224,3 +221,72 @@ --TICK-- jump(..., descr=...) """) + + def test_unicode_indexing_makes_no_bridges(self): + log = self.run(""" + u = u"aaaaaä👩‍👩‍👧‍👦" * 1000 + def main(): + for j in range(10): + for i in range(len(u)): + u[i] # ID: index0 + """, []) + ops = log.loops[0].ops_by_id("index0") + for op in ops: + assert op.bridge is None + + def test_unicode_indexing_small_constant_indices(self): + log = self.run(""" + l = [u"abä", u"cdä", u"äü", u"éé", u"–—¿"] * 1000 + def main(n): + global s + for u in l: + s = u[0] + u[1] + u[-1] # ID: index + len(u) + return len(s) + """, [1000]) + loop, = log.loops_by_filename(self.filepath) + assert loop.match_by_id('index', ''' + i77 = getfield_gc_i(p73, descr=) + p78 = getfield_gc_r(p73, descr=) + i79 = strlen(p78) + i80 = int_eq(i77, i79) + guard_false(i80, descr=...) # check not ascii + i82 = int_ge(0, i77) + guard_false(i82, descr=...) + i85 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p78, 0, descr=...) + i86 = int_gt(i85, i79) + guard_false(i86, descr=...) + i88 = int_ge(1, i77) + guard_false(i88, descr=...) + i90 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p78, i85, descr=...) + i91 = int_gt(i90, i79) + guard_false(i91, descr=...) + i92 = int_sub(i90, i85) + i94 = int_add(-1, i77) + i96 = call_i(ConstClass(prev_codepoint_pos_dont_look_inside), p78, i79, descr=...) + i97 = int_sub(i79, i96) + guard_not_invalidated(descr=...) + ''') + + def test_unicode_slicing_small_constant_indices(self): + log = self.run(""" + def main(n): + u = u"abä👩‍👩‍👧‍👦éé–—¿" * 1000 + global s + count = 0 + while u: + u = u[1:] # ID: index + count += 1 + return count + """, [1000]) + loop, = log.loops_by_filename(self.filepath) + assert loop.match_by_id('index', ''' + i51 = int_eq(1, i38) + guard_false(i51, descr=...) + i52 = strlen(p47) + i53 = int_eq(i38, i52) + guard_false(i53, descr=...) + i56 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p47, 0, descr=...) + i57 = int_sub(i52, i56) + i59 = int_sub(i38, 1) + ''') diff --git a/pypy/objspace/std/test/test_unicodeobject.py b/pypy/objspace/std/test/test_unicodeobject.py --- a/pypy/objspace/std/test/test_unicodeobject.py +++ b/pypy/objspace/std/test/test_unicodeobject.py @@ -187,6 +187,26 @@ space.newint(start + len1)) assert w_res is space.newbool(expected) + def test_getitem_constant_index_jit(self): + # test it directly, to prevent only seeing bugs in jitted code + space = self.space + u = u"äöabc" + w_u = self.space.wrap(u) + for i in range(-len(u), len(u)): + assert w_u._getitem_result_constant_index_jit(space, i)._utf8 == u[i].encode("utf-8") + with py.test.raises(OperationError): + w_u._getitem_result_constant_index_jit(space, len(u)) + with py.test.raises(OperationError): + w_u._getitem_result_constant_index_jit(space, -len(u) - 1) + + def test_getslice_constant_index_jit(self): + space = self.space + u = u"äöabcéééß" + w_u = self.space.wrap(u) + for start in range(0, 4): + for end in range(start, len(u)): + assert w_u._unicode_sliced_constant_index_jit(space, start, end)._utf8 == u[start: end].encode("utf-8") + class AppTestUnicodeStringStdOnly: def test_compares(self): diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -31,6 +31,16 @@ 'encode_object', 'decode_object', 'unicode_from_object', 'unicode_from_string', 'unicode_to_decimal_w'] +MAX_UNROLL_NEXT_CODEPOINT_POS = 4 + + at jit.elidable +def next_codepoint_pos_dont_look_inside(utf8, p): + return rutf8.next_codepoint_pos(utf8, p) + + at jit.elidable +def prev_codepoint_pos_dont_look_inside(utf8, p): + return rutf8.prev_codepoint_pos(utf8, p) + class W_UnicodeObject(W_Root): import_from_mixin(StringMethods) @@ -698,6 +708,9 @@ if sl == 0: return self._empty() elif step == 1: + if jit.we_are_jitted() and \ + self._unroll_slice_heuristic(start, stop, w_index.w_stop): + return self._unicode_sliced_constant_index_jit(space, start, stop) assert start >= 0 and stop >= 0 return self._unicode_sliced(space, start, stop) else: @@ -726,6 +739,9 @@ if start == stop: return self._empty() else: + if (jit.we_are_jitted() and + self._unroll_slice_heuristic(start, stop, w_stop)): + return self._unicode_sliced_constant_index_jit(space, start, stop) return self._unicode_sliced(space, start, stop) def _unicode_sliced(self, space, start, stop): @@ -737,6 +753,31 @@ byte_stop = self._index_to_byte(stop) return W_UnicodeObject(self._utf8[byte_start:byte_stop], stop - start) + @jit.unroll_safe + def _unicode_sliced_constant_index_jit(self, space, start, stop): + assert start >= 0 + assert stop >= 0 + byte_start = 0 + for i in range(start): + byte_start = next_codepoint_pos_dont_look_inside(self._utf8, byte_start) + byte_stop = len(self._utf8) + for i in range(self._len() - stop): + byte_stop = prev_codepoint_pos_dont_look_inside(self._utf8, byte_stop) + return W_UnicodeObject(self._utf8[byte_start:byte_stop], stop - start) + + def _unroll_slice_heuristic(self, start, stop, w_stop): + from pypy.objspace.std.intobject import W_IntObject + # the reason we use the *wrapped* stop is that for + # w_stop == wrapped -1, or w_None the stop that is computed will *not* + # be constant, because the length is often not constant. + return (not self.is_ascii() and + jit.isconstant(start) and + (jit.isconstant(w_stop) or + (isinstance(w_stop, W_IntObject) and + jit.isconstant(w_stop.intval))) and + start <= MAX_UNROLL_NEXT_CODEPOINT_POS and + self._len() - stop <= MAX_UNROLL_NEXT_CODEPOINT_POS) + def descr_capitalize(self, space): value = self._utf8 if len(value) == 0: @@ -863,12 +904,43 @@ return storage def _getitem_result(self, space, index): + if (jit.we_are_jitted() and + not self.is_ascii() and + jit.isconstant(index) and + -MAX_UNROLL_NEXT_CODEPOINT_POS <= index <= MAX_UNROLL_NEXT_CODEPOINT_POS): + return self._getitem_result_constant_index_jit(space, index) if index < 0: index += self._length if index < 0 or index >= self._length: raise oefmt(space.w_IndexError, "string index out of range") start = self._index_to_byte(index) - end = rutf8.next_codepoint_pos(self._utf8, start) + # we must not inline next_codepoint_pos, otherwise we produce a guard! + end = self.next_codepoint_pos_dont_look_inside(start) + return W_UnicodeObject(self._utf8[start:end], 1) + + @jit.unroll_safe + def _getitem_result_constant_index_jit(self, space, index): + # for small known indices, call next/prev_codepoint_pos a few times + # instead of possibly creating an index structure + if index < 0: + posindex = index + self._length + if posindex < 0: + raise oefmt(space.w_IndexError, "string index out of range") + end = len(self._utf8) + start = self.prev_codepoint_pos_dont_look_inside(end) + for i in range(-index-1): + end = start + start = self.prev_codepoint_pos_dont_look_inside(start) + else: + if index >= self._length: + raise oefmt(space.w_IndexError, "string index out of range") + start = 0 + end = self.next_codepoint_pos_dont_look_inside(start) + for i in range(index): + start = end + end = self.next_codepoint_pos_dont_look_inside(end) + assert start >= 0 + assert end >= 0 return W_UnicodeObject(self._utf8[start:end], 1) def is_ascii(self): @@ -895,6 +967,16 @@ return rutf8.codepoint_index_at_byte_position( self._utf8, self._get_index_storage(), bytepos, self._len()) + def next_codepoint_pos_dont_look_inside(self, pos): + if self.is_ascii(): + return pos + 1 + return next_codepoint_pos_dont_look_inside(self._utf8, pos) + + def prev_codepoint_pos_dont_look_inside(self, pos): + if self.is_ascii(): + return pos - 1 + return prev_codepoint_pos_dont_look_inside(self._utf8, pos) + @always_inline def _unwrap_and_search(self, space, w_sub, w_start, w_end, forward=True): w_sub = self.convert_arg_to_w_unicode(space, w_sub) From pypy.commits at gmail.com Sun Sep 15 08:16:46 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sun, 15 Sep 2019 05:16:46 -0700 (PDT) Subject: [pypy-commit] pypy default: one less copy for slice with step Message-ID: <5d7e2bae.1c69fb81.39c22.229e@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97481:db05162bc519 Date: 2019-09-15 14:16 +0200 http://bitbucket.org/pypy/pypy/changeset/db05162bc519/ Log: one less copy for slice with step diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -726,7 +726,7 @@ i = 0 while True: next_pos = rutf8.next_codepoint_pos(self._utf8, byte_pos) - builder.append(self._utf8[byte_pos:next_pos]) + builder.append_slice(self._utf8, byte_pos, next_pos) if i == sl - 1: break i += 1 From pypy.commits at gmail.com Sun Sep 15 08:24:32 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sun, 15 Sep 2019 05:24:32 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default Message-ID: <5d7e2d80.1c69fb81.78cf2.b059@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97482:9d30b102e8b1 Date: 2019-09-15 14:20 +0200 http://bitbucket.org/pypy/pypy/changeset/9d30b102e8b1/ Log: merge default diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py b/pypy/module/pypyjit/test_pypy_c/test_string.py --- a/pypy/module/pypyjit/test_pypy_c/test_string.py +++ b/pypy/module/pypyjit/test_pypy_c/test_string.py @@ -277,3 +277,72 @@ jump(..., descr=...) """) # XXX remove the guard_nonnull above? + + def test_unicode_indexing_makes_no_bridges(self): + log = self.run(""" + u = u"aaaaaä👩‍👩‍👧‍👦" * 1000 + def main(): + for j in range(10): + for i in range(len(u)): + u[i] # ID: index0 + """, []) + ops = log.loops[0].ops_by_id("index0") + for op in ops: + assert op.bridge is None + + def test_unicode_indexing_small_constant_indices(self): + log = self.run(""" + l = [u"abä", u"cdä", u"äü", u"éé", u"–—¿"] * 1000 + def main(n): + global s + for u in l: + s = u[0] + u[1] + u[-1] # ID: index + len(u) + return len(s) + """, [1000]) + loop, = log.loops_by_filename(self.filepath) + assert loop.match_by_id('index', ''' + i77 = getfield_gc_i(p73, descr=) + p78 = getfield_gc_r(p73, descr=) + i79 = strlen(p78) + i80 = int_eq(i77, i79) + guard_false(i80, descr=...) # check not ascii + i82 = int_ge(0, i77) + guard_false(i82, descr=...) + i85 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p78, 0, descr=...) + i86 = int_gt(i85, i79) + guard_false(i86, descr=...) + i88 = int_ge(1, i77) + guard_false(i88, descr=...) + i90 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p78, i85, descr=...) + i91 = int_gt(i90, i79) + guard_false(i91, descr=...) + i92 = int_sub(i90, i85) + i94 = int_add(-1, i77) + i96 = call_i(ConstClass(prev_codepoint_pos_dont_look_inside), p78, i79, descr=...) + i97 = int_sub(i79, i96) + guard_not_invalidated(descr=...) + ''') + + def test_unicode_slicing_small_constant_indices(self): + log = self.run(""" + def main(n): + u = u"abä👩‍👩‍👧‍👦éé–—¿" * 1000 + global s + count = 0 + while u: + u = u[1:] # ID: index + count += 1 + return count + """, [1000]) + loop, = log.loops_by_filename(self.filepath) + assert loop.match_by_id('index', ''' + i51 = int_eq(1, i38) + guard_false(i51, descr=...) + i52 = strlen(p47) + i53 = int_eq(i38, i52) + guard_false(i53, descr=...) + i56 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p47, 0, descr=...) + i57 = int_sub(i52, i56) + i59 = int_sub(i38, 1) + ''') diff --git a/pypy/objspace/std/test/test_unicodeobject.py b/pypy/objspace/std/test/test_unicodeobject.py --- a/pypy/objspace/std/test/test_unicodeobject.py +++ b/pypy/objspace/std/test/test_unicodeobject.py @@ -95,6 +95,26 @@ space.newint(start + len1)) assert space.int_w(w_index) == rexpected + def test_getitem_constant_index_jit(self): + # test it directly, to prevent only seeing bugs in jitted code + space = self.space + u = u"äöabc" + w_u = self.space.wrap(u) + for i in range(-len(u), len(u)): + assert w_u._getitem_result_constant_index_jit(space, i)._utf8 == u[i].encode("utf-8") + with py.test.raises(OperationError): + w_u._getitem_result_constant_index_jit(space, len(u)) + with py.test.raises(OperationError): + w_u._getitem_result_constant_index_jit(space, -len(u) - 1) + + def test_getslice_constant_index_jit(self): + space = self.space + u = u"äöabcéééß" + w_u = self.space.wrap(u) + for start in range(0, 4): + for end in range(start, len(u)): + assert w_u._unicode_sliced_constant_index_jit(space, start, end)._utf8 == u[start: end].encode("utf-8") + class AppTestUnicodeStringStdOnly: def test_compares(self): diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -26,6 +26,16 @@ __all__ = ['W_UnicodeObject', 'encode_object', 'decode_object', 'unicode_from_object', 'unicode_to_decimal_w'] +MAX_UNROLL_NEXT_CODEPOINT_POS = 4 + + at jit.elidable +def next_codepoint_pos_dont_look_inside(utf8, p): + return rutf8.next_codepoint_pos(utf8, p) + + at jit.elidable +def prev_codepoint_pos_dont_look_inside(utf8, p): + return rutf8.prev_codepoint_pos(utf8, p) + class W_UnicodeObject(W_Root): import_from_mixin(StringMethods) @@ -854,6 +864,9 @@ if sl == 0: return self._empty() elif step == 1: + if jit.we_are_jitted() and \ + self._unroll_slice_heuristic(start, stop, w_index.w_stop): + return self._unicode_sliced_constant_index_jit(space, start, stop) assert start >= 0 and stop >= 0 return self._unicode_sliced(space, start, stop) else: @@ -869,7 +882,7 @@ i = 0 while True: next_pos = rutf8.next_codepoint_pos(self._utf8, byte_pos) - builder.append(self._utf8[byte_pos:next_pos]) + builder.append_slice(self._utf8, byte_pos, next_pos) if i == sl - 1: break i += 1 @@ -882,6 +895,9 @@ if start == stop: return self._empty() else: + if (jit.we_are_jitted() and + self._unroll_slice_heuristic(start, stop, w_stop)): + return self._unicode_sliced_constant_index_jit(space, start, stop) return self._unicode_sliced(space, start, stop) def _unicode_sliced(self, space, start, stop): @@ -893,6 +909,31 @@ byte_stop = self._index_to_byte(stop) return W_UnicodeObject(self._utf8[byte_start:byte_stop], stop - start) + @jit.unroll_safe + def _unicode_sliced_constant_index_jit(self, space, start, stop): + assert start >= 0 + assert stop >= 0 + byte_start = 0 + for i in range(start): + byte_start = next_codepoint_pos_dont_look_inside(self._utf8, byte_start) + byte_stop = len(self._utf8) + for i in range(self._len() - stop): + byte_stop = prev_codepoint_pos_dont_look_inside(self._utf8, byte_stop) + return W_UnicodeObject(self._utf8[byte_start:byte_stop], stop - start) + + def _unroll_slice_heuristic(self, start, stop, w_stop): + from pypy.objspace.std.intobject import W_IntObject + # the reason we use the *wrapped* stop is that for + # w_stop == wrapped -1, or w_None the stop that is computed will *not* + # be constant, because the length is often not constant. + return (not self.is_ascii() and + jit.isconstant(start) and + (jit.isconstant(w_stop) or + (isinstance(w_stop, W_IntObject) and + jit.isconstant(w_stop.intval))) and + start <= MAX_UNROLL_NEXT_CODEPOINT_POS and + self._len() - stop <= MAX_UNROLL_NEXT_CODEPOINT_POS) + def descr_capitalize(self, space): return W_UnicodeObject._capitalize_unicode(self._utf8) @@ -1024,12 +1065,43 @@ return storage def _getitem_result(self, space, index): + if (jit.we_are_jitted() and + not self.is_ascii() and + jit.isconstant(index) and + -MAX_UNROLL_NEXT_CODEPOINT_POS <= index <= MAX_UNROLL_NEXT_CODEPOINT_POS): + return self._getitem_result_constant_index_jit(space, index) if index < 0: index += self._length if index < 0 or index >= self._length: raise oefmt(space.w_IndexError, "string index out of range") start = self._index_to_byte(index) - end = rutf8.next_codepoint_pos(self._utf8, start) + # we must not inline next_codepoint_pos, otherwise we produce a guard! + end = self.next_codepoint_pos_dont_look_inside(start) + return W_UnicodeObject(self._utf8[start:end], 1) + + @jit.unroll_safe + def _getitem_result_constant_index_jit(self, space, index): + # for small known indices, call next/prev_codepoint_pos a few times + # instead of possibly creating an index structure + if index < 0: + posindex = index + self._length + if posindex < 0: + raise oefmt(space.w_IndexError, "string index out of range") + end = len(self._utf8) + start = self.prev_codepoint_pos_dont_look_inside(end) + for i in range(-index-1): + end = start + start = self.prev_codepoint_pos_dont_look_inside(start) + else: + if index >= self._length: + raise oefmt(space.w_IndexError, "string index out of range") + start = 0 + end = self.next_codepoint_pos_dont_look_inside(start) + for i in range(index): + start = end + end = self.next_codepoint_pos_dont_look_inside(end) + assert start >= 0 + assert end >= 0 return W_UnicodeObject(self._utf8[start:end], 1) def is_ascii(self): @@ -1056,6 +1128,16 @@ return rutf8.codepoint_index_at_byte_position( self._utf8, self._get_index_storage(), bytepos, self._len()) + def next_codepoint_pos_dont_look_inside(self, pos): + if self.is_ascii(): + return pos + 1 + return next_codepoint_pos_dont_look_inside(self._utf8, pos) + + def prev_codepoint_pos_dont_look_inside(self, pos): + if self.is_ascii(): + return pos - 1 + return prev_codepoint_pos_dont_look_inside(self._utf8, pos) + @always_inline def _unwrap_and_search(self, space, w_sub, w_start, w_end, forward=True): w_sub = self.convert_arg_to_w_unicode(space, w_sub) From pypy.commits at gmail.com Sun Sep 15 08:24:34 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sun, 15 Sep 2019 05:24:34 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: remove unused method Message-ID: <5d7e2d82.1c69fb81.39c22.25a8@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97483:b092d08c0e10 Date: 2019-09-15 14:23 +0200 http://bitbucket.org/pypy/pypy/changeset/b092d08c0e10/ Log: remove unused method diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -889,17 +889,6 @@ byte_pos = self._index_to_byte(start + i * step) return W_UnicodeObject(builder.build(), sl) - def descr_getslice(self, space, w_start, w_stop): - start, stop = normalize_simple_slice( - space, self._len(), w_start, w_stop) - if start == stop: - return self._empty() - else: - if (jit.we_are_jitted() and - self._unroll_slice_heuristic(start, stop, w_stop)): - return self._unicode_sliced_constant_index_jit(space, start, stop) - return self._unicode_sliced(space, start, stop) - def _unicode_sliced(self, space, start, stop): # XXX maybe some heuristic, like first slice does not create # full index, but second does? From pypy.commits at gmail.com Sun Sep 15 16:55:58 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sun, 15 Sep 2019 13:55:58 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: faster implementation of get_utf8_length that makes use of the fact that the string in question must already be valid utf-8 Message-ID: <5d7ea55e.1c69fb81.916bb.0eb9@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97484:17c06a8891ad Date: 2019-09-15 22:55 +0200 http://bitbucket.org/pypy/pypy/changeset/17c06a8891ad/ Log: faster implementation of get_utf8_length that makes use of the fact that the string in question must already be valid utf-8 diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py --- a/rpython/rlib/rutf8.py +++ b/rpython/rlib/rutf8.py @@ -363,9 +363,25 @@ raise CheckError(~res) def get_utf8_length(s, start=0, end=-1): - """ Get the length out of valid utf8. For now just calls check_utf8 + """ Get the length out of valid utf8. """ - return check_utf8(s, True, start, end) + if end < 0: + end = len(s) + res = 0 + pos = start + while pos < end: + ordch1 = ord(s[pos]) + res += 1 + if ordch1 <= 0x7F: + pos += 1 + elif ordch1 <= 0xDF: + pos += 2 + elif ordch1 <= 0xEF: + pos += 3 + elif ordch1 <= 0xF4: + pos += 4 + + return res @jit.elidable def _check_utf8(s, allow_surrogates, start, stop): From pypy.commits at gmail.com Mon Sep 16 04:27:24 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 16 Sep 2019 01:27:24 -0700 (PDT) Subject: [pypy-commit] pypy default: for some reason we have two rutf8 functions that do the same thing, Message-ID: <5d7f476c.1c69fb81.44fa0.a747@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97485:28102f96dc5c Date: 2019-09-16 09:50 +0200 http://bitbucket.org/pypy/pypy/changeset/28102f96dc5c/ Log: for some reason we have two rutf8 functions that do the same thing, codepoints_in_utf8 and get_utf8_length. The former is much faster, therefore deprecate the latter and replace all calls to it. diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -31,7 +31,7 @@ # Fast version of the "strict" errors handler. def raise_unicode_exception_encode(errors, encoding, msg, utf8, startingpos, endingpos): - u_len = rutf8.get_utf8_length(utf8) + u_len = rutf8.codepoints_in_utf8(utf8) raise OperationError(space.w_UnicodeEncodeError, space.newtuple([space.newtext(encoding), space.newutf8(utf8, u_len), diff --git a/pypy/module/_io/interp_stringio.py b/pypy/module/_io/interp_stringio.py --- a/pypy/module/_io/interp_stringio.py +++ b/pypy/module/_io/interp_stringio.py @@ -1,4 +1,4 @@ -from rpython.rlib.rutf8 import get_utf8_length, next_codepoint_pos +from rpython.rlib.rutf8 import codepoints_in_utf8, next_codepoint_pos from pypy.interpreter.error import OperationError, oefmt from pypy.interpreter.typedef import ( @@ -93,7 +93,7 @@ return result def write(self, string): - length = get_utf8_length(string) + length = codepoints_in_utf8(string) if self.pos + length > len(self.data): self.resize(self.pos + length) pos = 0 @@ -164,7 +164,7 @@ if self.readnl is None: w_readnl = space.w_None else: - w_readnl = space.str(space.newutf8(self.readnl, get_utf8_length(self.readnl))) # YYY + w_readnl = space.str(space.newutf8(self.readnl, codepoints_in_utf8(self.readnl))) # YYY return space.newtuple([ w_initialval, w_readnl, space.newint(self.buf.pos), w_dict ]) @@ -229,7 +229,7 @@ w_decoded = space.call_method( w_decoded, "replace", space.newtext("\n"), space.newutf8(self.writenl, - get_utf8_length(self.writenl))) + codepoints_in_utf8(self.writenl))) string = space.utf8_w(w_decoded) if string: self.buf.write(string) @@ -240,7 +240,7 @@ self._check_closed(space) size = convert_size(space, w_size) v = self.buf.read(size) - lgt = get_utf8_length(v) + lgt = codepoints_in_utf8(v) return space.newutf8(v, lgt) def readline_w(self, space, w_limit=None): @@ -255,7 +255,7 @@ else: newline = self.readnl result = self.buf.readline(newline, limit) - resultlen = get_utf8_length(result) + resultlen = codepoints_in_utf8(result) return space.newutf8(result, resultlen) @@ -294,7 +294,7 @@ def getvalue_w(self, space): self._check_closed(space) v = self.buf.getvalue() - lgt = get_utf8_length(v) + lgt = codepoints_in_utf8(v) return space.newutf8(v, lgt) def readable_w(self, space): diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -12,7 +12,7 @@ from rpython.rlib.rbigint import rbigint from rpython.rlib.rstring import StringBuilder from rpython.rlib.rutf8 import (check_utf8, next_codepoint_pos, - codepoints_in_utf8, get_utf8_length, + codepoints_in_utf8, codepoints_in_utf8, Utf8StringBuilder) @@ -855,7 +855,7 @@ haslf = True if haslf and self.writetranslate and self.writenl: w_text = space.call_method(w_text, "replace", space.newutf8('\n', 1), - space.newutf8(self.writenl, get_utf8_length(self.writenl))) + space.newutf8(self.writenl, codepoints_in_utf8(self.writenl))) text = space.utf8_w(w_text) needflush = False diff --git a/pypy/module/_multibytecodec/c_codecs.py b/pypy/module/_multibytecodec/c_codecs.py --- a/pypy/module/_multibytecodec/c_codecs.py +++ b/pypy/module/_multibytecodec/c_codecs.py @@ -157,7 +157,7 @@ replace, end = errorcb(errors, namecb, reason, stringdata, start, end) # 'replace' is RPython unicode here - lgt = rutf8.get_utf8_length(replace) + lgt = rutf8.codepoints_in_utf8(replace) inbuf = rffi.utf82wcharp(replace, lgt) try: r = pypy_cjk_dec_replace_on_error(decodebuf, inbuf, lgt, end) @@ -268,7 +268,7 @@ rets, end = errorcb(errors, namecb, reason, unicodedata, start, end) codec = pypy_cjk_enc_getcodec(encodebuf) - lgt = rutf8.get_utf8_length(rets) + lgt = rutf8.codepoints_in_utf8(rets) replace = encode(codec, rets, lgt, "strict", errorcb, namecb) with rffi.scoped_nonmovingbuffer(replace) as inbuf: r = pypy_cjk_enc_replace_on_error(encodebuf, inbuf, len(replace), end) diff --git a/pypy/module/_multibytecodec/interp_incremental.py b/pypy/module/_multibytecodec/interp_incremental.py --- a/pypy/module/_multibytecodec/interp_incremental.py +++ b/pypy/module/_multibytecodec/interp_incremental.py @@ -66,7 +66,7 @@ pos = c_codecs.pypy_cjk_dec_inbuf_consumed(self.decodebuf) assert 0 <= pos <= len(object) self.pending = object[pos:] - lgt = rutf8.get_utf8_length(output) + lgt = rutf8.codepoints_in_utf8(output) return space.newutf8(output, lgt) diff --git a/pypy/module/_multibytecodec/interp_multibytecodec.py b/pypy/module/_multibytecodec/interp_multibytecodec.py --- a/pypy/module/_multibytecodec/interp_multibytecodec.py +++ b/pypy/module/_multibytecodec/interp_multibytecodec.py @@ -27,7 +27,7 @@ raise wrap_unicodedecodeerror(space, e, input, self.name) except RuntimeError: raise wrap_runtimeerror(space) - lgt = rutf8.get_utf8_length(utf8_output) + lgt = rutf8.codepoints_in_utf8(utf8_output) return space.newtuple([space.newutf8(utf8_output, lgt), space.newint(len(input))]) diff --git a/pypy/module/_multibytecodec/test/test_translation.py b/pypy/module/_multibytecodec/test/test_translation.py --- a/pypy/module/_multibytecodec/test/test_translation.py +++ b/pypy/module/_multibytecodec/test/test_translation.py @@ -14,7 +14,7 @@ codecname, string = argv[1], argv[2] c = c_codecs.getcodec(codecname) u = c_codecs.decode(c, string) - lgt = rutf8.get_utf8_length(u) + lgt = rutf8.codepoints_in_utf8(u) r = c_codecs.encode(c, u, lgt) print r return 0 diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py --- a/pypy/module/_sre/interp_sre.py +++ b/pypy/module/_sre/interp_sre.py @@ -45,7 +45,7 @@ return space.newbytes(ctx._string[start:end]) elif isinstance(ctx, rsre_utf8.Utf8MatchContext): s = ctx._utf8[start:end] - lgt = rutf8.get_utf8_length(s) + lgt = rutf8.codepoints_in_utf8(s) return space.newutf8(s, lgt) else: # unreachable @@ -383,7 +383,7 @@ elif use_builder == 'U': assert isinstance(ctx, rsre_utf8.Utf8MatchContext) return space.newutf8(result_bytes, - rutf8.get_utf8_length(result_bytes)), n + rutf8.codepoints_in_utf8(result_bytes)), n else: raise AssertionError(use_builder) else: @@ -652,7 +652,7 @@ elif isinstance(ctx, rsre_core.StrMatchContext): return space.newbytes(ctx._string) elif isinstance(ctx, rsre_utf8.Utf8MatchContext): - lgt = rutf8.get_utf8_length(ctx._utf8) + lgt = rutf8.codepoints_in_utf8(ctx._utf8) return space.newutf8(ctx._utf8, lgt) else: raise SystemError diff --git a/pypy/module/micronumpy/boxes.py b/pypy/module/micronumpy/boxes.py --- a/pypy/module/micronumpy/boxes.py +++ b/pypy/module/micronumpy/boxes.py @@ -11,7 +11,7 @@ from rpython.rlib.rstring import StringBuilder from rpython.rlib.objectmodel import specialize from rpython.rlib import jit -from rpython.rlib.rutf8 import get_utf8_length +from rpython.rlib.rutf8 import codepoints_in_utf8 from rpython.rtyper.lltypesystem import lltype, rffi from rpython.tool.sourcetools import func_with_new_name from pypy.module.micronumpy import constants as NPY @@ -638,7 +638,7 @@ return self elif dtype.is_object(): return W_ObjectBox(space.newutf8(self._value, - get_utf8_length(self._value))) + codepoints_in_utf8(self._value))) else: raise oefmt(space.w_NotImplementedError, "Conversion from unicode not implemented yet") diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py --- a/pypy/module/micronumpy/types.py +++ b/pypy/module/micronumpy/types.py @@ -1,7 +1,7 @@ import functools import math from rpython.rlib.unroll import unrolling_iterable -from rpython.rlib.rutf8 import Utf8StringIterator, get_utf8_length, Utf8StringBuilder +from rpython.rlib.rutf8 import Utf8StringIterator, codepoints_in_utf8, Utf8StringBuilder from pypy.interpreter.error import OperationError, oefmt from pypy.objspace.std.floatobject import float2string from pypy.objspace.std.complexobject import str_format @@ -2330,7 +2330,7 @@ def to_builtin_type(self, space, box): assert isinstance(box, boxes.W_UnicodeBox) - return space.newutf8(box._value, get_utf8_length(box._value)) + return space.newutf8(box._value, codepoints_in_utf8(box._value)) def eq(self, v1, v2): assert isinstance(v1, boxes.W_UnicodeBox) diff --git a/pypy/module/unicodedata/test/test_hyp.py b/pypy/module/unicodedata/test/test_hyp.py --- a/pypy/module/unicodedata/test/test_hyp.py +++ b/pypy/module/unicodedata/test/test_hyp.py @@ -6,12 +6,12 @@ pytest.skip("hypothesis required") from pypy.module.unicodedata.interp_ucd import ucd -from rpython.rlib.rutf8 import get_utf8_length +from rpython.rlib.rutf8 import codepoints_in_utf8 def make_normalization(space, NF_code): def normalize(s): u = s.encode('utf8') - w_s = space.newutf8(u, get_utf8_length(u)) + w_s = space.newutf8(u, codepoints_in_utf8(u)) w_res = ucd.normalize(space, NF_code, w_s) return space.utf8_w(w_res).decode('utf8') return normalize diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py --- a/rpython/rlib/rutf8.py +++ b/rpython/rlib/rutf8.py @@ -363,9 +363,12 @@ raise CheckError(~res) def get_utf8_length(s, start=0, end=-1): - """ Get the length out of valid utf8. For now just calls check_utf8 + # DEPRECATED! use codepoints_in_utf8 instead + """ Get the length out of valid utf8. """ - return check_utf8(s, True, start, end) + if end < 0: + end = len(s) + return codepoints_in_utf8(s, start, end) @jit.elidable def _check_utf8(s, allow_surrogates, start, stop): @@ -745,13 +748,13 @@ def append(self, s): # for strings self._s.append(s) - newlgt = get_utf8_length(s) + newlgt = codepoints_in_utf8(s) self._lgt += newlgt @always_inline def append_slice(self, s, start, end): self._s.append_slice(s, start, end) - newlgt = get_utf8_length(s, start, end) + newlgt = codepoints_in_utf8(s, start, end) self._lgt += newlgt @signature(types.self(), char(), returns=none()) diff --git a/rpython/rlib/test/test_rutf8.py b/rpython/rlib/test/test_rutf8.py --- a/rpython/rlib/test/test_rutf8.py +++ b/rpython/rlib/test/test_rutf8.py @@ -169,14 +169,6 @@ expected = any(uch for uch in unichars if u'\ud800' <= uch <= u'\udfff') assert result == expected - at given(strategies.lists(strategies.characters())) -def test_get_utf8_length(unichars): - u = u''.join(unichars) - exp_lgt = len(u) - s = ''.join([c.encode('utf8') for c in u]) - lgt = rutf8.get_utf8_length(s) - if not _has_surrogates(s) or sys.maxunicode > 0xffff: - assert lgt == exp_lgt def test_utf8_string_builder(): s = rutf8.Utf8StringBuilder() From pypy.commits at gmail.com Mon Sep 16 04:30:34 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 16 Sep 2019 01:30:34 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default Message-ID: <5d7f482a.1c69fb81.dcfef.f470@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97486:a94f909131d8 Date: 2019-09-16 10:29 +0200 http://bitbucket.org/pypy/pypy/changeset/a94f909131d8/ Log: merge default diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -31,7 +31,7 @@ # Fast version of the "strict" errors handler. def raise_unicode_exception_encode(errors, encoding, msg, utf8, startingpos, endingpos): - u_len = rutf8.get_utf8_length(utf8) + u_len = rutf8.codepoints_in_utf8(utf8) raise OperationError(space.w_UnicodeEncodeError, space.newtuple([space.newtext(encoding), space.newutf8(utf8, u_len), diff --git a/pypy/module/_io/interp_stringio.py b/pypy/module/_io/interp_stringio.py --- a/pypy/module/_io/interp_stringio.py +++ b/pypy/module/_io/interp_stringio.py @@ -1,4 +1,4 @@ -from rpython.rlib.rutf8 import get_utf8_length, next_codepoint_pos +from rpython.rlib.rutf8 import codepoints_in_utf8, next_codepoint_pos from pypy.interpreter.error import OperationError, oefmt from pypy.interpreter.typedef import ( @@ -98,7 +98,7 @@ return result def write(self, string): - length = get_utf8_length(string) + length = codepoints_in_utf8(string) if self.pos + length > len(self.data): self.resize(self.pos + length) pos = 0 @@ -173,7 +173,7 @@ if readnl is None: w_readnl = space.w_None else: - w_readnl = space.str(space.newutf8(readnl, get_utf8_length(readnl))) # YYY + w_readnl = space.str(space.newutf8(readnl, codepoints_in_utf8(readnl))) # YYY return space.newtuple([ w_initialval, w_readnl, space.newint(self.buf.pos), w_dict ]) @@ -239,7 +239,7 @@ w_decoded = space.call_method( w_decoded, "replace", space.newtext("\n"), - space.newutf8(writenl, get_utf8_length(writenl)), + space.newutf8(writenl, codepoints_in_utf8(writenl)), ) string = space.utf8_w(w_decoded) if string: @@ -251,7 +251,7 @@ self._check_closed(space) size = convert_size(space, w_size) v = self.buf.read(size) - lgt = get_utf8_length(v) + lgt = codepoints_in_utf8(v) return space.newutf8(v, lgt) def readline_w(self, space, w_limit=None): @@ -266,7 +266,7 @@ else: newline = self.readnl result = self.buf.readline(newline, limit) - resultlen = get_utf8_length(result) + resultlen = codepoints_in_utf8(result) return space.newutf8(result, resultlen) @@ -305,7 +305,7 @@ def getvalue_w(self, space): self._check_closed(space) v = self.buf.getvalue() - lgt = get_utf8_length(v) + lgt = codepoints_in_utf8(v) return space.newutf8(v, lgt) def readable_w(self, space): diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -12,7 +12,7 @@ from rpython.rlib.rbigint import rbigint from rpython.rlib.rstring import StringBuilder from rpython.rlib.rutf8 import (check_utf8, next_codepoint_pos, - codepoints_in_utf8, get_utf8_length, + codepoints_in_utf8, codepoints_in_utf8, Utf8StringBuilder) @@ -905,7 +905,7 @@ haslf = True if haslf and self.writetranslate and self.writenl: w_text = space.call_method(w_text, "replace", space.newutf8('\n', 1), - space.newutf8(self.writenl, get_utf8_length(self.writenl))) + space.newutf8(self.writenl, codepoints_in_utf8(self.writenl))) text = space.utf8_w(w_text) needflush = False diff --git a/pypy/module/_multibytecodec/c_codecs.py b/pypy/module/_multibytecodec/c_codecs.py --- a/pypy/module/_multibytecodec/c_codecs.py +++ b/pypy/module/_multibytecodec/c_codecs.py @@ -157,7 +157,7 @@ replace, end, rettype = errorcb(errors, namecb, reason, stringdata, start, end) # 'replace' is UTF8 encoded unicode, rettype is 'u' - lgt = rutf8.get_utf8_length(replace) + lgt = rutf8.codepoints_in_utf8(replace) inbuf = rffi.utf82wcharp(replace, lgt) try: r = pypy_cjk_dec_replace_on_error(decodebuf, inbuf, lgt, end) diff --git a/pypy/module/_multibytecodec/interp_incremental.py b/pypy/module/_multibytecodec/interp_incremental.py --- a/pypy/module/_multibytecodec/interp_incremental.py +++ b/pypy/module/_multibytecodec/interp_incremental.py @@ -67,7 +67,7 @@ pos = c_codecs.pypy_cjk_dec_inbuf_consumed(self.decodebuf) assert 0 <= pos <= len(object) self.pending = object[pos:] - lgt = rutf8.get_utf8_length(output) + lgt = rutf8.codepoints_in_utf8(output) return space.newutf8(output, lgt) diff --git a/pypy/module/_multibytecodec/interp_multibytecodec.py b/pypy/module/_multibytecodec/interp_multibytecodec.py --- a/pypy/module/_multibytecodec/interp_multibytecodec.py +++ b/pypy/module/_multibytecodec/interp_multibytecodec.py @@ -27,7 +27,7 @@ raise wrap_unicodedecodeerror(space, e, input, self.name) except RuntimeError: raise wrap_runtimeerror(space) - lgt = rutf8.get_utf8_length(utf8_output) + lgt = rutf8.codepoints_in_utf8(utf8_output) return space.newtuple([space.newutf8(utf8_output, lgt), space.newint(len(input))]) diff --git a/pypy/module/_multibytecodec/test/test_translation.py b/pypy/module/_multibytecodec/test/test_translation.py --- a/pypy/module/_multibytecodec/test/test_translation.py +++ b/pypy/module/_multibytecodec/test/test_translation.py @@ -14,7 +14,7 @@ codecname, string = argv[1], argv[2] c = c_codecs.getcodec(codecname) u = c_codecs.decode(c, string) - lgt = rutf8.get_utf8_length(u) + lgt = rutf8.codepoints_in_utf8(u) r = c_codecs.encode(c, u, lgt) print r return 0 diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py --- a/pypy/module/_sre/interp_sre.py +++ b/pypy/module/_sre/interp_sre.py @@ -49,7 +49,7 @@ return space.newbytes(ctx._string[start:end]) elif isinstance(ctx, rsre_utf8.Utf8MatchContext): s = ctx._utf8[start:end] - lgt = rutf8.get_utf8_length(s) + lgt = rutf8.codepoints_in_utf8(s) return space.newutf8(s, lgt) else: # unreachable @@ -496,7 +496,7 @@ elif use_builder == 'U': assert isinstance(ctx, rsre_utf8.Utf8MatchContext) return space.newutf8(result_bytes, - rutf8.get_utf8_length(result_bytes)), n + rutf8.codepoints_in_utf8(result_bytes)), n else: raise AssertionError(use_builder) else: @@ -788,7 +788,7 @@ elif isinstance(ctx, rsre_core.StrMatchContext): return space.newbytes(ctx._string) elif isinstance(ctx, rsre_utf8.Utf8MatchContext): - lgt = rutf8.get_utf8_length(ctx._utf8) + lgt = rutf8.codepoints_in_utf8(ctx._utf8) return space.newutf8(ctx._utf8, lgt) else: raise SystemError diff --git a/pypy/module/micronumpy/boxes.py b/pypy/module/micronumpy/boxes.py --- a/pypy/module/micronumpy/boxes.py +++ b/pypy/module/micronumpy/boxes.py @@ -11,7 +11,7 @@ from rpython.rlib.rstring import StringBuilder from rpython.rlib.objectmodel import specialize from rpython.rlib import jit -from rpython.rlib.rutf8 import get_utf8_length +from rpython.rlib.rutf8 import codepoints_in_utf8 from rpython.rtyper.lltypesystem import lltype, rffi from rpython.tool.sourcetools import func_with_new_name from pypy.module.micronumpy import constants as NPY @@ -629,7 +629,7 @@ return self elif dtype.is_object(): return W_ObjectBox(space.newutf8(self._value, - get_utf8_length(self._value))) + codepoints_in_utf8(self._value))) else: raise oefmt(space.w_NotImplementedError, "Conversion from unicode not implemented yet") diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py --- a/pypy/module/micronumpy/types.py +++ b/pypy/module/micronumpy/types.py @@ -1,7 +1,7 @@ import functools import math from rpython.rlib.unroll import unrolling_iterable -from rpython.rlib.rutf8 import Utf8StringIterator, get_utf8_length, Utf8StringBuilder +from rpython.rlib.rutf8 import Utf8StringIterator, codepoints_in_utf8, Utf8StringBuilder from pypy.interpreter.error import OperationError, oefmt from pypy.objspace.std.floatobject import float2string from pypy.objspace.std.complexobject import str_format @@ -2330,7 +2330,7 @@ def to_builtin_type(self, space, box): assert isinstance(box, boxes.W_UnicodeBox) - return space.newutf8(box._value, get_utf8_length(box._value)) + return space.newutf8(box._value, codepoints_in_utf8(box._value)) def eq(self, v1, v2): assert isinstance(v1, boxes.W_UnicodeBox) diff --git a/pypy/module/unicodedata/test/test_hyp.py b/pypy/module/unicodedata/test/test_hyp.py --- a/pypy/module/unicodedata/test/test_hyp.py +++ b/pypy/module/unicodedata/test/test_hyp.py @@ -6,12 +6,12 @@ pytest.skip("hypothesis required") from pypy.module.unicodedata.interp_ucd import ucd -from rpython.rlib.rutf8 import get_utf8_length +from rpython.rlib.rutf8 import codepoints_in_utf8 def make_normalization(space, NF_code): def normalize(s): u = s.encode('utf8') - w_s = space.newutf8(u, get_utf8_length(u)) + w_s = space.newutf8(u, codepoints_in_utf8(u)) w_res = ucd.normalize(space, NF_code, w_s) return space.utf8_w(w_res).decode('utf8') return normalize diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py --- a/rpython/rlib/rutf8.py +++ b/rpython/rlib/rutf8.py @@ -363,25 +363,12 @@ raise CheckError(~res) def get_utf8_length(s, start=0, end=-1): + # DEPRECATED! use codepoints_in_utf8 instead """ Get the length out of valid utf8. """ if end < 0: end = len(s) - res = 0 - pos = start - while pos < end: - ordch1 = ord(s[pos]) - res += 1 - if ordch1 <= 0x7F: - pos += 1 - elif ordch1 <= 0xDF: - pos += 2 - elif ordch1 <= 0xEF: - pos += 3 - elif ordch1 <= 0xF4: - pos += 4 - - return res + return codepoints_in_utf8(s, start, end) @jit.elidable def _check_utf8(s, allow_surrogates, start, stop): @@ -761,13 +748,13 @@ def append(self, s): # for strings self._s.append(s) - newlgt = get_utf8_length(s) + newlgt = codepoints_in_utf8(s) self._lgt += newlgt @always_inline def append_slice(self, s, start, end): self._s.append_slice(s, start, end) - newlgt = get_utf8_length(s, start, end) + newlgt = codepoints_in_utf8(s, start, end) self._lgt += newlgt @signature(types.self(), char(), returns=none()) diff --git a/rpython/rlib/test/test_rutf8.py b/rpython/rlib/test/test_rutf8.py --- a/rpython/rlib/test/test_rutf8.py +++ b/rpython/rlib/test/test_rutf8.py @@ -169,14 +169,6 @@ expected = any(uch for uch in unichars if u'\ud800' <= uch <= u'\udfff') assert result == expected - at given(strategies.lists(strategies.characters())) -def test_get_utf8_length(unichars): - u = u''.join(unichars) - exp_lgt = len(u) - s = ''.join([c.encode('utf8') for c in u]) - lgt = rutf8.get_utf8_length(s) - if not _has_surrogates(s) or sys.maxunicode > 0xffff: - assert lgt == exp_lgt def test_utf8_string_builder(): s = rutf8.Utf8StringBuilder() From pypy.commits at gmail.com Mon Sep 16 04:52:30 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 16 Sep 2019 01:52:30 -0700 (PDT) Subject: [pypy-commit] pypy default: call prev_codepoint_pos only once Message-ID: <5d7f4d4e.1c69fb81.c2f9c.f47e@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97487:6e05da20e7bd Date: 2019-09-16 10:51 +0200 http://bitbucket.org/pypy/pypy/changeset/6e05da20e7bd/ Log: call prev_codepoint_pos only once diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -1085,9 +1085,11 @@ lgt -= 1 if right: - while rpos > lpos and rutf8.isspace(value, - rutf8.prev_codepoint_pos(value, rpos)): - rpos = rutf8.prev_codepoint_pos(value, rpos) + while rpos > lpos: + prev = rutf8.prev_codepoint_pos(value, rpos) + if not rutf8.isspace(value, prev): + break + rpos = prev lgt -= 1 assert rpos >= lpos # annotator hint, don't remove @@ -1108,9 +1110,11 @@ lgt -= 1 if right: - while rpos > lpos and rutf8.utf8_in_chars(value, - rutf8.prev_codepoint_pos(value, rpos), chars): - rpos = rutf8.prev_codepoint_pos(value, rpos) + while rpos > lpos: + prev = rutf8.prev_codepoint_pos(value, rpos) + if not rutf8.utf8_in_chars(value, prev, chars): + break + rpos = prev lgt -= 1 assert rpos >= lpos # annotator hint, don't remove From pypy.commits at gmail.com Mon Sep 16 06:29:36 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Mon, 16 Sep 2019 03:29:36 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Fixed a bunch of translation issues Message-ID: <5d7f6410.1c69fb81.9ee07.8a10@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97488:fa6bd070da3d Date: 2019-09-16 11:27 +0100 http://bitbucket.org/pypy/pypy/changeset/fa6bd070da3d/ Log: Fixed a bunch of translation issues diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -19,6 +19,9 @@ SMALLBUF = 4 BUFMAX = (32*1024*1024) BUFSIZ = platform.ConstantInteger("BUFSIZ") +CONIN = rffi.unicode2wcharp(u"CONIN$") +CONOUT = rffi.unicode2wcharp(u"CONOUT$") +CON = rffi.unicode2wcharp(u"CON") def err_closed(space): raise oefmt(space.w_ValueError, @@ -32,7 +35,7 @@ def read_console_w(space, handle, maxlen, readlen): err = 0 sig = 0 - buf = lltype.malloc(rwin32.CWCHARP, maxlen, flavor='raw') + buf = lltype.malloc(rffi.CWCHARP, maxlen, flavor='raw') try: if not buf: @@ -42,7 +45,7 @@ while off < maxlen: with lltype.scoped_alloc(rwin32.LPDWORD.TO, 1) as n: n[0] = -1 - len = min(maxlen - off, BUFSIZE) + len = min(maxlen - off, BUFSIZ) rwin32.SetLastError_saved(0) res = rwin32.ReadConsoleW(handle, buf[off], len, n, rffi.NULL) err = rwin32.GetLastError_saved() @@ -69,7 +72,7 @@ break # We read a new line - if buf[readlen -1] == '\n': + if buf[readlen -1] == u'\n': break with lltype.scoped_alloc(rwin32.LPWORD.TO, 1) as char_type: @@ -77,7 +80,7 @@ rwin32.GetStringTypeW(rwin32.CT_CTYPE3, buf[readlen - 1], 1, char_type) and \ char_type == rwin32.C3_HIGHSURROGATE: maxlen += 1 - newbuf = lltype.malloc(rwin32.CWCHARP, maxlen, flavor='raw') + newbuf = lltype.malloc(rffi.CWCHARP, maxlen, flavor='raw') lltype.free(buf, flavor='raw') buf = newbuf off += n @@ -87,7 +90,7 @@ lltype.free(buf, flavor='raw') return None - if readlen > 0 and buf[0] == '\x1a': + if readlen > 0 and buf[0] == u'\x1a': lltype.free(buf, flavor='raw') buf = lltype.malloc(rwin32.CWCHARP, 1, flavor='raw') buf[0] = '\0' @@ -135,11 +138,11 @@ # In CPython the _wcsicmp function is used to perform case insensitive comparison decoded.lower() - if not rwin32.wcsicmp(decoded_wstr, "CONIN$"): + if not rwin32.wcsicmp(decoded_wstr, CONIN): m = 'r' - elif not rwin32.wcsicmp(decoded_wstr, "CONOUT$"): + elif not rwin32.wcsicmp(decoded_wstr, CONOUT): m = 'w' - elif not rwin32.wcsicmp(decoded_wstr, "CON"): + elif not rwin32.wcsicmp(decoded_wstr, CON): m = 'x' @@ -150,28 +153,31 @@ pname_buf = lltype.malloc(rffi.CWCHARP.TO, rwin32.MAX_PATH, flavor='raw') - traits = _preferred_traits(decoded_wstr) + uni_decoded_wstr = rffi.wcharp2unicode(decoded_wstr) + traits = _preferred_traits(uni_decoded_wstr) win32traits = make_win32_traits(traits) - length = win32traits.GetFullPathName(decoded_wstr, rwin32.MAX_PATH, pname_buf, rffi.NULL) + w_str_nullptr = lltype.nullptr(win32traits.LPSTRP.TO) + length = win32traits.GetFullPathName(decoded_wstr, rwin32.MAX_PATH, pname_buf, w_str_nullptr) if length > rwin32.MAX_PATH: lltype.free(pname_buf, flavor='raw') pname_buf = lltype.malloc(rffi.CWCHARP.TO, length, flavor='raw') if pname_buf: - length = win32traits.GetFullPathName(decoded_wstr, rwin32.MAX_PATH, pname_buf, rffi.NULL) + length = win32traits.GetFullPathName(decoded_wstr, rwin32.MAX_PATH, pname_buf, w_str_nullptr) else: length = 0 if length: - if length >= 4 and pname_buf[3] == '\\' and \ - (pname_buf[2] == '.' or pname_buf[2] == '?') and \ - pname_buf[1] == '\\' and pname_buf[0] == '\\': - pname_buf += 4 - if not rwin32.wcsicmp(decoded_wstr, "CONIN$"): + if length >= 4 and pname_buf[3] == u'\\' and \ + (pname_buf[2] == u'.' or pname_buf[2] == u'?') and \ + pname_buf[1] == u'\\' and pname_buf[0] == u'\\': + name = rffi.ptradd(pname_buf, 4) + + if not rwin32.wcsicmp(name, CONIN): m = 'r' - elif not rwin32.wcsicmp(decoded_wstr, "CONOUT$"): + elif not rwin32.wcsicmp(name, CONOUT): m = 'w' - elif not rwin32.wcsicmp(decoded_wstr, "CON"): + elif not rwin32.wcsicmp(name, CON): m = 'x' lltype.free(pname_buf, flavor='raw') return m @@ -201,6 +207,12 @@ len -= 1 n += 1 return n + + def _buflen(self): + for i in range(len(SMALLBUF)): + if not self.buf[i]: + return i + return SMALLBUF @unwrap_spec(w_mode=WrappedDefault("r"), w_closefd=WrappedDefault(True), w_opener=WrappedDefault(None)) def descr_init(self, space, w_nameobj, w_mode, w_closefd, w_opener): @@ -427,7 +439,7 @@ def read_w(self, space, w_size=None): size = convert_size(space, w_size) if self.handle == rwin32.INVALID_HANDLE_VALUE: - err_closed() + err_closed(space) if not self.readable: return err_mode("reading") @@ -449,15 +461,16 @@ def readall_w(self, space): if self.handle == rwin32.INVALID_HANDLE_VALUE: - err_closed() + err_closed(space) - bufsize = BUFSIZE - buf = lltype.malloc(rwin32.CWCHARP, bufsize + 1, flavor='raw') + bufsize = BUFSIZ + buf = lltype.malloc(rffi.CWCHARP, bufsize + 1, flavor='raw') len = 0 - n = lltype.malloc(rwin32.CWCHARP, 1, flavor='raw') + n = lltype.malloc(rffi.CWCHARP, 1, flavor='raw') n[0] = 0 try: + # Read the bytes from the console while True: if len >= bufsize: if len > BUFMAX: @@ -469,7 +482,7 @@ "than a Python bytes object can hold") bufsize = newsize lltype.free(buf, flavor='raw') - buf = lltype.malloc(rwin32.CWCHARP, bufsize + 1, flavor='raw') + buf = lltype.malloc(rffi.CWCHARP, bufsize + 1, flavor='raw') subbuf = read_console_w(self.handle, bufsize - len, n) if n > 0: @@ -482,14 +495,41 @@ len += n - if len == 0 and _buflen(self) == 0: + if len == 0 and self._buflen() == 0: return None - + + # Compute the size for the destination buffer + if len: + bytes_size = rwin32.WideCharToMultiByte(rwin32.CP_UTF8, 0, buf, + len, rffi.NULL, 0, rffi.NULL, rffi.NULL) + + if bytes_size: + err = rwin32.GetLastError_saved() + raise WindowsError(err, "Failed to convert wide characters to multi byte string") + else: + bytes_size = 0 + bytes_size += self._buflen() + + # Create destination buffer and convert the bytes + bytes = lltype.malloc(rffi.CCHARP, bytes_size, flavor='raw') + rn = self._copyfrombuf(bytes, bytes_size) + + if len: + bytes_size = rwin32.WideCharToMultiByte(rwin32.CP_UTF8, 0, buf, len, + bytes[rn], bytes_size - rn, rffi.NULL, rffi.NULL) + + if not bytes_size: + err = rwin32.GetLastError_saved() + raise WindowsError(err, "Failed to convert wide characters to multi byte string") + + bytes_size += rn + + w_bytes = space.charp2str(bytes) + return space.newbytes(w_bytes) + finally: lltype.free(buf, flavor='raw') - pass - def get_blksize(self,space): return space.newint(self.blksize) diff --git a/pypy/module/_io/test/test_win32consoleio.py b/pypy/module/_io/test/test_win32consoleio.py --- a/pypy/module/_io/test/test_win32consoleio.py +++ b/pypy/module/_io/test/test_win32consoleio.py @@ -9,4 +9,4 @@ def test_constructor(self): import _io - t = _io.WinConsoleIO() + t = _io.WindowsConsoleIO(u"CONIN$") diff --git a/pypy/module/signal/moduledef.py b/pypy/module/signal/moduledef.py --- a/pypy/module/signal/moduledef.py +++ b/pypy/module/signal/moduledef.py @@ -67,10 +67,12 @@ else: space.actionflag.__class__ = interp_signal.SignalActionFlag # xxx yes I know the previous line is a hack - print "loading module" if os.name == "nt": print "creating sigint event" interp_signal.create_sigint_event() + def startup(self, space): space.check_signal_action.startup(space) + + diff --git a/rpython/rlib/rwin32.py b/rpython/rlib/rwin32.py --- a/rpython/rlib/rwin32.py +++ b/rpython/rlib/rwin32.py @@ -255,10 +255,12 @@ fd = _open_osfhandle(handle, flags) with FdValidator(fd): return fd + + wcsicmp = rffi.llexternal('_wcsicmp', [rffi.CWCHARP, rffi.CWCHARP], rffi.INT) wcsncpy_s = rffi.llexternal('wcsncpy_s', [rffi.CWCHARP, rffi.SIZE_T, rffi.CWCHARP, rffi.SIZE_T], rffi.INT) - wcsicmp = rffi.llexternal('_wcsicmp', [rffi.CWCHARP, rffi.CWCHARP], rffi.INT) + def build_winerror_to_errno(): """Build a dictionary mapping windows error numbers to POSIX errno. From pypy.commits at gmail.com Mon Sep 16 07:38:07 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 16 Sep 2019 04:38:07 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix error message of barry_as_FLUFL, important work! Message-ID: <5d7f741f.1c69fb81.93eeb.5751@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97489:03c11d539a67 Date: 2019-09-16 13:37 +0200 http://bitbucket.org/pypy/pypy/changeset/03c11d539a67/ Log: fix error message of barry_as_FLUFL, important work! diff --git a/pypy/interpreter/astcompiler/astbuilder.py b/pypy/interpreter/astcompiler/astbuilder.py --- a/pypy/interpreter/astcompiler/astbuilder.py +++ b/pypy/interpreter/astcompiler/astbuilder.py @@ -939,7 +939,7 @@ elif comp_type == tokens.NOTEQUAL: flufl = self.compile_info.flags & consts.CO_FUTURE_BARRY_AS_BDFL if flufl and comp_node.get_value() == '!=': - self.error('invalid comparison', comp_node) + self.error("with Barry as BDFL, use '<>' instead of '!='", comp_node) elif not flufl and comp_node.get_value() == '<>': self.error('invalid comparison', comp_node) return ast.NotEq diff --git a/pypy/interpreter/test/test_compiler.py b/pypy/interpreter/test/test_compiler.py --- a/pypy/interpreter/test/test_compiler.py +++ b/pypy/interpreter/test/test_compiler.py @@ -744,7 +744,7 @@ sys.path[:] = copy return x """) - assert space.float_w(w_result) == 0 + assert space.is_true(w_result) def test_filename_in_syntaxerror(self): e = py.test.raises(OperationError, self.compiler.compile, """if 1: @@ -917,9 +917,11 @@ code = "from __future__ import barry_as_FLUFL; 2 {0} 3" compile(code.format('<>'), '', 'exec', __future__.CO_FUTURE_BARRY_AS_BDFL) - raises(SyntaxError, compile, code.format('!='), + with raises(SyntaxError) as excinfo: + compile(code.format('!='), '', 'exec', __future__.CO_FUTURE_BARRY_AS_BDFL) + assert excinfo.value.msg == "with Barry as BDFL, use '<>' instead of '!='" def test_guido_as_bdfl(self): # from test_flufl.py :-) From pypy.commits at gmail.com Mon Sep 16 07:38:09 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 16 Sep 2019 04:38:09 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: unskip these two tests Message-ID: <5d7f7421.1c69fb81.a6d7e.674c@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97490:c4bc6937bce1 Date: 2019-09-16 13:37 +0200 http://bitbucket.org/pypy/pypy/changeset/c4bc6937bce1/ Log: unskip these two tests diff --git a/pypy/interpreter/test/test_compiler.py b/pypy/interpreter/test/test_compiler.py --- a/pypy/interpreter/test/test_compiler.py +++ b/pypy/interpreter/test/test_compiler.py @@ -706,31 +706,26 @@ def test_dont_inherit_flag(self): # this test checks that compile() don't inherit the __future__ flags - # of the hosting code. However, in Python3 we don't have any - # meaningful __future__ flag to check that (they are all enabled). The - # only candidate could be barry_as_FLUFL, but it's not implemented yet - # (and not sure it'll ever be) - py.test.skip("we cannot actually check the result of this test (see comment)") + # of the hosting code. space = self.space s1 = str(py.code.Source(""" - from __future__ import division - exec(compile('x = 1/2', '?', 'exec', 0, 1)) + from __future__ import barry_as_FLUFL + # not a syntax error inside the exec! + exec(compile('x = 1 != 2', '?', 'exec', 0, 1)) """)) w_result = space.appexec([space.wrap(s1)], """(s1): ns = {} exec(s1, ns) return ns['x'] """) - assert space.float_w(w_result) == 0 + assert space.is_true(w_result) def test_dont_inherit_across_import(self): - # see the comment for test_dont_inherit_flag - py.test.skip("we cannot actually check the result of this test (see comment)") from rpython.tool.udir import udir - udir.join('test_dont_inherit_across_import.py').write('x = 1/2\n') + udir.join('test_dont_inherit_across_import.py').write('x = 1 != 2\n') space = self.space s1 = str(py.code.Source(""" - from __future__ import division + from __future__ import barry_as_FLUFL from test_dont_inherit_across_import import x """)) w_result = space.appexec([space.wrap(str(udir)), space.wrap(s1)], @@ -738,11 +733,12 @@ import sys copy = sys.path[:] sys.path.insert(0, udir) + ns = {} try: - exec s1 + exec(s1, ns) finally: sys.path[:] = copy - return x + return ns['x'] """) assert space.is_true(w_result) From pypy.commits at gmail.com Mon Sep 16 08:48:00 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 16 Sep 2019 05:48:00 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: don't fold too huge left shift either Message-ID: <5d7f8480.1c69fb81.a6d7e.6fac@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97491:cedd17bf511f Date: 2019-09-16 13:50 +0200 http://bitbucket.org/pypy/pypy/changeset/cedd17bf511f/ Log: don't fold too huge left shift either diff --git a/pypy/interpreter/astcompiler/optimize.py b/pypy/interpreter/astcompiler/optimize.py --- a/pypy/interpreter/astcompiler/optimize.py +++ b/pypy/interpreter/astcompiler/optimize.py @@ -142,6 +142,16 @@ """) return space.pow(w_left, w_right, space.w_None) +def _fold_lshift(space, w_left, w_right): + # don't constant-fold if "w_left" and "w_right" are integers and + # the estimated bit length of the result is unreasonably large + space.appexec([w_left, w_right], """(left, right): + if isinstance(left, int) and isinstance(right, int): + if left.bit_length() + right > 1000: + raise OverflowError + """) + return space.lshift(w_left, w_right) + def _fold_not(space, operand): return space.newbool(not space.is_true(operand)) @@ -154,7 +164,7 @@ ast.FloorDiv : _binary_fold("floordiv"), ast.Mod : _binary_fold("mod"), ast.Pow : _fold_pow, - ast.LShift : _binary_fold("lshift"), + ast.LShift : _fold_lshift, ast.RShift : _binary_fold("rshift"), ast.BitOr : _binary_fold("or_"), ast.BitXor : _binary_fold("xor"), diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py b/pypy/interpreter/astcompiler/test/test_compiler.py --- a/pypy/interpreter/astcompiler/test/test_compiler.py +++ b/pypy/interpreter/astcompiler/test/test_compiler.py @@ -1474,13 +1474,14 @@ assert ops.LOAD_CONST in counts def test_dont_fold_huge_powers(self): - for source in ( - "2 ** 3000", # not constant-folded: too big - "(-2) ** 3000", + for source, op in ( + ("2 ** 3000", ops.BINARY_POWER), # not constant-folded: too big + ("(-2) ** 3000", ops.BINARY_POWER), + ("5 << 1000", ops.BINARY_LSHIFT), ): source = 'def f(): %s' % source counts = self.count_instructions(source) - assert ops.BINARY_POWER in counts + assert op in counts for source in ( "2 ** 2000", # constant-folded From pypy.commits at gmail.com Mon Sep 16 08:48:01 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 16 Sep 2019 05:48:01 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: use getattr here as well (already done for another test) Message-ID: <5d7f8481.1c69fb81.f83dc.498d@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97492:ce752f8d7d1e Date: 2019-09-16 13:55 +0200 http://bitbucket.org/pypy/pypy/changeset/ce752f8d7d1e/ Log: use getattr here as well (already done for another test) diff --git a/lib-python/3/test/test_readline.py b/lib-python/3/test/test_readline.py --- a/lib-python/3/test/test_readline.py +++ b/lib-python/3/test/test_readline.py @@ -227,7 +227,7 @@ # See https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES # - editline: history size is broken on OS X 10.11.6. # Newer versions were not tested yet. - @unittest.skipIf(readline._READLINE_VERSION < 0x600, + @unittest.skipIf(getattr(readline, "_READLINE_VERSION", 0x601) < 0x600, "this readline version does not support history-size") @unittest.skipIf(is_editline, "editline history size configuration is broken") From pypy.commits at gmail.com Mon Sep 16 08:48:03 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 16 Sep 2019 05:48:03 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: this restriction was lifted, and we didn't import the test change correctly or Message-ID: <5d7f8483.1c69fb81.3ce60.e1a7@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97493:a741689e58e9 Date: 2019-09-16 14:04 +0200 http://bitbucket.org/pypy/pypy/changeset/a741689e58e9/ Log: this restriction was lifted, and we didn't import the test change correctly or something diff --git a/lib-python/3/test/test_regrtest.py b/lib-python/3/test/test_regrtest.py --- a/lib-python/3/test/test_regrtest.py +++ b/lib-python/3/test/test_regrtest.py @@ -260,7 +260,6 @@ self.checkError([opt, '0', '-l'], "don't go together") self.checkError([opt, '0', '-T'], "don't go together") self.checkError([opt, '0', '-l'], "don't go together") - self.checkError([opt, '0', '-M', '4G'], "don't go together") def test_coverage(self): for opt in '-T', '--coverage': From pypy.commits at gmail.com Mon Sep 16 10:19:49 2019 From: pypy.commits at gmail.com (mattip) Date: Mon, 16 Sep 2019 07:19:49 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: enable _io own tests on windows Message-ID: <5d7f9a05.1c69fb81.ecbc7.3435@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97494:b6cec0565e9d Date: 2019-09-16 16:28 +0300 http://bitbucket.org/pypy/pypy/changeset/b6cec0565e9d/ Log: enable _io own tests on windows diff --git a/pypy/module/_io/test/test_bufferedio.py b/pypy/module/_io/test/test_bufferedio.py --- a/pypy/module/_io/test/test_bufferedio.py +++ b/pypy/module/_io/test/test_bufferedio.py @@ -8,8 +8,10 @@ class AppTestBufferedReader: - spaceconfig = dict(usemodules=['_io', 'fcntl']) - + spaceconfig = dict(usemodules=['_io']) + if os.name != 'nt': + spaceconfig['usemodules'].append('fcntl') + def setup_class(cls): tmpfile = udir.join('tmpfile') tmpfile.write("a\nb\nc", mode='wb') @@ -388,7 +390,10 @@ def test_readline_issue3042(self): import _io as io - import fcntl + try: + import fcntl + except ImportError: + skip('fcntl missing') fdin, fdout = self.posix.pipe() f = io.open(fdin, "rb") fl = fcntl.fcntl(f, fcntl.F_GETFL) @@ -400,7 +405,10 @@ class AppTestBufferedReaderWithThreads(AppTestBufferedReader): - spaceconfig = dict(usemodules=['_io', 'fcntl', 'thread', 'time']) + spaceconfig = dict(usemodules=['_io', 'thread', 'time']) + if os.name != 'nt': + spaceconfig['usemodules'].append('fcntl') + def test_readinto_small_parts(self): import _io, os, _thread, time diff --git a/pypy/module/_io/test/test_fileio.py b/pypy/module/_io/test/test_fileio.py --- a/pypy/module/_io/test/test_fileio.py +++ b/pypy/module/_io/test/test_fileio.py @@ -5,8 +5,9 @@ class AppTestFileIO: - spaceconfig = dict(usemodules=['_io', 'array'] + - (['fcntl'] if os.name != 'nt' else [])) + spaceconfig = dict(usemodules=['_io', 'array']) + if os.name != 'nt': + spaceconfig['usemodules'].append('fcntl') def setup_method(self, meth): tmpfile = udir.join('tmpfile') From pypy.commits at gmail.com Mon Sep 16 10:19:54 2019 From: pypy.commits at gmail.com (mattip) Date: Mon, 16 Sep 2019 07:19:54 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: merge py3.6 into branch Message-ID: <5d7f9a0a.1c69fb81.aea86.e217@mx.google.com> Author: Matti Picus Branch: winconsoleio Changeset: r97495:905c730547a7 Date: 2019-09-16 17:20 +0300 http://bitbucket.org/pypy/pypy/changeset/905c730547a7/ Log: merge py3.6 into branch diff too long, truncating to 2000 out of 5141 lines diff --git a/lib-python/3/stat.py b/lib-python/3/stat.py --- a/lib-python/3/stat.py +++ b/lib-python/3/stat.py @@ -40,6 +40,10 @@ S_IFIFO = 0o010000 # fifo (named pipe) S_IFLNK = 0o120000 # symbolic link S_IFSOCK = 0o140000 # socket file +# Fallbacks for uncommon platform-specific constants +S_IFDOOR = 0 +S_IFPORT = 0 +S_IFWHT = 0 # Functions to test for each file type @@ -71,6 +75,18 @@ """Return True if mode is from a socket.""" return S_IFMT(mode) == S_IFSOCK +def S_ISDOOR(mode): + """Return True if mode is from a door.""" + return False + +def S_ISPORT(mode): + """Return True if mode is from an event port.""" + return False + +def S_ISWHT(mode): + """Return True if mode is from a whiteout.""" + return False + # Names for permission bits S_ISUID = 0o4000 # set UID bit diff --git a/lib-python/3/test/test_concurrent_futures.py b/lib-python/3/test/test_concurrent_futures.py --- a/lib-python/3/test/test_concurrent_futures.py +++ b/lib-python/3/test/test_concurrent_futures.py @@ -428,6 +428,7 @@ futures_list.remove(future) wr = weakref.ref(future) del future + test.support.gc_collect() self.assertIsNone(wr()) futures_list[0].set_result("test") @@ -435,6 +436,7 @@ futures_list.remove(future) wr = weakref.ref(future) del future + test.support.gc_collect() self.assertIsNone(wr()) if futures_list: futures_list[0].set_result("test") @@ -533,6 +535,7 @@ for obj in self.executor.map(make_dummy_object, range(10)): wr = weakref.ref(obj) del obj + test.support.gc_collect() self.assertIsNone(wr()) diff --git a/lib-python/3/test/test_readline.py b/lib-python/3/test/test_readline.py --- a/lib-python/3/test/test_readline.py +++ b/lib-python/3/test/test_readline.py @@ -227,7 +227,7 @@ # See https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES # - editline: history size is broken on OS X 10.11.6. # Newer versions were not tested yet. - @unittest.skipIf(readline._READLINE_VERSION < 0x600, + @unittest.skipIf(getattr(readline, "_READLINE_VERSION", 0x601) < 0x600, "this readline version does not support history-size") @unittest.skipIf(is_editline, "editline history size configuration is broken") diff --git a/lib-python/3/test/test_regrtest.py b/lib-python/3/test/test_regrtest.py --- a/lib-python/3/test/test_regrtest.py +++ b/lib-python/3/test/test_regrtest.py @@ -260,7 +260,6 @@ self.checkError([opt, '0', '-l'], "don't go together") self.checkError([opt, '0', '-T'], "don't go together") self.checkError([opt, '0', '-l'], "don't go together") - self.checkError([opt, '0', '-M', '4G'], "don't go together") def test_coverage(self): for opt in '-T', '--coverage': diff --git a/lib_pypy/_curses_build.py b/lib_pypy/_curses_build.py --- a/lib_pypy/_curses_build.py +++ b/lib_pypy/_curses_build.py @@ -34,6 +34,13 @@ #define NCURSES_OPAQUE 0 #endif + +/* ncurses 6 change behaviour and makes all pointers opaque, + lets define backward compatibility. It doesn't harm + previous versions */ + +#define NCURSES_INTERNALS 1 +#define NCURSES_REENTRANT 0 #include #include #include diff --git a/lib_pypy/_dbm.py b/lib_pypy/_dbm.py --- a/lib_pypy/_dbm.py +++ b/lib_pypy/_dbm.py @@ -149,7 +149,7 @@ lib = CDLL("/usr/lib/libdbm.dylib") # OS X _platform = 'osx' -library = "GNU gdbm" +library = "Berkeley DB" funcs = {} _init_func('open', (c_char_p, c_int, c_int), restype=c_void_p) diff --git a/lib_pypy/_pypy_testcapi.py b/lib_pypy/_pypy_testcapi.py --- a/lib_pypy/_pypy_testcapi.py +++ b/lib_pypy/_pypy_testcapi.py @@ -61,6 +61,8 @@ assert output_dir is not None from distutils.ccompiler import new_compiler + from distutils import log + log.set_verbosity(3) compiler = new_compiler() compiler.output_dir = output_dir @@ -72,7 +74,8 @@ ccflags = ['-fPIC', '-Wimplicit-function-declaration'] res = compiler.compile([os.path.join(thisdir, csource)], include_dirs=[include_dir], - extra_preargs=ccflags) + extra_preargs=ccflags, + ) object_filename = res[0] # set link options diff --git a/lib_pypy/_stat.py b/lib_pypy/_stat.py deleted file mode 100644 --- a/lib_pypy/_stat.py +++ /dev/null @@ -1,6 +0,0 @@ -# Assume not Solaris - -S_IFDOOR = 0 - -def S_ISDOOR(mode): - return False diff --git a/lib_pypy/_testcapimodule.c b/lib_pypy/_testcapimodule.c --- a/lib_pypy/_testcapimodule.c +++ b/lib_pypy/_testcapimodule.c @@ -3009,6 +3009,8 @@ return PyLong_FromLong(r); } +#endif /* PYPY_VERSION */ + static int check_time_rounding(int round) { @@ -3069,6 +3071,8 @@ return Py_BuildValue("Nl", _PyLong_FromTime_t(sec), nsec); } +#ifndef PYPY_VERSION + static void slot_tp_del(PyObject *self) { @@ -3902,8 +3906,6 @@ Py_RETURN_NONE; } -#ifndef PYPY_VERSION - static PyObject * test_pytime_fromseconds(PyObject *self, PyObject *args) { @@ -4022,6 +4024,8 @@ return _PyTime_AsNanosecondsObject(ms); } +#ifndef PYPY_VERSION + static PyObject* get_recursion_depth(PyObject *self, PyObject *args) { @@ -4445,9 +4449,11 @@ {"crash_no_current_thread", (PyCFunction)crash_no_current_thread, METH_NOARGS}, #ifndef PYPY_VERSION {"run_in_subinterp", run_in_subinterp, METH_VARARGS}, +#endif {"pytime_object_to_time_t", test_pytime_object_to_time_t, METH_VARARGS}, {"pytime_object_to_timeval", test_pytime_object_to_timeval, METH_VARARGS}, {"pytime_object_to_timespec", test_pytime_object_to_timespec, METH_VARARGS}, +#ifndef PYPY_VERSION {"with_tp_del", with_tp_del, METH_VARARGS}, #endif {"create_cfunction", create_cfunction, METH_NOARGS}, @@ -4515,7 +4521,6 @@ return_null_without_error, METH_NOARGS}, {"return_result_with_error", return_result_with_error, METH_NOARGS}, -#ifndef PYPY_VERSION {"PyTime_FromSeconds", test_pytime_fromseconds, METH_VARARGS}, {"PyTime_FromSecondsObject", test_pytime_fromsecondsobject, METH_VARARGS}, {"PyTime_AsSecondsDouble", test_pytime_assecondsdouble, METH_VARARGS}, @@ -4525,6 +4530,7 @@ #endif {"PyTime_AsMilliseconds", test_PyTime_AsMilliseconds, METH_VARARGS}, {"PyTime_AsMicroseconds", test_PyTime_AsMicroseconds, METH_VARARGS}, +#ifndef PYPY_VERSION {"get_recursion_depth", get_recursion_depth, METH_NOARGS}, {"pymem_buffer_overflow", pymem_buffer_overflow, METH_NOARGS}, {"pymem_api_misuse", pymem_api_misuse, METH_NOARGS}, @@ -4538,10 +4544,10 @@ {"pyobject_fastcalldict", test_pyobject_fastcalldict, METH_VARARGS}, {"pyobject_fastcallkeywords", test_pyobject_fastcallkeywords, METH_VARARGS}, {"raise_SIGINT_then_send_None", raise_SIGINT_then_send_None, METH_VARARGS}, +#endif #ifdef W_STOPCODE {"W_STOPCODE", py_w_stopcode, METH_VARARGS}, #endif -#endif /* PYPY_VERSION */ {NULL, NULL} /* sentinel */ }; diff --git a/lib_pypy/_tkinter/tklib_build.py b/lib_pypy/_tkinter/tklib_build.py --- a/lib_pypy/_tkinter/tklib_build.py +++ b/lib_pypy/_tkinter/tklib_build.py @@ -36,8 +36,11 @@ for _ver in ['8.6', '8.5', '']: incdirs = [] linklibs = ['tcl' + _ver, 'tk' + _ver] - if os.path.isfile(''.join(['/usr/lib/lib', linklibs[1], '.so'])): - found = True + for lib in ['/usr/lib/lib', '/usr/lib64/lib']: + if os.path.isfile(''.join([lib, linklibs[1], '.so'])): + found = True + break + if found: break if not found: sys.stderr.write("*** TCL libraries not found! Falling back...\n") diff --git a/pypy/config/test/test_pypyoption.py b/pypy/config/test/test_pypyoption.py --- a/pypy/config/test/test_pypyoption.py +++ b/pypy/config/test/test_pypyoption.py @@ -8,14 +8,13 @@ def test_required(): conf = get_pypy_config() assert not conf.translating - assert conf.objspace.usemodules.gc def test_conflicting_gcrootfinder(): conf = get_pypy_config() conf.translation.gc = "boehm" - py.test.raises(ConfigError, "conf.translation.gcrootfinder = 'asmgcc'") - + with py.test.raises(ConfigError): + conf.translation.gcrootfinder = 'asmgcc' def test_frameworkgc(): for name in ["minimark", "semispace"]: diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -70,3 +70,15 @@ .. branch: cryptograhpt-2.7 Update vendored cryptography used for _ssl to 2.7 + +.. branch: compile_ncurses_tcl_tk_suse_latest + +Check for headers and runtime libraries in more locations to support other linuxes + +.. branch: openssl-for-macos + +Update _ssl on macos to statically link to openssl-1.1.1c + +.. branch: more-cpyext + +Add more datetime C functions and definitions diff --git a/pypy/interpreter/astcompiler/ast.py b/pypy/interpreter/astcompiler/ast.py --- a/pypy/interpreter/astcompiler/ast.py +++ b/pypy/interpreter/astcompiler/ast.py @@ -2740,9 +2740,9 @@ w_metavar = get_field(space, w_node, 'metavar', False) w_lineno = get_field(space, w_node, 'lineno', False) w_col_offset = get_field(space, w_node, 'col_offset', False) - _metavar = space.int_w(w_metavar) - _lineno = space.int_w(w_lineno) - _col_offset = space.int_w(w_col_offset) + _metavar = obj_to_int(space, w_metavar, False) + _lineno = obj_to_int(space, w_lineno, False) + _col_offset = obj_to_int(space, w_col_offset, False) return RevDBMetaVar(_metavar, _lineno, _col_offset) State.ast_type('RevDBMetaVar', 'expr', ['metavar']) @@ -4291,19 +4291,27 @@ class GenericASTVisitor(ASTVisitor): + def visited(self, node): + pass # base implementation + def visit_Module(self, node): + self.visited(node) self.visit_sequence(node.body) def visit_Interactive(self, node): + self.visited(node) self.visit_sequence(node.body) def visit_Expression(self, node): + self.visited(node) node.body.walkabout(self) def visit_Suite(self, node): + self.visited(node) self.visit_sequence(node.body) def visit_FunctionDef(self, node): + self.visited(node) node.args.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.decorator_list) @@ -4311,6 +4319,7 @@ node.returns.walkabout(self) def visit_AsyncFunctionDef(self, node): + self.visited(node) node.args.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.decorator_list) @@ -4318,214 +4327,269 @@ node.returns.walkabout(self) def visit_ClassDef(self, node): + self.visited(node) self.visit_sequence(node.bases) self.visit_sequence(node.keywords) self.visit_sequence(node.body) self.visit_sequence(node.decorator_list) def visit_Return(self, node): + self.visited(node) if node.value: node.value.walkabout(self) def visit_Delete(self, node): + self.visited(node) self.visit_sequence(node.targets) def visit_Assign(self, node): + self.visited(node) self.visit_sequence(node.targets) node.value.walkabout(self) def visit_AugAssign(self, node): + self.visited(node) node.target.walkabout(self) node.value.walkabout(self) def visit_AnnAssign(self, node): + self.visited(node) node.target.walkabout(self) node.annotation.walkabout(self) if node.value: node.value.walkabout(self) def visit_For(self, node): + self.visited(node) node.target.walkabout(self) node.iter.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.orelse) def visit_AsyncFor(self, node): + self.visited(node) node.target.walkabout(self) node.iter.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.orelse) def visit_While(self, node): + self.visited(node) node.test.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.orelse) def visit_If(self, node): + self.visited(node) node.test.walkabout(self) self.visit_sequence(node.body) self.visit_sequence(node.orelse) def visit_With(self, node): + self.visited(node) self.visit_sequence(node.items) self.visit_sequence(node.body) def visit_AsyncWith(self, node): + self.visited(node) self.visit_sequence(node.items) self.visit_sequence(node.body) def visit_Raise(self, node): + self.visited(node) if node.exc: node.exc.walkabout(self) if node.cause: node.cause.walkabout(self) def visit_Try(self, node): + self.visited(node) self.visit_sequence(node.body) self.visit_sequence(node.handlers) self.visit_sequence(node.orelse) self.visit_sequence(node.finalbody) def visit_Assert(self, node): + self.visited(node) node.test.walkabout(self) if node.msg: node.msg.walkabout(self) def visit_Import(self, node): + self.visited(node) self.visit_sequence(node.names) def visit_ImportFrom(self, node): + self.visited(node) self.visit_sequence(node.names) def visit_Global(self, node): + self.visited(node) pass def visit_Nonlocal(self, node): + self.visited(node) pass def visit_Expr(self, node): + self.visited(node) node.value.walkabout(self) def visit_Pass(self, node): + self.visited(node) pass def visit_Break(self, node): + self.visited(node) pass def visit_Continue(self, node): + self.visited(node) pass def visit_BoolOp(self, node): + self.visited(node) self.visit_sequence(node.values) def visit_BinOp(self, node): + self.visited(node) node.left.walkabout(self) node.right.walkabout(self) def visit_UnaryOp(self, node): + self.visited(node) node.operand.walkabout(self) def visit_Lambda(self, node): + self.visited(node) node.args.walkabout(self) node.body.walkabout(self) def visit_IfExp(self, node): + self.visited(node) node.test.walkabout(self) node.body.walkabout(self) node.orelse.walkabout(self) def visit_Dict(self, node): + self.visited(node) self.visit_sequence(node.keys) self.visit_sequence(node.values) def visit_Set(self, node): + self.visited(node) self.visit_sequence(node.elts) def visit_ListComp(self, node): + self.visited(node) node.elt.walkabout(self) self.visit_sequence(node.generators) def visit_SetComp(self, node): + self.visited(node) node.elt.walkabout(self) self.visit_sequence(node.generators) def visit_DictComp(self, node): + self.visited(node) node.key.walkabout(self) node.value.walkabout(self) self.visit_sequence(node.generators) def visit_GeneratorExp(self, node): + self.visited(node) node.elt.walkabout(self) self.visit_sequence(node.generators) def visit_Await(self, node): + self.visited(node) node.value.walkabout(self) def visit_Yield(self, node): + self.visited(node) if node.value: node.value.walkabout(self) def visit_YieldFrom(self, node): + self.visited(node) node.value.walkabout(self) def visit_Compare(self, node): + self.visited(node) node.left.walkabout(self) self.visit_sequence(node.comparators) def visit_Call(self, node): + self.visited(node) node.func.walkabout(self) self.visit_sequence(node.args) self.visit_sequence(node.keywords) def visit_Num(self, node): + self.visited(node) pass def visit_Str(self, node): + self.visited(node) pass def visit_RevDBMetaVar(self, node): + self.visited(node) pass def visit_FormattedValue(self, node): + self.visited(node) node.value.walkabout(self) if node.format_spec: node.format_spec.walkabout(self) def visit_JoinedStr(self, node): + self.visited(node) self.visit_sequence(node.values) def visit_Bytes(self, node): + self.visited(node) pass def visit_NameConstant(self, node): + self.visited(node) pass def visit_Ellipsis(self, node): + self.visited(node) pass def visit_Constant(self, node): + self.visited(node) pass def visit_Attribute(self, node): + self.visited(node) node.value.walkabout(self) def visit_Subscript(self, node): + self.visited(node) node.value.walkabout(self) node.slice.walkabout(self) def visit_Starred(self, node): + self.visited(node) node.value.walkabout(self) def visit_Name(self, node): + self.visited(node) pass def visit_List(self, node): + self.visited(node) self.visit_sequence(node.elts) def visit_Tuple(self, node): + self.visited(node) self.visit_sequence(node.elts) def visit_Slice(self, node): + self.visited(node) if node.lower: node.lower.walkabout(self) if node.upper: @@ -4534,22 +4598,27 @@ node.step.walkabout(self) def visit_ExtSlice(self, node): + self.visited(node) self.visit_sequence(node.dims) def visit_Index(self, node): + self.visited(node) node.value.walkabout(self) def visit_comprehension(self, node): + self.visited(node) node.target.walkabout(self) node.iter.walkabout(self) self.visit_sequence(node.ifs) def visit_ExceptHandler(self, node): + self.visited(node) if node.type: node.type.walkabout(self) self.visit_sequence(node.body) def visit_arguments(self, node): + self.visited(node) self.visit_sequence(node.args) if node.vararg: node.vararg.walkabout(self) @@ -4560,16 +4629,20 @@ self.visit_sequence(node.defaults) def visit_arg(self, node): + self.visited(node) if node.annotation: node.annotation.walkabout(self) def visit_keyword(self, node): + self.visited(node) node.value.walkabout(self) def visit_alias(self, node): + self.visited(node) pass def visit_withitem(self, node): + self.visited(node) node.context_expr.walkabout(self) if node.optional_vars: node.optional_vars.walkabout(self) diff --git a/pypy/interpreter/astcompiler/astbuilder.py b/pypy/interpreter/astcompiler/astbuilder.py --- a/pypy/interpreter/astcompiler/astbuilder.py +++ b/pypy/interpreter/astcompiler/astbuilder.py @@ -939,7 +939,7 @@ elif comp_type == tokens.NOTEQUAL: flufl = self.compile_info.flags & consts.CO_FUTURE_BARRY_AS_BDFL if flufl and comp_node.get_value() == '!=': - self.error('invalid comparison', comp_node) + self.error("with Barry as BDFL, use '<>' instead of '!='", comp_node) elif not flufl and comp_node.get_value() == '<>': self.error('invalid comparison', comp_node) return ast.NotEq diff --git a/pypy/interpreter/astcompiler/fstring.py b/pypy/interpreter/astcompiler/fstring.py --- a/pypy/interpreter/astcompiler/fstring.py +++ b/pypy/interpreter/astcompiler/fstring.py @@ -25,7 +25,7 @@ def f_constant_string(astbuilder, joined_pieces, w_u, atom_node): add_constant_string(astbuilder, joined_pieces, w_u, atom_node) -def f_string_compile(astbuilder, source, atom_node): +def f_string_compile(astbuilder, source, atom_node, fstr): # Note: a f-string is kept as a single literal up to here. # At this point only, we recursively call the AST compiler # on all the '{expr}' parts. The 'expr' part is not parsed @@ -44,16 +44,44 @@ astbuilder.error("internal error: parser not available for parsing " "the expressions inside the f-string", atom_node) assert isinstance(source, str) # utf-8 encoded - source = '(%s)' % source + + paren_source = '(%s)' % source # to deal with whitespace at the start of source + + lineno = 0 + column_offset = 0 + if fstr.stnode: + stnode = fstr.stnode + lineno = stnode.get_lineno() - 1 # one-based + # CPython has an equivalent hack :-( + value = stnode.get_value() + if value is not None: + column_offset = value.find(source) + stnode.get_column() info = pyparse.CompileInfo("", "eval", consts.PyCF_SOURCE_IS_UTF8 | consts.PyCF_IGNORE_COOKIE, optimize=astbuilder.compile_info.optimize) parser = astbuilder.recursive_parser - parse_tree = parser.parse_source(source, info) - return ast_from_node(astbuilder.space, parse_tree, info, - recursive_parser=parser) + parse_tree = parser.parse_source(paren_source, info) + + ast = ast_from_node(astbuilder.space, parse_tree, info, + recursive_parser=parser) + fixup_fstring_positions(ast, lineno, column_offset) + return ast + +def fixup_fstring_positions(ast, line_offset, column_offset): + visitor = FixPosVisitor(line_offset, column_offset) + ast.walkabout(visitor) + +class FixPosVisitor(ast.GenericASTVisitor): + def __init__(self, line_offset, column_offset): + self.line_offset = line_offset + self.column_offset = column_offset + + def visited(self, node): + if isinstance(node, ast.stmt) or isinstance(node, ast.expr): + node.lineno += self.line_offset + node.col_offset += self.column_offset def unexpected_end_of_string(astbuilder, atom_node): @@ -177,7 +205,7 @@ # Compile the expression as soon as possible, so we show errors # related to the expression before errors related to the # conversion or format_spec. - expr = f_string_compile(astbuilder, s[expr_start:i], atom_node) + expr = f_string_compile(astbuilder, s[expr_start:i], atom_node, fstr) assert isinstance(expr, ast.Expression) # Check for a conversion char, if present. @@ -345,7 +373,7 @@ child = atom_node.get_child(i) try: w_next = parsestring.parsestr( - space, encoding, child.get_value()) + space, encoding, child.get_value(), child) if not isinstance(w_next, parsestring.W_FString): add_constant_string(astbuilder, joined_pieces, w_next, atom_node) diff --git a/pypy/interpreter/astcompiler/optimize.py b/pypy/interpreter/astcompiler/optimize.py --- a/pypy/interpreter/astcompiler/optimize.py +++ b/pypy/interpreter/astcompiler/optimize.py @@ -142,6 +142,16 @@ """) return space.pow(w_left, w_right, space.w_None) +def _fold_lshift(space, w_left, w_right): + # don't constant-fold if "w_left" and "w_right" are integers and + # the estimated bit length of the result is unreasonably large + space.appexec([w_left, w_right], """(left, right): + if isinstance(left, int) and isinstance(right, int): + if left.bit_length() + right > 1000: + raise OverflowError + """) + return space.lshift(w_left, w_right) + def _fold_not(space, operand): return space.newbool(not space.is_true(operand)) @@ -154,7 +164,7 @@ ast.FloorDiv : _binary_fold("floordiv"), ast.Mod : _binary_fold("mod"), ast.Pow : _fold_pow, - ast.LShift : _binary_fold("lshift"), + ast.LShift : _fold_lshift, ast.RShift : _binary_fold("rshift"), ast.BitOr : _binary_fold("or_"), ast.BitXor : _binary_fold("xor"), diff --git a/pypy/interpreter/astcompiler/test/test_astbuilder.py b/pypy/interpreter/astcompiler/test/test_astbuilder.py --- a/pypy/interpreter/astcompiler/test/test_astbuilder.py +++ b/pypy/interpreter/astcompiler/test/test_astbuilder.py @@ -22,7 +22,7 @@ flags = consts.CO_FUTURE_WITH_STATEMENT info = pyparse.CompileInfo("", p_mode, flags) tree = self.parser.parse_source(source, info) - ast_node = ast_from_node(self.space, tree, info) + ast_node = ast_from_node(self.space, tree, info, self.parser) return ast_node def get_first_expr(self, source, p_mode=None, flags=None): @@ -1476,3 +1476,8 @@ " bytes in position 0-1: truncated \\xXX escape") assert exc.lineno == 2 assert exc.offset == 6 + + def test_fstring_lineno(self): + mod = self.get_ast('x=1\nf"{ x + 1}"') + assert mod.body[1].value.values[0].value.lineno == 2 + assert mod.body[1].value.values[0].value.col_offset == 8 diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py b/pypy/interpreter/astcompiler/test/test_compiler.py --- a/pypy/interpreter/astcompiler/test/test_compiler.py +++ b/pypy/interpreter/astcompiler/test/test_compiler.py @@ -1474,13 +1474,14 @@ assert ops.LOAD_CONST in counts def test_dont_fold_huge_powers(self): - for source in ( - "2 ** 3000", # not constant-folded: too big - "(-2) ** 3000", + for source, op in ( + ("2 ** 3000", ops.BINARY_POWER), # not constant-folded: too big + ("(-2) ** 3000", ops.BINARY_POWER), + ("5 << 1000", ops.BINARY_LSHIFT), ): source = 'def f(): %s' % source counts = self.count_instructions(source) - assert ops.BINARY_POWER in counts + assert op in counts for source in ( "2 ** 2000", # constant-folded diff --git a/pypy/interpreter/astcompiler/tools/asdl_py.py b/pypy/interpreter/astcompiler/tools/asdl_py.py --- a/pypy/interpreter/astcompiler/tools/asdl_py.py +++ b/pypy/interpreter/astcompiler/tools/asdl_py.py @@ -341,6 +341,9 @@ def visitModule(self, mod): self.emit("class GenericASTVisitor(ASTVisitor):") self.emit("") + self.emit("def visited(self, node):", 1) + self.emit("pass # base implementation", 2) + self.emit("") super(GenericASTVisitorVisitor, self).visitModule(mod) self.emit("") @@ -357,6 +360,7 @@ def make_visitor(self, name, fields): self.emit("def visit_%s(self, node):" % (name,), 1) + self.emit("self.visited(node)", 2) have_body = False for field in fields: if self.visitField(field): diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py --- a/pypy/interpreter/generator.py +++ b/pypy/interpreter/generator.py @@ -785,4 +785,8 @@ # StopIteration, signalling that this 'aclose()' await # is done. raise OperationError(space.w_StopIteration, space.w_None) + if e.match(space, space.w_GeneratorExit): + if self.w_exc_type is None: + # Ignore this error. + raise OperationError(space.w_StopIteration, space.w_None) raise e diff --git a/pypy/interpreter/pyparser/parsestring.py b/pypy/interpreter/pyparser/parsestring.py --- a/pypy/interpreter/pyparser/parsestring.py +++ b/pypy/interpreter/pyparser/parsestring.py @@ -7,14 +7,15 @@ class W_FString(W_Root): - def __init__(self, unparsed, raw_mode): + def __init__(self, unparsed, raw_mode, stnode): assert isinstance(unparsed, str) # utf-8 encoded string self.unparsed = unparsed # but the quotes are removed self.raw_mode = raw_mode self.current_index = 0 # for astcompiler.fstring + self.stnode = stnode -def parsestr(space, encoding, s): +def parsestr(space, encoding, s, stnode=None): """Parses a string or unicode literal, and return usually a wrapped value. If we get an f-string, then instead return an unparsed but unquoted W_FString instance. @@ -88,7 +89,7 @@ if unicode_literal and not rawmode: # XXX Py_UnicodeFlag is ignored for now assert 0 <= ps <= q if saw_f: - return W_FString(s[ps:q], rawmode) + return W_FString(s[ps:q], rawmode, stnode) if encoding is None: substr = s[ps:q] else: @@ -112,7 +113,7 @@ if not unicode_literal: return space.newbytes(substr) elif saw_f: - return W_FString(substr, rawmode) + return W_FString(substr, rawmode, stnode) else: v = unicodehelper.str_decode_utf8(substr, 'strict', True, None) return space.newtext(*v) diff --git a/pypy/interpreter/test/apptest_coroutine.py b/pypy/interpreter/test/apptest_coroutine.py --- a/pypy/interpreter/test/apptest_coroutine.py +++ b/pypy/interpreter/test/apptest_coroutine.py @@ -202,6 +202,7 @@ import gc, warnings # XXX: importing warnings is expensive untranslated async def foobaz(): pass + gc.collect() # emit warnings from unrelated older tests with warnings.catch_warnings(record=True) as l: foobaz() gc.collect() diff --git a/pypy/interpreter/test/apptest_pyframe.py b/pypy/interpreter/test/apptest_pyframe.py --- a/pypy/interpreter/test/apptest_pyframe.py +++ b/pypy/interpreter/test/apptest_pyframe.py @@ -13,7 +13,8 @@ import sys f = sys._getframe() assert f.f_globals is globals() - pytest.raises(AttributeError, "f.f_globals = globals()") + with pytest.raises(AttributeError): + f.f_globals = globals() def test_f_builtins(): import sys, builtins diff --git a/pypy/interpreter/test/test_compiler.py b/pypy/interpreter/test/test_compiler.py --- a/pypy/interpreter/test/test_compiler.py +++ b/pypy/interpreter/test/test_compiler.py @@ -706,31 +706,26 @@ def test_dont_inherit_flag(self): # this test checks that compile() don't inherit the __future__ flags - # of the hosting code. However, in Python3 we don't have any - # meaningful __future__ flag to check that (they are all enabled). The - # only candidate could be barry_as_FLUFL, but it's not implemented yet - # (and not sure it'll ever be) - py.test.skip("we cannot actually check the result of this test (see comment)") + # of the hosting code. space = self.space s1 = str(py.code.Source(""" - from __future__ import division - exec(compile('x = 1/2', '?', 'exec', 0, 1)) + from __future__ import barry_as_FLUFL + # not a syntax error inside the exec! + exec(compile('x = 1 != 2', '?', 'exec', 0, 1)) """)) w_result = space.appexec([space.wrap(s1)], """(s1): ns = {} exec(s1, ns) return ns['x'] """) - assert space.float_w(w_result) == 0 + assert space.is_true(w_result) def test_dont_inherit_across_import(self): - # see the comment for test_dont_inherit_flag - py.test.skip("we cannot actually check the result of this test (see comment)") from rpython.tool.udir import udir - udir.join('test_dont_inherit_across_import.py').write('x = 1/2\n') + udir.join('test_dont_inherit_across_import.py').write('x = 1 != 2\n') space = self.space s1 = str(py.code.Source(""" - from __future__ import division + from __future__ import barry_as_FLUFL from test_dont_inherit_across_import import x """)) w_result = space.appexec([space.wrap(str(udir)), space.wrap(s1)], @@ -738,13 +733,14 @@ import sys copy = sys.path[:] sys.path.insert(0, udir) + ns = {} try: - exec s1 + exec(s1, ns) finally: sys.path[:] = copy - return x + return ns['x'] """) - assert space.float_w(w_result) == 0 + assert space.is_true(w_result) def test_filename_in_syntaxerror(self): e = py.test.raises(OperationError, self.compiler.compile, """if 1: @@ -917,9 +913,11 @@ code = "from __future__ import barry_as_FLUFL; 2 {0} 3" compile(code.format('<>'), '', 'exec', __future__.CO_FUTURE_BARRY_AS_BDFL) - raises(SyntaxError, compile, code.format('!='), + with raises(SyntaxError) as excinfo: + compile(code.format('!='), '', 'exec', __future__.CO_FUTURE_BARRY_AS_BDFL) + assert excinfo.value.msg == "with Barry as BDFL, use '<>' instead of '!='" def test_guido_as_bdfl(self): # from test_flufl.py :-) diff --git a/pypy/interpreter/test/test_function.py b/pypy/interpreter/test/test_function.py --- a/pypy/interpreter/test/test_function.py +++ b/pypy/interpreter/test/test_function.py @@ -160,7 +160,8 @@ return 41 assert f() == 42 assert g() == 41 - raises(TypeError, "f.__code__ = 1") + with raises(TypeError): + f.__code__ = 1 f.__code__ = g.__code__ assert f() == 41 def get_h(f=f): @@ -168,14 +169,17 @@ return f() # a closure return h h = get_h() - raises(ValueError, "f.__code__ = h.__code__") + with raises(ValueError): + f.__code__ = h.__code__ @pytest.mark.skipif("config.option.runappdirect") def test_write_code_builtin_forbidden(self): def f(*args): return 42 - raises(TypeError, "dir.__code__ = f.__code__") - raises(TypeError, "list.append.__code__ = f.__code__") + with raises(TypeError): + dir.__code__ = f.__code__ + with raises(TypeError): + list.append.__code__ = f.__code__ def test_set_module_to_name_eagerly(self): skip("fails on PyPy but works on CPython. Unsure we want to care") @@ -313,19 +317,10 @@ def func(self, **kw): return self, kw func = A().func - - # don't want the extra argument passing of raises - try: + with raises(TypeError): func(self=23) - assert False - except TypeError: - pass - - try: + with raises(TypeError): func(**{'self': 23}) - assert False - except TypeError: - pass def test_kwargs_confusing_name(self): def func(self): # 'self' conflicts with the interp-level diff --git a/pypy/interpreter/test/test_nestedscope.py b/pypy/interpreter/test/test_nestedscope.py --- a/pypy/interpreter/test/test_nestedscope.py +++ b/pypy/interpreter/test/test_nestedscope.py @@ -99,7 +99,8 @@ x = 1 g = f() - raises(ValueError, "g.__closure__[0].cell_contents") + with raises(ValueError): + g.__closure__[0].cell_contents def test_compare_cells(self): def f(n): diff --git a/pypy/interpreter/test/test_pyframe.py b/pypy/interpreter/test/test_pyframe.py --- a/pypy/interpreter/test/test_pyframe.py +++ b/pypy/interpreter/test/test_pyframe.py @@ -62,7 +62,7 @@ jump_out_of_block_forwards.jump = (3, 5) jump_out_of_block_forwards.output = [2, 5] - #run_test(jump_out_of_block_forwards) + run_test(jump_out_of_block_forwards) def jump_out_of_block_backwards(output): output.append(1) diff --git a/pypy/interpreter/test/test_raise.py b/pypy/interpreter/test/test_raise.py --- a/pypy/interpreter/test/test_raise.py +++ b/pypy/interpreter/test/test_raise.py @@ -2,9 +2,8 @@ class AppTestRaise: def test_arg_as_string(self): - def f(): + with raises(TypeError): raise "test" - raises(TypeError, f) def test_control_flow(self): try: @@ -36,9 +35,8 @@ assert isinstance(e, IndexError) def test_raise_cls(self): - def f(): + with raises(IndexError): raise IndexError - raises(IndexError, f) def test_raise_cls_catch(self): def f(r): @@ -46,7 +44,8 @@ raise r except LookupError: return 1 - raises(Exception, f, Exception) + with raises(Exception): + f(Exception) assert f(IndexError) == 1 def test_raise_wrong(self): @@ -99,7 +98,7 @@ assert sys.exc_info() == (None, None, None) def test_reraise_1(self): - raises(IndexError, """ + with raises(IndexError): import sys try: raise ValueError @@ -109,10 +108,10 @@ finally: assert sys.exc_info()[0] is IndexError raise - """) + def test_reraise_2(self): - raises(IndexError, """ + with raises(IndexError): def foo(): import sys assert sys.exc_info()[0] is IndexError @@ -124,10 +123,10 @@ raise IndexError finally: foo() - """) + def test_reraise_3(self): - raises(IndexError, """ + with raises(IndexError): def spam(): import sys try: @@ -142,7 +141,6 @@ raise IndexError finally: spam() - """) def test_reraise_4(self): import sys @@ -156,7 +154,7 @@ assert ok def test_reraise_5(self): - raises(IndexError, """ + with raises(IndexError): import sys try: raise ValueError @@ -170,17 +168,16 @@ finally: assert sys.exc_info()[0] is IndexError assert sys.exc_info()[2].tb_next is some_traceback - """) def test_nested_reraise(self): - raises(TypeError, """ + with raises(TypeError): def nested_reraise(): raise try: raise TypeError("foo") except: nested_reraise() - """) + def test_with_reraise_1(self): class Context: @@ -196,7 +193,8 @@ with Context(): pass raise - raises(ValueError, "fn()") + with raises(ValueError): + fn() def test_with_reraise_2(self): @@ -213,23 +211,20 @@ with Context(): raise KeyError("caught") raise - raises(ValueError, "fn()") + with raises(ValueError): + fn() def test_userclass(self): # new-style classes can't be raised unless they inherit from # BaseException - class A(object): def __init__(self, x=None): self.x = x - - def f(): + + with raises(TypeError): raise A - raises(TypeError, f) - - def f(): + with raises(TypeError): raise A(42) - raises(TypeError, f) def test_userclass_catch(self): # classes can't be caught unless they inherit from BaseException @@ -259,7 +254,7 @@ def test_catch_tuple(self): class A(Exception): pass - + try: raise ValueError except (ValueError, A): @@ -307,7 +302,9 @@ class MyException(Exception): def __new__(cls, *args): return object() - raises(TypeError, "raise MyException") + + with raises(TypeError): + raise MyException def test_with_exit_True(self): class X: diff --git a/pypy/interpreter/test/test_syntax.py b/pypy/interpreter/test/test_syntax.py --- a/pypy/interpreter/test/test_syntax.py +++ b/pypy/interpreter/test/test_syntax.py @@ -344,9 +344,6 @@ class AppTestWith: def test_with_simple(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -360,78 +357,28 @@ acontext = Context() with acontext: pass - """ - ns = {} - exec(s, ns) - acontext = ns['acontext'] assert acontext.calls == '__enter__ __exit__'.split() def test_compound_with(self): - s = """class Context: - def __init__(self, var): - self.record = [] - self.var = var - def __enter__(self): - self.record.append(("__enter__", self.var)) - return self.var - def __exit__(self, tp, value, tb): - self.record.append(("__exit__", self.var)) -c1 = Context("blah") -c2 = Context("bling") -with c1 as v1, c2 as v2: - pass - """ - ns = {} - exec(s, ns) - assert ns["v1"] == "blah" - assert ns["v2"] == "bling" - assert ns["c1"].record == [("__enter__", "blah"), ("__exit__", "blah")] - assert ns["c2"].record == [("__enter__", "bling"), - ("__exit__", "bling")] - - - def test_start_with_blank_line(self): - s = """ -if 1: class Context: - def __init__(self): - self.calls = list() - + def __init__(self, var): + self.record = [] + self.var = var def __enter__(self): - self.calls.append('__enter__') - - def __exit__(self, exc_type, exc_value, exc_tb): - self.calls.append('__exit__') - - acontext = Context() - with acontext: + self.record.append(("__enter__", self.var)) + return self.var + def __exit__(self, tp, value, tb): + self.record.append(("__exit__", self.var)) + c1 = Context("blah") + c2 = Context("bling") + with c1 as v1, c2 as v2: pass -""" - ns = {} - exec(s, ns) - acontext = ns['acontext'] - assert acontext.calls == '__enter__ __exit__'.split() - - def test_raw_doc_string(self): - s = """r'doc' -class Context(object): - def __enter__(self): - global enter - enter = True - def __exit__(self, *exc): - global exit - exit = True -with Context() as w: - pass""" - ns = {} - exec(s, ns) - assert ns['enter'] - assert ns['exit'] + assert v1 == "blah" + assert v2 == "bling" + assert c1.record == [("__enter__", "blah"), ("__exit__", "blah")] + assert c2.record == [("__enter__", "bling"), ("__exit__", "bling")] def test_with_as_var(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -448,17 +395,10 @@ with acontextfact as avar: avar.append('__body__') pass - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] assert acontextfact.exit_params == (None, None, None) assert acontextfact.calls == '__enter__ __body__ __exit__'.split() def test_with_raise_exception(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -482,20 +422,12 @@ pass else: raise AssertionError('With did not raise RuntimeError') - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] - error = ns['error'] assert acontextfact.calls == '__enter__ __body__ __exit__'.split() assert acontextfact.exit_params[0:2] == (RuntimeError, error) import types assert isinstance(acontextfact.exit_params[2], types.TracebackType) def test_with_swallow_exception(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -515,11 +447,6 @@ avar.append('__body__') raise error avar.append('__after_raise__') - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] - error = ns['error'] assert acontextfact.calls == '__enter__ __body__ __exit__'.split() assert acontextfact.exit_params[0:2] == (RuntimeError, error) import types @@ -544,9 +471,6 @@ assert c.calls == ['exit'] def test_with_break(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -568,17 +492,10 @@ avar.append('__after_break__') else: raise AssertionError('Break failed with With, reached else clause') - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] assert acontextfact.calls == '__enter__ __body__ __exit__'.split() assert acontextfact.exit_params == (None, None, None) def test_with_continue(self): - - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -600,16 +517,10 @@ avar.append('__after_continue__') else: avar.append('__continue__') - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] assert acontextfact.calls == '__enter__ __body__ __exit__ __continue__'.split() assert acontextfact.exit_params == (None, None, None) def test_with_return(self): - s = """ -if 1: class Context: def __init__(self): self.calls = list() @@ -630,28 +541,16 @@ return '__return__' avar.append('__after_return__') acontextfact.calls.append(g(acontextfact)) - """ - ns = {} - exec(s, ns) - acontextfact = ns['acontextfact'] assert acontextfact.calls == '__enter__ __body__ __exit__ __return__'.split() assert acontextfact.exit_params == (None, None, None) def test_with_as_keyword(self): - try: + with raises(SyntaxError): exec("with = 9") - except SyntaxError: - pass - else: - assert False, 'Assignment to with did not raise SyntaxError' def test_with_as_keyword_compound(self): - try: + with raises(SyntaxError): exec("from __future__ import generators, with_statement\nwith = 9") - except SyntaxError: - pass - else: - assert False, 'Assignment to with did not raise SyntaxError' def test_missing_as_SyntaxError(self): snippets = [ @@ -662,21 +561,10 @@ pass """] for snippet in snippets: - try: + with raises(SyntaxError): exec(snippet) - except SyntaxError: - pass - else: - assert False, "%s: did not raise SyntaxError" % snippet - def test_with_propagate_compileflag(self): - s = """ -if 1: - compile('''with x: - pass''', '', 'exec') - """ - exec(s) class AppTestFunctionAnnotations: @@ -707,7 +595,6 @@ pass f1() """ - class AppTestSyntaxError: def test_tokenizer_error_location(self): @@ -752,7 +639,8 @@ # -*- coding: uft-8 -*- pass """ - raises(SyntaxError, exec, program) + with raises(SyntaxError): + exec(program) ''' def test_exception_target_in_nested_scope(self): @@ -798,24 +686,3 @@ raise AssertionError("should have raised") """ - -if __name__ == '__main__': - # only to check on top of CPython (you need 2.4) - from py.test import raises - for s in VALID: - try: - compile(s, '?', 'exec') - except Exception as e: - print '-'*20, 'FAILED TO COMPILE:', '-'*20 - print s - print '%s: %s' % (e.__class__, e) - print '-'*60 - for s in INVALID: - try: - raises(SyntaxError, compile, s, '?', 'exec') - except Exception as e: - print '-'*20, 'UNEXPECTEDLY COMPILED:', '-'*20 - print s - print '%s: %s' % (e.__class__, e) - print '-'*60 - diff --git a/pypy/interpreter/test/test_unicodehelper.py b/pypy/interpreter/test/test_unicodehelper.py --- a/pypy/interpreter/test/test_unicodehelper.py +++ b/pypy/interpreter/test/test_unicodehelper.py @@ -1,7 +1,7 @@ import pytest from pypy.interpreter.unicodehelper import ( - utf8_encode_utf_8, decode_utf8sp, + utf8_encode_utf_8, decode_utf8sp, ErrorHandlerError ) @@ -21,7 +21,11 @@ called with a start and stop position of the full surrogate pair (new behavior in python3.6) """ - u = u"\udc80\ud800\udfff" + # /--surrogate pair--\ + # \udc80 \ud800 \udfff + b = "\xed\xb2\x80\xed\xa0\x80\xed\xbf\xbf" + + calls = [] def errorhandler(errors, encoding, msg, s, start, end): """ @@ -32,31 +36,23 @@ 2. the second time, the characters will be 0xD800 and 0xDFFF, since that is a valid surrogate pair. """ - assert s[start:end] in [u'\udc80', u'\uD800\uDFFF'] - return '', end, 'b' + calls.append(s.decode("utf-8")[start:end]) + return 'abc', end, 'b' - utf8_encode_utf_8( - u, 'strict', + res = utf8_encode_utf_8( + b, 'strict', errorhandler=errorhandler, allow_surrogates=False ) + assert res == "abcabc" + assert calls == [u'\udc80', u'\uD800\uDFFF'] def test_bad_error_handler(): - u = u"\udc80\ud800\udfff" + b = u"\udc80\ud800\udfff".encode("utf-8") + def errorhandler(errors, encoding, msg, s, start, end): + return '', start, 'b' # returned index is too small - def errorhandler(errors, encoding, msg, s, start, end): - """ - This handler will be called twice, so asserting both times: - - 1. the first time, 0xDC80 will be handled as a single surrogate, - since it is a standalone character and an invalid surrogate. - 2. the second time, the characters will be 0xD800 and 0xDFFF, since - that is a valid surrogate pair. - """ - assert s[start:end] in [u'\udc80', u'\uD800\uDFFF'] - return '', start, 'b' - - assert pytest.raises(Exception, utf8_encode_utf_8, u, 'strict', + pytest.raises(ErrorHandlerError, utf8_encode_utf_8, b, 'strict', errorhandler=errorhandler, allow_surrogates=False) def test_decode_utf8sp(): diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -31,7 +31,7 @@ # Fast version of the "strict" errors handler. def raise_unicode_exception_encode(errors, encoding, msg, utf8, startingpos, endingpos): - u_len = rutf8.get_utf8_length(utf8) + u_len = rutf8.codepoints_in_utf8(utf8) raise OperationError(space.w_UnicodeEncodeError, space.newtuple([space.newtext(encoding), space.newutf8(utf8, u_len), @@ -120,12 +120,6 @@ return encode_object(space, w_data, encoding, errors) -def _has_surrogate(u): - for c in u: - if 0xD800 <= ord(c) <= 0xDFFF: - return True - return False - # These functions take and return unwrapped rpython strings def decode_unicode_escape(space, string): from pypy.module._codecs import interp_codecs @@ -221,23 +215,35 @@ size = len(s) if size == 0: return '' + + # two fast paths + if allow_surrogates: + # already valid utf-8 with surrogates, surrogates are allowed, so just + # return + return s + if not rutf8.has_surrogates(s): + # already valid utf-8 and doesn't contain surrogates, so we don't need + # to do anything + return s + # annoying slow path + return _utf8_encode_utf_8_deal_with_surrogates(s, errors, errorhandler) + +def _utf8_encode_utf_8_deal_with_surrogates(s, errors, errorhandler): pos = 0 upos = 0 + size = len(s) result = StringBuilder(size) while pos < size: try: - lgt = rutf8.check_utf8(s, allow_surrogates=allow_surrogates, start=pos) - if pos == 0: - # fast path - return s - for ch in s[pos:]: - result.append(ch) + rutf8.check_utf8(s, allow_surrogates=False, start=pos) + # otherwise the fast path above would have triggered + assert pos != 0 + result.append_slice(s, pos, len(s)) break except rutf8.CheckError as e: end = e.pos assert end >= 0 - for ch in s[pos:end]: - result.append(ch) + result.append_slice(s, pos, end) upos += rutf8.codepoints_in_utf8(s, start=pos, end=end) pos = end # Try to get collect surrogates in one pass @@ -254,11 +260,13 @@ res, newindex, rettype = errorhandler(errors, 'utf-8', 'surrogates not allowed', s, upos, upos + delta) if rettype == 'u': - for cp in rutf8.Utf8StringIterator(res): - result.append(chr(cp)) - else: - for ch in res: - result.append(ch) + try: + rutf8.check_ascii(res) + except rutf8.CheckError: + # this is a weird behaviour of CPython, but it's what happens + errorhandler("strict", 'utf-8', 'surrogates not allowed', s, upos, upos + delta) + assert 0, "unreachable" + result.append(res) if newindex <= upos: raise ErrorHandlerError(newindex, upos) upos = newindex diff --git a/pypy/module/__builtin__/compiling.py b/pypy/module/__builtin__/compiling.py --- a/pypy/module/__builtin__/compiling.py +++ b/pypy/module/__builtin__/compiling.py @@ -133,11 +133,11 @@ if not space.ismapping_w(w_namespace): if isclass: raise oefmt(space.w_TypeError, - "%N.__prepare__ must return a mapping, not %T", + "%N.__prepare__() must return a mapping, not %T", w_meta, w_namespace) else: raise oefmt(space.w_TypeError, - ".__prepare__ must return a mapping, not %T", + ".__prepare__() must return a mapping, not %T", w_namespace) code = w_func.getcode() diff --git a/pypy/module/__builtin__/test/apptest_compile.py b/pypy/module/__builtin__/test/apptest_compile.py --- a/pypy/module/__builtin__/test/apptest_compile.py +++ b/pypy/module/__builtin__/test/apptest_compile.py @@ -179,3 +179,20 @@ assert 'module_doc' not in marshalled assert 'func_doc' not in marshalled assert 'class_doc' not in marshalled + +def test_build_class(): + """Test error message bad __prepare__""" + + class BadMeta(type): + @classmethod + def __prepare__(*args): + return None + + def func(): + class Foo(metaclass=BadMeta): + pass + + excinfo = raises(TypeError, func) + assert str(excinfo.value) == ( + r"BadMeta.__prepare__() must return a mapping, not NoneType" + ) diff --git a/pypy/module/_cffi_backend/test/test_recompiler.py b/pypy/module/_cffi_backend/test/test_recompiler.py --- a/pypy/module/_cffi_backend/test/test_recompiler.py +++ b/pypy/module/_cffi_backend/test/test_recompiler.py @@ -75,8 +75,12 @@ args_w = [space.wrap(module_name), space.wrap(so_file)] w_res = space.appexec(args_w, """(modulename, filename): - import imp - mod = imp.load_dynamic(modulename, filename) + import _imp + class Spec: pass + spec = Spec() + spec.name = modulename + spec.origin = filename + mod = _imp.create_dynamic(spec) assert mod.__name__ == modulename return (mod.ffi, mod.lib) """) diff --git a/pypy/module/_codecs/interp_codecs.py b/pypy/module/_codecs/interp_codecs.py --- a/pypy/module/_codecs/interp_codecs.py +++ b/pypy/module/_codecs/interp_codecs.py @@ -715,6 +715,8 @@ @unwrap_spec(errors='text_or_none') def utf_8_encode(space, w_obj, errors="strict"): utf8, lgt = space.utf8_len_w(w_obj) + if lgt == len(utf8): # ascii + return space.newtuple([space.newbytes(utf8), space.newint(lgt)]) if errors is None: errors = 'strict' state = space.fromcache(CodecState) diff --git a/pypy/module/_codecs/test/test_codecs.py b/pypy/module/_codecs/test/test_codecs.py --- a/pypy/module/_codecs/test/test_codecs.py +++ b/pypy/module/_codecs/test/test_codecs.py @@ -1041,6 +1041,14 @@ # CPython raises OverflowError here raises((IndexError, OverflowError), b'apple\x92ham\x93spam'.decode, 'utf-8', errors) + def test_badhandler_returns_unicode(self): + import codecs + import sys + errors = 'test.badhandler_unicode' + codecs.register_error(errors, lambda x: (chr(100000), x.end)) + # CPython raises OverflowError here + raises(UnicodeEncodeError, u'\udc80\ud800\udfff'.encode, 'utf-8', errors) + def test_unicode_internal(self): import codecs import sys diff --git a/pypy/module/_io/interp_iobase.py b/pypy/module/_io/interp_iobase.py --- a/pypy/module/_io/interp_iobase.py +++ b/pypy/module/_io/interp_iobase.py @@ -56,7 +56,7 @@ # `__IOBase_closed` and call flush() by itself, but it is redundant # with whatever behaviour a non-trivial derived class will implement. self.space = space - self.w_dict = space.newdict() + self.w_dict = space.newdict(instance=True) self.__IOBase_closed = False if add_to_autoflusher: get_autoflusher(space).add(self) diff --git a/pypy/module/_io/interp_stringio.py b/pypy/module/_io/interp_stringio.py --- a/pypy/module/_io/interp_stringio.py +++ b/pypy/module/_io/interp_stringio.py @@ -1,4 +1,4 @@ -from rpython.rlib.rutf8 import get_utf8_length, next_codepoint_pos +from rpython.rlib.rutf8 import codepoints_in_utf8, next_codepoint_pos from pypy.interpreter.error import OperationError, oefmt from pypy.interpreter.typedef import ( @@ -98,7 +98,7 @@ return result def write(self, string): - length = get_utf8_length(string) + length = codepoints_in_utf8(string) if self.pos + length > len(self.data): self.resize(self.pos + length) pos = 0 @@ -173,7 +173,7 @@ if readnl is None: w_readnl = space.w_None else: - w_readnl = space.str(space.newutf8(readnl, get_utf8_length(readnl))) # YYY + w_readnl = space.str(space.newutf8(readnl, codepoints_in_utf8(readnl))) # YYY return space.newtuple([ w_initialval, w_readnl, space.newint(self.buf.pos), w_dict ]) @@ -239,7 +239,7 @@ w_decoded = space.call_method( w_decoded, "replace", space.newtext("\n"), - space.newutf8(writenl, get_utf8_length(writenl)), + space.newutf8(writenl, codepoints_in_utf8(writenl)), ) string = space.utf8_w(w_decoded) if string: @@ -251,7 +251,7 @@ self._check_closed(space) size = convert_size(space, w_size) v = self.buf.read(size) - lgt = get_utf8_length(v) + lgt = codepoints_in_utf8(v) return space.newutf8(v, lgt) def readline_w(self, space, w_limit=None): @@ -266,7 +266,7 @@ else: newline = self.readnl result = self.buf.readline(newline, limit) - resultlen = get_utf8_length(result) + resultlen = codepoints_in_utf8(result) return space.newutf8(result, resultlen) @@ -305,7 +305,7 @@ def getvalue_w(self, space): self._check_closed(space) v = self.buf.getvalue() - lgt = get_utf8_length(v) + lgt = codepoints_in_utf8(v) return space.newutf8(v, lgt) def readable_w(self, space): diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py --- a/pypy/module/_io/interp_textio.py +++ b/pypy/module/_io/interp_textio.py @@ -12,7 +12,7 @@ from rpython.rlib.rbigint import rbigint from rpython.rlib.rstring import StringBuilder from rpython.rlib.rutf8 import (check_utf8, next_codepoint_pos, - codepoints_in_utf8, get_utf8_length, + codepoints_in_utf8, codepoints_in_utf8, Utf8StringBuilder) @@ -308,13 +308,18 @@ class DecodeBuffer(object): - def __init__(self, text=None): + def __init__(self, text=None, ulen=-1): + # self.text is a valid utf-8 string + if text is not None: + assert ulen >= 0 self.text = text self.pos = 0 self.upos = 0 + self.ulen = ulen def set(self, space, w_decoded): check_decoded(space, w_decoded) + self.ulen = space.len_w(w_decoded) self.text = space.utf8_w(w_decoded) self.pos = 0 self.upos = 0 @@ -323,12 +328,14 @@ self.text = None self.pos = 0 self.upos = 0 + self.ulen = -1 def get_chars(self, size): + """ returns a tuple (utf8, lgt) """ if self.text is None or size == 0: - return "" + return "", 0 - lgt = codepoints_in_utf8(self.text) + lgt = self.ulen available = lgt - self.upos if size < 0 or size > available: size = available @@ -337,7 +344,7 @@ if self.pos > 0 or size < available: start = self.pos pos = start - for i in range(size): + for i in range(size): pos = next_codepoint_pos(self.text, pos) self.upos += 1 assert start >= 0 @@ -348,8 +355,9 @@ chars = self.text self.pos = len(self.text) self.upos = lgt + size = lgt - return chars + return chars, size def has_data(self): return (self.text is not None and not self.exhausted()) @@ -386,22 +394,22 @@ limit = sys.maxint scanned = 0 while scanned < limit: - try: - ch = self.next_char() - scanned += 1 - except StopIteration: + if self.exhausted(): return False + ch = self.text[self.pos] + self._advance_codepoint() + scanned += 1 if ch == '\n': return True if ch == '\r': if scanned >= limit: return False - try: - ch = self.peek_char() - except StopIteration: + if self.exhausted(): + # don't split potential \r\n return False + ch = self.text[self.pos] if ch == '\n': - self.next_char() + self._advance_codepoint() return True else: return True @@ -412,39 +420,66 @@ limit = sys.maxint scanned = 0 while scanned < limit: - try: - ch = self.next_char() - except StopIteration: + if self.exhausted(): return False + ch = self.text[self.pos] + self._advance_codepoint() scanned += 1 if ch == '\r': if scanned >= limit: return False - try: - if self.peek_char() == '\n': - self.next_char() - return True - except StopIteration: - # This is the tricky case: we found a \r right at the end + if self.exhausted(): + # This is the tricky case: we found a \r right at the end, + # un-consume it self.pos -= 1 self.upos -= 1 return False + if self.text[self.pos] == '\n': + self._advance_codepoint() + return True return False def find_char(self, marker, limit): + # only works for ascii markers! + assert 0 <= ord(marker) < 128 + # ascii fast path + if self.ulen == len(self.text): + end = len(self.text) + if limit >= 0: + end = min(end, self.pos + limit) + pos = self.pos + assert pos >= 0 + assert end >= 0 + pos = self.text.find(marker, pos, end) + if pos >= 0: + self.pos = self.upos = pos + 1 + return True + else: + self.pos = self.upos = end + return False + if limit < 0: From pypy.commits at gmail.com Mon Sep 16 11:54:15 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Mon, 16 Sep 2019 08:54:15 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Implemented write method for the Windows console io class. Message-ID: <5d7fb027.1c69fb81.6130.1d32@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97496:d88f85fb9795 Date: 2019-09-16 16:52 +0100 http://bitbucket.org/pypy/pypy/changeset/d88f85fb9795/ Log: Implemented write method for the Windows console io class. diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -119,8 +119,9 @@ lltype.free(peek_count, flavor='raw') def _pyio_get_console_type(space, w_path_or_fd): - fd = space.int_w(w_path_or_fd) - if fd >= 0: + + if space.isinstance_w(w_path_or_fd, space.w_int): + fd = space.int_w(w_path_or_fd) handle = rwin32.get_osfhandle(fd) if handle == rwin32.INVALID_HANDLE_VALUE: return '\0' @@ -519,17 +520,73 @@ bytes[rn], bytes_size - rn, rffi.NULL, rffi.NULL) if not bytes_size: + lltype.free(bytes, flavor='raw') err = rwin32.GetLastError_saved() raise WindowsError(err, "Failed to convert wide characters to multi byte string") bytes_size += rn + lltype.free(bytes, flavor='raw') w_bytes = space.charp2str(bytes) return space.newbytes(w_bytes) finally: - lltype.free(buf, flavor='raw') + lltype.free(buf, flavor='raw') + lltype.free(n, flavor='raw') + def write_w(self, space, w_data): + buffer = space.charbuf_w(w_data) + n = lltype.malloc(rwin32.LPDWORD.TO, 0, flavor='raw') + + if self.handle == rwin32.INVALID_HANDLE_VALUE: + return err_closed(space) + + if not self.writable: + return err_mode("writing") + + if not len(buffer): + return 0 + + if len(buffer) > BUFMAX: + buflen = BUFMAX + else: + buflen = len(buffer) + + wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, rffi.NULL, 0) + + while wlen > (32766 / rffi.sizeof(rffi.CWCHARP.TO)): + buflen /= 2 + wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, rffi.NULL, 0) + + if not wlen: + lltype.free(n, flavor='raw') + raise WindowsError("Failed to convert bytes to wide characters") + + with lltype.scoped_alloc(rffi.CWCHARP, wlen) as wbuf: + wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, wbuf, wlen) + if wlen: + res = rwin32.WriteConsoleW(self.handle, wbuf, wlen, n , rffi.NULL) + + if res and n < wlen: + buflen = rwin32.WideCharToMultiByte(rwin32.CP_UTF8, 0, wbuf, n, + rffi.NULL, 0, rffi.NULL, rffi.NULL) + + if buflen: + wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0, buffer, + buflen, rffi.NULL, 0) + assert len == wlen + + else: + res = 0 + + if not res: + err = rwin32.GetLastError_saved() + lltype.free(n, flavor='raw') + raise WindowsError(err, "Failed to convert multi byte string to wide characters") + + lltype.free(n, flavor='raw') + return space.newint(len) + def get_blksize(self,space): return space.newint(self.blksize) @@ -545,6 +602,6 @@ read = interp2app(W_WinConsoleIO.read_w), readall = interp2app(W_WinConsoleIO.readall_w), readinto = interp2app(W_WinConsoleIO.readinto_w), - + write = interp2app(W_WinConsoleIO.write_w), _blksize = GetSetProperty(W_WinConsoleIO.get_blksize), ) diff --git a/pypy/module/_io/moduledef.py b/pypy/module/_io/moduledef.py --- a/pypy/module/_io/moduledef.py +++ b/pypy/module/_io/moduledef.py @@ -23,7 +23,7 @@ 'BufferedRWPair': 'interp_bufferedio.W_BufferedRWPair', 'BufferedRandom': 'interp_bufferedio.W_BufferedRandom', 'TextIOWrapper': 'interp_textio.W_TextIOWrapper', - 'WindowsConsoleIO': 'interp_win32consoleio.W_WinConsoleIO', + '_WindowsConsoleIO': 'interp_win32consoleio.W_WinConsoleIO', 'open': 'interp_io.open', 'IncrementalNewlineDecoder': 'interp_textio.W_IncrementalNewlineDecoder', diff --git a/pypy/module/_io/test/test_win32consoleio.py b/pypy/module/_io/test/test_win32consoleio.py --- a/pypy/module/_io/test/test_win32consoleio.py +++ b/pypy/module/_io/test/test_win32consoleio.py @@ -9,4 +9,4 @@ def test_constructor(self): import _io - t = _io.WindowsConsoleIO(u"CONIN$") + t = _io._WindowsConsoleIO(u"CONIN$") diff --git a/rpython/rlib/rwin32.py b/rpython/rlib/rwin32.py --- a/rpython/rlib/rwin32.py +++ b/rpython/rlib/rwin32.py @@ -583,11 +583,21 @@ ERROR_INSUFFICIENT_BUFFER = 122 ERROR_OPERATION_ABORTED = 995 CP_UTF8 = 65001 + WideCharToMultiByte = winexternal( 'WideCharToMultiByte', [rffi.UINT, DWORD, rffi.CWCHARP, rffi.INT, LPSTR, rffi.INT, rffi.CCHARP, LPBOOL], rffi.INT, save_err=rffi.RFFI_SAVE_LASTERROR) + MultiByteToWideChar = winexternal( + 'MultiByteToWideChar', [rffi.UINT, DWORD, rffi.CCHARP, rffi.INT, + LPWSTR, rffi.INT], rffi.INT, + save_err=rffi.RFFI_SAVE_LASTERROR) + ReadConsoleW = winexternal( 'ReadConsoleW', [HANDLE, LPVOID, DWORD, LPDWORD, LPVOID], BOOL, save_err=rffi.RFFI_SAVE_LASTERROR) + + WriteConsoleW = winexternal( + 'WriteConsoleW', [HANDLE, LPVOID, DWORD, LPDWORD, LPVOID], BOOL, + save_err=rffi.RFFI_SAVE_LASTERROR) \ No newline at end of file From pypy.commits at gmail.com Mon Sep 16 13:26:43 2019 From: pypy.commits at gmail.com (mattip) Date: Mon, 16 Sep 2019 10:26:43 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: fix copy-paster Message-ID: <5d7fc5d3.1c69fb81.7c68.a381@mx.google.com> Author: Matti Picus Branch: winconsoleio Changeset: r97497:bf4120ce59b6 Date: 2019-09-16 20:25 +0300 http://bitbucket.org/pypy/pypy/changeset/bf4120ce59b6/ Log: fix copy-paster diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -164,7 +164,7 @@ lltype.free(pname_buf, flavor='raw') pname_buf = lltype.malloc(rffi.CWCHARP.TO, length, flavor='raw') if pname_buf: - length = win32traits.GetFullPathName(decoded_wstr, rwin32.MAX_PATH, pname_buf, w_str_nullptr) + length = win32traits.GetFullPathName(decoded_wstr, length, pname_buf, w_str_nullptr) else: length = 0 From pypy.commits at gmail.com Mon Sep 16 14:16:23 2019 From: pypy.commits at gmail.com (mattip) Date: Mon, 16 Sep 2019 11:16:23 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: rewrite in pure python. "decoded" is a ascii string AFAICT Message-ID: <5d7fd177.1c69fb81.64703.72f8@mx.google.com> Author: Matti Picus Branch: winconsoleio Changeset: r97498:56316fa56a96 Date: 2019-09-16 21:17 +0300 http://bitbucket.org/pypy/pypy/changeset/56316fa56a96/ Log: rewrite in pure python. "decoded" is a ascii string AFAICT diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -131,56 +131,29 @@ if not decoded: return '\0' - decoded_wstr = rffi.cast(rffi.CWCHARP, decoded) - if not decoded_wstr: - return '\0' - m = '\0' # In CPython the _wcsicmp function is used to perform case insensitive comparison - decoded.lower() - if not rwin32.wcsicmp(decoded_wstr, CONIN): + dlower = decoded.lower() + if dlower == 'CONIN$'.lower(): m = 'r' - elif not rwin32.wcsicmp(decoded_wstr, CONOUT): + elif dlower == 'CONOUT$'.lower(): m = 'w' - elif not rwin32.wcsicmp(decoded_wstr, CON): + elif dlower == 'CON'.lower(): m = 'x' - if m != '\0': return m - length = 0 - - pname_buf = lltype.malloc(rffi.CWCHARP.TO, rwin32.MAX_PATH, flavor='raw') - - uni_decoded_wstr = rffi.wcharp2unicode(decoded_wstr) - traits = _preferred_traits(uni_decoded_wstr) - win32traits = make_win32_traits(traits) - w_str_nullptr = lltype.nullptr(win32traits.LPSTRP.TO) - length = win32traits.GetFullPathName(decoded_wstr, rwin32.MAX_PATH, pname_buf, w_str_nullptr) - - if length > rwin32.MAX_PATH: - lltype.free(pname_buf, flavor='raw') - pname_buf = lltype.malloc(rffi.CWCHARP.TO, length, flavor='raw') - if pname_buf: - length = win32traits.GetFullPathName(decoded_wstr, length, pname_buf, w_str_nullptr) - else: - length = 0 - - if length: - if length >= 4 and pname_buf[3] == u'\\' and \ - (pname_buf[2] == u'.' or pname_buf[2] == u'?') and \ - pname_buf[1] == u'\\' and pname_buf[0] == u'\\': - name = rffi.ptradd(pname_buf, 4) - - if not rwin32.wcsicmp(name, CONIN): + if len(dlower) >=4: + if dlower[:4] == '\\\\.\\' or dlower[:4] == '\\\\?\\': + dlower = dlower[4:] + if dlower == 'CONIN$'.lower(): m = 'r' - elif not rwin32.wcsicmp(name, CONOUT): + elif dlower == 'CONOUT$'.lower(): m = 'w' - elif not rwin32.wcsicmp(name, CON): + elif dlower == 'CON'.lower(): m = 'x' - lltype.free(pname_buf, flavor='raw') return m From pypy.commits at gmail.com Mon Sep 16 14:38:49 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Mon, 16 Sep 2019 11:38:49 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Fixed issues Message-ID: <5d7fd6b9.1c69fb81.817f1.c998@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97499:01ae8b151011 Date: 2019-09-16 19:35 +0100 http://bitbucket.org/pypy/pypy/changeset/01ae8b151011/ Log: Fixed issues diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -157,14 +157,14 @@ uni_decoded_wstr = rffi.wcharp2unicode(decoded_wstr) traits = _preferred_traits(uni_decoded_wstr) win32traits = make_win32_traits(traits) - w_str_nullptr = lltype.nullptr(win32traits.LPSTRP.TO) - length = win32traits.GetFullPathName(decoded_wstr, rwin32.MAX_PATH, pname_buf, w_str_nullptr) + str_nullptr = lltype.nullptr(win32traits.LPSTRP.TO) + length = win32traits.GetFullPathName(decoded_wstr, rwin32.MAX_PATH, pname_buf, str_nullptr) if length > rwin32.MAX_PATH: lltype.free(pname_buf, flavor='raw') pname_buf = lltype.malloc(rffi.CWCHARP.TO, length, flavor='raw') if pname_buf: - length = win32traits.GetFullPathName(decoded_wstr, rwin32.MAX_PATH, pname_buf, w_str_nullptr) + length = win32traits.GetFullPathName(decoded_wstr, length, pname_buf, str_nullptr) else: length = 0 @@ -190,8 +190,8 @@ self.handle = rwin32.INVALID_HANDLE_VALUE self.fd = -1 self.created = 0 - self.readable = 0 - self.writable = 0 + self.readable = False + self.writable = False self.closehandle = 0 self.blksize = 0 @@ -217,18 +217,17 @@ @unwrap_spec(w_mode=WrappedDefault("r"), w_closefd=WrappedDefault(True), w_opener=WrappedDefault(None)) def descr_init(self, space, w_nameobj, w_mode, w_closefd, w_opener): - return None - #self.fd = -1 - #self.created = 0 name = None self.readable = False self.writable = False - #self.closehandle = 0; self.blksize = 0 rwa = False console_type = '\0' self.buf = lltype.malloc(rffi.CCHARPP.TO,SMALLBUF,flavor='raw') + if w_mode == None: + w_mode = space.newtext("r") + try: self.fd = space.int_w(w_nameobj) closefd = space.bool_w(w_closefd) @@ -262,7 +261,7 @@ raise oefmt(space.w_ValueError, "invalid mode: %s", space.text_w(w_mode)) rwa = True - self.writable = True; + self.writable = True if console_type == 'x': console_type = 'w' else: @@ -359,7 +358,7 @@ else: self.fd = rwin32.open_osfhandle(self.handle, rwin32._O_RDONLY | rwin32._O_BINARY) if self.fd < 0: - return err_mode("fileno") + return err_mode(space, "fileno") return space.newint(self.fd) def readinto_w(self, space, w_buffer): @@ -442,7 +441,7 @@ if self.handle == rwin32.INVALID_HANDLE_VALUE: err_closed(space) if not self.readable: - return err_mode("reading") + return err_mode(space,"reading") if size < 0: return self.readall_w(space) @@ -542,7 +541,7 @@ return err_closed(space) if not self.writable: - return err_mode("writing") + return err_mode(space,"writing") if not len(buffer): return 0 From pypy.commits at gmail.com Mon Sep 16 14:38:50 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Mon, 16 Sep 2019 11:38:50 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Merge Message-ID: <5d7fd6ba.1c69fb81.2dd99.eb41@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97500:0e928fe22992 Date: 2019-09-16 19:37 +0100 http://bitbucket.org/pypy/pypy/changeset/0e928fe22992/ Log: Merge From pypy.commits at gmail.com Mon Sep 16 15:03:46 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Mon, 16 Sep 2019 12:03:46 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Merged discarded changes back in. Message-ID: <5d7fdc92.1c69fb81.95939.e1e3@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97501:dfec1e76b2be Date: 2019-09-16 20:02 +0100 http://bitbucket.org/pypy/pypy/changeset/dfec1e76b2be/ Log: Merged discarded changes back in. diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -136,14 +136,14 @@ return '\0' m = '\0' - + # In CPython the _wcsicmp function is used to perform case insensitive comparison - decoded.lower() - if not rwin32.wcsicmp(decoded_wstr, CONIN): + dlower = decoded.lower() + if dlower == 'CONIN$'.lower(): m = 'r' - elif not rwin32.wcsicmp(decoded_wstr, CONOUT): + elif dlower == 'CONOUT$'.lower(): m = 'w' - elif not rwin32.wcsicmp(decoded_wstr, CON): + elif dlower == 'CON'.lower(): m = 'x' @@ -168,17 +168,15 @@ else: length = 0 - if length: - if length >= 4 and pname_buf[3] == u'\\' and \ - (pname_buf[2] == u'.' or pname_buf[2] == u'?') and \ - pname_buf[1] == u'\\' and pname_buf[0] == u'\\': - name = rffi.ptradd(pname_buf, 4) - - if not rwin32.wcsicmp(name, CONIN): + dlower = space.wcharp2unicode(pname_buf).lower() + if len(dlower) >=4: + if dlower[:4] == u'\\\\.\\' or dlower[:4] == u'\\\\?\\': + dlower = dlower[4:] + if dlower == u'CONIN$'.lower(): m = 'r' - elif not rwin32.wcsicmp(name, CONOUT): + elif dlower == u'CONOUT$'.lower(): m = 'w' - elif not rwin32.wcsicmp(name, CON): + elif dlower == u'CON'.lower(): m = 'x' lltype.free(pname_buf, flavor='raw') return m From pypy.commits at gmail.com Mon Sep 16 16:58:04 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 16 Sep 2019 13:58:04 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: un-mess argument handling and test of select.poll().poll(): previously the test Message-ID: <5d7ff75c.1c69fb81.15b09.0d88@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97502:f41451c91702 Date: 2019-09-16 19:23 +0200 http://bitbucket.org/pypy/pypy/changeset/f41451c91702/ Log: un-mess argument handling and test of select.poll().poll(): previously the test was passing completely by accident, since the argument A() was interpreted as a timeout, not a fileno! Now we also support negative timeouts, which means block. also, add docstrings. diff --git a/pypy/module/select/interp_select.py b/pypy/module/select/interp_select.py --- a/pypy/module/select/interp_select.py +++ b/pypy/module/select/interp_select.py @@ -30,11 +30,23 @@ @unwrap_spec(events="c_ushort") def register(self, space, w_fd, events=defaultevents): + """ + Register a file descriptor with the polling object. + fd -- either an integer, or an object with a fileno() method returning an + int. + events -- an optional bitmask describing the type of events to check for + """ fd = space.c_filedescriptor_w(w_fd) self.fddict[fd] = events @unwrap_spec(events="c_ushort") def modify(self, space, w_fd, events): + """ + Modify an already registered file descriptor. + fd -- either an integer, or an object with a fileno() method returning an + int. + events -- an optional bitmask describing the type of events to check for + """ fd = space.c_filedescriptor_w(w_fd) if fd not in self.fddict: raise wrap_oserror(space, OSError(errno.ENOENT, "poll.modify"), @@ -42,6 +54,9 @@ self.fddict[fd] = events def unregister(self, space, w_fd): + """ + Remove a file descriptor being tracked by the polling object. + """ fd = space.c_filedescriptor_w(w_fd) try: del self.fddict[fd] @@ -50,21 +65,24 @@ @unwrap_spec(w_timeout=WrappedDefault(None)) def poll(self, space, w_timeout): - """WARNING: the timeout parameter is in **milliseconds**!""" + """ + Polls the set of registered file descriptors, returning a list containing + any descriptors that have events or errors to report. + + the timeout parameter is in milliseconds""" if space.is_w(w_timeout, space.w_None): timeout = -1 end_time = 0 + elif space.isinstance_w(w_timeout, space.w_float) or space.isinstance_w(w_timeout, space.w_int): + if space.is_true(space.lt(w_timeout, space.newint(0))): + timeout = -1 + end_time = 0 + else: + timeout = space.c_int_w(space.int(w_timeout)) + end_time = timeutils.monotonic(space) + timeout * 0.001 else: - # we want to be compatible with cpython and also accept things - # that can be casted to integer (I think) - try: - # compute the integer - w_timeout = space.int(w_timeout) - except OperationError: - raise oefmt(space.w_TypeError, - "timeout must be an integer or None") - timeout = space.c_int_w(w_timeout) - end_time = timeutils.monotonic(space) + timeout * 0.001 + raise oefmt(space.w_TypeError, + "timeout must be an integer or None") if self.running: raise oefmt(space.w_RuntimeError, "concurrent poll() invocation") diff --git a/pypy/module/select/test/test_select.py b/pypy/module/select/test/test_select.py --- a/pypy/module/select/test/test_select.py +++ b/pypy/module/select/test/test_select.py @@ -217,9 +217,25 @@ readend, writeend = self.getpair() try: class A(object): - def __int__(self): + def fileno(self): return readend.fileno() - select.poll().poll(A()) # assert did not crash + poll = select.poll() + poll.register(A()) + + res = poll.poll(10) # timeout in ms + assert res == [] + res = poll.poll(1.1) # check floats + assert res == [] + + writeend.send(b"foo!") + # can't easily test actual blocking, is done in lib-python tests + res = poll.poll() + assert res == [(readend.fileno(), 1)] + + # check negative timeout + # proper test in lib-python, test_poll_blocks_with_negative_ms + res = poll.poll(-0.001) + assert res == [(readend.fileno(), 1)] finally: readend.close() writeend.close() @@ -238,7 +254,6 @@ pollster.register(0, 65535) # USHRT_MAX raises(OverflowError, pollster.register, 0, 65536) # USHRT_MAX + 1 raises(OverflowError, pollster.poll, 2147483648) # INT_MAX + 1 - raises(OverflowError, pollster.poll, -2147483648 - 1) raises(OverflowError, pollster.poll, 4294967296) # UINT_MAX + 1 exc = raises(TypeError, pollster.poll, '123') assert str(exc.value) == 'timeout must be an integer or None' From pypy.commits at gmail.com Mon Sep 16 16:58:06 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 16 Sep 2019 13:58:06 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: update docstrings Message-ID: <5d7ff75e.1c69fb81.7d660.04e2@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97503:7e303c8f90af Date: 2019-09-16 22:57 +0200 http://bitbucket.org/pypy/pypy/changeset/7e303c8f90af/ Log: update docstrings diff --git a/pypy/module/__builtin__/functional.py b/pypy/module/__builtin__/functional.py --- a/pypy/module/__builtin__/functional.py +++ b/pypy/module/__builtin__/functional.py @@ -203,19 +203,26 @@ implementation_of) def max(space, __args__): - """max(iterable[, key=func]) -> value - max(a, b, c, ...[, key=func]) -> value + """ + max(iterable, *[, default=obj, key=func]) -> value + max(arg1, arg2, *args, *[, key=func]) -> value - With a single iterable argument, return its largest item. + With a single iterable argument, return its biggest item. The + default keyword-only argument specifies an object to return if + the provided iterable is empty. With two or more arguments, return the largest argument. """ return min_max(space, __args__, "max") def min(space, __args__): - """min(iterable[, key=func]) -> value - min(a, b, c, ...[, key=func]) -> value + """ + min(...) + min(iterable, *[, default=obj, key=func]) -> value + min(arg1, arg2, *args, *[, key=func]) -> value - With a single iterable argument, return its smallest item. + With a single iterable argument, return its smallest item. The + default keyword-only argument specifies an object to return if + the provided iterable is empty. With two or more arguments, return the smallest argument. """ return min_max(space, __args__, "min") From pypy.commits at gmail.com Mon Sep 16 21:31:38 2019 From: pypy.commits at gmail.com (Yannick_Jadoul) Date: Mon, 16 Sep 2019 18:31:38 -0700 (PDT) Subject: [pypy-commit] pypy py3.7: Making sure __class_getitem__ is a classmethod, even when not annotated with @classmethod Message-ID: <5d80377a.1c69fb81.fcf4b.48cf@mx.google.com> Author: Yannick Jadoul Branch: py3.7 Changeset: r97504:5972be85ad6d Date: 2019-09-08 22:45 +0200 http://bitbucket.org/pypy/pypy/changeset/5972be85ad6d/ Log: Making sure __class_getitem__ is a classmethod, even when not annotated with @classmethod diff --git a/pypy/objspace/std/test/test_typeobject.py b/pypy/objspace/std/test/test_typeobject.py --- a/pypy/objspace/std/test/test_typeobject.py +++ b/pypy/objspace/std/test/test_typeobject.py @@ -1412,7 +1412,7 @@ def __getitem__(self, index): return index + 1 def __class_getitem__(cls, item): - return "{}[{}]".format(cls.__name__, item.__name__) + return super().__class_getitem__(item) assert WithoutMetaclass()[0] == 1 assert WithoutMetaclass[int] == "WithoutMetaclass[int]" @@ -1427,7 +1427,7 @@ def __getitem__(self, index): return index + 1 def __class_getitem__(cls, item): - return "{}[{}]".format(cls.__name__, item.__name__) + return super().__class_getitem__(item) assert WithMetaclass()[0] == 1 assert WithMetaclass[int] == "Metaclass[int]" diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py --- a/pypy/objspace/std/typeobject.py +++ b/pypy/objspace/std/typeobject.py @@ -1380,7 +1380,7 @@ w_self.mro_w = [] # temporarily w_self.hasmro = False compute_mro(w_self) - ensure_classmethod_init_subclass(w_self) + ensure_classmethods(w_self, ['__init_subclass__', '__class_getitem__']) def ensure_static_new(w_self): # special-case __new__, as in CPython: @@ -1390,11 +1390,12 @@ if isinstance(w_new, Function): w_self.dict_w['__new__'] = StaticMethod(w_new) -def ensure_classmethod_init_subclass(w_self): - if '__init_subclass__' in w_self.dict_w: - w_init_subclass = w_self.dict_w['__init_subclass__'] - if isinstance(w_init_subclass, Function): - w_self.dict_w['__init_subclass__'] = ClassMethod(w_init_subclass) +def ensure_classmethods(w_self, method_names): + for method_name in method_names: + if method_name in w_self.dict_w: + w_method = w_self.dict_w[method_name] + if isinstance(w_method, Function): + w_self.dict_w[method_name] = ClassMethod(w_method) def ensure_module_attr(w_self): # initialize __module__ in the dict (user-defined types only) From pypy.commits at gmail.com Tue Sep 17 03:46:56 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 17 Sep 2019 00:46:56 -0700 (PDT) Subject: [pypy-commit] pypy default: test, fix CDLL(None) on win32 should raise TypeError Message-ID: <5d808f70.1c69fb81.ee105.7464@mx.google.com> Author: Matti Picus Branch: Changeset: r97505:5605eba9586b Date: 2019-09-17 10:04 +0300 http://bitbucket.org/pypy/pypy/changeset/5605eba9586b/ Log: test, fix CDLL(None) on win32 should raise TypeError diff --git a/pypy/module/_rawffi/interp_rawffi.py b/pypy/module/_rawffi/interp_rawffi.py --- a/pypy/module/_rawffi/interp_rawffi.py +++ b/pypy/module/_rawffi/interp_rawffi.py @@ -239,7 +239,11 @@ except OSError as e: raise wrap_oserror(space, e) - at unwrap_spec(name='fsencode_or_none') +if _MS_WINDOWS: + name_spec = 'fsencode' +else: + name_spec = 'fsencode_or_none' + at unwrap_spec(name=name_spec) def descr_new_cdll(space, w_type, name): cdll = open_cdll(space, name) return W_CDLL(space, name, cdll) diff --git a/pypy/module/_rawffi/test/test__rawffi.py b/pypy/module/_rawffi/test/test__rawffi.py --- a/pypy/module/_rawffi/test/test__rawffi.py +++ b/pypy/module/_rawffi/test/test__rawffi.py @@ -262,14 +262,17 @@ raise AssertionError("did not fail??") def test_libload_None(self): - if self.iswin32: - skip("unix specific") import _rawffi # this should return *all* loaded libs, dlopen(NULL) - dll = _rawffi.CDLL(None) - func = dll.ptr('rand', [], 'i') - res = func() - assert res[0] != 0 + try: + dll = _rawffi.CDLL(None) + except TypeError: + if not self.iswin32: + raise + else: + func = dll.ptr('rand', [], 'i') + res = func() + assert res[0] != 0 def test_libc_load(self): import _rawffi From pypy.commits at gmail.com Tue Sep 17 05:29:01 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 17 Sep 2019 02:29:01 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: somewhat messy code to be able to give the function name in TypeErrors produced Message-ID: <5d80a75d.1c69fb81.7d660.7bdf@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97506:535b4f6bdd4d Date: 2019-09-17 11:27 +0200 http://bitbucket.org/pypy/pypy/changeset/535b4f6bdd4d/ Log: somewhat messy code to be able to give the function name in TypeErrors produced by argument parsing more consistently. There is still a case where we can't do that, CPython cheats there peeking around in the stack in the BUILD_MAP_UNPACK_WITH_CALL bytecode, but that's a huge mess. diff --git a/pypy/interpreter/argument.py b/pypy/interpreter/argument.py --- a/pypy/interpreter/argument.py +++ b/pypy/interpreter/argument.py @@ -2,13 +2,20 @@ Arguments objects. """ from rpython.rlib.debug import make_sure_not_resized -from rpython.rlib.objectmodel import not_rpython +from rpython.rlib.objectmodel import not_rpython, specialize from rpython.rlib import jit from rpython.rlib.objectmodel import enforceargs from rpython.rlib.rstring import StringBuilder from pypy.interpreter.error import OperationError, oefmt + at specialize.arg(1) +def raise_type_error(space, fnname_parens, msg, *args): + if fnname_parens is None: + raise oefmt(space.w_TypeError, msg, *args) + msg = "%s " + msg + raise oefmt(space.w_TypeError, msg, fnname_parens, *args) + class Arguments(object): """ @@ -21,11 +28,9 @@ semantics are complex, but calls occur everywhere. """ - ### Construction ### - #@enforceargs(keywords=[unicode]) def __init__(self, space, args_w, keywords=None, keywords_w=None, w_stararg=None, w_starstararg=None, keyword_names_w=None, - methodcall=False): + methodcall=False, fnname_parens=None): self.space = space assert isinstance(args_w, list) self.arguments_w = args_w @@ -41,7 +46,7 @@ make_sure_not_resized(self.keywords_w) make_sure_not_resized(self.arguments_w) - self._combine_wrapped(w_stararg, w_starstararg) + self._combine_wrapped(w_stararg, w_starstararg, fnname_parens) # a flag that specifies whether the JIT can unroll loops that operate # on the keywords self._jit_few_keywords = self.keywords is None or jit.isconstant(len(self.keywords)) @@ -79,14 +84,14 @@ "Return a new Arguments with a new argument inserted first." return self.replace_arguments([w_firstarg] + self.arguments_w) - def _combine_wrapped(self, w_stararg, w_starstararg): + def _combine_wrapped(self, w_stararg, w_starstararg, fnname_parens=None): "unpack the *arg and **kwd into arguments_w and keywords_w" if w_stararg is not None: - self._combine_starargs_wrapped(w_stararg) + self._combine_starargs_wrapped(w_stararg, fnname_parens) if w_starstararg is not None: - self._combine_starstarargs_wrapped(w_starstararg) + self._combine_starstarargs_wrapped(w_starstararg, fnname_parens) - def _combine_starargs_wrapped(self, w_stararg): + def _combine_starargs_wrapped(self, w_stararg, fnname_parens=None): # unpack the * arguments space = self.space try: @@ -94,13 +99,13 @@ except OperationError as e: if (e.match(space, space.w_TypeError) and not space.is_iterable(w_stararg)): - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "argument after * must be an iterable, not %T", w_stararg) raise self.arguments_w = self.arguments_w + args_w - def _combine_starstarargs_wrapped(self, w_starstararg): + def _combine_starstarargs_wrapped(self, w_starstararg, fnname_parens=None): # unpack the ** arguments space = self.space keywords, values_w = space.view_as_kwargs(w_starstararg) @@ -110,7 +115,8 @@ self.keywords_w = values_w else: _check_not_duplicate_kwargs( - self.space, self.keywords, keywords, values_w) + self.space, self.keywords, keywords, values_w, + fnname_parens) self.keywords = self.keywords + keywords self.keywords_w = self.keywords_w + values_w return @@ -123,7 +129,7 @@ w_keys = space.call_method(w_starstararg, "keys") except OperationError as e: if e.match(space, space.w_AttributeError): - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "argument after ** must be a mapping, not %T", w_starstararg) raise @@ -132,7 +138,7 @@ keywords = [None] * len(keys_w) _do_combine_starstarargs_wrapped( space, keys_w, w_starstararg, keywords, keywords_w, self.keywords, - is_dict) + is_dict, fnname_parens) self.keyword_names_w = keys_w if self.keywords is None: self.keywords = keywords @@ -349,8 +355,8 @@ def parse_obj(self, w_firstarg, fnname, signature, defaults_w=None, w_kw_defs=None, blindargs=0): - """Parse args and kwargs to initialize a frame - according to the signature of code object. + """Parse args and kwargs into a list according to the signature of a + code object. """ try: return self._parse(w_firstarg, signature, defaults_w, w_kw_defs, @@ -387,28 +393,28 @@ # look at. They should not get a self arguments, which makes the amount of # arguments annoying :-( - at jit.look_inside_iff(lambda space, existingkeywords, keywords, keywords_w: + at jit.look_inside_iff(lambda space, existingkeywords, keywords, keywords_w, fnname_parens: jit.isconstant(len(keywords) and jit.isconstant(existingkeywords))) -def _check_not_duplicate_kwargs(space, existingkeywords, keywords, keywords_w): +def _check_not_duplicate_kwargs(space, existingkeywords, keywords, keywords_w, fnname_parens): # looks quadratic, but the JIT should remove all of it nicely. # Also, all the lists should be small for key in keywords: for otherkey in existingkeywords: if otherkey == key: - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "got multiple values for keyword argument '%s'", key) def _do_combine_starstarargs_wrapped(space, keys_w, w_starstararg, keywords, - keywords_w, existingkeywords, is_dict): + keywords_w, existingkeywords, is_dict, fnname_parens): i = 0 for w_key in keys_w: try: key = space.text_w(w_key) except OperationError as e: if e.match(space, space.w_TypeError): - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "keywords must be strings, not '%T'", w_key) if e.match(space, space.w_UnicodeEncodeError): @@ -418,7 +424,7 @@ raise else: if existingkeywords and key in existingkeywords: - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "got multiple values for keyword argument '%s'", key) keywords[i] = key diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py --- a/pypy/interpreter/baseobjspace.py +++ b/pypy/interpreter/baseobjspace.py @@ -1180,7 +1180,7 @@ if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). - args = frame.make_arguments(nargs) + args = frame.make_arguments(nargs, w_function=w_func) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: @@ -1197,7 +1197,7 @@ nargs, frame, methodcall=methodcall) # end of hack for performance - args = frame.make_arguments(nargs) + args = frame.make_arguments(nargs, w_function=w_func) return self.call_args(w_func, args) def call_args_and_c_profile(self, frame, w_func, args): diff --git a/pypy/interpreter/function.py b/pypy/interpreter/function.py --- a/pypy/interpreter/function.py +++ b/pypy/interpreter/function.py @@ -172,10 +172,10 @@ elif fast_natural_arity == Code.PASSTHROUGHARGS1 and nargs >= 1: assert isinstance(code, gateway.BuiltinCodePassThroughArguments1) w_obj = frame.peekvalue(nargs-1) - args = frame.make_arguments(nargs-1) + args = frame.make_arguments(nargs-1, w_function=self) return code.funcrun_obj(self, w_obj, args) - args = frame.make_arguments(nargs, methodcall=methodcall) + args = frame.make_arguments(nargs, methodcall=methodcall, w_function=self) return self.call_args(args) @jit.unroll_safe diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py --- a/pypy/interpreter/pyframe.py +++ b/pypy/interpreter/pyframe.py @@ -490,14 +490,32 @@ depth -= 1 self.valuestackdepth = finaldepth - def make_arguments(self, nargs, methodcall=False): + def _guess_function_name_parens(self, fnname=None, w_function=None): + """ Returns 'funcname()' from either a function name fnname or a + wrapped callable w_function. If it's not a function or a method, returns + 'Classname object'""" + # CPython has a similar function, PyEval_GetFuncName + from pypy.interpreter.function import Function, Method + if fnname is not None: + return fnname + '()' + if w_function is None: + return None + if isinstance(w_function, Function): + return w_function.name + '()' + if isinstance(w_function, Method): + return self._guess_function_name_parens(None, w_function.w_function) + return w_function.getname(self.space) + ' object' + + def make_arguments(self, nargs, methodcall=False, w_function=None, fnname=None): + fnname_parens = self._guess_function_name_parens(fnname, w_function) return Arguments( - self.space, self.peekvalues(nargs), methodcall=methodcall) + self.space, self.peekvalues(nargs), methodcall=methodcall, fnname_parens=fnname_parens) - def argument_factory(self, arguments, keywords, keywords_w, w_star, w_starstar, methodcall=False): + def argument_factory(self, arguments, keywords, keywords_w, w_star, w_starstar, methodcall=False, w_function=None, fnname=None): + fnname_parens = self._guess_function_name_parens(fnname, w_function) return Arguments( self.space, arguments, keywords, keywords_w, w_star, - w_starstar, methodcall=methodcall) + w_starstar, methodcall=methodcall, fnname_parens=fnname_parens) def hide(self): return self.pycode.hidden_applevel diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py --- a/pypy/interpreter/pyopcode.py +++ b/pypy/interpreter/pyopcode.py @@ -1307,9 +1307,9 @@ else: w_star = None arguments = self.popvalues(n_arguments) + w_function = self.popvalue() args = self.argument_factory(arguments, keywords, keywords_w, w_star, - w_starstar) - w_function = self.popvalue() + w_starstar, w_function=w_function) if self.get_is_being_profiled() and function.is_builtin_code(w_function): w_result = self.space.call_args_and_c_profile(self, w_function, args) diff --git a/pypy/interpreter/test/test_argument.py b/pypy/interpreter/test/test_argument.py --- a/pypy/interpreter/test/test_argument.py +++ b/pypy/interpreter/test/test_argument.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import py +import pytest from pypy.interpreter.argument import (Arguments, ArgErr, ArgErrUnknownKwds, ArgErrMultipleValues, ArgErrMissing, ArgErrTooMany, ArgErrTooManyMethod) from pypy.interpreter.signature import Signature @@ -138,6 +139,7 @@ class Type: def getname(self, space): return type(obj).__name__ + name = type(obj).__name__ return Type() @@ -332,15 +334,17 @@ def test_duplicate_kwds(self): space = DummySpace() - excinfo = py.test.raises(OperationError, Arguments, space, [], ["a"], - [1], w_starstararg={"a": 2}) + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg={"a": 2}, fnname_parens="foo()") assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "foo() got multiple values for keyword argument 'a'" def test_starstararg_wrong_type(self): space = DummySpace() - excinfo = py.test.raises(OperationError, Arguments, space, [], ["a"], - [1], w_starstararg="hello") + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg="hello", fnname_parens="bar()") assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "bar() argument after ** must be a mapping, not str" def test_unwrap_error(self): space = DummySpace() @@ -353,12 +357,12 @@ return bytes(w, 'utf-8') space.utf8_w = utf8_w space.text_w = utf8_w - excinfo = py.test.raises(OperationError, Arguments, space, [], - ["a"], [1], w_starstararg={None: 1}) + with py.test.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg={None: 1}, fnname_parens="f1()") assert excinfo.value.w_type is TypeError assert excinfo.value._w_value is None - excinfo = py.test.raises(OperationError, Arguments, space, [], - ["a"], [1], w_starstararg={valuedummy: 1}) + with py.test.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg={valuedummy: 1}, fnname_parens="f2()") assert excinfo.value.w_type is ValueError assert excinfo.value._w_value is None @@ -435,9 +439,9 @@ raise FakeArgErr() args._match_signature = _match_signature - - excinfo = py.test.raises(OperationError, args.parse_obj, "obj", "foo", - Signature(["a", "b"], None, None)) + with pytest.raises(OperationError) as excinfo: + args.parse_obj("obj", "foo", + Signature(["a", "b"], None, None)) assert excinfo.value.w_type is TypeError assert excinfo.value.get_w_value(space) == "foo() msg" @@ -491,9 +495,9 @@ args._match_signature = _match_signature - excinfo = py.test.raises(OperationError, args.parse_into_scope, - "obj", [None, None], "foo", - Signature(["a", "b"], None, None)) + with pytest.raises(OperationError) as excinfo: + args.parse_into_scope("obj", [None, None], "foo", + Signature(["a", "b"], None, None)) assert excinfo.value.w_type is TypeError assert excinfo.value.get_w_value(space) == "foo() msg" @@ -568,9 +572,17 @@ l = [None, None, None] args._match_signature(None, l, Signature(["a", "b"], None, "**")) assert l == [1, 2, {'c': 3}] - excinfo = py.test.raises(OperationError, Arguments, space, [], ["a"], - [1], w_starstararg=kwargs(["a"], [2])) + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], + [1], w_starstararg=kwargs(["a"], [2])) assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "got multiple values for keyword argument 'a'" + + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], + [1], w_starstararg=kwargs(["a"], [2]), fnname_parens="foo()") + assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "foo() got multiple values for keyword argument 'a'" @@ -671,20 +683,14 @@ def test_bad_type_for_star(self): space = self.space - try: - Arguments(space, [], w_stararg=space.wrap(42)) - except OperationError as e: - msg = space.text_w(space.str(e.get_w_value(space))) - assert msg == "argument after * must be an iterable, not int" - else: - assert 0, "did not raise" - try: - Arguments(space, [], w_starstararg=space.wrap(42)) - except OperationError as e: - msg = space.text_w(space.str(e.get_w_value(space))) - assert msg == "argument after ** must be a mapping, not int" - else: - assert 0, "did not raise" + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], w_stararg=space.wrap(42), fnname_parens="f1()") + msg = space.text_w(excinfo.value.get_w_value(space)) + assert msg == "f1() argument after * must be an iterable, not int" + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], w_starstararg=space.wrap(42), fnname_parens="f2()") + msg = space.text_w(excinfo.value.get_w_value(space)) + assert msg == "f2() argument after ** must be a mapping, not int" def test_dont_count_default_arguments(self): space = self.space @@ -889,7 +895,7 @@ pass e = raises(TypeError, "f(*42)") assert str(e.value).endswith( - "argument after * must be an iterable, not int") + "f() argument after * must be an iterable, not int") e = raises(TypeError, "f(*X())") assert str(e.value) == "myerror" @@ -904,8 +910,10 @@ def f(x, y): pass e = raises(TypeError, "f(y=2, **{3: 5}, x=6)") - assert "keywords must be strings" in str(e.value) + assert "f() keywords must be strings" in str(e.value) e = raises(TypeError, "f(y=2, **{'x': 5}, x=6)") + # CPython figures out the name here, by peeking around in the stack in + # BUILD_MAP_UNPACK_WITH_CALL. we don't, too messy assert "got multiple values for keyword argument 'x'" in str(e.value) def test_dict_subclass_with_weird_getitem(self): diff --git a/pypy/objspace/std/callmethod.py b/pypy/objspace/std/callmethod.py --- a/pypy/objspace/std/callmethod.py +++ b/pypy/objspace/std/callmethod.py @@ -111,12 +111,12 @@ keywords_w[n_kwargs] = w_value arguments = f.popvalues(n) # includes w_self if it is not None - args = f.argument_factory( - arguments, keywords, keywords_w, None, None, - methodcall=w_self is not None) if w_self is None: f.popvalue_maybe_none() # removes w_self, which is None w_callable = f.popvalue() + args = f.argument_factory( + arguments, keywords, keywords_w, None, None, + methodcall=w_self is not None, w_function=w_callable) if f.get_is_being_profiled() and function.is_builtin_code(w_callable): w_result = f.space.call_args_and_c_profile(f, w_callable, args) else: From pypy.commits at gmail.com Tue Sep 17 05:43:07 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 17 Sep 2019 02:43:07 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix test_functools (!) Message-ID: <5d80aaab.1c69fb81.67486.85f8@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97507:b636aa7e226b Date: 2019-09-17 11:42 +0200 http://bitbucket.org/pypy/pypy/changeset/b636aa7e226b/ Log: fix test_functools (!) diff --git a/pypy/module/__builtin__/functional.py b/pypy/module/__builtin__/functional.py --- a/pypy/module/__builtin__/functional.py +++ b/pypy/module/__builtin__/functional.py @@ -203,27 +203,24 @@ implementation_of) def max(space, __args__): - """ - max(iterable, *[, default=obj, key=func]) -> value - max(arg1, arg2, *args, *[, key=func]) -> value + """max(iterable, *[, default=obj, key=func]) -> value +max(arg1, arg2, *args, *[, key=func]) -> value - With a single iterable argument, return its biggest item. The - default keyword-only argument specifies an object to return if - the provided iterable is empty. - With two or more arguments, return the largest argument. +With a single iterable argument, return its biggest item. The +default keyword-only argument specifies an object to return if +the provided iterable is empty. +With two or more arguments, return the largest argument. """ return min_max(space, __args__, "max") def min(space, __args__): - """ - min(...) - min(iterable, *[, default=obj, key=func]) -> value - min(arg1, arg2, *args, *[, key=func]) -> value + """min(iterable, *[, default=obj, key=func]) -> value +min(arg1, arg2, *args, *[, key=func]) -> value - With a single iterable argument, return its smallest item. The - default keyword-only argument specifies an object to return if - the provided iterable is empty. - With two or more arguments, return the smallest argument. +With a single iterable argument, return its smallest item. The +default keyword-only argument specifies an object to return if +the provided iterable is empty. +With two or more arguments, return the smallest argument. """ return min_max(space, __args__, "min") From pypy.commits at gmail.com Tue Sep 17 05:43:43 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 17 Sep 2019 02:43:43 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: we don't have this restriction of cpython Message-ID: <5d80aacf.1c69fb81.4d47f.4663@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97508:3ead6447613b Date: 2019-09-17 11:42 +0200 http://bitbucket.org/pypy/pypy/changeset/3ead6447613b/ Log: we don't have this restriction of cpython diff --git a/lib-python/3/unittest/test/testmock/testhelpers.py b/lib-python/3/unittest/test/testmock/testhelpers.py --- a/lib-python/3/unittest/test/testmock/testhelpers.py +++ b/lib-python/3/unittest/test/testmock/testhelpers.py @@ -2,6 +2,8 @@ import types import unittest +from test.support import cpython_only + from unittest.mock import ( call, _Call, create_autospec, MagicMock, Mock, ANY, _CallList, patch, PropertyMock @@ -873,7 +875,7 @@ # plain data descriptor check_data_descriptor(foo.desc) - + @cpython_only # PyPy can easily extract a spec from a builtin function def test_autospec_on_bound_builtin_function(self): meth = types.MethodType(time.ctime, time.time()) self.assertIsInstance(meth(), str) From pypy.commits at gmail.com Tue Sep 17 05:48:37 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 17 Sep 2019 02:48:37 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix difference caused by our hacks in the timeit module Message-ID: <5d80abf5.1c69fb81.6c43d.7ae8@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97509:c2f6ba3490b8 Date: 2019-09-17 11:47 +0200 http://bitbucket.org/pypy/pypy/changeset/c2f6ba3490b8/ Log: fix difference caused by our hacks in the timeit module diff --git a/lib-python/3/test/test_timeit.py b/lib-python/3/test/test_timeit.py --- a/lib-python/3/test/test_timeit.py +++ b/lib-python/3/test/test_timeit.py @@ -387,7 +387,8 @@ num_loops, time_taken = self.autorange(callback) self.assertEqual(num_loops, 1000) self.assertEqual(time_taken, 1.0) - expected = ('10 0.010\n' + expected = ('1 0.001\n' + '10 0.010\n' '100 0.100\n' '1000 1.000\n') self.assertEqual(s.getvalue(), expected) From pypy.commits at gmail.com Tue Sep 17 06:58:45 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Tue, 17 Sep 2019 03:58:45 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Fixed a few more things and implemented another test. Message-ID: <5d80bc65.1c69fb81.e0308.d8dd@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97510:5b5a1bf2f5af Date: 2019-09-17 11:56 +0100 http://bitbucket.org/pypy/pypy/changeset/5b5a1bf2f5af/ Log: Fixed a few more things and implemented another test. diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -19,9 +19,6 @@ SMALLBUF = 4 BUFMAX = (32*1024*1024) BUFSIZ = platform.ConstantInteger("BUFSIZ") -CONIN = rffi.unicode2wcharp(u"CONIN$") -CONOUT = rffi.unicode2wcharp(u"CONOUT$") -CON = rffi.unicode2wcharp(u"CON") def err_closed(space): raise oefmt(space.w_ValueError, @@ -130,10 +127,6 @@ decoded = space.fsdecode_w(w_path_or_fd) if not decoded: return '\0' - - decoded_wstr = rffi.cast(rffi.CWCHARP, decoded) - if not decoded_wstr: - return '\0' m = '\0' @@ -146,39 +139,18 @@ elif dlower == 'CON'.lower(): m = 'x' - if m != '\0': return m - length = 0 - - pname_buf = lltype.malloc(rffi.CWCHARP.TO, rwin32.MAX_PATH, flavor='raw') - - uni_decoded_wstr = rffi.wcharp2unicode(decoded_wstr) - traits = _preferred_traits(uni_decoded_wstr) - win32traits = make_win32_traits(traits) - str_nullptr = lltype.nullptr(win32traits.LPSTRP.TO) - length = win32traits.GetFullPathName(decoded_wstr, rwin32.MAX_PATH, pname_buf, str_nullptr) - - if length > rwin32.MAX_PATH: - lltype.free(pname_buf, flavor='raw') - pname_buf = lltype.malloc(rffi.CWCHARP.TO, length, flavor='raw') - if pname_buf: - length = win32traits.GetFullPathName(decoded_wstr, length, pname_buf, str_nullptr) - else: - length = 0 - - dlower = space.wcharp2unicode(pname_buf).lower() if len(dlower) >=4: - if dlower[:4] == u'\\\\.\\' or dlower[:4] == u'\\\\?\\': + if dlower[:4] == '\\\\.\\' or dlower[:4] == '\\\\?\\': dlower = dlower[4:] - if dlower == u'CONIN$'.lower(): - m = 'r' - elif dlower == u'CONOUT$'.lower(): - m = 'w' - elif dlower == u'CON'.lower(): - m = 'x' - lltype.free(pname_buf, flavor='raw') + if dlower == 'CONIN$'.lower(): + m = 'r' + elif dlower == 'CONOUT$'.lower(): + m = 'w' + elif dlower == 'CON'.lower(): + m = 'x' return m @@ -190,7 +162,7 @@ self.created = 0 self.readable = False self.writable = False - self.closehandle = 0 + self.closehandle = False self.blksize = 0 # def _internal_close(self, space): @@ -215,7 +187,9 @@ @unwrap_spec(w_mode=WrappedDefault("r"), w_closefd=WrappedDefault(True), w_opener=WrappedDefault(None)) def descr_init(self, space, w_nameobj, w_mode, w_closefd, w_opener): - name = None + name = rffi.cast(rffi.CWCHARP, 0) + self.fd = -1 + self.handle = rwin32.INVALID_HANDLE_VALUE self.readable = False self.writable = False self.blksize = 0 @@ -223,16 +197,15 @@ console_type = '\0' self.buf = lltype.malloc(rffi.CCHARPP.TO,SMALLBUF,flavor='raw') - if w_mode == None: - w_mode = space.newtext("r") - try: - self.fd = space.int_w(w_nameobj) + if space.isinstance_w(w_nameobj, space.w_int): + self.fd = space.int_w(w_nameobj) closefd = space.bool_w(w_closefd) if self.fd < 0: + w_decodedname = space.fsdecode(w_nameobj) - name = rffi.cast(rffi.CWCHARP, space.text_w(w_decodedname)) + name = space.unicode2wcharp(w_decodedname) console_type = _pyio_get_console_type(space, w_decodedname) if not console_type: raise oefmt(space.w_ValueError, @@ -281,7 +254,7 @@ if self.writable: access = rwin32.GENERIC_WRITE - traits = _preferred_traits(name) + traits = _preferred_traits(space.wcharp2unicode(name)) if not (traits.str is unicode): raise oefmt(space.w_ValueError, "Non-unicode string name %s", traits.str) @@ -319,8 +292,6 @@ rffi.c_memset(self.buf, 0, SMALLBUF) finally: lltype.free(self.buf, flavor='raw') - - return None def readable_w(self, space): if self.handle == rwin32.INVALID_HANDLE_VALUE: @@ -400,6 +371,7 @@ u8n = 0 + if len < 4: if rwin32.WideCharToMultiByte(rwin32.CP_UTF8, 0, wbuf, n, self.buf, @@ -551,7 +523,7 @@ wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, rffi.NULL, 0) - while wlen > (32766 / rffi.sizeof(rffi.CWCHARP.TO)): + while wlen > (32766 / rffi.sizeof(rffi.CWCHARP)): buflen /= 2 wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, rffi.NULL, 0) diff --git a/pypy/module/_io/test/test_win32consoleio.py b/pypy/module/_io/test/test_win32consoleio.py --- a/pypy/module/_io/test/test_win32consoleio.py +++ b/pypy/module/_io/test/test_win32consoleio.py @@ -7,6 +7,55 @@ cls.w_INT_MAX = space.wrap(INT_MAX) cls.w_UINT_MAX = space.wrap(UINT_MAX) + def test_open_fd(self): + self.assertRaisesRegex(ValueError, + "negative file descriptor", _io._WindowsConsoleIO, -1) + + fd, _ = tempfile.mkstemp() + try: + # Windows 10: "Cannot open non-console file" + # Earlier: "Cannot open console output buffer for reading" + self.assertRaisesRegex(ValueError, + "Cannot open (console|non-console file)", _io._WindowsConsoleIO, fd) + finally: + os.close(fd) + + try: + f = _io._WindowsConsoleIO(0) + except ValueError: + # cannot open console because it's not a real console + pass + else: + self.assertTrue(f.readable()) + self.assertFalse(f.writable()) + self.assertEqual(0, f.fileno()) + f.close() # multiple close should not crash + f.close() + + try: + f = _io._WindowsConsoleIO(1, 'w') + except ValueError: + # cannot open console because it's not a real console + pass + else: + self.assertFalse(f.readable()) + self.assertTrue(f.writable()) + self.assertEqual(1, f.fileno()) + f.close() + f.close() + + try: + f = _io._WindowsConsoleIO(2, 'w') + except ValueError: + # cannot open console because it's not a real console + pass + else: + self.assertFalse(f.readable()) + self.assertTrue(f.writable()) + self.assertEqual(2, f.fileno()) + f.close() + f.close() + def test_constructor(self): import _io - t = _io._WindowsConsoleIO(u"CONIN$") + t = _io._WindowsConsoleIO("CONIN$") From pypy.commits at gmail.com Tue Sep 17 07:14:44 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 17 Sep 2019 04:14:44 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: change sys.getfilesystemcodeerors() to 'strict' on win32 Message-ID: <5d80c024.1c69fb81.132c9.bbab@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97511:6e101bbc9993 Date: 2019-09-17 14:13 +0300 http://bitbucket.org/pypy/pypy/changeset/6e101bbc9993/ Log: change sys.getfilesystemcodeerors() to 'strict' on win32 diff --git a/pypy/module/sys/interp_encoding.py b/pypy/module/sys/interp_encoding.py --- a/pypy/module/sys/interp_encoding.py +++ b/pypy/module/sys/interp_encoding.py @@ -51,4 +51,6 @@ def getfilesystemencodeerrors(space): + if sys.platform == "win32": + return space.newtext('strict') return space.newtext('surrogateescape') From pypy.commits at gmail.com Tue Sep 17 07:14:46 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 17 Sep 2019 04:14:46 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default into py3.6 Message-ID: <5d80c026.1c69fb81.218ba.62a0@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97512:d9092e9cba63 Date: 2019-09-17 14:15 +0300 http://bitbucket.org/pypy/pypy/changeset/d9092e9cba63/ Log: merge default into py3.6 diff --git a/pypy/module/_rawffi/interp_rawffi.py b/pypy/module/_rawffi/interp_rawffi.py --- a/pypy/module/_rawffi/interp_rawffi.py +++ b/pypy/module/_rawffi/interp_rawffi.py @@ -245,7 +245,11 @@ except OSError as e: raise wrap_oserror(space, e) - at unwrap_spec(name='fsencode_or_none') +if _MS_WINDOWS: + name_spec = 'fsencode' +else: + name_spec = 'fsencode_or_none' + at unwrap_spec(name=name_spec) def descr_new_cdll(space, w_type, name): cdll = open_cdll(space, name) return W_CDLL(space, name, cdll) diff --git a/pypy/module/_rawffi/test/test__rawffi.py b/pypy/module/_rawffi/test/test__rawffi.py --- a/pypy/module/_rawffi/test/test__rawffi.py +++ b/pypy/module/_rawffi/test/test__rawffi.py @@ -262,14 +262,17 @@ raise AssertionError("did not fail??") def test_libload_None(self): - if self.iswin32: - skip("unix specific") import _rawffi # this should return *all* loaded libs, dlopen(NULL) - dll = _rawffi.CDLL(None) - func = dll.ptr('rand', [], 'i') - res = func() - assert res[0] != 0 + try: + dll = _rawffi.CDLL(None) + except TypeError: + if not self.iswin32: + raise + else: + func = dll.ptr('rand', [], 'i') + res = func() + assert res[0] != 0 def test_libc_load(self): import _rawffi diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -1235,9 +1235,11 @@ lgt -= 1 if right: - while rpos > lpos and rutf8.isspace(value, - rutf8.prev_codepoint_pos(value, rpos)): - rpos = rutf8.prev_codepoint_pos(value, rpos) + while rpos > lpos: + prev = rutf8.prev_codepoint_pos(value, rpos) + if not rutf8.isspace(value, prev): + break + rpos = prev lgt -= 1 assert rpos >= lpos # annotator hint, don't remove @@ -1258,9 +1260,11 @@ lgt -= 1 if right: - while rpos > lpos and rutf8.utf8_in_chars(value, - rutf8.prev_codepoint_pos(value, rpos), chars): - rpos = rutf8.prev_codepoint_pos(value, rpos) + while rpos > lpos: + prev = rutf8.prev_codepoint_pos(value, rpos) + if not rutf8.utf8_in_chars(value, prev, chars): + break + rpos = prev lgt -= 1 assert rpos >= lpos # annotator hint, don't remove From pypy.commits at gmail.com Tue Sep 17 07:14:47 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 17 Sep 2019 04:14:47 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: merge py3.6 into branch Message-ID: <5d80c027.1c69fb81.37adb.8c6e@mx.google.com> Author: Matti Picus Branch: winconsoleio Changeset: r97513:9d954abe5763 Date: 2019-09-17 14:15 +0300 http://bitbucket.org/pypy/pypy/changeset/9d954abe5763/ Log: merge py3.6 into branch diff --git a/lib-python/3/test/test_timeit.py b/lib-python/3/test/test_timeit.py --- a/lib-python/3/test/test_timeit.py +++ b/lib-python/3/test/test_timeit.py @@ -387,7 +387,8 @@ num_loops, time_taken = self.autorange(callback) self.assertEqual(num_loops, 1000) self.assertEqual(time_taken, 1.0) - expected = ('10 0.010\n' + expected = ('1 0.001\n' + '10 0.010\n' '100 0.100\n' '1000 1.000\n') self.assertEqual(s.getvalue(), expected) diff --git a/lib-python/3/unittest/test/testmock/testhelpers.py b/lib-python/3/unittest/test/testmock/testhelpers.py --- a/lib-python/3/unittest/test/testmock/testhelpers.py +++ b/lib-python/3/unittest/test/testmock/testhelpers.py @@ -2,6 +2,8 @@ import types import unittest +from test.support import cpython_only + from unittest.mock import ( call, _Call, create_autospec, MagicMock, Mock, ANY, _CallList, patch, PropertyMock @@ -873,7 +875,7 @@ # plain data descriptor check_data_descriptor(foo.desc) - + @cpython_only # PyPy can easily extract a spec from a builtin function def test_autospec_on_bound_builtin_function(self): meth = types.MethodType(time.ctime, time.time()) self.assertIsInstance(meth(), str) diff --git a/pypy/interpreter/argument.py b/pypy/interpreter/argument.py --- a/pypy/interpreter/argument.py +++ b/pypy/interpreter/argument.py @@ -2,13 +2,20 @@ Arguments objects. """ from rpython.rlib.debug import make_sure_not_resized -from rpython.rlib.objectmodel import not_rpython +from rpython.rlib.objectmodel import not_rpython, specialize from rpython.rlib import jit from rpython.rlib.objectmodel import enforceargs from rpython.rlib.rstring import StringBuilder from pypy.interpreter.error import OperationError, oefmt + at specialize.arg(1) +def raise_type_error(space, fnname_parens, msg, *args): + if fnname_parens is None: + raise oefmt(space.w_TypeError, msg, *args) + msg = "%s " + msg + raise oefmt(space.w_TypeError, msg, fnname_parens, *args) + class Arguments(object): """ @@ -21,11 +28,9 @@ semantics are complex, but calls occur everywhere. """ - ### Construction ### - #@enforceargs(keywords=[unicode]) def __init__(self, space, args_w, keywords=None, keywords_w=None, w_stararg=None, w_starstararg=None, keyword_names_w=None, - methodcall=False): + methodcall=False, fnname_parens=None): self.space = space assert isinstance(args_w, list) self.arguments_w = args_w @@ -41,7 +46,7 @@ make_sure_not_resized(self.keywords_w) make_sure_not_resized(self.arguments_w) - self._combine_wrapped(w_stararg, w_starstararg) + self._combine_wrapped(w_stararg, w_starstararg, fnname_parens) # a flag that specifies whether the JIT can unroll loops that operate # on the keywords self._jit_few_keywords = self.keywords is None or jit.isconstant(len(self.keywords)) @@ -79,14 +84,14 @@ "Return a new Arguments with a new argument inserted first." return self.replace_arguments([w_firstarg] + self.arguments_w) - def _combine_wrapped(self, w_stararg, w_starstararg): + def _combine_wrapped(self, w_stararg, w_starstararg, fnname_parens=None): "unpack the *arg and **kwd into arguments_w and keywords_w" if w_stararg is not None: - self._combine_starargs_wrapped(w_stararg) + self._combine_starargs_wrapped(w_stararg, fnname_parens) if w_starstararg is not None: - self._combine_starstarargs_wrapped(w_starstararg) + self._combine_starstarargs_wrapped(w_starstararg, fnname_parens) - def _combine_starargs_wrapped(self, w_stararg): + def _combine_starargs_wrapped(self, w_stararg, fnname_parens=None): # unpack the * arguments space = self.space try: @@ -94,13 +99,13 @@ except OperationError as e: if (e.match(space, space.w_TypeError) and not space.is_iterable(w_stararg)): - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "argument after * must be an iterable, not %T", w_stararg) raise self.arguments_w = self.arguments_w + args_w - def _combine_starstarargs_wrapped(self, w_starstararg): + def _combine_starstarargs_wrapped(self, w_starstararg, fnname_parens=None): # unpack the ** arguments space = self.space keywords, values_w = space.view_as_kwargs(w_starstararg) @@ -110,7 +115,8 @@ self.keywords_w = values_w else: _check_not_duplicate_kwargs( - self.space, self.keywords, keywords, values_w) + self.space, self.keywords, keywords, values_w, + fnname_parens) self.keywords = self.keywords + keywords self.keywords_w = self.keywords_w + values_w return @@ -123,7 +129,7 @@ w_keys = space.call_method(w_starstararg, "keys") except OperationError as e: if e.match(space, space.w_AttributeError): - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "argument after ** must be a mapping, not %T", w_starstararg) raise @@ -132,7 +138,7 @@ keywords = [None] * len(keys_w) _do_combine_starstarargs_wrapped( space, keys_w, w_starstararg, keywords, keywords_w, self.keywords, - is_dict) + is_dict, fnname_parens) self.keyword_names_w = keys_w if self.keywords is None: self.keywords = keywords @@ -349,8 +355,8 @@ def parse_obj(self, w_firstarg, fnname, signature, defaults_w=None, w_kw_defs=None, blindargs=0): - """Parse args and kwargs to initialize a frame - according to the signature of code object. + """Parse args and kwargs into a list according to the signature of a + code object. """ try: return self._parse(w_firstarg, signature, defaults_w, w_kw_defs, @@ -387,28 +393,28 @@ # look at. They should not get a self arguments, which makes the amount of # arguments annoying :-( - at jit.look_inside_iff(lambda space, existingkeywords, keywords, keywords_w: + at jit.look_inside_iff(lambda space, existingkeywords, keywords, keywords_w, fnname_parens: jit.isconstant(len(keywords) and jit.isconstant(existingkeywords))) -def _check_not_duplicate_kwargs(space, existingkeywords, keywords, keywords_w): +def _check_not_duplicate_kwargs(space, existingkeywords, keywords, keywords_w, fnname_parens): # looks quadratic, but the JIT should remove all of it nicely. # Also, all the lists should be small for key in keywords: for otherkey in existingkeywords: if otherkey == key: - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "got multiple values for keyword argument '%s'", key) def _do_combine_starstarargs_wrapped(space, keys_w, w_starstararg, keywords, - keywords_w, existingkeywords, is_dict): + keywords_w, existingkeywords, is_dict, fnname_parens): i = 0 for w_key in keys_w: try: key = space.text_w(w_key) except OperationError as e: if e.match(space, space.w_TypeError): - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "keywords must be strings, not '%T'", w_key) if e.match(space, space.w_UnicodeEncodeError): @@ -418,7 +424,7 @@ raise else: if existingkeywords and key in existingkeywords: - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "got multiple values for keyword argument '%s'", key) keywords[i] = key diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py --- a/pypy/interpreter/baseobjspace.py +++ b/pypy/interpreter/baseobjspace.py @@ -1180,7 +1180,7 @@ if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). - args = frame.make_arguments(nargs) + args = frame.make_arguments(nargs, w_function=w_func) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: @@ -1197,7 +1197,7 @@ nargs, frame, methodcall=methodcall) # end of hack for performance - args = frame.make_arguments(nargs) + args = frame.make_arguments(nargs, w_function=w_func) return self.call_args(w_func, args) def call_args_and_c_profile(self, frame, w_func, args): diff --git a/pypy/interpreter/function.py b/pypy/interpreter/function.py --- a/pypy/interpreter/function.py +++ b/pypy/interpreter/function.py @@ -172,10 +172,10 @@ elif fast_natural_arity == Code.PASSTHROUGHARGS1 and nargs >= 1: assert isinstance(code, gateway.BuiltinCodePassThroughArguments1) w_obj = frame.peekvalue(nargs-1) - args = frame.make_arguments(nargs-1) + args = frame.make_arguments(nargs-1, w_function=self) return code.funcrun_obj(self, w_obj, args) - args = frame.make_arguments(nargs, methodcall=methodcall) + args = frame.make_arguments(nargs, methodcall=methodcall, w_function=self) return self.call_args(args) @jit.unroll_safe diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py --- a/pypy/interpreter/pyframe.py +++ b/pypy/interpreter/pyframe.py @@ -490,14 +490,32 @@ depth -= 1 self.valuestackdepth = finaldepth - def make_arguments(self, nargs, methodcall=False): + def _guess_function_name_parens(self, fnname=None, w_function=None): + """ Returns 'funcname()' from either a function name fnname or a + wrapped callable w_function. If it's not a function or a method, returns + 'Classname object'""" + # CPython has a similar function, PyEval_GetFuncName + from pypy.interpreter.function import Function, Method + if fnname is not None: + return fnname + '()' + if w_function is None: + return None + if isinstance(w_function, Function): + return w_function.name + '()' + if isinstance(w_function, Method): + return self._guess_function_name_parens(None, w_function.w_function) + return w_function.getname(self.space) + ' object' + + def make_arguments(self, nargs, methodcall=False, w_function=None, fnname=None): + fnname_parens = self._guess_function_name_parens(fnname, w_function) return Arguments( - self.space, self.peekvalues(nargs), methodcall=methodcall) + self.space, self.peekvalues(nargs), methodcall=methodcall, fnname_parens=fnname_parens) - def argument_factory(self, arguments, keywords, keywords_w, w_star, w_starstar, methodcall=False): + def argument_factory(self, arguments, keywords, keywords_w, w_star, w_starstar, methodcall=False, w_function=None, fnname=None): + fnname_parens = self._guess_function_name_parens(fnname, w_function) return Arguments( self.space, arguments, keywords, keywords_w, w_star, - w_starstar, methodcall=methodcall) + w_starstar, methodcall=methodcall, fnname_parens=fnname_parens) def hide(self): return self.pycode.hidden_applevel diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py --- a/pypy/interpreter/pyopcode.py +++ b/pypy/interpreter/pyopcode.py @@ -1307,9 +1307,9 @@ else: w_star = None arguments = self.popvalues(n_arguments) + w_function = self.popvalue() args = self.argument_factory(arguments, keywords, keywords_w, w_star, - w_starstar) - w_function = self.popvalue() + w_starstar, w_function=w_function) if self.get_is_being_profiled() and function.is_builtin_code(w_function): w_result = self.space.call_args_and_c_profile(self, w_function, args) diff --git a/pypy/interpreter/test/test_argument.py b/pypy/interpreter/test/test_argument.py --- a/pypy/interpreter/test/test_argument.py +++ b/pypy/interpreter/test/test_argument.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import py +import pytest from pypy.interpreter.argument import (Arguments, ArgErr, ArgErrUnknownKwds, ArgErrMultipleValues, ArgErrMissing, ArgErrTooMany, ArgErrTooManyMethod) from pypy.interpreter.signature import Signature @@ -138,6 +139,7 @@ class Type: def getname(self, space): return type(obj).__name__ + name = type(obj).__name__ return Type() @@ -332,15 +334,17 @@ def test_duplicate_kwds(self): space = DummySpace() - excinfo = py.test.raises(OperationError, Arguments, space, [], ["a"], - [1], w_starstararg={"a": 2}) + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg={"a": 2}, fnname_parens="foo()") assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "foo() got multiple values for keyword argument 'a'" def test_starstararg_wrong_type(self): space = DummySpace() - excinfo = py.test.raises(OperationError, Arguments, space, [], ["a"], - [1], w_starstararg="hello") + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg="hello", fnname_parens="bar()") assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "bar() argument after ** must be a mapping, not str" def test_unwrap_error(self): space = DummySpace() @@ -353,12 +357,12 @@ return bytes(w, 'utf-8') space.utf8_w = utf8_w space.text_w = utf8_w - excinfo = py.test.raises(OperationError, Arguments, space, [], - ["a"], [1], w_starstararg={None: 1}) + with py.test.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg={None: 1}, fnname_parens="f1()") assert excinfo.value.w_type is TypeError assert excinfo.value._w_value is None - excinfo = py.test.raises(OperationError, Arguments, space, [], - ["a"], [1], w_starstararg={valuedummy: 1}) + with py.test.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg={valuedummy: 1}, fnname_parens="f2()") assert excinfo.value.w_type is ValueError assert excinfo.value._w_value is None @@ -435,9 +439,9 @@ raise FakeArgErr() args._match_signature = _match_signature - - excinfo = py.test.raises(OperationError, args.parse_obj, "obj", "foo", - Signature(["a", "b"], None, None)) + with pytest.raises(OperationError) as excinfo: + args.parse_obj("obj", "foo", + Signature(["a", "b"], None, None)) assert excinfo.value.w_type is TypeError assert excinfo.value.get_w_value(space) == "foo() msg" @@ -491,9 +495,9 @@ args._match_signature = _match_signature - excinfo = py.test.raises(OperationError, args.parse_into_scope, - "obj", [None, None], "foo", - Signature(["a", "b"], None, None)) + with pytest.raises(OperationError) as excinfo: + args.parse_into_scope("obj", [None, None], "foo", + Signature(["a", "b"], None, None)) assert excinfo.value.w_type is TypeError assert excinfo.value.get_w_value(space) == "foo() msg" @@ -568,9 +572,17 @@ l = [None, None, None] args._match_signature(None, l, Signature(["a", "b"], None, "**")) assert l == [1, 2, {'c': 3}] - excinfo = py.test.raises(OperationError, Arguments, space, [], ["a"], - [1], w_starstararg=kwargs(["a"], [2])) + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], + [1], w_starstararg=kwargs(["a"], [2])) assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "got multiple values for keyword argument 'a'" + + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], + [1], w_starstararg=kwargs(["a"], [2]), fnname_parens="foo()") + assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "foo() got multiple values for keyword argument 'a'" @@ -671,20 +683,14 @@ def test_bad_type_for_star(self): space = self.space - try: - Arguments(space, [], w_stararg=space.wrap(42)) - except OperationError as e: - msg = space.text_w(space.str(e.get_w_value(space))) - assert msg == "argument after * must be an iterable, not int" - else: - assert 0, "did not raise" - try: - Arguments(space, [], w_starstararg=space.wrap(42)) - except OperationError as e: - msg = space.text_w(space.str(e.get_w_value(space))) - assert msg == "argument after ** must be a mapping, not int" - else: - assert 0, "did not raise" + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], w_stararg=space.wrap(42), fnname_parens="f1()") + msg = space.text_w(excinfo.value.get_w_value(space)) + assert msg == "f1() argument after * must be an iterable, not int" + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], w_starstararg=space.wrap(42), fnname_parens="f2()") + msg = space.text_w(excinfo.value.get_w_value(space)) + assert msg == "f2() argument after ** must be a mapping, not int" def test_dont_count_default_arguments(self): space = self.space @@ -889,7 +895,7 @@ pass e = raises(TypeError, "f(*42)") assert str(e.value).endswith( - "argument after * must be an iterable, not int") + "f() argument after * must be an iterable, not int") e = raises(TypeError, "f(*X())") assert str(e.value) == "myerror" @@ -904,8 +910,10 @@ def f(x, y): pass e = raises(TypeError, "f(y=2, **{3: 5}, x=6)") - assert "keywords must be strings" in str(e.value) + assert "f() keywords must be strings" in str(e.value) e = raises(TypeError, "f(y=2, **{'x': 5}, x=6)") + # CPython figures out the name here, by peeking around in the stack in + # BUILD_MAP_UNPACK_WITH_CALL. we don't, too messy assert "got multiple values for keyword argument 'x'" in str(e.value) def test_dict_subclass_with_weird_getitem(self): diff --git a/pypy/module/__builtin__/functional.py b/pypy/module/__builtin__/functional.py --- a/pypy/module/__builtin__/functional.py +++ b/pypy/module/__builtin__/functional.py @@ -203,20 +203,24 @@ implementation_of) def max(space, __args__): - """max(iterable[, key=func]) -> value - max(a, b, c, ...[, key=func]) -> value + """max(iterable, *[, default=obj, key=func]) -> value +max(arg1, arg2, *args, *[, key=func]) -> value - With a single iterable argument, return its largest item. - With two or more arguments, return the largest argument. +With a single iterable argument, return its biggest item. The +default keyword-only argument specifies an object to return if +the provided iterable is empty. +With two or more arguments, return the largest argument. """ return min_max(space, __args__, "max") def min(space, __args__): - """min(iterable[, key=func]) -> value - min(a, b, c, ...[, key=func]) -> value + """min(iterable, *[, default=obj, key=func]) -> value +min(arg1, arg2, *args, *[, key=func]) -> value - With a single iterable argument, return its smallest item. - With two or more arguments, return the smallest argument. +With a single iterable argument, return its smallest item. The +default keyword-only argument specifies an object to return if +the provided iterable is empty. +With two or more arguments, return the smallest argument. """ return min_max(space, __args__, "min") diff --git a/pypy/module/_rawffi/interp_rawffi.py b/pypy/module/_rawffi/interp_rawffi.py --- a/pypy/module/_rawffi/interp_rawffi.py +++ b/pypy/module/_rawffi/interp_rawffi.py @@ -245,7 +245,11 @@ except OSError as e: raise wrap_oserror(space, e) - at unwrap_spec(name='fsencode_or_none') +if _MS_WINDOWS: + name_spec = 'fsencode' +else: + name_spec = 'fsencode_or_none' + at unwrap_spec(name=name_spec) def descr_new_cdll(space, w_type, name): cdll = open_cdll(space, name) return W_CDLL(space, name, cdll) diff --git a/pypy/module/_rawffi/test/test__rawffi.py b/pypy/module/_rawffi/test/test__rawffi.py --- a/pypy/module/_rawffi/test/test__rawffi.py +++ b/pypy/module/_rawffi/test/test__rawffi.py @@ -262,14 +262,17 @@ raise AssertionError("did not fail??") def test_libload_None(self): - if self.iswin32: - skip("unix specific") import _rawffi # this should return *all* loaded libs, dlopen(NULL) - dll = _rawffi.CDLL(None) - func = dll.ptr('rand', [], 'i') - res = func() - assert res[0] != 0 + try: + dll = _rawffi.CDLL(None) + except TypeError: + if not self.iswin32: + raise + else: + func = dll.ptr('rand', [], 'i') + res = func() + assert res[0] != 0 def test_libc_load(self): import _rawffi diff --git a/pypy/module/select/interp_select.py b/pypy/module/select/interp_select.py --- a/pypy/module/select/interp_select.py +++ b/pypy/module/select/interp_select.py @@ -30,11 +30,23 @@ @unwrap_spec(events="c_ushort") def register(self, space, w_fd, events=defaultevents): + """ + Register a file descriptor with the polling object. + fd -- either an integer, or an object with a fileno() method returning an + int. + events -- an optional bitmask describing the type of events to check for + """ fd = space.c_filedescriptor_w(w_fd) self.fddict[fd] = events @unwrap_spec(events="c_ushort") def modify(self, space, w_fd, events): + """ + Modify an already registered file descriptor. + fd -- either an integer, or an object with a fileno() method returning an + int. + events -- an optional bitmask describing the type of events to check for + """ fd = space.c_filedescriptor_w(w_fd) if fd not in self.fddict: raise wrap_oserror(space, OSError(errno.ENOENT, "poll.modify"), @@ -42,6 +54,9 @@ self.fddict[fd] = events def unregister(self, space, w_fd): + """ + Remove a file descriptor being tracked by the polling object. + """ fd = space.c_filedescriptor_w(w_fd) try: del self.fddict[fd] @@ -50,21 +65,24 @@ @unwrap_spec(w_timeout=WrappedDefault(None)) def poll(self, space, w_timeout): - """WARNING: the timeout parameter is in **milliseconds**!""" + """ + Polls the set of registered file descriptors, returning a list containing + any descriptors that have events or errors to report. + + the timeout parameter is in milliseconds""" if space.is_w(w_timeout, space.w_None): timeout = -1 end_time = 0 + elif space.isinstance_w(w_timeout, space.w_float) or space.isinstance_w(w_timeout, space.w_int): + if space.is_true(space.lt(w_timeout, space.newint(0))): + timeout = -1 + end_time = 0 + else: + timeout = space.c_int_w(space.int(w_timeout)) + end_time = timeutils.monotonic(space) + timeout * 0.001 else: - # we want to be compatible with cpython and also accept things - # that can be casted to integer (I think) - try: - # compute the integer - w_timeout = space.int(w_timeout) - except OperationError: - raise oefmt(space.w_TypeError, - "timeout must be an integer or None") - timeout = space.c_int_w(w_timeout) - end_time = timeutils.monotonic(space) + timeout * 0.001 + raise oefmt(space.w_TypeError, + "timeout must be an integer or None") if self.running: raise oefmt(space.w_RuntimeError, "concurrent poll() invocation") diff --git a/pypy/module/select/test/test_select.py b/pypy/module/select/test/test_select.py --- a/pypy/module/select/test/test_select.py +++ b/pypy/module/select/test/test_select.py @@ -217,9 +217,25 @@ readend, writeend = self.getpair() try: class A(object): - def __int__(self): + def fileno(self): return readend.fileno() - select.poll().poll(A()) # assert did not crash + poll = select.poll() + poll.register(A()) + + res = poll.poll(10) # timeout in ms + assert res == [] + res = poll.poll(1.1) # check floats + assert res == [] + + writeend.send(b"foo!") + # can't easily test actual blocking, is done in lib-python tests + res = poll.poll() + assert res == [(readend.fileno(), 1)] + + # check negative timeout + # proper test in lib-python, test_poll_blocks_with_negative_ms + res = poll.poll(-0.001) + assert res == [(readend.fileno(), 1)] finally: readend.close() writeend.close() @@ -238,7 +254,6 @@ pollster.register(0, 65535) # USHRT_MAX raises(OverflowError, pollster.register, 0, 65536) # USHRT_MAX + 1 raises(OverflowError, pollster.poll, 2147483648) # INT_MAX + 1 - raises(OverflowError, pollster.poll, -2147483648 - 1) raises(OverflowError, pollster.poll, 4294967296) # UINT_MAX + 1 exc = raises(TypeError, pollster.poll, '123') assert str(exc.value) == 'timeout must be an integer or None' diff --git a/pypy/module/sys/interp_encoding.py b/pypy/module/sys/interp_encoding.py --- a/pypy/module/sys/interp_encoding.py +++ b/pypy/module/sys/interp_encoding.py @@ -51,4 +51,6 @@ def getfilesystemencodeerrors(space): + if sys.platform == "win32": + return space.newtext('strict') return space.newtext('surrogateescape') diff --git a/pypy/objspace/std/callmethod.py b/pypy/objspace/std/callmethod.py --- a/pypy/objspace/std/callmethod.py +++ b/pypy/objspace/std/callmethod.py @@ -111,12 +111,12 @@ keywords_w[n_kwargs] = w_value arguments = f.popvalues(n) # includes w_self if it is not None - args = f.argument_factory( - arguments, keywords, keywords_w, None, None, - methodcall=w_self is not None) if w_self is None: f.popvalue_maybe_none() # removes w_self, which is None w_callable = f.popvalue() + args = f.argument_factory( + arguments, keywords, keywords_w, None, None, + methodcall=w_self is not None, w_function=w_callable) if f.get_is_being_profiled() and function.is_builtin_code(w_callable): w_result = f.space.call_args_and_c_profile(f, w_callable, args) else: diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -1235,9 +1235,11 @@ lgt -= 1 if right: - while rpos > lpos and rutf8.isspace(value, - rutf8.prev_codepoint_pos(value, rpos)): - rpos = rutf8.prev_codepoint_pos(value, rpos) + while rpos > lpos: + prev = rutf8.prev_codepoint_pos(value, rpos) + if not rutf8.isspace(value, prev): + break + rpos = prev lgt -= 1 assert rpos >= lpos # annotator hint, don't remove @@ -1258,9 +1260,11 @@ lgt -= 1 if right: - while rpos > lpos and rutf8.utf8_in_chars(value, - rutf8.prev_codepoint_pos(value, rpos), chars): - rpos = rutf8.prev_codepoint_pos(value, rpos) + while rpos > lpos: + prev = rutf8.prev_codepoint_pos(value, rpos) + if not rutf8.utf8_in_chars(value, prev, chars): + break + rpos = prev lgt -= 1 assert rpos >= lpos # annotator hint, don't remove From pypy.commits at gmail.com Tue Sep 17 08:05:22 2019 From: pypy.commits at gmail.com (mattip) Date: Tue, 17 Sep 2019 05:05:22 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: must build the strings at import Message-ID: <5d80cc02.1c69fb81.8c720.0495@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97514:023a3e349a63 Date: 2019-09-17 15:04 +0300 http://bitbucket.org/pypy/pypy/changeset/023a3e349a63/ Log: must build the strings at import diff --git a/pypy/module/sys/interp_encoding.py b/pypy/module/sys/interp_encoding.py --- a/pypy/module/sys/interp_encoding.py +++ b/pypy/module/sys/interp_encoding.py @@ -9,16 +9,20 @@ if sys.platform == "win32": base_encoding = "mbcs" + base_error = "strict" elif sys.platform == "darwin": base_encoding = "utf-8" + base_error = "surrogateescape" elif sys.platform == "linux2": base_encoding = "ascii" + base_error = "surrogateescape" else: # In CPython, the default base encoding is NULL. This is paired with a # comment that says "If non-NULL, this is different than the default # encoding for strings". Therefore, the default filesystem encoding is the # default encoding for strings, which is ASCII. base_encoding = "ascii" + base_error = "surrogateescape" def _getfilesystemencoding(space): encoding = base_encoding @@ -51,6 +55,4 @@ def getfilesystemencodeerrors(space): - if sys.platform == "win32": - return space.newtext('strict') - return space.newtext('surrogateescape') + return space.newtext(base_error) From pypy.commits at gmail.com Tue Sep 17 09:43:42 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Tue, 17 Sep 2019 06:43:42 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Switched fsdecode call to fspath following other pypy io modules Message-ID: <5d80e30e.1c69fb81.7c1cd.c595@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97515:6257428ac55f Date: 2019-09-17 14:41 +0100 http://bitbucket.org/pypy/pypy/changeset/6257428ac55f/ Log: Switched fsdecode call to fspath following other pypy io modules diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -203,10 +203,10 @@ closefd = space.bool_w(w_closefd) if self.fd < 0: - - w_decodedname = space.fsdecode(w_nameobj) - name = space.unicode2wcharp(w_decodedname) - console_type = _pyio_get_console_type(space, w_decodedname) + from pypy.module.posix.interp_posix import fspath + w_path = fspath(space, w_nameobj) + name = rffi.unicode2wcharp(space.utf8_w(w_path)) + console_type = _pyio_get_console_type(space, w_path) if not console_type: raise oefmt(space.w_ValueError, "Invalid console type") From pypy.commits at gmail.com Tue Sep 17 09:43:44 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Tue, 17 Sep 2019 06:43:44 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: merged heads Message-ID: <5d80e310.1c69fb81.507fe.4f8e@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97516:4d02b4bab2af Date: 2019-09-17 14:42 +0100 http://bitbucket.org/pypy/pypy/changeset/4d02b4bab2af/ Log: merged heads diff --git a/lib-python/3/test/test_timeit.py b/lib-python/3/test/test_timeit.py --- a/lib-python/3/test/test_timeit.py +++ b/lib-python/3/test/test_timeit.py @@ -387,7 +387,8 @@ num_loops, time_taken = self.autorange(callback) self.assertEqual(num_loops, 1000) self.assertEqual(time_taken, 1.0) - expected = ('10 0.010\n' + expected = ('1 0.001\n' + '10 0.010\n' '100 0.100\n' '1000 1.000\n') self.assertEqual(s.getvalue(), expected) diff --git a/lib-python/3/unittest/test/testmock/testhelpers.py b/lib-python/3/unittest/test/testmock/testhelpers.py --- a/lib-python/3/unittest/test/testmock/testhelpers.py +++ b/lib-python/3/unittest/test/testmock/testhelpers.py @@ -2,6 +2,8 @@ import types import unittest +from test.support import cpython_only + from unittest.mock import ( call, _Call, create_autospec, MagicMock, Mock, ANY, _CallList, patch, PropertyMock @@ -873,7 +875,7 @@ # plain data descriptor check_data_descriptor(foo.desc) - + @cpython_only # PyPy can easily extract a spec from a builtin function def test_autospec_on_bound_builtin_function(self): meth = types.MethodType(time.ctime, time.time()) self.assertIsInstance(meth(), str) diff --git a/pypy/interpreter/argument.py b/pypy/interpreter/argument.py --- a/pypy/interpreter/argument.py +++ b/pypy/interpreter/argument.py @@ -2,13 +2,20 @@ Arguments objects. """ from rpython.rlib.debug import make_sure_not_resized -from rpython.rlib.objectmodel import not_rpython +from rpython.rlib.objectmodel import not_rpython, specialize from rpython.rlib import jit from rpython.rlib.objectmodel import enforceargs from rpython.rlib.rstring import StringBuilder from pypy.interpreter.error import OperationError, oefmt + at specialize.arg(1) +def raise_type_error(space, fnname_parens, msg, *args): + if fnname_parens is None: + raise oefmt(space.w_TypeError, msg, *args) + msg = "%s " + msg + raise oefmt(space.w_TypeError, msg, fnname_parens, *args) + class Arguments(object): """ @@ -21,11 +28,9 @@ semantics are complex, but calls occur everywhere. """ - ### Construction ### - #@enforceargs(keywords=[unicode]) def __init__(self, space, args_w, keywords=None, keywords_w=None, w_stararg=None, w_starstararg=None, keyword_names_w=None, - methodcall=False): + methodcall=False, fnname_parens=None): self.space = space assert isinstance(args_w, list) self.arguments_w = args_w @@ -41,7 +46,7 @@ make_sure_not_resized(self.keywords_w) make_sure_not_resized(self.arguments_w) - self._combine_wrapped(w_stararg, w_starstararg) + self._combine_wrapped(w_stararg, w_starstararg, fnname_parens) # a flag that specifies whether the JIT can unroll loops that operate # on the keywords self._jit_few_keywords = self.keywords is None or jit.isconstant(len(self.keywords)) @@ -79,14 +84,14 @@ "Return a new Arguments with a new argument inserted first." return self.replace_arguments([w_firstarg] + self.arguments_w) - def _combine_wrapped(self, w_stararg, w_starstararg): + def _combine_wrapped(self, w_stararg, w_starstararg, fnname_parens=None): "unpack the *arg and **kwd into arguments_w and keywords_w" if w_stararg is not None: - self._combine_starargs_wrapped(w_stararg) + self._combine_starargs_wrapped(w_stararg, fnname_parens) if w_starstararg is not None: - self._combine_starstarargs_wrapped(w_starstararg) + self._combine_starstarargs_wrapped(w_starstararg, fnname_parens) - def _combine_starargs_wrapped(self, w_stararg): + def _combine_starargs_wrapped(self, w_stararg, fnname_parens=None): # unpack the * arguments space = self.space try: @@ -94,13 +99,13 @@ except OperationError as e: if (e.match(space, space.w_TypeError) and not space.is_iterable(w_stararg)): - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "argument after * must be an iterable, not %T", w_stararg) raise self.arguments_w = self.arguments_w + args_w - def _combine_starstarargs_wrapped(self, w_starstararg): + def _combine_starstarargs_wrapped(self, w_starstararg, fnname_parens=None): # unpack the ** arguments space = self.space keywords, values_w = space.view_as_kwargs(w_starstararg) @@ -110,7 +115,8 @@ self.keywords_w = values_w else: _check_not_duplicate_kwargs( - self.space, self.keywords, keywords, values_w) + self.space, self.keywords, keywords, values_w, + fnname_parens) self.keywords = self.keywords + keywords self.keywords_w = self.keywords_w + values_w return @@ -123,7 +129,7 @@ w_keys = space.call_method(w_starstararg, "keys") except OperationError as e: if e.match(space, space.w_AttributeError): - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "argument after ** must be a mapping, not %T", w_starstararg) raise @@ -132,7 +138,7 @@ keywords = [None] * len(keys_w) _do_combine_starstarargs_wrapped( space, keys_w, w_starstararg, keywords, keywords_w, self.keywords, - is_dict) + is_dict, fnname_parens) self.keyword_names_w = keys_w if self.keywords is None: self.keywords = keywords @@ -349,8 +355,8 @@ def parse_obj(self, w_firstarg, fnname, signature, defaults_w=None, w_kw_defs=None, blindargs=0): - """Parse args and kwargs to initialize a frame - according to the signature of code object. + """Parse args and kwargs into a list according to the signature of a + code object. """ try: return self._parse(w_firstarg, signature, defaults_w, w_kw_defs, @@ -387,28 +393,28 @@ # look at. They should not get a self arguments, which makes the amount of # arguments annoying :-( - at jit.look_inside_iff(lambda space, existingkeywords, keywords, keywords_w: + at jit.look_inside_iff(lambda space, existingkeywords, keywords, keywords_w, fnname_parens: jit.isconstant(len(keywords) and jit.isconstant(existingkeywords))) -def _check_not_duplicate_kwargs(space, existingkeywords, keywords, keywords_w): +def _check_not_duplicate_kwargs(space, existingkeywords, keywords, keywords_w, fnname_parens): # looks quadratic, but the JIT should remove all of it nicely. # Also, all the lists should be small for key in keywords: for otherkey in existingkeywords: if otherkey == key: - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "got multiple values for keyword argument '%s'", key) def _do_combine_starstarargs_wrapped(space, keys_w, w_starstararg, keywords, - keywords_w, existingkeywords, is_dict): + keywords_w, existingkeywords, is_dict, fnname_parens): i = 0 for w_key in keys_w: try: key = space.text_w(w_key) except OperationError as e: if e.match(space, space.w_TypeError): - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "keywords must be strings, not '%T'", w_key) if e.match(space, space.w_UnicodeEncodeError): @@ -418,7 +424,7 @@ raise else: if existingkeywords and key in existingkeywords: - raise oefmt(space.w_TypeError, + raise_type_error(space, fnname_parens, "got multiple values for keyword argument '%s'", key) keywords[i] = key diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py --- a/pypy/interpreter/baseobjspace.py +++ b/pypy/interpreter/baseobjspace.py @@ -1180,7 +1180,7 @@ if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). - args = frame.make_arguments(nargs) + args = frame.make_arguments(nargs, w_function=w_func) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: @@ -1197,7 +1197,7 @@ nargs, frame, methodcall=methodcall) # end of hack for performance - args = frame.make_arguments(nargs) + args = frame.make_arguments(nargs, w_function=w_func) return self.call_args(w_func, args) def call_args_and_c_profile(self, frame, w_func, args): diff --git a/pypy/interpreter/function.py b/pypy/interpreter/function.py --- a/pypy/interpreter/function.py +++ b/pypy/interpreter/function.py @@ -172,10 +172,10 @@ elif fast_natural_arity == Code.PASSTHROUGHARGS1 and nargs >= 1: assert isinstance(code, gateway.BuiltinCodePassThroughArguments1) w_obj = frame.peekvalue(nargs-1) - args = frame.make_arguments(nargs-1) + args = frame.make_arguments(nargs-1, w_function=self) return code.funcrun_obj(self, w_obj, args) - args = frame.make_arguments(nargs, methodcall=methodcall) + args = frame.make_arguments(nargs, methodcall=methodcall, w_function=self) return self.call_args(args) @jit.unroll_safe diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py --- a/pypy/interpreter/pyframe.py +++ b/pypy/interpreter/pyframe.py @@ -490,14 +490,32 @@ depth -= 1 self.valuestackdepth = finaldepth - def make_arguments(self, nargs, methodcall=False): + def _guess_function_name_parens(self, fnname=None, w_function=None): + """ Returns 'funcname()' from either a function name fnname or a + wrapped callable w_function. If it's not a function or a method, returns + 'Classname object'""" + # CPython has a similar function, PyEval_GetFuncName + from pypy.interpreter.function import Function, Method + if fnname is not None: + return fnname + '()' + if w_function is None: + return None + if isinstance(w_function, Function): + return w_function.name + '()' + if isinstance(w_function, Method): + return self._guess_function_name_parens(None, w_function.w_function) + return w_function.getname(self.space) + ' object' + + def make_arguments(self, nargs, methodcall=False, w_function=None, fnname=None): + fnname_parens = self._guess_function_name_parens(fnname, w_function) return Arguments( - self.space, self.peekvalues(nargs), methodcall=methodcall) + self.space, self.peekvalues(nargs), methodcall=methodcall, fnname_parens=fnname_parens) - def argument_factory(self, arguments, keywords, keywords_w, w_star, w_starstar, methodcall=False): + def argument_factory(self, arguments, keywords, keywords_w, w_star, w_starstar, methodcall=False, w_function=None, fnname=None): + fnname_parens = self._guess_function_name_parens(fnname, w_function) return Arguments( self.space, arguments, keywords, keywords_w, w_star, - w_starstar, methodcall=methodcall) + w_starstar, methodcall=methodcall, fnname_parens=fnname_parens) def hide(self): return self.pycode.hidden_applevel diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py --- a/pypy/interpreter/pyopcode.py +++ b/pypy/interpreter/pyopcode.py @@ -1307,9 +1307,9 @@ else: w_star = None arguments = self.popvalues(n_arguments) + w_function = self.popvalue() args = self.argument_factory(arguments, keywords, keywords_w, w_star, - w_starstar) - w_function = self.popvalue() + w_starstar, w_function=w_function) if self.get_is_being_profiled() and function.is_builtin_code(w_function): w_result = self.space.call_args_and_c_profile(self, w_function, args) diff --git a/pypy/interpreter/test/test_argument.py b/pypy/interpreter/test/test_argument.py --- a/pypy/interpreter/test/test_argument.py +++ b/pypy/interpreter/test/test_argument.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import py +import pytest from pypy.interpreter.argument import (Arguments, ArgErr, ArgErrUnknownKwds, ArgErrMultipleValues, ArgErrMissing, ArgErrTooMany, ArgErrTooManyMethod) from pypy.interpreter.signature import Signature @@ -138,6 +139,7 @@ class Type: def getname(self, space): return type(obj).__name__ + name = type(obj).__name__ return Type() @@ -332,15 +334,17 @@ def test_duplicate_kwds(self): space = DummySpace() - excinfo = py.test.raises(OperationError, Arguments, space, [], ["a"], - [1], w_starstararg={"a": 2}) + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg={"a": 2}, fnname_parens="foo()") assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "foo() got multiple values for keyword argument 'a'" def test_starstararg_wrong_type(self): space = DummySpace() - excinfo = py.test.raises(OperationError, Arguments, space, [], ["a"], - [1], w_starstararg="hello") + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg="hello", fnname_parens="bar()") assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "bar() argument after ** must be a mapping, not str" def test_unwrap_error(self): space = DummySpace() @@ -353,12 +357,12 @@ return bytes(w, 'utf-8') space.utf8_w = utf8_w space.text_w = utf8_w - excinfo = py.test.raises(OperationError, Arguments, space, [], - ["a"], [1], w_starstararg={None: 1}) + with py.test.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg={None: 1}, fnname_parens="f1()") assert excinfo.value.w_type is TypeError assert excinfo.value._w_value is None - excinfo = py.test.raises(OperationError, Arguments, space, [], - ["a"], [1], w_starstararg={valuedummy: 1}) + with py.test.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], [1], w_starstararg={valuedummy: 1}, fnname_parens="f2()") assert excinfo.value.w_type is ValueError assert excinfo.value._w_value is None @@ -435,9 +439,9 @@ raise FakeArgErr() args._match_signature = _match_signature - - excinfo = py.test.raises(OperationError, args.parse_obj, "obj", "foo", - Signature(["a", "b"], None, None)) + with pytest.raises(OperationError) as excinfo: + args.parse_obj("obj", "foo", + Signature(["a", "b"], None, None)) assert excinfo.value.w_type is TypeError assert excinfo.value.get_w_value(space) == "foo() msg" @@ -491,9 +495,9 @@ args._match_signature = _match_signature - excinfo = py.test.raises(OperationError, args.parse_into_scope, - "obj", [None, None], "foo", - Signature(["a", "b"], None, None)) + with pytest.raises(OperationError) as excinfo: + args.parse_into_scope("obj", [None, None], "foo", + Signature(["a", "b"], None, None)) assert excinfo.value.w_type is TypeError assert excinfo.value.get_w_value(space) == "foo() msg" @@ -568,9 +572,17 @@ l = [None, None, None] args._match_signature(None, l, Signature(["a", "b"], None, "**")) assert l == [1, 2, {'c': 3}] - excinfo = py.test.raises(OperationError, Arguments, space, [], ["a"], - [1], w_starstararg=kwargs(["a"], [2])) + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], + [1], w_starstararg=kwargs(["a"], [2])) assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "got multiple values for keyword argument 'a'" + + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], ["a"], + [1], w_starstararg=kwargs(["a"], [2]), fnname_parens="foo()") + assert excinfo.value.w_type is TypeError + assert excinfo.value.get_w_value(space) == "foo() got multiple values for keyword argument 'a'" @@ -671,20 +683,14 @@ def test_bad_type_for_star(self): space = self.space - try: - Arguments(space, [], w_stararg=space.wrap(42)) - except OperationError as e: - msg = space.text_w(space.str(e.get_w_value(space))) - assert msg == "argument after * must be an iterable, not int" - else: - assert 0, "did not raise" - try: - Arguments(space, [], w_starstararg=space.wrap(42)) - except OperationError as e: - msg = space.text_w(space.str(e.get_w_value(space))) - assert msg == "argument after ** must be a mapping, not int" - else: - assert 0, "did not raise" + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], w_stararg=space.wrap(42), fnname_parens="f1()") + msg = space.text_w(excinfo.value.get_w_value(space)) + assert msg == "f1() argument after * must be an iterable, not int" + with pytest.raises(OperationError) as excinfo: + Arguments(space, [], w_starstararg=space.wrap(42), fnname_parens="f2()") + msg = space.text_w(excinfo.value.get_w_value(space)) + assert msg == "f2() argument after ** must be a mapping, not int" def test_dont_count_default_arguments(self): space = self.space @@ -889,7 +895,7 @@ pass e = raises(TypeError, "f(*42)") assert str(e.value).endswith( - "argument after * must be an iterable, not int") + "f() argument after * must be an iterable, not int") e = raises(TypeError, "f(*X())") assert str(e.value) == "myerror" @@ -904,8 +910,10 @@ def f(x, y): pass e = raises(TypeError, "f(y=2, **{3: 5}, x=6)") - assert "keywords must be strings" in str(e.value) + assert "f() keywords must be strings" in str(e.value) e = raises(TypeError, "f(y=2, **{'x': 5}, x=6)") + # CPython figures out the name here, by peeking around in the stack in + # BUILD_MAP_UNPACK_WITH_CALL. we don't, too messy assert "got multiple values for keyword argument 'x'" in str(e.value) def test_dict_subclass_with_weird_getitem(self): diff --git a/pypy/module/__builtin__/functional.py b/pypy/module/__builtin__/functional.py --- a/pypy/module/__builtin__/functional.py +++ b/pypy/module/__builtin__/functional.py @@ -203,20 +203,24 @@ implementation_of) def max(space, __args__): - """max(iterable[, key=func]) -> value - max(a, b, c, ...[, key=func]) -> value + """max(iterable, *[, default=obj, key=func]) -> value +max(arg1, arg2, *args, *[, key=func]) -> value - With a single iterable argument, return its largest item. - With two or more arguments, return the largest argument. +With a single iterable argument, return its biggest item. The +default keyword-only argument specifies an object to return if +the provided iterable is empty. +With two or more arguments, return the largest argument. """ return min_max(space, __args__, "max") def min(space, __args__): - """min(iterable[, key=func]) -> value - min(a, b, c, ...[, key=func]) -> value + """min(iterable, *[, default=obj, key=func]) -> value +min(arg1, arg2, *args, *[, key=func]) -> value - With a single iterable argument, return its smallest item. - With two or more arguments, return the smallest argument. +With a single iterable argument, return its smallest item. The +default keyword-only argument specifies an object to return if +the provided iterable is empty. +With two or more arguments, return the smallest argument. """ return min_max(space, __args__, "min") diff --git a/pypy/module/_rawffi/interp_rawffi.py b/pypy/module/_rawffi/interp_rawffi.py --- a/pypy/module/_rawffi/interp_rawffi.py +++ b/pypy/module/_rawffi/interp_rawffi.py @@ -245,7 +245,11 @@ except OSError as e: raise wrap_oserror(space, e) - at unwrap_spec(name='fsencode_or_none') +if _MS_WINDOWS: + name_spec = 'fsencode' +else: + name_spec = 'fsencode_or_none' + at unwrap_spec(name=name_spec) def descr_new_cdll(space, w_type, name): cdll = open_cdll(space, name) return W_CDLL(space, name, cdll) diff --git a/pypy/module/_rawffi/test/test__rawffi.py b/pypy/module/_rawffi/test/test__rawffi.py --- a/pypy/module/_rawffi/test/test__rawffi.py +++ b/pypy/module/_rawffi/test/test__rawffi.py @@ -262,14 +262,17 @@ raise AssertionError("did not fail??") def test_libload_None(self): - if self.iswin32: - skip("unix specific") import _rawffi # this should return *all* loaded libs, dlopen(NULL) - dll = _rawffi.CDLL(None) - func = dll.ptr('rand', [], 'i') - res = func() - assert res[0] != 0 + try: + dll = _rawffi.CDLL(None) + except TypeError: + if not self.iswin32: + raise + else: + func = dll.ptr('rand', [], 'i') + res = func() + assert res[0] != 0 def test_libc_load(self): import _rawffi diff --git a/pypy/module/select/interp_select.py b/pypy/module/select/interp_select.py --- a/pypy/module/select/interp_select.py +++ b/pypy/module/select/interp_select.py @@ -30,11 +30,23 @@ @unwrap_spec(events="c_ushort") def register(self, space, w_fd, events=defaultevents): + """ + Register a file descriptor with the polling object. + fd -- either an integer, or an object with a fileno() method returning an + int. + events -- an optional bitmask describing the type of events to check for + """ fd = space.c_filedescriptor_w(w_fd) self.fddict[fd] = events @unwrap_spec(events="c_ushort") def modify(self, space, w_fd, events): + """ + Modify an already registered file descriptor. + fd -- either an integer, or an object with a fileno() method returning an + int. + events -- an optional bitmask describing the type of events to check for + """ fd = space.c_filedescriptor_w(w_fd) if fd not in self.fddict: raise wrap_oserror(space, OSError(errno.ENOENT, "poll.modify"), @@ -42,6 +54,9 @@ self.fddict[fd] = events def unregister(self, space, w_fd): + """ + Remove a file descriptor being tracked by the polling object. + """ fd = space.c_filedescriptor_w(w_fd) try: del self.fddict[fd] @@ -50,21 +65,24 @@ @unwrap_spec(w_timeout=WrappedDefault(None)) def poll(self, space, w_timeout): - """WARNING: the timeout parameter is in **milliseconds**!""" + """ + Polls the set of registered file descriptors, returning a list containing + any descriptors that have events or errors to report. + + the timeout parameter is in milliseconds""" if space.is_w(w_timeout, space.w_None): timeout = -1 end_time = 0 + elif space.isinstance_w(w_timeout, space.w_float) or space.isinstance_w(w_timeout, space.w_int): + if space.is_true(space.lt(w_timeout, space.newint(0))): + timeout = -1 + end_time = 0 + else: + timeout = space.c_int_w(space.int(w_timeout)) + end_time = timeutils.monotonic(space) + timeout * 0.001 else: - # we want to be compatible with cpython and also accept things - # that can be casted to integer (I think) - try: - # compute the integer - w_timeout = space.int(w_timeout) - except OperationError: - raise oefmt(space.w_TypeError, - "timeout must be an integer or None") - timeout = space.c_int_w(w_timeout) - end_time = timeutils.monotonic(space) + timeout * 0.001 + raise oefmt(space.w_TypeError, + "timeout must be an integer or None") if self.running: raise oefmt(space.w_RuntimeError, "concurrent poll() invocation") diff --git a/pypy/module/select/test/test_select.py b/pypy/module/select/test/test_select.py --- a/pypy/module/select/test/test_select.py +++ b/pypy/module/select/test/test_select.py @@ -217,9 +217,25 @@ readend, writeend = self.getpair() try: class A(object): - def __int__(self): + def fileno(self): return readend.fileno() - select.poll().poll(A()) # assert did not crash + poll = select.poll() + poll.register(A()) + + res = poll.poll(10) # timeout in ms + assert res == [] + res = poll.poll(1.1) # check floats + assert res == [] + + writeend.send(b"foo!") + # can't easily test actual blocking, is done in lib-python tests + res = poll.poll() + assert res == [(readend.fileno(), 1)] + + # check negative timeout + # proper test in lib-python, test_poll_blocks_with_negative_ms + res = poll.poll(-0.001) + assert res == [(readend.fileno(), 1)] finally: readend.close() writeend.close() @@ -238,7 +254,6 @@ pollster.register(0, 65535) # USHRT_MAX raises(OverflowError, pollster.register, 0, 65536) # USHRT_MAX + 1 raises(OverflowError, pollster.poll, 2147483648) # INT_MAX + 1 - raises(OverflowError, pollster.poll, -2147483648 - 1) raises(OverflowError, pollster.poll, 4294967296) # UINT_MAX + 1 exc = raises(TypeError, pollster.poll, '123') assert str(exc.value) == 'timeout must be an integer or None' diff --git a/pypy/module/sys/interp_encoding.py b/pypy/module/sys/interp_encoding.py --- a/pypy/module/sys/interp_encoding.py +++ b/pypy/module/sys/interp_encoding.py @@ -51,4 +51,6 @@ def getfilesystemencodeerrors(space): + if sys.platform == "win32": + return space.newtext('strict') return space.newtext('surrogateescape') diff --git a/pypy/objspace/std/callmethod.py b/pypy/objspace/std/callmethod.py --- a/pypy/objspace/std/callmethod.py +++ b/pypy/objspace/std/callmethod.py @@ -111,12 +111,12 @@ keywords_w[n_kwargs] = w_value arguments = f.popvalues(n) # includes w_self if it is not None - args = f.argument_factory( - arguments, keywords, keywords_w, None, None, - methodcall=w_self is not None) if w_self is None: f.popvalue_maybe_none() # removes w_self, which is None w_callable = f.popvalue() + args = f.argument_factory( + arguments, keywords, keywords_w, None, None, + methodcall=w_self is not None, w_function=w_callable) if f.get_is_being_profiled() and function.is_builtin_code(w_callable): w_result = f.space.call_args_and_c_profile(f, w_callable, args) else: diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -1235,9 +1235,11 @@ lgt -= 1 if right: - while rpos > lpos and rutf8.isspace(value, - rutf8.prev_codepoint_pos(value, rpos)): - rpos = rutf8.prev_codepoint_pos(value, rpos) + while rpos > lpos: + prev = rutf8.prev_codepoint_pos(value, rpos) + if not rutf8.isspace(value, prev): + break + rpos = prev lgt -= 1 assert rpos >= lpos # annotator hint, don't remove @@ -1258,9 +1260,11 @@ lgt -= 1 if right: - while rpos > lpos and rutf8.utf8_in_chars(value, - rutf8.prev_codepoint_pos(value, rpos), chars): - rpos = rutf8.prev_codepoint_pos(value, rpos) + while rpos > lpos: + prev = rutf8.prev_codepoint_pos(value, rpos) + if not rutf8.utf8_in_chars(value, prev, chars): + break + rpos = prev lgt -= 1 assert rpos >= lpos # annotator hint, don't remove From pypy.commits at gmail.com Tue Sep 17 11:06:43 2019 From: pypy.commits at gmail.com (daka...@gmail.com) Date: Tue, 17 Sep 2019 08:06:43 -0700 (PDT) Subject: [pypy-commit] pypy py3.7: Skip CPython specific test Message-ID: <5d80f683.1c69fb81.6ef49.328b@mx.google.com> Author: dakarpov at gmail.com Branch: py3.7 Changeset: r97517:838c4df236cd Date: 2019-09-17 17:03 +0300 http://bitbucket.org/pypy/pypy/changeset/838c4df236cd/ Log: Skip CPython specific test diff --git a/lib-python/3/test/test_dict.py b/lib-python/3/test/test_dict.py --- a/lib-python/3/test/test_dict.py +++ b/lib-python/3/test/test_dict.py @@ -299,6 +299,7 @@ self.assertNotEqual(d, d2) self.assertEqual(len(d2), len(d) + 1) + @support.cpython_only def test_copy_maintains_tracking(self): class A: pass From pypy.commits at gmail.com Tue Sep 17 12:27:03 2019 From: pypy.commits at gmail.com (cfbolz) Date: Tue, 17 Sep 2019 09:27:03 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix translation, I think Message-ID: <5d810957.1c69fb81.2de06.25d6@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97518:060a31354521 Date: 2019-09-17 18:25 +0200 http://bitbucket.org/pypy/pypy/changeset/060a31354521/ Log: fix translation, I think diff --git a/pypy/interpreter/argument.py b/pypy/interpreter/argument.py --- a/pypy/interpreter/argument.py +++ b/pypy/interpreter/argument.py @@ -9,7 +9,7 @@ from pypy.interpreter.error import OperationError, oefmt - at specialize.arg(1) + at specialize.arg(2) def raise_type_error(space, fnname_parens, msg, *args): if fnname_parens is None: raise oefmt(space.w_TypeError, msg, *args) From pypy.commits at gmail.com Tue Sep 17 13:24:12 2019 From: pypy.commits at gmail.com (antocuni) Date: Tue, 17 Sep 2019 10:24:12 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: some review comments; more to follow Message-ID: <5d8116bc.1c69fb81.54355.e57a@mx.google.com> Author: Antonio Cuni Branch: json-decoder-maps Changeset: r97519:557bf35c498d Date: 2019-09-17 19:23 +0200 http://bitbucket.org/pypy/pypy/changeset/557bf35c498d/ Log: some review comments; more to follow diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -25,6 +25,16 @@ return x * NEG_POW_10[exp] +# This is basically the same logic that we use to implement +# objspace.std.withintprebuilt. On one hand, it would be nice to have only a +# single implementation. On the other hand, since it is disabled by default, +# it doesn't change much at runtime. However, in intobject.wrapint there is an +# "obscure hack to help the CPU cache": it might be useful here as well? +# +# this is more a feature than a review but: I wonder whether it is +# worth to also have a per-decoder int cache which caches all the ints, not +# only the small ones. I suppose it might be useful in case you have a big +# json file with e.g. unique ids which might be repeated here and there. class IntCache(object): """ A cache for wrapped ints between START and END """ @@ -49,6 +59,7 @@ DEFAULT_SIZE_SCRATCH = 20 + # put a comment explaining what it does and why this is a reasonable number MIN_SIZE_FOR_STRING_CACHE = 1024 * 1024 # evaluate the string cache for 200 strings, before looking at the hit rate @@ -818,6 +829,7 @@ if single_nextmap.key_repr_cmp(ll_chars, position): decoder.pos = position + len(single_nextmap.key_repr) return single_nextmap + # return None explicitly? def observe_transition(self, newmap, terminator): """ observe a transition from self to newmap. @@ -1034,6 +1046,8 @@ self.cache_hits * JSONDecoder.STRING_CACHE_USEFULNESS_FACTOR < self.decoded_strings) def key_repr_cmp(self, ll_chars, i): + # isn't there a way to use a "real" strcmp/memcmp? Maybe + # (ab)using llstr/rstr._get_raw_buf or similar? for j, c in enumerate(self.key_repr): if ll_chars[i] != c: return False From pypy.commits at gmail.com Tue Sep 17 17:11:25 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Tue, 17 Sep 2019 14:11:25 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Fixed construction Message-ID: <5d814bfd.1c69fb81.e8a63.5fd9@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97520:63fa74a8e4b7 Date: 2019-09-17 22:10 +0100 http://bitbucket.org/pypy/pypy/changeset/63fa74a8e4b7/ Log: Fixed construction diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -185,8 +185,8 @@ return i return SMALLBUF - @unwrap_spec(w_mode=WrappedDefault("r"), w_closefd=WrappedDefault(True), w_opener=WrappedDefault(None)) - def descr_init(self, space, w_nameobj, w_mode, w_closefd, w_opener): + @unwrap_spec(mode='text', closefd=int) + def descr_init(self, space, w_nameobj, mode='r', closefd=True, w_opener=None): name = rffi.cast(rffi.CWCHARP, 0) self.fd = -1 self.handle = rwin32.INVALID_HANDLE_VALUE @@ -200,12 +200,10 @@ try: if space.isinstance_w(w_nameobj, space.w_int): self.fd = space.int_w(w_nameobj) - closefd = space.bool_w(w_closefd) if self.fd < 0: from pypy.module.posix.interp_posix import fspath w_path = fspath(space, w_nameobj) - name = rffi.unicode2wcharp(space.utf8_w(w_path)) console_type = _pyio_get_console_type(space, w_path) if not console_type: raise oefmt(space.w_ValueError, @@ -213,9 +211,8 @@ if console_type == '\0': raise oefmt(space.w_ValueError, "Cannot open non-console file") - s = space.text_w(w_mode) - for char in s: + for char in mode: if char in "+abx": # OK do nothing pass @@ -254,11 +251,14 @@ if self.writable: access = rwin32.GENERIC_WRITE - traits = _preferred_traits(space.wcharp2unicode(name)) + traits = _preferred_traits(space.realunicode_w(w_path)) if not (traits.str is unicode): raise oefmt(space.w_ValueError, "Non-unicode string name %s", traits.str) win32traits = make_win32_traits(traits) + + pathlen = space.len_w(w_path) + name = rffi.utf82wcharp(space.utf8_w(w_path), pathlen) self.handle = win32traits.CreateFile(name, rwin32.GENERIC_READ | rwin32.GENERIC_WRITE, rwin32.FILE_SHARE_READ | rwin32.FILE_SHARE_WRITE, @@ -268,7 +268,8 @@ access, rwin32.FILE_SHARE_READ | rwin32.FILE_SHARE_WRITE, rffi.NULL, win32traits.OPEN_EXISTING, 0, rffi.NULL) - + lltype.free(name, flavor='raw') + if self.handle == rwin32.INVALID_HANDLE_VALUE: raise WindowsError(rwin32.GetLastError_saved(), "Failed to open handle") diff --git a/pypy/module/_io/test/test_win32consoleio.py b/pypy/module/_io/test/test_win32consoleio.py --- a/pypy/module/_io/test/test_win32consoleio.py +++ b/pypy/module/_io/test/test_win32consoleio.py @@ -8,15 +8,14 @@ cls.w_UINT_MAX = space.wrap(UINT_MAX) def test_open_fd(self): - self.assertRaisesRegex(ValueError, - "negative file descriptor", _io._WindowsConsoleIO, -1) + import _io + raises(ValueError, _io._WindowsConsoleIO, -1) fd, _ = tempfile.mkstemp() try: # Windows 10: "Cannot open non-console file" # Earlier: "Cannot open console output buffer for reading" - self.assertRaisesRegex(ValueError, - "Cannot open (console|non-console file)", _io._WindowsConsoleIO, fd) + raises(ValueError, _io._WindowsConsoleIO, fd) finally: os.close(fd) @@ -26,9 +25,9 @@ # cannot open console because it's not a real console pass else: - self.assertTrue(f.readable()) - self.assertFalse(f.writable()) - self.assertEqual(0, f.fileno()) + assert f.readable() == True + assert f.writable() == False + assert 0 == f.fileno() f.close() # multiple close should not crash f.close() @@ -38,9 +37,9 @@ # cannot open console because it's not a real console pass else: - self.assertFalse(f.readable()) - self.assertTrue(f.writable()) - self.assertEqual(1, f.fileno()) + assert f.readable() == False + assert True == f.writable() + assert 1 == f.fileno() f.close() f.close() @@ -50,9 +49,9 @@ # cannot open console because it's not a real console pass else: - self.assertFalse(f.readable()) - self.assertTrue(f.writable()) - self.assertEqual(2, f.fileno()) + assert False == f.readable() + assert True == f.writable() + assert 2 == f.fileno() f.close() f.close() diff --git a/rpython/rlib/rwin32.py b/rpython/rlib/rwin32.py --- a/rpython/rlib/rwin32.py +++ b/rpython/rlib/rwin32.py @@ -255,12 +255,9 @@ fd = _open_osfhandle(handle, flags) with FdValidator(fd): return fd - - wcsicmp = rffi.llexternal('_wcsicmp', [rffi.CWCHARP, rffi.CWCHARP], rffi.INT) wcsncpy_s = rffi.llexternal('wcsncpy_s', [rffi.CWCHARP, rffi.SIZE_T, rffi.CWCHARP, rffi.SIZE_T], rffi.INT) - def build_winerror_to_errno(): """Build a dictionary mapping windows error numbers to POSIX errno. From pypy.commits at gmail.com Wed Sep 18 07:42:49 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 18 Sep 2019 04:42:49 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: merge py3.6 into branch Message-ID: <5d821839.1c69fb81.132c9.7ba1@mx.google.com> Author: Matti Picus Branch: winconsoleio Changeset: r97522:90f3fa6eca04 Date: 2019-09-18 14:41 +0300 http://bitbucket.org/pypy/pypy/changeset/90f3fa6eca04/ Log: merge py3.6 into branch diff --git a/pypy/interpreter/argument.py b/pypy/interpreter/argument.py --- a/pypy/interpreter/argument.py +++ b/pypy/interpreter/argument.py @@ -9,7 +9,7 @@ from pypy.interpreter.error import OperationError, oefmt - at specialize.arg(1) + at specialize.arg(2) def raise_type_error(space, fnname_parens, msg, *args): if fnname_parens is None: raise oefmt(space.w_TypeError, msg, *args) diff --git a/pypy/module/sys/app.py b/pypy/module/sys/app.py --- a/pypy/module/sys/app.py +++ b/pypy/module/sys/app.py @@ -22,7 +22,17 @@ try: from traceback import print_exception - print_exception(exctype, value, traceback) + limit = getattr(sys, 'tracebacklimit', None) + if isinstance(limit, int): + # ok, this is bizarre, but, the meaning of sys.tracebacklimit is + # understood differently in the traceback module than in + # PyTraceBack_Print in CPython, see + # https://bugs.python.org/issue38197 + # one is counting from the top, the other from the bottom of the + # stack. so reverse polarity here + print_exception(exctype, value, traceback, limit=-limit) + else: + print_exception(exctype, value, traceback) except: if not excepthook_failsafe(exctype, value): raise diff --git a/pypy/module/sys/interp_encoding.py b/pypy/module/sys/interp_encoding.py --- a/pypy/module/sys/interp_encoding.py +++ b/pypy/module/sys/interp_encoding.py @@ -9,16 +9,20 @@ if sys.platform == "win32": base_encoding = "mbcs" + base_error = "strict" elif sys.platform == "darwin": base_encoding = "utf-8" + base_error = "surrogateescape" elif sys.platform == "linux2": base_encoding = "ascii" + base_error = "surrogateescape" else: # In CPython, the default base encoding is NULL. This is paired with a # comment that says "If non-NULL, this is different than the default # encoding for strings". Therefore, the default filesystem encoding is the # default encoding for strings, which is ASCII. base_encoding = "ascii" + base_error = "surrogateescape" def _getfilesystemencoding(space): encoding = base_encoding @@ -51,6 +55,4 @@ def getfilesystemencodeerrors(space): - if sys.platform == "win32": - return space.newtext('strict') - return space.newtext('surrogateescape') + return space.newtext(base_error) diff --git a/pypy/module/sys/test/test_sysmodule.py b/pypy/module/sys/test/test_sysmodule.py --- a/pypy/module/sys/test/test_sysmodule.py +++ b/pypy/module/sys/test/test_sysmodule.py @@ -381,6 +381,36 @@ assert out.getvalue() == 'hello\n123 456' # no final \n added in 3.x """ + def test_tracebacklimit_excepthook(self): + import sys, _io + savestderr = sys.stderr + err = _io.StringIO() + sys.stderr = err + assert not hasattr(sys, "tracebacklimit") + sys.tracebacklimit = 2 + + eh = sys.__excepthook__ + def f1(): + f2() + def f2(): + f3() + def f3(): + raise ValueError(42) + + + try: + f1() + except ValueError as exc: + eh(*sys.exc_info()) + msg = err.getvalue() + print(msg) + # should be removed by the limit + assert "f1" not in msg + + sys.stderr = savestderr + del sys.tracebacklimit + + # FIXME: testing the code for a lost or replaced excepthook in # Python/pythonrun.c::PyErr_PrintEx() is tricky. From pypy.commits at gmail.com Wed Sep 18 07:52:37 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 18 Sep 2019 04:52:37 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: bad copy paste? Message-ID: <5d821a85.1c69fb81.7fe5a.a566@mx.google.com> Author: Matti Picus Branch: winconsoleio Changeset: r97523:58e969594b31 Date: 2019-09-18 14:51 +0300 http://bitbucket.org/pypy/pypy/changeset/58e969594b31/ Log: bad copy paste? diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -219,7 +219,7 @@ elif char == "r": if rwa: raise oefmt(space.w_ValueError, - "invalid mode: %s", space.text_w(w_mode)) + "invalid mode: %s", space.newtext(mode)) rwa = True self.readable = True if console_type == "x": @@ -227,14 +227,14 @@ elif char == "w": if rwa: raise oefmt(space.w_ValueError, - "invalid mode: %s", space.text_w(w_mode)) + "invalid mode: %s", space.newtext(mode)) rwa = True self.writable = True if console_type == 'x': console_type = 'w' else: raise oefmt(space.w_ValueError, - "invalid mode: %s", space.text_w(w_mode)) + "invalid mode: %s", space.newtext(mode)) if not rwa: raise oefmt(space.w_ValueError, "Must have exactly one of read or write mode") From pypy.commits at gmail.com Wed Sep 18 08:40:05 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 18 Sep 2019 05:40:05 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: help flow analysis Message-ID: <5d8225a5.1c69fb81.52bf.8c66@mx.google.com> Author: Matti Picus Branch: winconsoleio Changeset: r97524:758dcf8d6170 Date: 2019-09-18 15:39 +0300 http://bitbucket.org/pypy/pypy/changeset/758dcf8d6170/ Log: help flow analysis diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -201,6 +201,9 @@ if space.isinstance_w(w_nameobj, space.w_int): self.fd = space.int_w(w_nameobj) + # make the flow analysis happy,otherwise it thinks w_path + # is undefined later + w_path = w_nameobj if self.fd < 0: from pypy.module.posix.interp_posix import fspath w_path = fspath(space, w_nameobj) From pypy.commits at gmail.com Wed Sep 18 09:49:32 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 18 Sep 2019 06:49:32 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: fix 58e969594b31 Message-ID: <5d8235ec.1c69fb81.4879b.355e@mx.google.com> Author: Matti Picus Branch: winconsoleio Changeset: r97525:53bf39ed2750 Date: 2019-09-18 16:48 +0300 http://bitbucket.org/pypy/pypy/changeset/53bf39ed2750/ Log: fix 58e969594b31 diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -222,7 +222,7 @@ elif char == "r": if rwa: raise oefmt(space.w_ValueError, - "invalid mode: %s", space.newtext(mode)) + "invalid mode: %s", mode) rwa = True self.readable = True if console_type == "x": @@ -230,14 +230,14 @@ elif char == "w": if rwa: raise oefmt(space.w_ValueError, - "invalid mode: %s", space.newtext(mode)) + "invalid mode: %s", mode) rwa = True self.writable = True if console_type == 'x': console_type = 'w' else: raise oefmt(space.w_ValueError, - "invalid mode: %s", space.newtext(mode)) + "invalid mode: %s", mode) if not rwa: raise oefmt(space.w_ValueError, "Must have exactly one of read or write mode") From pypy.commits at gmail.com Wed Sep 18 15:27:30 2019 From: pypy.commits at gmail.com (cfbolz) Date: Wed, 18 Sep 2019 12:27:30 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: another corner case of PyTraceBack_Print with tracebacklimit Message-ID: <5d828522.1c69fb81.618ee.a58c@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97526:67edce2ce705 Date: 2019-09-18 21:26 +0200 http://bitbucket.org/pypy/pypy/changeset/67edce2ce705/ Log: another corner case of PyTraceBack_Print with tracebacklimit diff --git a/pypy/module/sys/app.py b/pypy/module/sys/app.py --- a/pypy/module/sys/app.py +++ b/pypy/module/sys/app.py @@ -21,7 +21,7 @@ pass try: - from traceback import print_exception + from traceback import print_exception, format_exception_only limit = getattr(sys, 'tracebacklimit', None) if isinstance(limit, int): # ok, this is bizarre, but, the meaning of sys.tracebacklimit is @@ -30,7 +30,16 @@ # https://bugs.python.org/issue38197 # one is counting from the top, the other from the bottom of the # stack. so reverse polarity here - print_exception(exctype, value, traceback, limit=-limit) + if limit: + print_exception(exctype, value, traceback, limit=-limit) + else: + # the limit is 0. PyTraceBack_Print does not print + # Traceback (most recent call last): + # because there is indeed no traceback. + # the traceback module don't care + for line in format_exception_only(exctype, value): + print(line, end="") + else: print_exception(exctype, value, traceback) except: diff --git a/pypy/module/sys/test/test_sysmodule.py b/pypy/module/sys/test/test_sysmodule.py --- a/pypy/module/sys/test/test_sysmodule.py +++ b/pypy/module/sys/test/test_sysmodule.py @@ -400,13 +400,22 @@ try: f1() - except ValueError as exc: + except ValueError: eh(*sys.exc_info()) msg = err.getvalue() - print(msg) # should be removed by the limit assert "f1" not in msg + err = _io.StringIO() + sys.stderr = err + sys.tracebacklimit = 0 + try: + f1() + except ValueError: + eh(*sys.exc_info()) + msg = err.getvalue() + assert "Traceback (most recent call last):" not in msg + sys.stderr = savestderr del sys.tracebacklimit From pypy.commits at gmail.com Wed Sep 18 15:48:20 2019 From: pypy.commits at gmail.com (rlamy) Date: Wed, 18 Sep 2019 12:48:20 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Raise SyntaxError instead of DeprecationWarning when treating invalid escapes in bytes as errors (bpo-28691) Message-ID: <5d828a04.1c69fb81.e0308.3ae8@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97528:5dbba3873910 Date: 2019-09-18 20:47 +0100 http://bitbucket.org/pypy/pypy/changeset/5dbba3873910/ Log: Raise SyntaxError instead of DeprecationWarning when treating invalid escapes in bytes as errors (bpo-28691) diff --git a/pypy/interpreter/pyparser/parsestring.py b/pypy/interpreter/pyparser/parsestring.py --- a/pypy/interpreter/pyparser/parsestring.py +++ b/pypy/interpreter/pyparser/parsestring.py @@ -249,10 +249,14 @@ buf = builder.build() if first_escape_error_char != '': - space.warn( - space.newtext("invalid escape sequence '\\%s'" - % first_escape_error_char), - space.w_DeprecationWarning) + try: + msg = "invalid escape sequence '\\%s'" % first_escape_error_char + space.warn(space.newtext(msg), space.w_DeprecationWarning) + except OperationError as e: + if e.match(space, space.w_DeprecationWarning): + raise oefmt(space.w_SyntaxError, msg) + else: + raise return buf, first_escape_error_char diff --git a/pypy/interpreter/pyparser/test/apptest_parsestring.py b/pypy/interpreter/pyparser/test/apptest_parsestring.py new file mode 100644 --- /dev/null +++ b/pypy/interpreter/pyparser/test/apptest_parsestring.py @@ -0,0 +1,10 @@ +from pytest import raises +import warnings + +def test_bytes_invalid_escape(): + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('error', category=DeprecationWarning) + with raises(SyntaxError) as excinfo: + eval("b'''\n\\z'''") + assert not w + assert excinfo.value.filename == '' diff --git a/pypy/interpreter/pyparser/test/test_parsestring.py b/pypy/interpreter/pyparser/test/test_parsestring.py --- a/pypy/interpreter/pyparser/test/test_parsestring.py +++ b/pypy/interpreter/pyparser/test/test_parsestring.py @@ -47,9 +47,7 @@ parsestring.parsestr, space, None, "b'\xe9'") self.parse_and_compare(r"b'\xe9'", chr(0xE9)) - def test_unicode(self): - space = self.space for s in ['hello world', 'hello\n world']: self.parse_and_compare(repr(s), unicode(s)) @@ -106,7 +104,7 @@ s = s.decode("koi8-u").encode("utf8") w_ret = parsestring.parsestr(self.space, 'koi8-u', s) ret = space.unwrap(w_ret) - assert ret == eval("# -*- coding: koi8-u -*-\nu'\x81\\t'") + assert ret == eval("# -*- coding: koi8-u -*-\nu'\x81\\t'") def test_multiline_unicode_strings_with_backslash(self): space = self.space From pypy.commits at gmail.com Thu Sep 19 02:04:20 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 18 Sep 2019 23:04:20 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix translation Message-ID: <5d831a64.1c69fb81.2c8c4.184d@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97529:be7243dd1d25 Date: 2019-09-19 08:29 +0300 http://bitbucket.org/pypy/pypy/changeset/be7243dd1d25/ Log: fix translation diff --git a/pypy/interpreter/pyparser/parsestring.py b/pypy/interpreter/pyparser/parsestring.py --- a/pypy/interpreter/pyparser/parsestring.py +++ b/pypy/interpreter/pyparser/parsestring.py @@ -249,12 +249,12 @@ buf = builder.build() if first_escape_error_char != '': + msg = "invalid escape sequence '%s'" try: - msg = "invalid escape sequence '\\%s'" % first_escape_error_char - space.warn(space.newtext(msg), space.w_DeprecationWarning) + space.warn(space.newtext(msg % first_escape_error_char), space.w_DeprecationWarning) except OperationError as e: if e.match(space, space.w_DeprecationWarning): - raise oefmt(space.w_SyntaxError, msg) + raise oefmt(space.w_SyntaxError, msg, first_escape_error_char) else: raise From pypy.commits at gmail.com Thu Sep 19 02:04:41 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 18 Sep 2019 23:04:41 -0700 (PDT) Subject: [pypy-commit] pypy default: default is now 7.3.0 Message-ID: <5d831a79.1c69fb81.21219.6b25@mx.google.com> Author: Matti Picus Branch: Changeset: r97531:78cd4acbcbec Date: 2019-09-19 08:34 +0300 http://bitbucket.org/pypy/pypy/changeset/78cd4acbcbec/ Log: default is now 7.3.0 diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-pypy2-7.2.0.rst rename from pypy/doc/whatsnew-head.rst rename to pypy/doc/whatsnew-pypy2-7.2.0.rst diff --git a/pypy/module/cpyext/include/patchlevel.h b/pypy/module/cpyext/include/patchlevel.h --- a/pypy/module/cpyext/include/patchlevel.h +++ b/pypy/module/cpyext/include/patchlevel.h @@ -32,8 +32,8 @@ * module/sys/version.py * doc/conf.py */ -#define PYPY_VERSION "7.2.0-alpha0" -#define PYPY_VERSION_NUM 0x07020000 +#define PYPY_VERSION "7.3.0-alpha0" +#define PYPY_VERSION_NUM 0x07030000 /* Defined to mean a PyPy where cpyext holds more regular references to PyObjects, e.g. staying alive as long as the internal PyPy object stays alive. */ diff --git a/pypy/module/sys/version.py b/pypy/module/sys/version.py --- a/pypy/module/sys/version.py +++ b/pypy/module/sys/version.py @@ -13,7 +13,7 @@ # make sure to keep PYPY_VERSION in sync with: # module/cpyext/include/patchlevel.h # doc/conf.py -PYPY_VERSION = (7, 2, 0, "alpha", 0) +PYPY_VERSION = (7, 3, 0, "alpha", 0) import pypy From pypy.commits at gmail.com Thu Sep 19 02:04:42 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 18 Sep 2019 23:04:42 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy2.7-v7.x: release is now 7.2.0 Message-ID: <5d831a7a.1c69fb81.a54f0.dccb@mx.google.com> Author: Matti Picus Branch: release-pypy2.7-v7.x Changeset: r97532:cb2be12846a2 Date: 2019-09-19 08:36 +0300 http://bitbucket.org/pypy/pypy/changeset/cb2be12846a2/ Log: release is now 7.2.0 diff --git a/pypy/module/cpyext/include/patchlevel.h b/pypy/module/cpyext/include/patchlevel.h --- a/pypy/module/cpyext/include/patchlevel.h +++ b/pypy/module/cpyext/include/patchlevel.h @@ -32,8 +32,8 @@ * module/sys/version.py * doc/conf.py */ -#define PYPY_VERSION "7.1.1" -#define PYPY_VERSION_NUM 0x07010100 +#define PYPY_VERSION "7.2.0" +#define PYPY_VERSION_NUM 0x07020000 /* Defined to mean a PyPy where cpyext holds more regular references to PyObjects, e.g. staying alive as long as the internal PyPy object stays alive. */ diff --git a/pypy/module/sys/version.py b/pypy/module/sys/version.py --- a/pypy/module/sys/version.py +++ b/pypy/module/sys/version.py @@ -13,7 +13,7 @@ # make sure to keep PYPY_VERSION in sync with: # module/cpyext/include/patchlevel.h # doc/conf.py -PYPY_VERSION = (7, 1, 1, "final", 0) +PYPY_VERSION = (7, 2, 0, "final", 0) import pypy From pypy.commits at gmail.com Thu Sep 19 02:04:39 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 18 Sep 2019 23:04:39 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy2.7-v7.x: merge default into branch Message-ID: <5d831a77.1c69fb81.4faa3.e60b@mx.google.com> Author: Matti Picus Branch: release-pypy2.7-v7.x Changeset: r97530:5285865f8958 Date: 2019-09-19 08:30 +0300 http://bitbucket.org/pypy/pypy/changeset/5285865f8958/ Log: merge default into branch diff too long, truncating to 2000 out of 60853 lines diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -70,7 +70,9 @@ ^lib_pypy/ctypes_config_cache/_.+_cache\.py$ ^lib_pypy/ctypes_config_cache/_.+_.+_\.py$ ^lib_pypy/_libmpdec/.+.o$ -^lib_pypy/.+.c$ +^lib_pypy/.+_cffi.c$ +^lib_pypy/_curses_cffi_check.c +^lib_pypy/_pypy_openssl.c ^lib_pypy/.+.o$ ^lib_pypy/.+.so$ ^lib_pypy/.+.pyd$ diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -10,10 +10,6 @@ 32f35069a16d819b58c1b6efb17c44e3e53397b2 release-2.3.1 10f1b29a2bd21f837090286174a9ca030b8680b2 release-2.5.0 9c4588d731b7fe0b08669bd732c2b676cb0a8233 release-2.5.1 -fcdb941565156385cbac04cfb891f8f4c7a92ef6 release-2.6.0 -fcdb941565156385cbac04cfb891f8f4c7a92ef6 release-2.6.0 -e03971291f3a0729ecd3ee7fae7ddb0bb82d476c release-2.6.0 -e03971291f3a0729ecd3ee7fae7ddb0bb82d476c release-2.6.0 295ee98b69288471b0fcf2e0ede82ce5209eb90b release-2.6.0 f3ad1e1e1d6215e20d34bb65ab85ff9188c9f559 release-2.6.1 850edf14b2c75573720f59e95767335fb1affe55 release-4.0.0 @@ -24,17 +20,10 @@ b0a649e90b6642251fb4a765fe5b27a97b1319a9 release-5.1.1 80ef432a32d9baa4b3c5a54c215e8ebe499f6374 release-5.1.2 40497617ae91caa1a394d8be6f9cd2de31cb0628 release-pypy3.3-v5.2 -40497617ae91caa1a394d8be6f9cd2de31cb0628 release-pypy3.3-v5.2 c09c19272c990a0611b17569a0085ad1ab00c8ff release-pypy2.7-v5.3 7e8df3df96417c16c2d55b41352ec82c9c69c978 release-pypy2.7-v5.3.1 -68bb3510d8212ae9efb687e12e58c09d29e74f87 release-pypy2.7-v5.4.0 -68bb3510d8212ae9efb687e12e58c09d29e74f87 release-pypy2.7-v5.4.0 77392ad263504df011ccfcabf6a62e21d04086d0 release-pypy2.7-v5.4.0 -050d84dd78997f021acf0e133934275d63547cc0 release-pypy2.7-v5.4.1 -050d84dd78997f021acf0e133934275d63547cc0 release-pypy2.7-v5.4.1 0e2d9a73f5a1818d0245d75daccdbe21b2d5c3ef release-pypy2.7-v5.4.1 -4909c06daf41ce88f87dc01c57959cadad4df4a8 RevDB-pypy2.7-v5.4.1 -4909c06daf41ce88f87dc01c57959cadad4df4a8 RevDB-pypy2.7-v5.4.1 d7724c0a5700b895a47de44074cdf5fd659a988f RevDB-pypy2.7-v5.4.1 aff251e543859ce4508159dd9f1a82a2f553de00 release-pypy2.7-v5.6.0 e90317857d27917bf840caf675832292ee070510 RevDB-pypy2.7-v5.6.1 @@ -45,33 +34,20 @@ 2875f328eae2216a87f3d6f335092832eb031f56 release-pypy3.5-v5.7.1 c925e73810367cd960a32592dd7f728f436c125c release-pypy2.7-v5.8.0 a37ecfe5f142bc971a86d17305cc5d1d70abec64 release-pypy3.5-v5.8.0 -03d614975835870da65ff0481e1edad68ebbcb8d release-pypy2.7-v5.9.0 d72f9800a42b46a8056951b1da2426d2c2d8d502 release-pypy3.5-v5.9.0 -03d614975835870da65ff0481e1edad68ebbcb8d release-pypy2.7-v5.9.0 84a2f3e6a7f88f2fe698e473998755b3bd1a12e2 release-pypy2.7-v5.9.0 0e7ea4fe15e82d5124e805e2e4a37cae1a402d4b release-pypy2.7-v5.10.0 -a91df6163fb76df245091f741dbf6a23ddc72374 release-pypy3.5-v5.10.0 -a91df6163fb76df245091f741dbf6a23ddc72374 release-pypy3.5-v5.10.0 -0000000000000000000000000000000000000000 release-pypy3.5-v5.10.0 -0000000000000000000000000000000000000000 release-pypy3.5-v5.10.0 09f9160b643e3f02ccb8c843b2fbb4e5cbf54082 release-pypy3.5-v5.10.0 3f6eaa010fce78cc7973bdc1dfdb95970f08fed2 release-pypy3.5-v5.10.1 ab0b9caf307db6592905a80b8faffd69b39005b8 release-pypy2.7-v6.0.0 fdd60ed87e941677e8ea11acf9f1819466521bf2 release-pypy3.5-v6.0.0 9112c8071614108b1042bfef0713915107004d62 release-pypy2.7-v7.0.0 1f86f25937b6ae6c8b25236c35228fac587678bf release-pypy3.5-v7.0.0 -dab365a465140aa79a5f3ba4db784c4af4d5c195 release-pypy3.6-v7.0.0 -9112c8071614108b1042bfef0713915107004d62 release-pypy2.7-v7.0.0 c8805ee6d7846ca2722b106eeaa2f128c699aba3 release-pypy2.7-v7.0.0 -1f86f25937b6ae6c8b25236c35228fac587678bf release-pypy3.5-v7.0.0 928a4f70d3de7d17449456946154c5da6e600162 release-pypy3.5-v7.0.0 -dab365a465140aa79a5f3ba4db784c4af4d5c195 release-pypy3.6-v7.0.0 fb40f7a5524c77b80e6c468e087d621610137261 release-pypy3.6-v7.0.0 990cef41fe11e5d46b019a46aa956ff46ea1a234 release-pypy2.7-v7.1.0 -bb0d05b190b9c579f0c889a368636e14f6205bab release-pypy3.6-v7.1.0 -bb0d05b190b9c579f0c889a368636e14f6205bab release-pypy3.6-v7.1.0 -6fd188f8f903b7555920adf7d5e7fe21db1bd593 release-pypy3.6-v7.1.0 -6fd188f8f903b7555920adf7d5e7fe21db1bd593 release-pypy3.6-v7.1.0 -7a2e437acfceafe2665b23b1394dc6c66add3b89 release-pypy3.6-v7.1.0 -7a2e437acfceafe2665b23b1394dc6c66add3b89 release-pypy3.6-v7.1.0 de061d87e39c7df4e436974096d7982c676a859d release-pypy3.6-v7.1.0 +784b254d669919c872a505b807db8462b6140973 release-pypy3.6-v7.1.1 +8cdda8b8cdb8ff29d9e620cccd6c5edd2f2a23ec release-pypy2.7-v7.1.1 + diff --git a/extra_tests/cffi_tests/cffi0/test_parsing.py b/extra_tests/cffi_tests/cffi0/test_parsing.py --- a/extra_tests/cffi_tests/cffi0/test_parsing.py +++ b/extra_tests/cffi_tests/cffi0/test_parsing.py @@ -410,7 +410,17 @@ def test_enum(): ffi = FFI() ffi.cdef(""" - enum Enum { POS = +1, TWO = 2, NIL = 0, NEG = -1, OP = (POS+TWO)-1}; + enum Enum { + POS = +1, + TWO = 2, + NIL = 0, + NEG = -1, + ADDSUB = (POS+TWO)-1, + DIVMULINT = (3 * 3) / 2, + SHIFT = (1 << 3) >> 1, + BINOPS = (0x7 & 0x1) | 0x8, + XOR = 0xf ^ 0xa + }; """) needs_dlopen_none() C = ffi.dlopen(None) @@ -418,7 +428,11 @@ assert C.TWO == 2 assert C.NIL == 0 assert C.NEG == -1 - assert C.OP == 2 + assert C.ADDSUB == 2 + assert C.DIVMULINT == 4 + assert C.SHIFT == 4 + assert C.BINOPS == 0b1001 + assert C.XOR == 0b0101 def test_stdcall(): ffi = FFI() diff --git a/extra_tests/cffi_tests/cffi0/test_verify.py b/extra_tests/cffi_tests/cffi0/test_verify.py --- a/extra_tests/cffi_tests/cffi0/test_verify.py +++ b/extra_tests/cffi_tests/cffi0/test_verify.py @@ -2535,3 +2535,29 @@ x.p = p x.cyclic = x del p, x + +def test_arithmetic_in_cdef(): + for a in [0, 11, 15]: + ffi = FFI() + ffi.cdef(""" + enum FOO { + DIVNN = ((-?) / (-3)), + DIVNP = ((-?) / (+3)), + DIVPN = ((+?) / (-3)), + MODNN = ((-?) % (-3)), + MODNP = ((-?) % (+3)), + MODPN = ((+?) % (-3)), + }; + """.replace('?', str(a))) + lib = ffi.verify(""" + enum FOO { + DIVNN = ((-?) / (-3)), + DIVNP = ((-?) / (+3)), + DIVPN = ((+?) / (-3)), + MODNN = ((-?) % (-3)), + MODNP = ((-?) % (+3)), + MODPN = ((+?) % (-3)), + }; + """.replace('?', str(a))) + # the verify() crashes if the values in the enum are different from + # the values we computed ourselves from the cdef() diff --git a/extra_tests/cffi_tests/cffi0/test_zintegration.py b/extra_tests/cffi_tests/cffi0/test_zintegration.py --- a/extra_tests/cffi_tests/cffi0/test_zintegration.py +++ b/extra_tests/cffi_tests/cffi0/test_zintegration.py @@ -2,11 +2,13 @@ import py, os, sys, shutil import subprocess from extra_tests.cffi_tests.udir import udir +import pytest if sys.platform == 'win32': - py.test.skip('snippets do not run on win32') + pytestmark = pytest.mark.skip('snippets do not run on win32') if sys.version_info < (2, 7): - py.test.skip('fails e.g. on a Debian/Ubuntu which patches virtualenv' + pytestmark = pytest.mark.skip( + 'fails e.g. on a Debian/Ubuntu which patches virtualenv' ' in a non-2.6-friendly way') def create_venv(name): diff --git a/extra_tests/cffi_tests/cffi1/test_recompiler.py b/extra_tests/cffi_tests/cffi1/test_recompiler.py --- a/extra_tests/cffi_tests/cffi1/test_recompiler.py +++ b/extra_tests/cffi_tests/cffi1/test_recompiler.py @@ -2339,3 +2339,101 @@ typedef int foo_t; struct foo_s { void (*x)(foo_t); }; """) py.test.raises(TypeError, ffi.new, "struct foo_s *") + +def test_from_buffer_struct(): + ffi = FFI() + ffi.cdef("""struct foo_s { int a, b; };""") + lib = verify(ffi, "test_from_buffer_struct_p", """ + struct foo_s { int a, b; }; + """) + p = ffi.new("struct foo_s *", [-219239, 58974983]) + q = ffi.from_buffer("struct foo_s[]", ffi.buffer(p)) + assert ffi.typeof(q) == ffi.typeof("struct foo_s[]") + assert len(q) == 1 + assert q[0].a == p.a + assert q[0].b == p.b + assert q == p + q = ffi.from_buffer("struct foo_s *", ffi.buffer(p)) + assert ffi.typeof(q) == ffi.typeof("struct foo_s *") + assert q.a == p.a + assert q.b == p.b + assert q[0].a == p.a + assert q[0].b == p.b + assert q == p + +def test_unnamed_bitfield_1(): + ffi = FFI() + ffi.cdef("""struct A { char : 1; };""") + lib = verify(ffi, "test_unnamed_bitfield_1", """ + struct A { char : 1; }; + """) + p = ffi.new("struct A *") + assert ffi.sizeof(p[0]) == 1 + # Note: on gcc, the type name is ignored for anonymous bitfields + # and that's why the result is 1. On MSVC, the result is + # sizeof("char") which is also 1. + +def test_unnamed_bitfield_2(): + ffi = FFI() + ffi.cdef("""struct A { + short c : 1; short : 1; short d : 1; short : 1; };""") + lib = verify(ffi, "test_unnamed_bitfield_2", """ + struct A { + short c : 1; short : 1; short d : 1; short : 1; + }; + """) + p = ffi.new("struct A *") + assert ffi.sizeof(p[0]) == ffi.sizeof("short") + +def test_unnamed_bitfield_3(): + ffi = FFI() + ffi.cdef("""struct A { struct { char : 1; char : 1; } b; };""") + lib = verify(ffi, "test_unnamed_bitfield_3", """ + struct A { struct { char : 1; char : 1; } b; }; + """) + p = ffi.new("struct A *") + assert ffi.sizeof(p[0]) == 1 + # Note: on gcc, the type name is ignored for anonymous bitfields + # and that's why the result is 1. On MSVC, the result is + # sizeof("char") which is also 1. + +def test_unnamed_bitfield_4(): + ffi = FFI() + ffi.cdef("""struct A { struct { + unsigned c : 1; unsigned : 1; unsigned d : 1; unsigned : 1; } a; + }; + struct B { struct A a; };""") + lib = verify(ffi, "test_unnamed_bitfield_4", """ + struct A { struct { + unsigned c : 1; unsigned : 1; unsigned d : 1; unsigned : 1; } a; + }; + struct B { struct A a; }; + """) + b = ffi.new("struct B *") + a = ffi.new("struct A *") + assert ffi.sizeof(a[0]) == ffi.sizeof("unsigned") + assert ffi.sizeof(b[0]) == ffi.sizeof(a[0]) + +def test_struct_with_func_with_struct_pointer_arg(): + ffi = FFI() + ffi.cdef("""struct BinaryTree { + int (* CompareKey)(struct BinaryTree *tree); + };""") + lib = verify(ffi, "test_struct_with_func_with_struct_pointer_arg", """ + struct BinaryTree { + int (* CompareKey)(struct BinaryTree *tree); + }; + """) + ffi.new("struct BinaryTree *") + +def test_struct_with_func_with_struct_arg(): + ffi = FFI() + ffi.cdef("""struct BinaryTree { + int (* CompareKey)(struct BinaryTree tree); + };""") + lib = verify(ffi, "test_struct_with_func_with_struct_arg", """ + struct BinaryTree { + int (* CompareKey)(struct BinaryTree tree); + }; + """) + py.test.raises(RuntimeError, ffi.new, "struct BinaryTree *") diff --git a/extra_tests/cffi_tests/embedding/test_basic.py b/extra_tests/cffi_tests/embedding/test_basic.py --- a/extra_tests/cffi_tests/embedding/test_basic.py +++ b/extra_tests/cffi_tests/embedding/test_basic.py @@ -64,8 +64,8 @@ output = popen.stdout.read() err = popen.wait() if err: - raise OSError("popen failed with exit code %r: %r" % ( - err, args)) + raise OSError(("popen failed with exit code %r: %r\n\n%s" % ( + err, args, output)).rstrip()) print(output.rstrip()) return output diff --git a/extra_tests/cffi_tests/embedding/test_performance.py b/extra_tests/cffi_tests/embedding/test_performance.py --- a/extra_tests/cffi_tests/embedding/test_performance.py +++ b/extra_tests/cffi_tests/embedding/test_performance.py @@ -3,8 +3,8 @@ from extra_tests.cffi_tests.embedding.test_basic import EmbeddingTests if sys.platform == 'win32': - import py - py.test.skip("written with POSIX functions") + import pytest + pytestmark = pytest.mark.skip("written with POSIX functions") class TestPerformance(EmbeddingTests): diff --git a/extra_tests/ctypes_tests/test_cast.py b/extra_tests/ctypes_tests/test_cast.py --- a/extra_tests/ctypes_tests/test_cast.py +++ b/extra_tests/ctypes_tests/test_cast.py @@ -28,3 +28,13 @@ assert x.value is False x = c_bool(['yadda']) assert x.value is True + +def test_cast_array(): + import sys + data = b'data' + ubyte = c_ubyte * len(data) + byteslike = ubyte.from_buffer_copy(data) + m = memoryview(byteslike) + if sys.version_info > (3, 3): + b = m.cast('B') + assert bytes(b) == data diff --git a/extra_tests/ctypes_tests/test_win32.py b/extra_tests/ctypes_tests/test_win32.py --- a/extra_tests/ctypes_tests/test_win32.py +++ b/extra_tests/ctypes_tests/test_win32.py @@ -5,7 +5,7 @@ import pytest @pytest.mark.skipif("sys.platform != 'win32'") -def test_VARIANT(self): +def test_VARIANT(): from ctypes import wintypes a = wintypes.VARIANT_BOOL() assert a.value is False diff --git a/extra_tests/test_datetime.py b/extra_tests/test_datetime.py --- a/extra_tests/test_datetime.py +++ b/extra_tests/test_datetime.py @@ -128,7 +128,7 @@ import os import time if os.name == 'nt': - skip("setting os.environ['TZ'] ineffective on windows") + pytest.skip("setting os.environ['TZ'] ineffective on windows") try: prev_tz = os.environ.get("TZ") os.environ["TZ"] = "GMT" diff --git a/extra_tests/test_json.py b/extra_tests/test_json.py --- a/extra_tests/test_json.py +++ b/extra_tests/test_json.py @@ -31,3 +31,31 @@ @given(jsondata) def test_roundtrip(d): assert json.loads(json.dumps(d)) == d + +def test_skipkeys(): + assert json.dumps({Ellipsis: 42}, skipkeys=True) == '{}' + assert json.dumps({Ellipsis: 42, 3: 4}, skipkeys=True) == '{"3": 4}' + assert json.dumps({3: 4, Ellipsis: 42}, skipkeys=True) == '{"3": 4}' + assert json.dumps({Ellipsis: 42, NotImplemented: 43}, skipkeys=True) \ + == '{}' + assert json.dumps({3: 4, Ellipsis: 42, NotImplemented: 43}, skipkeys=True)\ + == '{"3": 4}' + assert json.dumps({Ellipsis: 42, 3: 4, NotImplemented: 43}, skipkeys=True)\ + == '{"3": 4}' + assert json.dumps({Ellipsis: 42, NotImplemented: 43, 3: 4}, skipkeys=True)\ + == '{"3": 4}' + assert json.dumps({3: 4, 5: 6, Ellipsis: 42}, skipkeys=True) \ + == '{"3": 4, "5": 6}' + assert json.dumps({3: 4, Ellipsis: 42, 5: 6}, skipkeys=True) \ + == '{"3": 4, "5": 6}' + assert json.dumps({Ellipsis: 42, 3: 4, 5: 6}, skipkeys=True) \ + == '{"3": 4, "5": 6}' + +def test_boolean_as_dict_key(): + # In CPython 2.x, dumps({True:...}) gives {"True":...}. It should be + # "true" instead; it's a bug as far as I can tell. In 3.x it was fixed. + # BUT! if we call dumps() with sort_keys=True, then CPython (any version) + # gives "true" instead of "True". Surprize! + # I don't want to understand why, let's just not attempt to reproduce that. + assert json.dumps({True: 5}) == '{"true": 5}' + assert json.dumps({False: 5}) == '{"false": 5}' diff --git a/lib-python/2.7/ctypes/test/test_byteswap.py b/lib-python/2.7/ctypes/test/test_byteswap.py --- a/lib-python/2.7/ctypes/test/test_byteswap.py +++ b/lib-python/2.7/ctypes/test/test_byteswap.py @@ -2,7 +2,6 @@ from binascii import hexlify from ctypes import * -from ctypes.test import xfail def bin(s): return hexlify(memoryview(s)).upper() diff --git a/lib-python/2.7/ctypes/test/test_loading.py b/lib-python/2.7/ctypes/test/test_loading.py --- a/lib-python/2.7/ctypes/test/test_loading.py +++ b/lib-python/2.7/ctypes/test/test_loading.py @@ -2,7 +2,7 @@ import sys, unittest import os from ctypes.util import find_library -from ctypes.test import is_resource_enabled, xfail +from ctypes.test import is_resource_enabled libc_name = None if os.name == "nt": @@ -80,7 +80,6 @@ self.assertRaises(AttributeError, dll.__getitem__, 1234) - @xfail @unittest.skipUnless(os.name == "nt", 'Windows-specific test') def test_1703286_A(self): from _ctypes import LoadLibrary, FreeLibrary @@ -92,7 +91,6 @@ handle = LoadLibrary("advapi32") FreeLibrary(handle) - @xfail @unittest.skipUnless(os.name == "nt", 'Windows-specific test') def test_1703286_B(self): # Since on winXP 64-bit advapi32 loads like described diff --git a/lib-python/2.7/distutils/sysconfig_pypy.py b/lib-python/2.7/distutils/sysconfig_pypy.py --- a/lib-python/2.7/distutils/sysconfig_pypy.py +++ b/lib-python/2.7/distutils/sysconfig_pypy.py @@ -71,7 +71,7 @@ g['AR'] = "ar" g['ARFLAGS'] = "rc" g['EXE'] = "" - g['LIBDIR'] = os.path.join(sys.prefix, 'lib') + g['LIBDIR'] = os.path.join(sys.prefix, 'bin') # where is the shared library g['VERSION'] = get_python_version() if sys.platform[:6] == "darwin": @@ -86,6 +86,7 @@ arch = platform.machine() g['LDSHARED'] += ' -undefined dynamic_lookup' g['CC'] += ' -arch %s' % (arch,) + g['MACOSX_DEPLOYMENT_TARGET'] = '10.14' global _config_vars _config_vars = g diff --git a/lib-python/2.7/json/encoder.py b/lib-python/2.7/json/encoder.py --- a/lib-python/2.7/json/encoder.py +++ b/lib-python/2.7/json/encoder.py @@ -294,10 +294,6 @@ items = d.iteritems() for key, v in items: - if first: - first = False - else: - builder.append(separator) if isinstance(key, basestring): pass # JavaScript is weakly typed for these, so it makes sense to @@ -316,6 +312,10 @@ continue else: raise TypeError("key " + repr(key) + " is not a string") + if first: + first = False + else: + builder.append(separator) builder.append('"') builder.append(self.__encoder(key)) builder.append('"') diff --git a/lib-python/2.7/socket.py b/lib-python/2.7/socket.py --- a/lib-python/2.7/socket.py +++ b/lib-python/2.7/socket.py @@ -61,20 +61,22 @@ DeprecationWarning, stacklevel=2) return _realssl.sslwrap_simple(sock, keyfile, certfile) - # we need to import the same constants we used to... - from _ssl import SSLError as sslerror - from _ssl import \ - RAND_add, \ - RAND_status, \ - SSL_ERROR_ZERO_RETURN, \ - SSL_ERROR_WANT_READ, \ - SSL_ERROR_WANT_WRITE, \ - SSL_ERROR_WANT_X509_LOOKUP, \ - SSL_ERROR_SYSCALL, \ - SSL_ERROR_SSL, \ - SSL_ERROR_WANT_CONNECT, \ - SSL_ERROR_EOF, \ - SSL_ERROR_INVALID_ERROR_CODE + # we need to import the same constants we used to, + # see lib_pypy/_cffi_ssl/_stdssl/error.py and __init__.py to prevent + # circular import + # from _ssl import SSLError as sslerror + # from _ssl import \ + # RAND_add, \ + # RAND_status + # SSL_ERROR_ZERO_RETURN, \ + # SSL_ERROR_WANT_READ, \ + # SSL_ERROR_WANT_WRITE, \ + # SSL_ERROR_WANT_X509_LOOKUP, \ + # SSL_ERROR_SYSCALL, \ + # SSL_ERROR_SSL, \ + # SSL_ERROR_WANT_CONNECT, \ + # SSL_ERROR_EOF, \ + # SSL_ERROR_INVALID_ERROR_CODE try: from _ssl import RAND_egd except ImportError: diff --git a/lib-python/2.7/subprocess.py b/lib-python/2.7/subprocess.py --- a/lib-python/2.7/subprocess.py +++ b/lib-python/2.7/subprocess.py @@ -337,7 +337,7 @@ # --- PyPy hack, see _pypy_install_libs_after_virtualenv() --- # match arguments passed by different versions of virtualenv - if args[1:] in ( + if isinstance(args, (list, tuple)) and args[1:] in ( ['-c', 'import sys; print(sys.prefix)'], # 1.6 10ba3f3c ['-c', "\nimport sys\nprefix = sys.prefix\n" # 1.7 0e9342ce "if sys.version_info[0] == 3:\n" diff --git a/lib-python/2.7/sysconfig.py b/lib-python/2.7/sysconfig.py --- a/lib-python/2.7/sysconfig.py +++ b/lib-python/2.7/sysconfig.py @@ -483,6 +483,7 @@ _CONFIG_VARS['projectbase'] = _PROJECT_BASE _CONFIG_VARS['implementation'] = _get_implementation() _CONFIG_VARS['implementation_lower'] = _get_implementation().lower() + _CONFIG_VARS['LIBRARY'] = '' if os.name in ('nt', 'os2'): _init_non_posix(_CONFIG_VARS) diff --git a/lib-python/2.7/test/capath/efa5f9c3.0 b/lib-python/2.7/test/capath/efa5f9c3.0 new file mode 100644 --- /dev/null +++ b/lib-python/2.7/test/capath/efa5f9c3.0 @@ -0,0 +1,34 @@ +-----BEGIN CERTIFICATE----- +MIIF9zCCA9+gAwIBAgIUH98b4Fw/DyugC9cV7VK7ZODzHsIwDQYJKoZIhvcNAQEL +BQAwgYoxCzAJBgNVBAYTAlhZMRcwFQYDVQQIDA5DYXN0bGUgQW50aHJheDEYMBYG +A1UEBwwPQXJndW1lbnQgQ2xpbmljMSMwIQYDVQQKDBpQeXRob24gU29mdHdhcmUg +Rm91bmRhdGlvbjEjMCEGA1UEAwwac2VsZi1zaWduZWQucHl0aG9udGVzdC5uZXQw +HhcNMTkwNTA4MDEwMjQzWhcNMjcwNzI0MDEwMjQzWjCBijELMAkGA1UEBhMCWFkx +FzAVBgNVBAgMDkNhc3RsZSBBbnRocmF4MRgwFgYDVQQHDA9Bcmd1bWVudCBDbGlu +aWMxIzAhBgNVBAoMGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMSMwIQYDVQQD +DBpzZWxmLXNpZ25lZC5weXRob250ZXN0Lm5ldDCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAMKdJlyCThkahwoBb7pl5q64Pe9Fn5jrIvzsveHTc97TpjV2 +RLfICnXKrltPk/ohkVl6K5SUZQZwMVzFubkyxE0nZPHYHlpiKWQxbsYVkYv01rix +IFdLvaxxbGYke2jwQao31s4o61AdlsfK1SdpHQUynBBMssqI3SB4XPmcA7e+wEEx +jxjVish4ixA1vuIZOx8yibu+CFCf/geEjoBMF3QPdzULzlrCSw8k/45iZCSoNbvK +DoL4TVV07PHOxpheDh8ZQmepGvU6pVqhb9m4lgmV0OGWHgozd5Ur9CbTVDmxIEz3 +TSoRtNJK7qtyZdGNqwjksQxgZTjM/d/Lm/BJG99AiOmYOjsl9gbQMZgvQmMAtUsI +aMJnQuZ6R+KEpW/TR5qSKLWZSG45z/op+tzI2m+cE6HwTRVAWbcuJxcAA55MZjqU +OOOu3BBYMjS5nf2sQ9uoXsVBFH7i0mQqoW1SLzr9opI8KsWwFxQmO2vBxWYaN+lH +OmwBZBwyODIsmI1YGXmTp09NxRYz3Qe5GCgFzYowpMrcxUC24iduIdMwwhRM7rKg +7GtIWMSrFfuI1XCLRmSlhDbhNN6fVg2f8Bo9PdH9ihiIyxSrc+FOUasUYCCJvlSZ +8hFUlLvcmrZlWuazohm0lsXuMK1JflmQr/DA/uXxP9xzFfRy+RU3jDyxJbRHAgMB +AAGjUzBRMB0GA1UdDgQWBBSQJyxiPMRK01i+0BsV9zUwDiBaHzAfBgNVHSMEGDAW +gBSQJyxiPMRK01i+0BsV9zUwDiBaHzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 +DQEBCwUAA4ICAQCR+7a7N/m+WLkxPPIA/CB4MOr2Uf8ixTv435Nyv6rXOun0+lTP +ExSZ0uYQ+L0WylItI3cQHULldDueD+s8TGzxf5woaLKf6tqyr0NYhKs+UeNEzDnN +9PHQIhX0SZw3XyXGUgPNBfRCg2ZDdtMMdOU4XlQN/IN/9hbYTrueyY7eXq9hmtI9 +1srftAMqr9SR1JP7aHI6DVgrEsZVMTDnfT8WmLSGLlY1HmGfdEn1Ip5sbo9uSkiH +AEPgPfjYIvR5LqTOMn4KsrlZyBbFIDh9Sl99M1kZzgH6zUGVLCDg1y6Cms69fx/e +W1HoIeVkY4b4TY7Bk7JsqyNhIuqu7ARaxkdaZWhYaA2YyknwANdFfNpfH+elCLIk +BUt5S3f4i7DaUePTvKukCZiCq4Oyln7RcOn5If73wCeLB/ZM9Ei1HforyLWP1CN8 +XLfpHaoeoPSWIveI0XHUl65LsPN2UbMbul/F23hwl+h8+BLmyAS680Yhn4zEN6Ku +B7Po90HoFa1Du3bmx4jsN73UkT/dwMTi6K072FbipnC1904oGlWmLwvAHvrtxxmL +Pl3pvEaZIu8wa/PNF6Y7J7VIewikIJq6Ta6FrWeFfzMWOj2qA1ZZi6fUaDSNYvuV +J5quYKCc/O+I/yDDf8wyBbZ/gvUXzUHTMYGG+bFrn1p7XDbYYeEJ6R/xEg== +-----END CERTIFICATE----- diff --git a/lib-python/2.7/test/selfsigned_pythontestdotnet.pem b/lib-python/2.7/test/selfsigned_pythontestdotnet.pem --- a/lib-python/2.7/test/selfsigned_pythontestdotnet.pem +++ b/lib-python/2.7/test/selfsigned_pythontestdotnet.pem @@ -1,16 +1,34 @@ -----BEGIN CERTIFICATE----- -MIIClTCCAf6gAwIBAgIJAKGU95wKR8pTMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV -BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u -IFNvZnR3YXJlIEZvdW5kYXRpb24xIzAhBgNVBAMMGnNlbGYtc2lnbmVkLnB5dGhv -bnRlc3QubmV0MB4XDTE0MTEwMjE4MDkyOVoXDTI0MTAzMDE4MDkyOVowcDELMAkG -A1UEBhMCWFkxFzAVBgNVBAcMDkNhc3RsZSBBbnRocmF4MSMwIQYDVQQKDBpQeXRo -b24gU29mdHdhcmUgRm91bmRhdGlvbjEjMCEGA1UEAwwac2VsZi1zaWduZWQucHl0 -aG9udGVzdC5uZXQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANDXQXW9tjyZ -Xt0Iv2tLL1+jinr4wGg36ioLDLFkMf+2Y1GL0v0BnKYG4N1OKlAU15LXGeGer8vm -Sv/yIvmdrELvhAbbo3w4a9TMYQA4XkIVLdvu3mvNOAet+8PMJxn26dbDhG809ALv -EHY57lQsBS3G59RZyBPVqAqmImWNJnVzAgMBAAGjNzA1MCUGA1UdEQQeMByCGnNl -bGYtc2lnbmVkLnB5dGhvbnRlc3QubmV0MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcN -AQEFBQADgYEAIuzAhgMouJpNdf3URCHIineyoSt6WK/9+eyUcjlKOrDoXNZaD72h -TXMeKYoWvJyVcSLKL8ckPtDobgP2OTt0UkyAaj0n+ZHaqq1lH2yVfGUA1ILJv515 -C8BqbvVZuqm3i7ygmw3bqE/lYMgOrYtXXnqOrz6nvsE6Yc9V9rFflOM= +MIIF9zCCA9+gAwIBAgIUH98b4Fw/DyugC9cV7VK7ZODzHsIwDQYJKoZIhvcNAQEL +BQAwgYoxCzAJBgNVBAYTAlhZMRcwFQYDVQQIDA5DYXN0bGUgQW50aHJheDEYMBYG +A1UEBwwPQXJndW1lbnQgQ2xpbmljMSMwIQYDVQQKDBpQeXRob24gU29mdHdhcmUg +Rm91bmRhdGlvbjEjMCEGA1UEAwwac2VsZi1zaWduZWQucHl0aG9udGVzdC5uZXQw +HhcNMTkwNTA4MDEwMjQzWhcNMjcwNzI0MDEwMjQzWjCBijELMAkGA1UEBhMCWFkx +FzAVBgNVBAgMDkNhc3RsZSBBbnRocmF4MRgwFgYDVQQHDA9Bcmd1bWVudCBDbGlu +aWMxIzAhBgNVBAoMGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMSMwIQYDVQQD +DBpzZWxmLXNpZ25lZC5weXRob250ZXN0Lm5ldDCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAMKdJlyCThkahwoBb7pl5q64Pe9Fn5jrIvzsveHTc97TpjV2 +RLfICnXKrltPk/ohkVl6K5SUZQZwMVzFubkyxE0nZPHYHlpiKWQxbsYVkYv01rix +IFdLvaxxbGYke2jwQao31s4o61AdlsfK1SdpHQUynBBMssqI3SB4XPmcA7e+wEEx +jxjVish4ixA1vuIZOx8yibu+CFCf/geEjoBMF3QPdzULzlrCSw8k/45iZCSoNbvK +DoL4TVV07PHOxpheDh8ZQmepGvU6pVqhb9m4lgmV0OGWHgozd5Ur9CbTVDmxIEz3 +TSoRtNJK7qtyZdGNqwjksQxgZTjM/d/Lm/BJG99AiOmYOjsl9gbQMZgvQmMAtUsI +aMJnQuZ6R+KEpW/TR5qSKLWZSG45z/op+tzI2m+cE6HwTRVAWbcuJxcAA55MZjqU +OOOu3BBYMjS5nf2sQ9uoXsVBFH7i0mQqoW1SLzr9opI8KsWwFxQmO2vBxWYaN+lH +OmwBZBwyODIsmI1YGXmTp09NxRYz3Qe5GCgFzYowpMrcxUC24iduIdMwwhRM7rKg +7GtIWMSrFfuI1XCLRmSlhDbhNN6fVg2f8Bo9PdH9ihiIyxSrc+FOUasUYCCJvlSZ +8hFUlLvcmrZlWuazohm0lsXuMK1JflmQr/DA/uXxP9xzFfRy+RU3jDyxJbRHAgMB +AAGjUzBRMB0GA1UdDgQWBBSQJyxiPMRK01i+0BsV9zUwDiBaHzAfBgNVHSMEGDAW +gBSQJyxiPMRK01i+0BsV9zUwDiBaHzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 +DQEBCwUAA4ICAQCR+7a7N/m+WLkxPPIA/CB4MOr2Uf8ixTv435Nyv6rXOun0+lTP +ExSZ0uYQ+L0WylItI3cQHULldDueD+s8TGzxf5woaLKf6tqyr0NYhKs+UeNEzDnN +9PHQIhX0SZw3XyXGUgPNBfRCg2ZDdtMMdOU4XlQN/IN/9hbYTrueyY7eXq9hmtI9 +1srftAMqr9SR1JP7aHI6DVgrEsZVMTDnfT8WmLSGLlY1HmGfdEn1Ip5sbo9uSkiH +AEPgPfjYIvR5LqTOMn4KsrlZyBbFIDh9Sl99M1kZzgH6zUGVLCDg1y6Cms69fx/e +W1HoIeVkY4b4TY7Bk7JsqyNhIuqu7ARaxkdaZWhYaA2YyknwANdFfNpfH+elCLIk +BUt5S3f4i7DaUePTvKukCZiCq4Oyln7RcOn5If73wCeLB/ZM9Ei1HforyLWP1CN8 +XLfpHaoeoPSWIveI0XHUl65LsPN2UbMbul/F23hwl+h8+BLmyAS680Yhn4zEN6Ku +B7Po90HoFa1Du3bmx4jsN73UkT/dwMTi6K072FbipnC1904oGlWmLwvAHvrtxxmL +Pl3pvEaZIu8wa/PNF6Y7J7VIewikIJq6Ta6FrWeFfzMWOj2qA1ZZi6fUaDSNYvuV +J5quYKCc/O+I/yDDf8wyBbZ/gvUXzUHTMYGG+bFrn1p7XDbYYeEJ6R/xEg== -----END CERTIFICATE----- diff --git a/lib-python/2.7/test/test_dictviews.py b/lib-python/2.7/test/test_dictviews.py --- a/lib-python/2.7/test/test_dictviews.py +++ b/lib-python/2.7/test/test_dictviews.py @@ -1,5 +1,6 @@ import copy import pickle +import sys import unittest import collections from test import test_support @@ -169,6 +170,20 @@ def test_recursive_repr(self): d = {} d[42] = d.viewvalues() + r = repr(d) + # Cannot perform a stronger test, as the contents of the repr + # are implementation-dependent. All we can say is that we + # want a str result, not an exception of any sort. + self.assertIsInstance(r, str) + d[42] = d.viewitems() + r = repr(d) + # Again. + self.assertIsInstance(r, str) + + def test_deeply_nested_repr(self): + d = {} + for i in range(sys.getrecursionlimit() + 100): + d = {42: d.viewvalues()} self.assertRaises(RuntimeError, repr, d) def test_abc_registry(self): diff --git a/lib-python/2.7/test/test_ftplib.py b/lib-python/2.7/test/test_ftplib.py --- a/lib-python/2.7/test/test_ftplib.py +++ b/lib-python/2.7/test/test_ftplib.py @@ -234,11 +234,17 @@ def run(self): self.active = True self.__flag.set() - while self.active and asyncore.socket_map: - self.active_lock.acquire() - asyncore.loop(timeout=0.1, count=1) - self.active_lock.release() - asyncore.close_all(ignore_all=True) + try: + while self.active and asyncore.socket_map: + self.active_lock.acquire() + try: + asyncore.loop(timeout=0.1, count=1) + except: + self.active_lock.release() + raise + self.active_lock.release() + finally: + asyncore.close_all(ignore_all=True) def stop(self): assert self.active diff --git a/lib-python/2.7/test/test_ssl.py b/lib-python/2.7/test/test_ssl.py --- a/lib-python/2.7/test/test_ssl.py +++ b/lib-python/2.7/test/test_ssl.py @@ -764,12 +764,17 @@ ctx.set_ciphers("^$:,;?*'dorothyx") @skip_if_broken_ubuntu_ssl - def test_options(self): + def _test_options(self): + ''' + Disable this test, it is too flaky. Different platforms define + different defaults + ''' ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) # OP_ALL | OP_NO_SSLv2 | OP_NO_SSLv3 is the default value default = (ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3) if not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0): default |= ssl.OP_NO_COMPRESSION + default |= ssl.OP_ENABLE_MIDDLEBOX_COMPAT self.assertEqual(default, ctx.options) ctx.options |= ssl.OP_NO_TLSv1 self.assertEqual(default | ssl.OP_NO_TLSv1, ctx.options) diff --git a/lib-python/2.7/test/test_sys.py b/lib-python/2.7/test/test_sys.py --- a/lib-python/2.7/test/test_sys.py +++ b/lib-python/2.7/test/test_sys.py @@ -216,6 +216,11 @@ raise ValueError() except ValueError, e: pass + except MemoryError: + # Documentation for setrecursionlimit says: "The highest possible + # limit is platform-dependent. ... a too-high limit can lead to a + # crash" so we allow MemoryError here + pass finally: sys.setrecursionlimit(oldlimit) diff --git a/lib-python/2.7/test/test_timeit.py b/lib-python/2.7/test/test_timeit.py --- a/lib-python/2.7/test/test_timeit.py +++ b/lib-python/2.7/test/test_timeit.py @@ -317,9 +317,9 @@ def test_main_recommends_perf(self): s = self.run_main(seconds_per_increment=2.0, switches=['-n35', '-s', 'print("CustomSetup")']) self.assertIn(dedent("""\ - WARNING: timeit is a very unreliable tool. use perf or something else for real measurements + WARNING: timeit is a very unreliable tool. use pyperf or something else for real measurements """), s) - self.assertIn("-m pip install perf", s) + self.assertIn("-m pip install pyperf", s) diff --git a/lib-python/2.7/test/test_unicode.py b/lib-python/2.7/test/test_unicode.py --- a/lib-python/2.7/test/test_unicode.py +++ b/lib-python/2.7/test/test_unicode.py @@ -1652,10 +1652,10 @@ # when a string allocation fails with a MemoryError. # This used to crash the interpreter, # or leak references when the number was smaller. - charwidth = 4 if sys.maxunicode >= 0x10000 else 2 + charwidth = 2 # pypy: the char \u0123 is stored in two utf-8 bytes # Note: sys.maxsize is half of the actual max allocation because of # the signedness of Py_ssize_t. - alloc = lambda: u"a" * (sys.maxsize // charwidth * 2) + alloc = lambda: u"\u0123" * (sys.maxsize // charwidth * 2) self.assertRaises(MemoryError, alloc) self.assertRaises(MemoryError, alloc) diff --git a/lib-python/2.7/timeit.py b/lib-python/2.7/timeit.py --- a/lib-python/2.7/timeit.py +++ b/lib-python/2.7/timeit.py @@ -308,10 +308,10 @@ return 0 setup = "\n".join(setup) or "pass" - print "WARNING: timeit is a very unreliable tool. use perf or something else for real measurements" + print "WARNING: timeit is a very unreliable tool. use pyperf or something else for real measurements" executable = os.path.basename(sys.executable) - print "%s -m pip install perf" % executable - print "%s -m perf timeit %s" % ( + print "%s -m pip install pyperf" % executable + print "%s -m pyperf timeit %s" % ( executable, " ".join([(arg if arg.startswith("-") else repr(arg)) for arg in origargs]), ) diff --git a/lib-python/3/_osx_support.py b/lib-python/3/_osx_support.py deleted file mode 100644 --- a/lib-python/3/_osx_support.py +++ /dev/null @@ -1,488 +0,0 @@ -"""Shared OS X support functions.""" - -import os -import re -import sys - -__all__ = [ - 'compiler_fixup', - 'customize_config_vars', - 'customize_compiler', - 'get_platform_osx', -] - -# configuration variables that may contain universal build flags, -# like "-arch" or "-isdkroot", that may need customization for -# the user environment -_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS', - 'BLDSHARED', 'LDSHARED', 'CC', 'CXX', - 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', - 'PY_CORE_CFLAGS') - -# configuration variables that may contain compiler calls -_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX') - -# prefix added to original configuration variable names -_INITPRE = '_OSX_SUPPORT_INITIAL_' - - -def _find_executable(executable, path=None): - """Tries to find 'executable' in the directories listed in 'path'. - - A string listing directories separated by 'os.pathsep'; defaults to - os.environ['PATH']. Returns the complete filename or None if not found. - """ - if path is None: - path = os.environ['PATH'] - - paths = path.split(os.pathsep) - base, ext = os.path.splitext(executable) - - if (sys.platform == 'win32' or os.name == 'os2') and (ext != '.exe'): - executable = executable + '.exe' - - if not os.path.isfile(executable): - for p in paths: - f = os.path.join(p, executable) - if os.path.isfile(f): - # the file exists, we have a shot at spawn working - return f - return None - else: - return executable - - -def _read_output(commandstring): - """Output from succesful command execution or None""" - # Similar to os.popen(commandstring, "r").read(), - # but without actually using os.popen because that - # function is not usable during python bootstrap. - # tempfile is also not available then. - import contextlib - try: - import tempfile - fp = tempfile.NamedTemporaryFile() - except ImportError: - fp = open("/tmp/_osx_support.%s"%( - os.getpid(),), "w+b") - - with contextlib.closing(fp) as fp: - cmd = "%s 2>/dev/null >'%s'" % (commandstring, fp.name) - return fp.read().decode('utf-8').strip() if not os.system(cmd) else None - - -def _find_build_tool(toolname): - """Find a build tool on current path or using xcrun""" - return (_find_executable(toolname) - or _read_output("/usr/bin/xcrun -find %s" % (toolname,)) - or '' - ) - -_SYSTEM_VERSION = None - -def _get_system_version(): - """Return the OS X system version as a string""" - # Reading this plist is a documented way to get the system - # version (see the documentation for the Gestalt Manager) - # We avoid using platform.mac_ver to avoid possible bootstrap issues during - # the build of Python itself (distutils is used to build standard library - # extensions). - - global _SYSTEM_VERSION - - if _SYSTEM_VERSION is None: - _SYSTEM_VERSION = '' - try: - f = open('/System/Library/CoreServices/SystemVersion.plist') - except IOError: - # We're on a plain darwin box, fall back to the default - # behaviour. - pass - else: - try: - m = re.search(r'ProductUserVisibleVersion\s*' - r'(.*?)', f.read()) - finally: - f.close() - if m is not None: - _SYSTEM_VERSION = '.'.join(m.group(1).split('.')[:2]) - # else: fall back to the default behaviour - - return _SYSTEM_VERSION - -def _remove_original_values(_config_vars): - """Remove original unmodified values for testing""" - # This is needed for higher-level cross-platform tests of get_platform. - for k in list(_config_vars): - if k.startswith(_INITPRE): - del _config_vars[k] - -def _save_modified_value(_config_vars, cv, newvalue): - """Save modified and original unmodified value of configuration var""" - - oldvalue = _config_vars.get(cv, '') - if (oldvalue != newvalue) and (_INITPRE + cv not in _config_vars): - _config_vars[_INITPRE + cv] = oldvalue - _config_vars[cv] = newvalue - -def _supports_universal_builds(): - """Returns True if universal builds are supported on this system""" - # As an approximation, we assume that if we are running on 10.4 or above, - # then we are running with an Xcode environment that supports universal - # builds, in particular -isysroot and -arch arguments to the compiler. This - # is in support of allowing 10.4 universal builds to run on 10.3.x systems. - - osx_version = _get_system_version() - if osx_version: - try: - osx_version = tuple(int(i) for i in osx_version.split('.')) - except ValueError: - osx_version = '' - return bool(osx_version >= (10, 4)) if osx_version else False - - -def _find_appropriate_compiler(_config_vars): - """Find appropriate C compiler for extension module builds""" - - # Issue #13590: - # The OSX location for the compiler varies between OSX - # (or rather Xcode) releases. With older releases (up-to 10.5) - # the compiler is in /usr/bin, with newer releases the compiler - # can only be found inside Xcode.app if the "Command Line Tools" - # are not installed. - # - # Futhermore, the compiler that can be used varies between - # Xcode releases. Upto Xcode 4 it was possible to use 'gcc-4.2' - # as the compiler, after that 'clang' should be used because - # gcc-4.2 is either not present, or a copy of 'llvm-gcc' that - # miscompiles Python. - - # skip checks if the compiler was overriden with a CC env variable - if 'CC' in os.environ: - return _config_vars - - # The CC config var might contain additional arguments. - # Ignore them while searching. - cc = oldcc = _config_vars['CC'].split()[0] - if not _find_executable(cc): - # Compiler is not found on the shell search PATH. - # Now search for clang, first on PATH (if the Command LIne - # Tools have been installed in / or if the user has provided - # another location via CC). If not found, try using xcrun - # to find an uninstalled clang (within a selected Xcode). - - # NOTE: Cannot use subprocess here because of bootstrap - # issues when building Python itself (and os.popen is - # implemented on top of subprocess and is therefore not - # usable as well) - - cc = _find_build_tool('clang') - - elif os.path.basename(cc).startswith('gcc'): - # Compiler is GCC, check if it is LLVM-GCC - data = _read_output("'%s' --version" - % (cc.replace("'", "'\"'\"'"),)) - if 'llvm-gcc' in data: - # Found LLVM-GCC, fall back to clang - cc = _find_build_tool('clang') - - if not cc: - raise SystemError( - "Cannot locate working compiler") - - if cc != oldcc: - # Found a replacement compiler. - # Modify config vars using new compiler, if not already explictly - # overriden by an env variable, preserving additional arguments. - for cv in _COMPILER_CONFIG_VARS: - if cv in _config_vars and cv not in os.environ: - cv_split = _config_vars[cv].split() - cv_split[0] = cc if cv != 'CXX' else cc + '++' - _save_modified_value(_config_vars, cv, ' '.join(cv_split)) - - return _config_vars - - -def _remove_universal_flags(_config_vars): - """Remove all universal build arguments from config vars""" - - for cv in _UNIVERSAL_CONFIG_VARS: - # Do not alter a config var explicitly overriden by env var - if cv in _config_vars and cv not in os.environ: - flags = _config_vars[cv] - flags = re.sub('-arch\s+\w+\s', ' ', flags, re.ASCII) - flags = re.sub('-isysroot [^ \t]*', ' ', flags) - _save_modified_value(_config_vars, cv, flags) - - return _config_vars - - -def _remove_unsupported_archs(_config_vars): - """Remove any unsupported archs from config vars""" - # Different Xcode releases support different sets for '-arch' - # flags. In particular, Xcode 4.x no longer supports the - # PPC architectures. - # - # This code automatically removes '-arch ppc' and '-arch ppc64' - # when these are not supported. That makes it possible to - # build extensions on OSX 10.7 and later with the prebuilt - # 32-bit installer on the python.org website. - - # skip checks if the compiler was overriden with a CC env variable - if 'CC' in os.environ: - return _config_vars - - if re.search('-arch\s+ppc', _config_vars['CFLAGS']) is not None: - # NOTE: Cannot use subprocess here because of bootstrap - # issues when building Python itself - status = os.system("'%s' -arch ppc -x c /dev/null 2>/dev/null"%( - _config_vars['CC'].replace("'", "'\"'\"'"),)) - # The Apple compiler drivers return status 255 if no PPC - if (status >> 8) == 255: - # Compiler doesn't support PPC, remove the related - # '-arch' flags if not explicitly overridden by an - # environment variable - for cv in _UNIVERSAL_CONFIG_VARS: - if cv in _config_vars and cv not in os.environ: - flags = _config_vars[cv] - flags = re.sub('-arch\s+ppc\w*\s', ' ', flags) - _save_modified_value(_config_vars, cv, flags) - - return _config_vars - - -def _override_all_archs(_config_vars): - """Allow override of all archs with ARCHFLAGS env var""" - # NOTE: This name was introduced by Apple in OSX 10.5 and - # is used by several scripting languages distributed with - # that OS release. - if 'ARCHFLAGS' in os.environ: - arch = os.environ['ARCHFLAGS'] - for cv in _UNIVERSAL_CONFIG_VARS: - if cv in _config_vars and '-arch' in _config_vars[cv]: - flags = _config_vars[cv] - flags = re.sub('-arch\s+\w+\s', ' ', flags) - flags = flags + ' ' + arch - _save_modified_value(_config_vars, cv, flags) - - return _config_vars - - -def _check_for_unavailable_sdk(_config_vars): - """Remove references to any SDKs not available""" - # If we're on OSX 10.5 or later and the user tries to - # compile an extension using an SDK that is not present - # on the current machine it is better to not use an SDK - # than to fail. This is particularly important with - # the standalong Command Line Tools alternative to a - # full-blown Xcode install since the CLT packages do not - # provide SDKs. If the SDK is not present, it is assumed - # that the header files and dev libs have been installed - # to /usr and /System/Library by either a standalone CLT - # package or the CLT component within Xcode. - cflags = _config_vars.get('CFLAGS', '') - m = re.search(r'-isysroot\s+(\S+)', cflags) - if m is not None: - sdk = m.group(1) - if not os.path.exists(sdk): - for cv in _UNIVERSAL_CONFIG_VARS: - # Do not alter a config var explicitly overriden by env var - if cv in _config_vars and cv not in os.environ: - flags = _config_vars[cv] - flags = re.sub(r'-isysroot\s+\S+(?:\s|$)', ' ', flags) - _save_modified_value(_config_vars, cv, flags) - - return _config_vars - - -def compiler_fixup(compiler_so, cc_args): - """ - This function will strip '-isysroot PATH' and '-arch ARCH' from the - compile flags if the user has specified one them in extra_compile_flags. - - This is needed because '-arch ARCH' adds another architecture to the - build, without a way to remove an architecture. Furthermore GCC will - barf if multiple '-isysroot' arguments are present. - """ - stripArch = stripSysroot = False - - compiler_so = list(compiler_so) - - if not _supports_universal_builds(): - # OSX before 10.4.0, these don't support -arch and -isysroot at - # all. - stripArch = stripSysroot = True - else: - stripArch = '-arch' in cc_args - stripSysroot = '-isysroot' in cc_args - - if stripArch or 'ARCHFLAGS' in os.environ: - while True: - try: - index = compiler_so.index('-arch') - # Strip this argument and the next one: - del compiler_so[index:index+2] - except ValueError: - break - - if 'ARCHFLAGS' in os.environ and not stripArch: - # User specified different -arch flags in the environ, - # see also distutils.sysconfig - compiler_so = compiler_so + os.environ['ARCHFLAGS'].split() - - if stripSysroot: - while True: - try: - index = compiler_so.index('-isysroot') - # Strip this argument and the next one: - del compiler_so[index:index+2] - except ValueError: - break - - # Check if the SDK that is used during compilation actually exists, - # the universal build requires the usage of a universal SDK and not all - # users have that installed by default. - sysroot = None - if '-isysroot' in cc_args: - idx = cc_args.index('-isysroot') - sysroot = cc_args[idx+1] - elif '-isysroot' in compiler_so: - idx = compiler_so.index('-isysroot') - sysroot = compiler_so[idx+1] - - if sysroot and not os.path.isdir(sysroot): - from distutils import log - log.warn("Compiling with an SDK that doesn't seem to exist: %s", - sysroot) - log.warn("Please check your Xcode installation") - - return compiler_so - - -def customize_config_vars(_config_vars): - """Customize Python build configuration variables. - - Called internally from sysconfig with a mutable mapping - containing name/value pairs parsed from the configured - makefile used to build this interpreter. Returns - the mapping updated as needed to reflect the environment - in which the interpreter is running; in the case of - a Python from a binary installer, the installed - environment may be very different from the build - environment, i.e. different OS levels, different - built tools, different available CPU architectures. - - This customization is performed whenever - distutils.sysconfig.get_config_vars() is first - called. It may be used in environments where no - compilers are present, i.e. when installing pure - Python dists. Customization of compiler paths - and detection of unavailable archs is deferred - until the first extention module build is - requested (in distutils.sysconfig.customize_compiler). - - Currently called from distutils.sysconfig - """ - - if not _supports_universal_builds(): - # On Mac OS X before 10.4, check if -arch and -isysroot - # are in CFLAGS or LDFLAGS and remove them if they are. - # This is needed when building extensions on a 10.3 system - # using a universal build of python. - _remove_universal_flags(_config_vars) - - # Allow user to override all archs with ARCHFLAGS env var - _override_all_archs(_config_vars) - - # Remove references to sdks that are not found - _check_for_unavailable_sdk(_config_vars) - - return _config_vars - - -def customize_compiler(_config_vars): - """Customize compiler path and configuration variables. - - This customization is performed when the first - extension module build is requested - in distutils.sysconfig.customize_compiler). - """ - - # Find a compiler to use for extension module builds - _find_appropriate_compiler(_config_vars) - - # Remove ppc arch flags if not supported here - _remove_unsupported_archs(_config_vars) - - # Allow user to override all archs with ARCHFLAGS env var - _override_all_archs(_config_vars) - - return _config_vars - - -def get_platform_osx(_config_vars, osname, release, machine): - """Filter values for get_platform()""" - # called from get_platform() in sysconfig and distutils.util - # - # For our purposes, we'll assume that the system version from - # distutils' perspective is what MACOSX_DEPLOYMENT_TARGET is set - # to. This makes the compatibility story a bit more sane because the - # machine is going to compile and link as if it were - # MACOSX_DEPLOYMENT_TARGET. - - macver = _config_vars.get('MACOSX_DEPLOYMENT_TARGET', '') - macrelease = _get_system_version() or macver - macver = macver or macrelease - - if macver: - release = macver - osname = "macosx" - - # Use the original CFLAGS value, if available, so that we - # return the same machine type for the platform string. - # Otherwise, distutils may consider this a cross-compiling - # case and disallow installs. - cflags = _config_vars.get(_INITPRE+'CFLAGS', - _config_vars.get('CFLAGS', '')) - if ((macrelease + '.') >= '10.4.' and - '-arch' in cflags.strip()): - # The universal build will build fat binaries, but not on - # systems before 10.4 - - machine = 'fat' - - archs = re.findall('-arch\s+(\S+)', cflags) - archs = tuple(sorted(set(archs))) - - if len(archs) == 1: - machine = archs[0] - elif archs == ('i386', 'ppc'): - machine = 'fat' - elif archs == ('i386', 'x86_64'): - machine = 'intel' - elif archs == ('i386', 'ppc', 'x86_64'): - machine = 'fat3' - elif archs == ('ppc64', 'x86_64'): - machine = 'fat64' - elif archs == ('i386', 'ppc', 'ppc64', 'x86_64'): - machine = 'universal' - else: - raise ValueError( - "Don't know machine value for archs=%r" % (archs,)) - - elif machine == 'i386': - # On OSX the machine type returned by uname is always the - # 32-bit variant, even if the executable architecture is - # the 64-bit variant - if sys.maxsize >= 2**32: - machine = 'x86_64' - - elif machine in ('PowerPC', 'Power_Macintosh'): - # Pick a sane name for the PPC architecture. - # See 'i386' case - if sys.maxsize >= 2**32: - machine = 'ppc64' - else: - machine = 'ppc' - - return (osname, release, machine) diff --git a/lib-python/3/test/crashers/trace_at_recursion_limit.py b/lib-python/3/test/crashers/trace_at_recursion_limit.py deleted file mode 100644 --- a/lib-python/3/test/crashers/trace_at_recursion_limit.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -From http://bugs.python.org/issue6717 - -A misbehaving trace hook can trigger a segfault by exceeding the recursion -limit. -""" -import sys - - -def x(): - pass - -def g(*args): - if True: # change to True to crash interpreter - try: - x() - except: - pass - return g - -def f(): - print(sys.getrecursionlimit()) - f() - -sys.settrace(g) - -f() diff --git a/lib-python/3/test/json_tests/test_tool.py b/lib-python/3/test/json_tests/test_tool.py deleted file mode 100644 --- a/lib-python/3/test/json_tests/test_tool.py +++ /dev/null @@ -1,69 +0,0 @@ -import os -import sys -import textwrap -import unittest -import subprocess -from test import support -from test.script_helper import assert_python_ok - -class TestTool(unittest.TestCase): - data = """ - - [["blorpie"],[ "whoops" ] , [ - ],\t"d-shtaeou",\r"d-nthiouh", - "i-vhbjkhnth", {"nifty":87}, {"morefield" :\tfalse,"field" - :"yes"} ] - """ - - expect = textwrap.dedent("""\ - [ - [ - "blorpie" - ], - [ - "whoops" - ], - [], - "d-shtaeou", - "d-nthiouh", - "i-vhbjkhnth", - { - "nifty": 87 - }, - { - "field": "yes", - "morefield": false - } - ] - """) - - def test_stdin_stdout(self): - with subprocess.Popen( - (sys.executable, '-m', 'json.tool'), - stdin=subprocess.PIPE, stdout=subprocess.PIPE) as proc: - out, err = proc.communicate(self.data.encode()) - self.assertEqual(out.splitlines(), self.expect.encode().splitlines()) - self.assertEqual(err, None) - - def _create_infile(self): - infile = support.TESTFN - with open(infile, "w") as fp: - self.addCleanup(os.remove, infile) - fp.write(self.data) - return infile - - def test_infile_stdout(self): - infile = self._create_infile() - rc, out, err = assert_python_ok('-m', 'json.tool', infile) - self.assertEqual(out.splitlines(), self.expect.encode().splitlines()) - self.assertEqual(err, b'') - - def test_infile_outfile(self): - infile = self._create_infile() - outfile = support.TESTFN + '.out' - rc, out, err = assert_python_ok('-m', 'json.tool', infile, outfile) - self.addCleanup(os.remove, outfile) - with open(outfile, "r") as fp: - self.assertEqual(fp.read(), self.expect) - self.assertEqual(out, b'') - self.assertEqual(err, b'') diff --git a/lib-python/3/test/mp_fork_bomb.py b/lib-python/3/test/mp_fork_bomb.py deleted file mode 100644 --- a/lib-python/3/test/mp_fork_bomb.py +++ /dev/null @@ -1,13 +0,0 @@ -import multiprocessing, sys - -def foo(): - print("123") - -# Because "if __name__ == '__main__'" is missing this will not work -# correctly on Windows. However, we should get a RuntimeError rather -# than the Windows equivalent of a fork bomb. - -p = multiprocessing.Process(target=foo) -p.start() -p.join() -sys.exit(p.exitcode) diff --git a/lib-python/3/test/sample_doctest_no_docstrings.py b/lib-python/3/test/sample_doctest_no_docstrings.py deleted file mode 100644 --- a/lib-python/3/test/sample_doctest_no_docstrings.py +++ /dev/null @@ -1,12 +0,0 @@ -# This is a sample module used for testing doctest. -# -# This module is for testing how doctest handles a module with no -# docstrings. - - -class Foo(object): - - # A class with no docstring. - - def __init__(self): - pass diff --git a/lib-python/3/test/sample_doctest_no_doctests.py b/lib-python/3/test/sample_doctest_no_doctests.py deleted file mode 100644 --- a/lib-python/3/test/sample_doctest_no_doctests.py +++ /dev/null @@ -1,15 +0,0 @@ -"""This is a sample module used for testing doctest. - -This module is for testing how doctest handles a module with docstrings -but no doctest examples. - -""" - - -class Foo(object): - """A docstring with no doctest examples. - - """ - - def __init__(self): - pass diff --git a/lib-python/3/test/test__osx_support.py b/lib-python/3/test/test__osx_support.py deleted file mode 100644 --- a/lib-python/3/test/test__osx_support.py +++ /dev/null @@ -1,279 +0,0 @@ -""" -Test suite for _osx_support: shared OS X support functions. -""" - -import os -import platform -import shutil -import stat -import sys -import unittest - -import test.support - -import _osx_support - - at unittest.skipUnless(sys.platform.startswith("darwin"), "requires OS X") -class Test_OSXSupport(unittest.TestCase): - - def setUp(self): - self.maxDiff = None - self.prog_name = 'bogus_program_xxxx' - self.temp_path_dir = os.path.abspath(os.getcwd()) - self.env = test.support.EnvironmentVarGuard() - self.addCleanup(self.env.__exit__) - for cv in ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', - 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'CC', - 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', - 'PY_CORE_CFLAGS'): - if cv in self.env: - self.env.unset(cv) - - def add_expected_saved_initial_values(self, config_vars, expected_vars): - # Ensure that the initial values for all modified config vars - # are also saved with modified keys. - expected_vars.update(('_OSX_SUPPORT_INITIAL_'+ k, - config_vars[k]) for k in config_vars - if config_vars[k] != expected_vars[k]) - - def test__find_executable(self): - if self.env['PATH']: - self.env['PATH'] = self.env['PATH'] + ':' - self.env['PATH'] = self.env['PATH'] + os.path.abspath(self.temp_path_dir) - test.support.unlink(self.prog_name) - self.assertIsNone(_osx_support._find_executable(self.prog_name)) - self.addCleanup(test.support.unlink, self.prog_name) - with open(self.prog_name, 'w') as f: - f.write("#!/bin/sh\n/bin/echo OK\n") - os.chmod(self.prog_name, stat.S_IRWXU) - self.assertEqual(self.prog_name, - _osx_support._find_executable(self.prog_name)) - - def test__read_output(self): - if self.env['PATH']: - self.env['PATH'] = self.env['PATH'] + ':' - self.env['PATH'] = self.env['PATH'] + os.path.abspath(self.temp_path_dir) - test.support.unlink(self.prog_name) - self.addCleanup(test.support.unlink, self.prog_name) - with open(self.prog_name, 'w') as f: - f.write("#!/bin/sh\n/bin/echo ExpectedOutput\n") - os.chmod(self.prog_name, stat.S_IRWXU) - self.assertEqual('ExpectedOutput', - _osx_support._read_output(self.prog_name)) - - def test__find_build_tool(self): - out = _osx_support._find_build_tool('cc') - self.assertTrue(os.path.isfile(out), - 'cc not found - check xcode-select') - - def test__get_system_version(self): - self.assertTrue(platform.mac_ver()[0].startswith( - _osx_support._get_system_version())) - - def test__remove_original_values(self): - config_vars = { - 'CC': 'gcc-test -pthreads', - } - expected_vars = { - 'CC': 'clang -pthreads', - } - cv = 'CC' - newvalue = 'clang -pthreads' - _osx_support._save_modified_value(config_vars, cv, newvalue) - self.assertNotEqual(expected_vars, config_vars) - _osx_support._remove_original_values(config_vars) - self.assertEqual(expected_vars, config_vars) - - def test__save_modified_value(self): - config_vars = { - 'CC': 'gcc-test -pthreads', - } - expected_vars = { - 'CC': 'clang -pthreads', - } - self.add_expected_saved_initial_values(config_vars, expected_vars) - cv = 'CC' - newvalue = 'clang -pthreads' - _osx_support._save_modified_value(config_vars, cv, newvalue) - self.assertEqual(expected_vars, config_vars) - - def test__save_modified_value_unchanged(self): - config_vars = { - 'CC': 'gcc-test -pthreads', - } - expected_vars = config_vars.copy() - cv = 'CC' - newvalue = 'gcc-test -pthreads' - _osx_support._save_modified_value(config_vars, cv, newvalue) - self.assertEqual(expected_vars, config_vars) - - def test__supports_universal_builds(self): - import platform - self.assertEqual(platform.mac_ver()[0].split('.') >= ['10', '4'], - _osx_support._supports_universal_builds()) - - def test__find_appropriate_compiler(self): - compilers = ( - ('gcc-test', 'i686-apple-darwin11-llvm-gcc-4.2'), - ('clang', 'clang version 3.1'), - ) - config_vars = { - 'CC': 'gcc-test -pthreads', - 'CXX': 'cc++-test', - 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ', - 'LDFLAGS': '-arch ppc -arch i386 -g', - 'CPPFLAGS': '-I. -isysroot /Developer/SDKs/MacOSX10.4u.sdk', - 'BLDSHARED': 'gcc-test -bundle -arch ppc -arch i386 -g', - 'LDSHARED': 'gcc-test -bundle -arch ppc -arch i386 ' - '-isysroot /Developer/SDKs/MacOSX10.4u.sdk -g', - } - expected_vars = { - 'CC': 'clang -pthreads', - 'CXX': 'clang++', - 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ', - 'LDFLAGS': '-arch ppc -arch i386 -g', - 'CPPFLAGS': '-I. -isysroot /Developer/SDKs/MacOSX10.4u.sdk', - 'BLDSHARED': 'clang -bundle -arch ppc -arch i386 -g', - 'LDSHARED': 'clang -bundle -arch ppc -arch i386 ' - '-isysroot /Developer/SDKs/MacOSX10.4u.sdk -g', - } - self.add_expected_saved_initial_values(config_vars, expected_vars) - - suffix = (':' + self.env['PATH']) if self.env['PATH'] else '' - self.env['PATH'] = os.path.abspath(self.temp_path_dir) + suffix - for c_name, c_output in compilers: - test.support.unlink(c_name) - self.addCleanup(test.support.unlink, c_name) - with open(c_name, 'w') as f: - f.write("#!/bin/sh\n/bin/echo " + c_output) - os.chmod(c_name, stat.S_IRWXU) - self.assertEqual(expected_vars, - _osx_support._find_appropriate_compiler( - config_vars)) - - def test__remove_universal_flags(self): - config_vars = { - 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ', - 'LDFLAGS': '-arch ppc -arch i386 -g', - 'CPPFLAGS': '-I. -isysroot /Developer/SDKs/MacOSX10.4u.sdk', - 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', - 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' - '-isysroot /Developer/SDKs/MacOSX10.4u.sdk -g', - } - expected_vars = { - 'CFLAGS': '-fno-strict-aliasing -g -O3 ', - 'LDFLAGS': ' -g', - 'CPPFLAGS': '-I. ', - 'BLDSHARED': 'gcc-4.0 -bundle -g', - 'LDSHARED': 'gcc-4.0 -bundle -g', - } - self.add_expected_saved_initial_values(config_vars, expected_vars) - - self.assertEqual(expected_vars, - _osx_support._remove_universal_flags( - config_vars)) - - def test__remove_unsupported_archs(self): - config_vars = { - 'CC': 'clang', - 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ', - 'LDFLAGS': '-arch ppc -arch i386 -g', - 'CPPFLAGS': '-I. -isysroot /Developer/SDKs/MacOSX10.4u.sdk', - 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', - 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' - '-isysroot /Developer/SDKs/MacOSX10.4u.sdk -g', - } - expected_vars = { - 'CC': 'clang', - 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch i386 ', - 'LDFLAGS': ' -arch i386 -g', - 'CPPFLAGS': '-I. -isysroot /Developer/SDKs/MacOSX10.4u.sdk', - 'BLDSHARED': 'gcc-4.0 -bundle -arch i386 -g', - 'LDSHARED': 'gcc-4.0 -bundle -arch i386 ' - '-isysroot /Developer/SDKs/MacOSX10.4u.sdk -g', - } - self.add_expected_saved_initial_values(config_vars, expected_vars) - - suffix = (':' + self.env['PATH']) if self.env['PATH'] else '' - self.env['PATH'] = os.path.abspath(self.temp_path_dir) + suffix - c_name = 'clang' - test.support.unlink(c_name) - self.addCleanup(test.support.unlink, c_name) - # exit status 255 means no PPC support in this compiler chain - with open(c_name, 'w') as f: - f.write("#!/bin/sh\nexit 255") - os.chmod(c_name, stat.S_IRWXU) - self.assertEqual(expected_vars, - _osx_support._remove_unsupported_archs( - config_vars)) - - def test__override_all_archs(self): - self.env['ARCHFLAGS'] = '-arch x86_64' - config_vars = { - 'CC': 'clang', - 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ', - 'LDFLAGS': '-arch ppc -arch i386 -g', - 'CPPFLAGS': '-I. -isysroot /Developer/SDKs/MacOSX10.4u.sdk', - 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', - 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' - '-isysroot /Developer/SDKs/MacOSX10.4u.sdk -g', - } - expected_vars = { - 'CC': 'clang', - 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch x86_64', - 'LDFLAGS': ' -g -arch x86_64', - 'CPPFLAGS': '-I. -isysroot /Developer/SDKs/MacOSX10.4u.sdk', - 'BLDSHARED': 'gcc-4.0 -bundle -g -arch x86_64', - 'LDSHARED': 'gcc-4.0 -bundle -isysroot ' - '/Developer/SDKs/MacOSX10.4u.sdk -g -arch x86_64', - } - self.add_expected_saved_initial_values(config_vars, expected_vars) - - self.assertEqual(expected_vars, - _osx_support._override_all_archs( - config_vars)) - - def test__check_for_unavailable_sdk(self): - config_vars = { - 'CC': 'clang', - 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ' - '-isysroot /Developer/SDKs/MacOSX10.1.sdk', - 'LDFLAGS': '-arch ppc -arch i386 -g', - 'CPPFLAGS': '-I. -isysroot /Developer/SDKs/MacOSX10.1.sdk', - 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', - 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' - '-isysroot /Developer/SDKs/MacOSX10.1.sdk -g', - } - expected_vars = { - 'CC': 'clang', - 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ' - ' ', - 'LDFLAGS': '-arch ppc -arch i386 -g', - 'CPPFLAGS': '-I. ', - 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', - 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' - ' -g', - } - self.add_expected_saved_initial_values(config_vars, expected_vars) - - self.assertEqual(expected_vars, - _osx_support._check_for_unavailable_sdk( - config_vars)) - - def test_get_platform_osx(self): - # Note, get_platform_osx is currently tested more extensively - # indirectly by test_sysconfig and test_distutils - config_vars = { - 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ' - '-isysroot /Developer/SDKs/MacOSX10.1.sdk', - 'MACOSX_DEPLOYMENT_TARGET': '10.6', - } - result = _osx_support.get_platform_osx(config_vars, ' ', ' ', ' ') - self.assertEqual(('macosx', '10.6', 'fat'), result) - -def test_main(): - if sys.platform == 'darwin': - test.support.run_unittest(Test_OSXSupport) - -if __name__ == "__main__": - test_main() diff --git a/lib-python/3/test/test_file_eintr.py b/lib-python/3/test/test_file_eintr.py deleted file mode 100644 --- a/lib-python/3/test/test_file_eintr.py +++ /dev/null @@ -1,236 +0,0 @@ -# Written to test interrupted system calls interfering with our many buffered -# IO implementations. http://bugs.python.org/issue12268 -# -# It was suggested that this code could be merged into test_io and the tests -# made to work using the same method as the existing signal tests in test_io. -# I was unable to get single process tests using alarm or setitimer that way -# to reproduce the EINTR problems. This process based test suite reproduces -# the problems prior to the issue12268 patch reliably on Linux and OSX. -# - gregory.p.smith - -import os -import select -import signal -import subprocess -import sys -from test.support import run_unittest -import time -import unittest - -# Test import all of the things we're about to try testing up front. -from _io import FileIO - - - at unittest.skipUnless(os.name == 'posix', 'tests requires a posix system.') -class TestFileIOSignalInterrupt(unittest.TestCase): - def setUp(self): - self._process = None - - def tearDown(self): - if self._process and self._process.poll() is None: - try: - self._process.kill() - except OSError: - pass - - def _generate_infile_setup_code(self): - """Returns the infile = ... line of code for the reader process. - - subclasseses should override this to test different IO objects. - """ - return ('import _io ;' - 'infile = _io.FileIO(sys.stdin.fileno(), "rb")') - - def fail_with_process_info(self, why, stdout=b'', stderr=b'', - communicate=True): - """A common way to cleanup and fail with useful debug output. - - Kills the process if it is still running, collects remaining output - and fails the test with an error message including the output. - - Args: - why: Text to go after "Error from IO process" in the message. - stdout, stderr: standard output and error from the process so - far to include in the error message. - communicate: bool, when True we call communicate() on the process - after killing it to gather additional output. - """ - if self._process.poll() is None: - time.sleep(0.1) # give it time to finish printing the error. - try: - self._process.terminate() # Ensure it dies. - except OSError: - pass - if communicate: - stdout_end, stderr_end = self._process.communicate() - stdout += stdout_end - stderr += stderr_end - self.fail('Error from IO process %s:\nSTDOUT:\n%sSTDERR:\n%s\n' % - (why, stdout.decode(), stderr.decode())) - - def _test_reading(self, data_to_write, read_and_verify_code): - """Generic buffered read method test harness to validate EINTR behavior. - - Also validates that Python signal handlers are run during the read. - - Args: - data_to_write: String to write to the child process for reading - before sending it a signal, confirming the signal was handled, - writing a final newline and closing the infile pipe. - read_and_verify_code: Single "line" of code to read from a file - object named 'infile' and validate the result. This will be - executed as part of a python subprocess fed data_to_write. - """ - infile_setup_code = self._generate_infile_setup_code() - # Total pipe IO in this function is smaller than the minimum posix OS - # pipe buffer size of 512 bytes. No writer should block. - assert len(data_to_write) < 512, 'data_to_write must fit in pipe buf.' - - # Start a subprocess to call our read method while handling a signal. - self._process = subprocess.Popen( - [sys.executable, '-u', '-c', - 'import signal, sys ;' - 'signal.signal(signal.SIGINT, ' - 'lambda s, f: sys.stderr.write("$\\n")) ;' - + infile_setup_code + ' ;' + - 'sys.stderr.write("Worm Sign!\\n") ;' - + read_and_verify_code + ' ;' + - 'infile.close()' - ], - stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - - # Wait for the signal handler to be installed. - worm_sign = self._process.stderr.read(len(b'Worm Sign!\n')) - if worm_sign != b'Worm Sign!\n': # See also, Dune by Frank Herbert. - self.fail_with_process_info('while awaiting a sign', - stderr=worm_sign) - self._process.stdin.write(data_to_write) - - signals_sent = 0 - rlist = [] - # We don't know when the read_and_verify_code in our child is actually - # executing within the read system call we want to interrupt. This - # loop waits for a bit before sending the first signal to increase - # the likelihood of that. Implementations without correct EINTR - # and signal handling usually fail this test. - while not rlist: - rlist, _, _ = select.select([self._process.stderr], (), (), 0.05) - self._process.send_signal(signal.SIGINT) - signals_sent += 1 - if signals_sent > 200: - self._process.kill() - self.fail('reader process failed to handle our signals.') - # This assumes anything unexpected that writes to stderr will also - # write a newline. That is true of the traceback printing code. - signal_line = self._process.stderr.readline() - if signal_line != b'$\n': - self.fail_with_process_info('while awaiting signal', - stderr=signal_line) - - # We append a newline to our input so that a readline call can - # end on its own before the EOF is seen and so that we're testing - # the read call that was interrupted by a signal before the end of - # the data stream has been reached. - stdout, stderr = self._process.communicate(input=b'\n') - if self._process.returncode: - self.fail_with_process_info( - 'exited rc=%d' % self._process.returncode, - stdout, stderr, communicate=False) - # PASS! - - # String format for the read_and_verify_code used by read methods. - _READING_CODE_TEMPLATE = ( - 'got = infile.{read_method_name}() ;' - 'expected = {expected!r} ;' - 'assert got == expected, (' - '"{read_method_name} returned wrong data.\\n"' - '"got data %r\\nexpected %r" % (got, expected))' - ) - - def test_readline(self): - """readline() must handle signals and not lose data.""" - self._test_reading( - data_to_write=b'hello, world!', - read_and_verify_code=self._READING_CODE_TEMPLATE.format( - read_method_name='readline', - expected=b'hello, world!\n')) - - def test_readlines(self): - """readlines() must handle signals and not lose data.""" - self._test_reading( - data_to_write=b'hello\nworld!', - read_and_verify_code=self._READING_CODE_TEMPLATE.format( - read_method_name='readlines', - expected=[b'hello\n', b'world!\n'])) - - def test_readall(self): - """readall() must handle signals and not lose data.""" - self._test_reading( - data_to_write=b'hello\nworld!', - read_and_verify_code=self._READING_CODE_TEMPLATE.format( - read_method_name='readall', - expected=b'hello\nworld!\n')) - # read() is the same thing as readall(). - self._test_reading( - data_to_write=b'hello\nworld!', - read_and_verify_code=self._READING_CODE_TEMPLATE.format( - read_method_name='read', - expected=b'hello\nworld!\n')) - - -class TestBufferedIOSignalInterrupt(TestFileIOSignalInterrupt): - def _generate_infile_setup_code(self): - """Returns the infile = ... line of code to make a BufferedReader.""" - return ('infile = open(sys.stdin.fileno(), "rb") ;' - 'import _io ;assert isinstance(infile, _io.BufferedReader)') - - def test_readall(self): - """BufferedReader.read() must handle signals and not lose data.""" - self._test_reading( - data_to_write=b'hello\nworld!', - read_and_verify_code=self._READING_CODE_TEMPLATE.format( - read_method_name='read', - expected=b'hello\nworld!\n')) - - -class TestTextIOSignalInterrupt(TestFileIOSignalInterrupt): - def _generate_infile_setup_code(self): - """Returns the infile = ... line of code to make a TextIOWrapper.""" - return ('infile = open(sys.stdin.fileno(), "rt", newline=None) ;' - 'import _io ;assert isinstance(infile, _io.TextIOWrapper)') - - def test_readline(self): - """readline() must handle signals and not lose data.""" - self._test_reading( - data_to_write=b'hello, world!', - read_and_verify_code=self._READING_CODE_TEMPLATE.format( - read_method_name='readline', - expected='hello, world!\n')) - - def test_readlines(self): - """readlines() must handle signals and not lose data.""" - self._test_reading( - data_to_write=b'hello\r\nworld!', - read_and_verify_code=self._READING_CODE_TEMPLATE.format( - read_method_name='readlines', - expected=['hello\n', 'world!\n'])) - - def test_readall(self): - """read() must handle signals and not lose data.""" - self._test_reading( - data_to_write=b'hello\nworld!', - read_and_verify_code=self._READING_CODE_TEMPLATE.format( - read_method_name='read', - expected="hello\nworld!\n")) - - -def test_main(): - test_cases = [ - tc for tc in globals().values() - if isinstance(tc, type) and issubclass(tc, unittest.TestCase)] - run_unittest(*test_cases) - - -if __name__ == '__main__': - test_main() diff --git a/lib-python/3/test/test_tools.py b/lib-python/3/test/test_tools.py deleted file mode 100644 --- a/lib-python/3/test/test_tools.py +++ /dev/null @@ -1,433 +0,0 @@ -"""Tests for scripts in the Tools directory. - -This file contains regression tests for some of the scripts found in the -Tools directory of a Python checkout or tarball, such as reindent.py. -""" - -import os -import sys -import imp -import unittest -import shutil -import subprocess -import sysconfig -import tempfile -import textwrap -from test import support -from test.script_helper import assert_python_ok, temp_dir - -if not sysconfig.is_python_build(): - # XXX some installers do contain the tools, should we detect that - # and run the tests in that case too? - raise unittest.SkipTest('test irrelevant for an installed Python') - -basepath = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), - 'Tools') -scriptsdir = os.path.join(basepath, 'scripts') - - -class ReindentTests(unittest.TestCase): - script = os.path.join(scriptsdir, 'reindent.py') - - def test_noargs(self): - assert_python_ok(self.script) - - def test_help(self): - rc, out, err = assert_python_ok(self.script, '-h') - self.assertEqual(out, b'') - self.assertGreater(err, b'') - - -class PindentTests(unittest.TestCase): - script = os.path.join(scriptsdir, 'pindent.py') - - def assertFileEqual(self, fn1, fn2): - with open(fn1) as f1, open(fn2) as f2: - self.assertEqual(f1.readlines(), f2.readlines()) - - def pindent(self, source, *args): - with subprocess.Popen( - (sys.executable, self.script) + args, - stdin=subprocess.PIPE, stdout=subprocess.PIPE, - universal_newlines=True) as proc: - out, err = proc.communicate(source) - self.assertIsNone(err) - return out - - def lstriplines(self, data): From pypy.commits at gmail.com Thu Sep 19 02:04:44 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 18 Sep 2019 23:04:44 -0700 (PDT) Subject: [pypy-commit] pypy default: start release cycle Message-ID: <5d831a7c.1c69fb81.cd2b.8178@mx.google.com> Author: Matti Picus Branch: Changeset: r97533:bb5b1b1126ae Date: 2019-09-19 09:03 +0300 http://bitbucket.org/pypy/pypy/changeset/bb5b1b1126ae/ Log: start release cycle diff --git a/LICENSE b/LICENSE --- a/LICENSE +++ b/LICENSE @@ -40,11 +40,11 @@ Armin Rigo Maciej Fijalkowski Carl Friedrich Bolz-Tereick + Matti Picus Antonio Cuni Amaury Forgeot d'Arc - Matti Picus + Ronan Lamy Samuele Pedroni - Ronan Lamy Alex Gaynor Philip Jenvey Richard Plangger @@ -94,6 +94,7 @@ Jason Creighton Mark Young Alex Martelli + Andrew Lawrence Spenser Bauman Michal Bendowski Jan de Mooij @@ -106,11 +107,11 @@ Stefan Schwarzer Tomek Meka Valentino Volonghi + Stefan Beyer Patrick Maupin Devin Jeanpierre Bob Ippolito Bruno Gola - Andrew Lawrence David Malcolm Squeaky Edd Barrett @@ -124,7 +125,6 @@ Wenzhu Man Konstantin Lopuhin John Witulski - Stefan Beyer Jeremy Thurgood Greg Price Ivan Sichmann Freitas @@ -138,6 +138,7 @@ Pavel Vinogradov William Leslie Paweł Piotr Przeradowski + Stian Andreassen marky1991 Ilya Osadchiy Tobias Oberstein @@ -146,14 +147,13 @@ Taavi Burns Adrian Kuhn tav - Stian Andreassen Georg Brandl Joannah Nanjekye + Julian Berman Bert Freudenberg Wanja Saatkamp Mike Blume Gerald Klix - Julian Berman Oscar Nierstrasz Rami Chowdhury Stefan H. Muller @@ -204,6 +204,7 @@ Andrews Medina Aaron Iles Toby Watson + Lin Cheng Daniel Patrick Stuart Williams Antoine Pitrou @@ -245,6 +246,7 @@ Valentina Mukhamedzhanova Stefano Parmesan touilleMan + Anthony Sottile Marc Abramowitz Arjun Naik Aaron Gallagher @@ -254,7 +256,6 @@ Omer Katz Jacek Generowicz Tomasz Dziopa - Lin Cheng Sylvain Thenault Jakub Stasiak Andrew Dalke @@ -285,7 +286,6 @@ Lene Wagner Tomo Cocoa Miro Hrončok - Anthony Sottile David Lievens Neil Blakey-Milner Henrik Vendelbo @@ -294,11 +294,14 @@ Christoph Gerum Miguel de Val Borro Artur Lisiecki + joserubiovidales at gmail.com afteryu Toni Mattis + Vincent Michel Laurens Van Houtven Bobby Impollonia Roberto De Ioris + Yannick Jadoul Jeong YunWon Christopher Armstrong Aaron Tubbs @@ -312,6 +315,7 @@ Fabio Niephaus Akira Li Gustavo Niemeyer + joachim-ballmann at bitbucket.org Nate Bragg Lucas Stadler roberto at goyle @@ -331,8 +335,12 @@ Ben Darnell Juan Francisco Cantero Hurtado Godefroid Chappelle + Paul Ganssle + Michal Kuffa Stephan Busemann + Bystroushaak Dan Colish + Ram Rachum timo Volodymyr Vladymyrov Daniel Neuhäuser @@ -342,18 +350,22 @@ Chris Lambacher John Aldis coolbutuseless at gmail.com + Yasen Kiprov Mike Bayer Rodrigo Araújo Daniil Yarancev Min RK OlivierBlanvillain + dakarpov at gmail.com Jonas Pfannschmidt Zearin Johan Forsberg Andrey Churin Dan Crosta reubano at gmail.com + Ryan Hileman Stanisław Halik + DeVerne Jones Julien Phalip Roman Podoliaka Steve Papanik @@ -369,17 +381,20 @@ Jim Hunziker shoma hosaka Buck Golemon + whitequark Iraklis D. JohnDoe yrttyr Michael Chermside Anna Ravencroft remarkablerocket + Ivan Petre Vijiac Berker Peksag Christian Muirhead soareschen Matthew Miller + Jesdi Konrad Delong Dinu Gherman pizi @@ -398,13 +413,16 @@ Markus Unterwaditzer Kristoffer Kleine Graham Markall + paugier Dan Loewenherz werat Filip Salomonsson Niclas Olofsson + Zsolt Cserna Chris Pressey Tobias Diaz Paul Graydon + mkuffa Nikolaos-Digenis Karagiannis Kurt Griffiths Ben Mather diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py --- a/pypy/doc/conf.py +++ b/pypy/doc/conf.py @@ -71,9 +71,9 @@ # module/cpyext/include/patchlevel.h # # The short X.Y version. -version = '7.2' +version = '7.3' # The full version, including alpha/beta/rc tags. -release = '7.2.0' +release = '7.3.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/pypy/doc/contributor.rst b/pypy/doc/contributor.rst --- a/pypy/doc/contributor.rst +++ b/pypy/doc/contributor.rst @@ -7,11 +7,11 @@ Armin Rigo Maciej Fijalkowski Carl Friedrich Bolz-Tereick + Matti Picus Antonio Cuni Amaury Forgeot d'Arc - Matti Picus + Ronan Lamy Samuele Pedroni - Ronan Lamy Alex Gaynor Philip Jenvey Richard Plangger @@ -61,6 +61,7 @@ Jason Creighton Mark Young Alex Martelli + Andrew Lawrence Spenser Bauman Michal Bendowski Jan de Mooij @@ -73,11 +74,11 @@ Stefan Schwarzer Tomek Meka Valentino Volonghi + Stefan Beyer Patrick Maupin Devin Jeanpierre Bob Ippolito Bruno Gola - Andrew Lawrence David Malcolm Squeaky Edd Barrett @@ -91,7 +92,6 @@ Wenzhu Man Konstantin Lopuhin John Witulski - Stefan Beyer Jeremy Thurgood Greg Price Ivan Sichmann Freitas @@ -105,6 +105,7 @@ Pavel Vinogradov William Leslie Paweł Piotr Przeradowski + Stian Andreassen marky1991 Ilya Osadchiy Tobias Oberstein @@ -113,14 +114,13 @@ Taavi Burns Adrian Kuhn tav - Stian Andreassen Georg Brandl Joannah Nanjekye + Julian Berman Bert Freudenberg Wanja Saatkamp Mike Blume Gerald Klix - Julian Berman Oscar Nierstrasz Rami Chowdhury Stefan H. Muller @@ -171,6 +171,7 @@ Andrews Medina Aaron Iles Toby Watson + Lin Cheng Daniel Patrick Stuart Williams Antoine Pitrou @@ -212,6 +213,7 @@ Valentina Mukhamedzhanova Stefano Parmesan touilleMan + Anthony Sottile Marc Abramowitz Arjun Naik Aaron Gallagher @@ -221,7 +223,6 @@ Omer Katz Jacek Generowicz Tomasz Dziopa - Lin Cheng Sylvain Thenault Jakub Stasiak Andrew Dalke @@ -261,11 +262,14 @@ Christoph Gerum Miguel de Val Borro Artur Lisiecki + joserubiovidales at gmail.com afteryu Toni Mattis + Vincent Michel Laurens Van Houtven Bobby Impollonia Roberto De Ioris + Yannick Jadoul Jeong YunWon Christopher Armstrong Aaron Tubbs @@ -279,6 +283,7 @@ Fabio Niephaus Akira Li Gustavo Niemeyer + joachim-ballmann at bitbucket.org Nate Bragg Lucas Stadler roberto at goyle @@ -298,8 +303,12 @@ Ben Darnell Juan Francisco Cantero Hurtado Godefroid Chappelle + Paul Ganssle + Michal Kuffa Stephan Busemann + Bystroushaak Dan Colish + Ram Rachum timo Volodymyr Vladymyrov Daniel Neuhäuser @@ -309,18 +318,22 @@ Chris Lambacher John Aldis coolbutuseless at gmail.com + Yasen Kiprov Mike Bayer Rodrigo Araújo Daniil Yarancev Min RK OlivierBlanvillain + dakarpov at gmail.com Jonas Pfannschmidt Zearin Johan Forsberg Andrey Churin Dan Crosta reubano at gmail.com + Ryan Hileman Stanisław Halik + DeVerne Jones Julien Phalip Roman Podoliaka Steve Papanik @@ -336,17 +349,20 @@ Jim Hunziker shoma hosaka Buck Golemon + whitequark Iraklis D. JohnDoe yrttyr Michael Chermside Anna Ravencroft remarkablerocket + Ivan Petre Vijiac Berker Peksag Christian Muirhead soareschen Matthew Miller + Jesdi Konrad Delong Dinu Gherman pizi @@ -365,13 +381,16 @@ Markus Unterwaditzer Kristoffer Kleine Graham Markall + paugier Dan Loewenherz werat Filip Salomonsson Niclas Olofsson + Zsolt Cserna Chris Pressey Tobias Diaz Paul Graydon + mkuffa Nikolaos-Digenis Karagiannis Kurt Griffiths Ben Mather diff --git a/pypy/doc/index-of-release-notes.rst b/pypy/doc/index-of-release-notes.rst --- a/pypy/doc/index-of-release-notes.rst +++ b/pypy/doc/index-of-release-notes.rst @@ -6,6 +6,7 @@ .. toctree:: + release-v7.2.0.rst release-v7.1.1.rst release-v7.1.0.rst release-v7.0.0.rst diff --git a/pypy/doc/index-of-whatsnew.rst b/pypy/doc/index-of-whatsnew.rst --- a/pypy/doc/index-of-whatsnew.rst +++ b/pypy/doc/index-of-whatsnew.rst @@ -7,6 +7,7 @@ .. toctree:: whatsnew-head.rst + whatsnew-pypy2-7.2.0.rst whatsnew-pypy2-7.1.0.rst whatsnew-pypy2-7.0.0.rst whatsnew-pypy2-6.0.0.rst @@ -37,12 +38,17 @@ whatsnew-1.9.rst +CPython 3.6 compatible versions +------------------------------- + +.. toctree:: + whatsnew-pypy3-head.rst + CPython 3.5 compatible versions ------------------------------- .. toctree:: - whatsnew-pypy3-head.rst whatsnew-pypy3-7.0.0.rst whatsnew-pypy3-5.9.0.rst whatsnew-pypy3-5.8.0.rst diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst new file mode 100644 --- /dev/null +++ b/pypy/doc/release-v7.2.0.rst @@ -0,0 +1,104 @@ +==================================== +PyPy v7.2.0: release of 2.7, and 3.6 +==================================== + +The PyPy team is proud to release the version 7.2.0 of PyPy, which includes +two different interpreters: + + - PyPy2.7, which is an interpreter supporting the syntax and the features of + Python 2.7 including the stdlib for CPython 2.7.13 + + - PyPy3.6: which is an interpreter supporting the syntax and the features of + Python 3.6, including the stdlib for CPython 3.6.9. + +The interpreters are based on much the same codebase, thus the double +release. + +This release removes the "beta" tag from PyPy3.6. While there may still be some +small corner-case incompatibilities (around the exact error messages in +exceptions and the handling of faulty codec errorhandlers) we are happy with +the quality of the 3.6 series and are looking forward to working on a Python +3.7 interpreter. + +With the support of the ARM foundation, this release supports the 64-bit +``aarch64`` ARM architecture. + +We updated our benchmark runner at https://speed.pypy.org to a more modern +machine and updated the baseline python to CPython 2.7.11. Thanks to `Baroque +Software` for maintaining the benchmark runner. + +Until we can work with downstream providers to distribute builds with PyPy, we +have made packages for some common packages `available as wheels`_. + +The `CFFI`_ backend has been updated to version 1.13.0. We recommend using CFFI +rather than c-extensions to interact with C, and `cppyy`_ for interacting with +C++ code. + +As always, this release is 100% compatible with the previous one and fixed +several issues and bugs raised by the growing community of PyPy users. +We strongly recommend updating. + +You can download the v7.2 releases here: + + http://pypy.org/download.html + +We would like to thank our donors for the continued support of the PyPy +project. If PyPy is not quite good enough for your needs, we are available for +direct consulting work. + +We would also like to thank our contributors and encourage new people to join +the project. PyPy has many layers and we need help with all of them: `PyPy`_ +and `RPython`_ documentation improvements, tweaking popular modules to run +on pypy, or general `help`_ with making RPython's JIT even better. Since the +previous release, we have accepted contributions from 27 new contributors, +thanks for pitching in. + +.. _`PyPy`: index.html +.. _`RPython`: https://rpython.readthedocs.org +.. _`help`: project-ideas.html +.. _`CFFI`: http://cffi.readthedocs.io +.. _`cppyy`: https://cppyy.readthedocs.io +.. _`available as wheels`: https://github.com/antocuni/pypy-wheels +.. _`Baroque Software`: https://baroquesoftware.com + +What is PyPy? +============= + +PyPy is a very compliant Python interpreter, almost a drop-in replacement for +CPython 2.7, 3.6. It's fast (`PyPy and CPython 2.7.x`_ performance +comparison) due to its integrated tracing JIT compiler. + +We also welcome developers of other `dynamic languages`_ to see what RPython +can do for them. + +This PyPy release supports: + + * **x86** machines on most common operating systems + (Linux 32/64 bits, Mac OS X 64 bits, Windows 32 bits, OpenBSD, FreeBSD) + + * big- and little-endian variants of **PPC64** running Linux, + + * **s390x** running Linux + + * 64-bit **ARM** machines running Linux. + +Unfortunately at the moment of writing our ARM buildbots are out of service, +so for now we are **not** releasing any binary for the ARM architecture (32 +bit), although PyPy does support ARM 32 bit processors. + +.. _`PyPy and CPython 2.7.x`: http://speed.pypy.org +.. _`dynamic languages`: http://rpython.readthedocs.io/en/latest/examples.html + + +Changelog +========= + +Changes shared across versions + +* Update ``cffi`` to 1.13.0 + +C-API (cpyext) improvements shared across versions + +Python 3.6 only + + diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst new file mode 100644 --- /dev/null +++ b/pypy/doc/whatsnew-head.rst @@ -0,0 +1,7 @@ +========================== +What's new in PyPy2.7 7.3+ +========================== + +.. this is a revision shortly after release-pypy-7.2.0 +.. startrev: 78cd4acbcbec + diff --git a/pypy/doc/whatsnew-pypy2-7.2.0.rst b/pypy/doc/whatsnew-pypy2-7.2.0.rst --- a/pypy/doc/whatsnew-pypy2-7.2.0.rst +++ b/pypy/doc/whatsnew-pypy2-7.2.0.rst @@ -1,6 +1,6 @@ -========================== -What's new in PyPy2.7 7.1+ -========================== +=========================== +What's new in PyPy2.7 7.2.0 +=========================== .. this is a revision shortly after release-pypy-7.1.0 .. startrev: d3aefbf6dae7 @@ -73,4 +73,4 @@ .. branch: openssl-for-macos -Update _ssl on macos to statically link to openssl-1.1.1c \ No newline at end of file +Update _ssl on macos to statically link to openssl-1.1.1c From pypy.commits at gmail.com Thu Sep 19 05:42:21 2019 From: pypy.commits at gmail.com (mattip) Date: Thu, 19 Sep 2019 02:42:21 -0700 (PDT) Subject: [pypy-commit] pypy default: update release note (from 7.1.1 release up to commit 97179-e0689d0f47c6) Message-ID: <5d834d7d.1c69fb81.18662.3399@mx.google.com> Author: Matti Picus Branch: Changeset: r97534:9c2a1fc23434 Date: 2019-09-19 12:41 +0300 http://bitbucket.org/pypy/pypy/changeset/9c2a1fc23434/ Log: update release note (from 7.1.1 release up to commit 97179-e0689d0f47c6) diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst --- a/pypy/doc/release-v7.2.0.rst +++ b/pypy/doc/release-v7.2.0.rst @@ -27,16 +27,30 @@ machine and updated the baseline python to CPython 2.7.11. Thanks to `Baroque Software` for maintaining the benchmark runner. -Until we can work with downstream providers to distribute builds with PyPy, we +The CFFI-based ``_ssl`` module was backported to PyPy2.7 and updated to use +`cryptography`_ version 2.7. Additionally the `_hashlib`, and ``crypt`` (or +``_crypt`` on Python3) modules were converted to CFFI. This has two +consequences. End users and packagers can more easily update these libraries +for their platform by executing ``(cd lib_pypy; ../bin/pypy _*_build.py)``. +More significantly, since PyPy itself links to fewer system shared objects +(DLLs), on platforms with a single runtime namespace like linux different CFFI +and c-extension modules can load different versions of the same shared object +into PyPy without collision (`issue 2617`_). + +Until downstream providers begin to distribute c-extension builds with PyPy, we have made packages for some common packages `available as wheels`_. The `CFFI`_ backend has been updated to version 1.13.0. We recommend using CFFI rather than c-extensions to interact with C, and `cppyy`_ for interacting with C++ code. +Thanks to Anvil_, we revived the `PyPy Sandbox`_, which allows total control +over a python interpreter's interactions with the external world. + As always, this release is 100% compatible with the previous one and fixed several issues and bugs raised by the growing community of PyPy users. -We strongly recommend updating. +We strongly recommend updating. Many of the fixes are the direct result of +end-user bug reports, so please continue reporting issues as they crop up. You can download the v7.2 releases here: @@ -60,6 +74,8 @@ .. _`cppyy`: https://cppyy.readthedocs.io .. _`available as wheels`: https://github.com/antocuni/pypy-wheels .. _`Baroque Software`: https://baroquesoftware.com +.. _Anvil: https://anvil.works +.. _`PyPy Sandbox`: https://morepypy.blogspot.com/2019/08 What is PyPy? ============= @@ -93,12 +109,162 @@ Changelog ========= +Changes released in v7.1.1 +-------------------------- + +* Improve performance of ``u''.append`` +* Prevent a crash in ``zlib`` when flushing a closed stream +* Fix a few corner cases when encountering unicode values above 0x110000 +* Teach the JIT how to handle very large constant lists, sets, or dicts +* Fix building on ARM32 (`issue 2984`_) +* Fix a bug in register assignment in ARM32 +* Package windows DLLs needed by cffi modules next to the cffi c-extensions + (`issue 2988`_) +* Cleanup and refactor JIT code to remove ``rpython.jit.metainterp.typesystem`` +* Fix memoryviews of ctype structures with padding, (cpython issue 32780_) + +Changes to Python 3.6 released in v7.1.1 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* On win32, override some ``errno.E*`` values that were added to MSVC in v2010 + so that ``errno.E* == errno.WSAE*`` as in CPython +* Do the same optimization that CPython does for ``(1, 2, 3, *a)`` (but at the + AST level) +* Raise a ``TypeError`` when using buffers and unicode such as ``''.strip(buffer)`` + and ``'a' < buffer`` +* Support ``_overlapped`` and asyncio on win32 +* Fix an issue where ``''.join(list_of_strings)`` would rarely confuse utf8 and + bytes (`issue 2997`_) +* Fix ``io.IncrementalNewlineDecoder`` interaction with ``\r`` (`issue 3012`_) + Changes shared across versions +------------------------------ * Update ``cffi`` to 1.13.0 +* Add support for ARM aarch64 +* Many internal changes to the utf-8 processing code, since now unicode strings + are stored internally as utf-8. A few corner cases were fixed, and performance + bottlenecks were improved. Specifically, issues were fixed with ``maketrans``, + ``strip``, comparison with ``bytearray``, use in ``array.array``, ``join``, + ``translate``, forrmatting, ``__int__``, ``str()``, ``startswith``, + ``endswith``, +* Reduce the probability of a deadlock when acquiring a semaphore by + moving global state changes closer to the actual aquire (`issue 2953`_) +* Cleanup and refactor parts of the JIT code +* Cleanup ``optimizeopt`` +* Support the ``z15`` variant of the ``s390x`` CPU. +* Fixes to ``_ctypes`` handling of memoryviews +* Fix a shadowstack overflow when using ``sys.setrecurtionlimit`` (`issue 2722`) +* Fix a bug that prevent memory-tracking in vmprof working on PyPy +* Improve the speed and memory use of the ``_pypyjson`` JSON decoder. The + resulting dictionaries that come out of the JSON decoder have faster lookups too +* ``struct.unpack`` of a sliced ``bytearray`` exposed a subtle bug where the + JIT's ``gc_load`` family of calls must force some lazy code (`issue 3014`_) +* Remove ``copystrcontent`` and ``copyunicodecontent`` in the backends. + Instead, replace it in ``rewrite.py`` with a direct call to ``memcpy()`` and + a new basic operation, ``load_effective_address``, which the backend can + even decide not to implement. +* Allow 2d indexing in ``memoryview.__setitem__`` (`issue 3028`_) +* Speed up 'bytearray += bytes' and other similar combinations +* Compute the greatest common divisor of two RPython ``rbigint`` instances + using `Lehmer's algorithm`_ and use it in the ``math`` module +* Add ``RFile.closed`` to mirror standard `file` behaviour +* Add a ``-D`` pytest option to run tests directly on the host python without + any knowlege of PyPy internals. This allows using ``pypy3 pytest.py ...`` + for a subset of tests (called **app-level testing**) +* Accept arguments to ``subprocess.Popen`` that are not directly subscriptable + (like iterators) (`issue 3050`_) +* Catch more low-level ``SocketError`` exceptions and turn them into app-level + exceptions (`issue 3049`_) +* Fix formatting of a ``memoryview``: ``b"<%s>" % memoryview(b"X")`` +* Correctly wrap the I/O errors we can get when importing modules +* Fix bad output from JSON with ``'skipkeys=True'`` (`issue 3052`_) +* Fix compatibility with latest virtualenv HEAD -C-API (cpyext) improvements shared across versions +C-API (cpyext) and c-extensions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* Add ``DateTime_FromTimestamp`` and ``Date_FromTimestamp`` to the + ``PyDateTime_CAPI`` struct + +* Add constants and macros needed to build opencv2_ with PyPy2.7 +* Add more constants to `sysconfig``. Set ``MACOSX_DEPLOYMENT_TARGET`` for + darwin (`issue 2994`_) +* fix ``CBuffer.buffer_attach`` Python 3.6 only +--------------- +* Accept ``a, b = (*x, 2)`` (`issue 2995`_) +* Class methods with the signature ``def meth(*args, **kwargs)`` were not adding + an implied ``self`` argument (`issue 2996`_) +* Fix handling of ``__fpath__`` (`issue 2985`_) +* Disable ``assert`` when run with ``-O`` (`issue 3000`_) +* ``codecs.encode``, ``codecs.decode`` can behave differently than + ``ustr.encode``, ``bytes.decode`` (`issue 3001`_) +* Putting ``pdb.set_trace`` call in a threaded program did not work (`issue + 3003`_) +* Fix parsing for converting strings with underscore into ints +* Add ``memoryview.obj`` which stores a reference, (`issue 3016`_) +* Fix datetime.fromtimestamp for win32 (cpython issue 29097_) +* Improve multiprocessing support on win32 +* Support negative offsets in ``lnotab`` (`issue 2943`_) +* Fix leak of file descriptor with `_io.FileIO('dir/')` +* Fix ``float.__round__(None)`` (`issue 3033`_) +* Fix for when we should use the Universal Newline mode on Windows for + stdin/stdout/stderr (`issue 3007`_) +* Fix ImportError invalid arguments error wording +* Ignore GeneratorExit when throwing into the aclose coroutine of an + asynchronous generator (CPython issue 35409_) +* Improve the pure-python ``faulthander`` module +* Properly raise an exception when a ``BlockingIOError`` exception escapes + from ``W_BufferedReader.readline_w()`` (`issue 3042`_) +* Fix a code path only used in ``zipimport`` (`issue 3034`_) +* Update the stdlib to 3.6.9, fix many failing tests +* Fix handling of ``__debug__``, ``-O``, and ``sys.flags.optimizeOptimize`` + (CPython issue 27169_) +* Fix raising ``SystemExit`` in ``atexit`` +* Fix case where ``int()`` would go into infinite recursion +* Don't ignore fold parameter in ``(date,)time.replace()`` +* Fix logic bug for ``memoryview.cast`` (when ``view.format`` is not ``'B'``) +Python 3.6 c-API +~~~~~~~~~~~~~~~~ + +* Add ``PyStructSequence_InitType2``, ``Py_RETURN_NOTIMPLEMENTED``, + ``PyGILState_Check``, ``PyUnicode_AsUCS4``, ``PyUnicode_AsUCS4Copy`` +* Sync the various ``Py**Flag`` constants with CPython + +.. _`Lehmer's algorithm`: https://en.wikipedia.org/wiki/Lehmer's_GCD_algorithm +.. _29097: https://bugs.python.org/issue29097 +.. _32780: https://bugs.python.org/issue32780 +.. _35409 : https://bugs.python.org/issue35409 +.. _27169 : https://bugs.python.org/issue27169 +.. _opencv2: https://github.com/skvark/opencv-python/ +.. _`issue 2617`: https://bitbucket.com/pypy/pypy/issues/2617 +.. _`issue 2722`: https://bitbucket.com/pypy/pypy/issues/2722 +.. _`issue 2953`: https://bitbucket.com/pypy/pypy/issues/2953 +.. _`issue 2943`: https://bitbucket.com/pypy/pypy/issues/2943 +.. _`issue 2980`: https://bitbucket.com/pypy/pypy/issues/2980 +.. _`issue 2984`: https://bitbucket.com/pypy/pypy/issues/2984 +.. _`issue 2994`: https://bitbucket.com/pypy/pypy/issues/2994 +.. _`issue 2995`: https://bitbucket.com/pypy/pypy/issues/2995 +.. _`issue 2996`: https://bitbucket.com/pypy/pypy/issues/2995 +.. _`issue 2997`: https://bitbucket.com/pypy/pypy/issues/2995 +.. _`issue 2988`: https://bitbucket.com/pypy/pypy/issues/2988 +.. _`issue 2985`: https://bitbucket.com/pypy/pypy/issues/2985 +.. _`issue 2986`: https://bitbucket.com/pypy/pypy/issues/2986 +.. _`issue 3000`: https://bitbucket.com/pypy/pypy/issues/3000 +.. _`issue 3001`: https://bitbucket.com/pypy/pypy/issues/3001 +.. _`issue 3003`: https://bitbucket.com/pypy/pypy/issues/3003 +.. _`issue 3007`: https://bitbucket.com/pypy/pypy/issues/3007 +.. _`issue 3012`: https://bitbucket.com/pypy/pypy/issues/3012 +.. _`issue 3014`: https://bitbucket.com/pypy/pypy/issues/3014 +.. _`issue 3016`: https://bitbucket.com/pypy/pypy/issues/3016 +.. _`issue 3028`: https://bitbucket.com/pypy/pypy/issues/3028 +.. _`issue 3033`: https://bitbucket.com/pypy/pypy/issues/3033 +.. _`issue 3034`: https://bitbucket.com/pypy/pypy/issues/3034 +.. _`issue 3042`: https://bitbucket.com/pypy/pypy/issues/3042 +.. _`issue 3049`: https://bitbucket.com/pypy/pypy/issues/3049 +.. _`issue 3050`: https://bitbucket.com/pypy/pypy/issues/3050 +.. _`issue 3052`: https://bitbucket.com/pypy/pypy/issues/3052 From pypy.commits at gmail.com Thu Sep 19 06:11:48 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 19 Sep 2019 03:11:48 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: change test_peepholer: PyPy implements the feature, but the limit is different than CPython's Message-ID: <5d835464.1c69fb81.79fcc.7b0c@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97535:7ea1a4ba3ea1 Date: 2019-09-19 11:45 +0200 http://bitbucket.org/pypy/pypy/changeset/7ea1a4ba3ea1/ Log: change test_peepholer: PyPy implements the feature, but the limit is different than CPython's diff --git a/lib-python/3/test/test_peepholer.py b/lib-python/3/test/test_peepholer.py --- a/lib-python/3/test/test_peepholer.py +++ b/lib-python/3/test/test_peepholer.py @@ -189,9 +189,11 @@ code = compile('a=1<<1000', '', 'single') self.assertInBytecode(code, 'LOAD_CONST', 1000) self.assertNotIn(1<<1000, code.co_consts) - code = compile('a=2**1000', '', 'single') - self.assertInBytecode(code, 'LOAD_CONST', 1000) - self.assertNotIn(2**1000, code.co_consts) + # difference to CPython: PyPy allows slightly larger constants to be + # created + code = compile('a=2**10000', '', 'single') + self.assertInBytecode(code, 'LOAD_CONST', 10000) + self.assertNotIn(2**10000, code.co_consts) @cpython_only # we currently not bother to implement that def test_binary_subscr_on_unicode(self): From pypy.commits at gmail.com Thu Sep 19 06:11:50 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 19 Sep 2019 03:11:50 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: pypy doesn't call all finalizers during shutdown Message-ID: <5d835466.1c69fb81.af06c.bf73@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97536:3f81620aeee8 Date: 2019-09-19 11:50 +0200 http://bitbucket.org/pypy/pypy/changeset/3f81620aeee8/ Log: pypy doesn't call all finalizers during shutdown diff --git a/lib-python/3/test/test_threading.py b/lib-python/3/test/test_threading.py --- a/lib-python/3/test/test_threading.py +++ b/lib-python/3/test/test_threading.py @@ -557,6 +557,7 @@ self.assertEqual(err, b"") self.assertEqual(data, "Thread-1\nTrue\nTrue\n") + @test.support.cpython_only @requires_type_collecting def test_main_thread_during_shutdown(self): # bpo-31516: current_thread() should still point to the main thread From pypy.commits at gmail.com Thu Sep 19 08:17:18 2019 From: pypy.commits at gmail.com (rlamy) Date: Thu, 19 Sep 2019 05:17:18 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Remove --no-objspace-fstrings translation option: f-strings should always be enabled in 3.6 Message-ID: <5d8371ce.1c69fb81.ee105.23e9@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97537:199eb552dbe7 Date: 2019-09-19 13:16 +0100 http://bitbucket.org/pypy/pypy/changeset/199eb552dbe7/ Log: Remove --no-objspace-fstrings translation option: f-strings should always be enabled in 3.6 diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py --- a/pypy/config/pypyoption.py +++ b/pypy/config/pypyoption.py @@ -170,11 +170,6 @@ "Disable only cffi's embedding mode.", default=False), - BoolOption("fstrings", - "if you are really convinced that f-strings are a security " - "issue, you can disable them here", - default=True), - ChoiceOption("hash", "The hash function to use for strings: fnv from CPython 2.7" " or siphash24 from CPython >= 3.4", diff --git a/pypy/interpreter/astcompiler/fstring.py b/pypy/interpreter/astcompiler/fstring.py --- a/pypy/interpreter/astcompiler/fstring.py +++ b/pypy/interpreter/astcompiler/fstring.py @@ -318,27 +318,15 @@ # In our case, parse_f_string() and fstring_find_literal_and_expr() # could be merged into a single function with a clearer logic. It's # done this way to follow CPython's source code more closely. - space = astbuilder.space - if not space.config.objspace.fstrings: - raise astbuilder.error( - "f-strings have been disabled in this version of pypy " - "with the translation option '--no-objspace-fstrings'. " - "The PyPy team (and CPython) thinks f-strings don't " - "add any security risks, but we leave it to you to " - "convince whoever translated this pypy that it is " - "really the case", atom_node) - while True: w_u, expr = fstring_find_literal_and_expr(astbuilder, fstr, atom_node, rec) # add the literal part f_constant_string(astbuilder, joined_pieces, w_u, atom_node) - if expr is None: break # We're done with this f-string. - joined_pieces.append(expr) # If recurse_lvl is zero, then we must be at the end of the From pypy.commits at gmail.com Thu Sep 19 09:05:41 2019 From: pypy.commits at gmail.com (antocuni) Date: Thu, 19 Sep 2019 06:05:41 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: more comments and review Message-ID: <5d837d25.1c69fb81.724db.c928@mx.google.com> Author: Antonio Cuni Branch: json-decoder-maps Changeset: r97538:1a3d5908e330 Date: 2019-09-19 15:05 +0200 http://bitbucket.org/pypy/pypy/changeset/1a3d5908e330/ Log: more comments and review diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -89,6 +89,11 @@ # two caches, one for keys, one for general strings. they both have the # form {hash-as-int: CacheEntry} and they don't deal with # collisions at all. For every hash there is simply one string stored. + # + # if I understand it correctly, the point is not only to + # cache the wrapped strings, but also to avoid to memcpy them out of + # the original string in the common case. Maybe this should be + # explained here. self.cache = {} self.cache_wrapped = {} @@ -385,6 +390,19 @@ return get_jsonmap_from_dict(w_dict) def _switch_to_dict(self, currmap, values_w, nextindex): + # not sure if this is a problem, but it's something which I + # noticed and I think it's worth thinking about it for 5 minutes. + # + # In Python3 dicts preserve the order of keys; this means that a + # "naive" json parser produces dicts whose keys are in the same order + # as in the source document (CPython 3.7 does this). I don't think it + # is guaranteed at all, but I'd not be surprised if real world + # programs will rely on this anyway. + # + # But with the logic here we get the weird effect that the resulting + # dicts contains the first keys in reversed order (up to when we reach + # the blocked state in the map), then the subsequent ones are in the + # "correct" order. dict_w = self._create_empty_dict() index = nextindex - 1 while isinstance(currmap, JSONMap): @@ -657,6 +675,8 @@ i += 1 return self._decode_key_string(i) + +# maybe this should be called StringCacheEntry? class CacheEntry(object): """ A cache entry, bundling the encoded version of a string, and its wrapped decoded variant. """ @@ -754,6 +774,8 @@ def __init__(self, space): self.space = space + # what about calling this "first_nextmap"? Or, even better: + # nextmap_first and nextmap_all # a single transition is stored in .single_nextmap self.single_nextmap = None @@ -792,6 +814,7 @@ self.single_nextmap = next else: if self.all_next is None: + # 2nd transition ever seen (comment added by , please review) self.all_next = objectmodel.r_dict(unicode_eq, unicode_hash, force_non_null=True, simple_hash_eq=True) self.all_next[single_nextmap.w_key] = single_nextmap @@ -799,6 +822,7 @@ next = self.all_next.get(w_key, None) if next is not None: return next + # if we are at this point we didn't find the transition yet, so create a new one (comment added by , please review) next = self._make_next_map(w_key, string[start:stop]) self.all_next[w_key] = next From pypy.commits at gmail.com Thu Sep 19 11:04:11 2019 From: pypy.commits at gmail.com (rlamy) Date: Thu, 19 Sep 2019 08:04:11 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Separate bytes() and str() paths in parsestr() Message-ID: <5d8398eb.1c69fb81.87d04.1f0b@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97539:323217710a5a Date: 2019-09-19 15:45 +0100 http://bitbucket.org/pypy/pypy/changeset/323217710a5a/ Log: Separate bytes() and str() paths in parsestr() diff --git a/pypy/interpreter/pyparser/parsestring.py b/pypy/interpreter/pyparser/parsestring.py --- a/pypy/interpreter/pyparser/parsestring.py +++ b/pypy/interpreter/pyparser/parsestring.py @@ -86,37 +86,32 @@ 'unmatched triple quotes in literal') q -= 2 - if unicode_literal and not rawmode: # XXX Py_UnicodeFlag is ignored for now - assert 0 <= ps <= q + assert 0 <= ps <= q + if unicode_literal: if saw_f: return W_FString(s[ps:q], rawmode, stnode) - if encoding is None: - substr = s[ps:q] + elif rawmode: + v = unicodehelper.str_decode_utf8(s[ps:q], 'strict', True, None) + return space.newtext(*v) else: - unicodehelper.check_utf8_or_raise(space, s, ps, q) - substr = decode_unicode_utf8(space, s, ps, q) - r = unicodehelper.decode_unicode_escape(space, substr) - v, length, pos = r - return space.newutf8(v, length) + if encoding is None: + substr = s[ps:q] + else: + unicodehelper.check_utf8_or_raise(space, s, ps, q) + substr = decode_unicode_utf8(space, s, ps, q) + r = unicodehelper.decode_unicode_escape(space, substr) + v, length, pos = r + return space.newutf8(v, length) - assert 0 <= ps <= q substr = s[ps : q] - - if not unicode_literal: - # Disallow non-ascii characters (but not escapes) - for c in substr: - if ord(c) > 0x80: - raise oefmt(space.w_SyntaxError, - "bytes can only contain ASCII literal characters.") + # Disallow non-ascii characters (but not escapes) + for c in substr: + if ord(c) > 0x80: + raise oefmt(space.w_SyntaxError, + "bytes can only contain ASCII literal characters.") if rawmode or '\\' not in substr: - if not unicode_literal: - return space.newbytes(substr) - elif saw_f: - return W_FString(substr, rawmode, stnode) - else: - v = unicodehelper.str_decode_utf8(substr, 'strict', True, None) - return space.newtext(*v) + return space.newbytes(substr) v, first_escape_error_char = PyString_DecodeEscape( space, substr, 'strict', encoding) From pypy.commits at gmail.com Thu Sep 19 11:04:13 2019 From: pypy.commits at gmail.com (rlamy) Date: Thu, 19 Sep 2019 08:04:13 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Fix confusing variable naming Message-ID: <5d8398ed.1c69fb81.e4687.343a@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97540:90d95ff4347e Date: 2019-09-19 16:03 +0100 http://bitbucket.org/pypy/pypy/changeset/90d95ff4347e/ Log: Fix confusing variable naming diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -125,12 +125,12 @@ from pypy.module._codecs import interp_codecs state = space.fromcache(interp_codecs.CodecState) unicodedata_handler = state.get_unicodedata_handler(space) - s, blen, ulen, first_escape_error_char = str_decode_unicode_escape( + s, ulen, blen, first_escape_error_char = str_decode_unicode_escape( string, "strict", final=True, errorhandler=state.decode_error_handler, ud_handler=unicodedata_handler) - return s, blen, ulen + return s, ulen, blen def decode_raw_unicode_escape(space, string): return str_decode_raw_unicode_escape( diff --git a/pypy/module/_codecs/interp_codecs.py b/pypy/module/_codecs/interp_codecs.py --- a/pypy/module/_codecs/interp_codecs.py +++ b/pypy/module/_codecs/interp_codecs.py @@ -733,8 +733,6 @@ @unwrap_spec(string='bufferstr', errors='text_or_none', w_final = WrappedDefault(False)) def utf_8_decode(space, string, errors="strict", w_final=None): - - if errors is None: errors = 'strict' final = space.is_true(w_final) @@ -874,8 +872,6 @@ @unwrap_spec(string='bufferstr', errors='text_or_none') def charmap_decode(space, string, errors="strict", w_mapping=None): - - if errors is None: errors = 'strict' if len(string) == 0: @@ -896,7 +892,6 @@ @unwrap_spec(errors='text_or_none') def charmap_encode(space, w_unicode, errors="strict", w_mapping=None): - if errors is None: errors = 'strict' if space.is_none(w_mapping): @@ -954,7 +949,7 @@ unicode_name_handler = state.get_unicodedata_handler(space) - result, lgt, u_len, first_escape_error_char = unicodehelper.str_decode_unicode_escape( + result, u_len, lgt, first_escape_error_char = unicodehelper.str_decode_unicode_escape( string, errors, final, state.decode_error_handler, unicode_name_handler) @@ -973,7 +968,7 @@ space.newtext(msg), space.w_DeprecationWarning ) - return space.newtuple([space.newutf8(result, lgt), space.newint(u_len)]) + return space.newtuple([space.newutf8(result, u_len), space.newint(lgt)]) # ____________________________________________________________ # Raw Unicode escape (accepts bytes or str) @@ -994,8 +989,6 @@ @unwrap_spec(errors='text_or_none') def unicode_internal_decode(space, w_string, errors="strict"): - - if errors is None: errors = 'strict' # special case for this codec: unicodes are returned as is From pypy.commits at gmail.com Thu Sep 19 12:13:24 2019 From: pypy.commits at gmail.com (rlamy) Date: Thu, 19 Sep 2019 09:13:24 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Add DeprecationWarning for invalid escapes in str literals, similarly to bytes literals Message-ID: <5d83a924.1c69fb81.40afb.21bc@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97541:abe60bf6dc7b Date: 2019-09-19 17:12 +0100 http://bitbucket.org/pypy/pypy/changeset/abe60bf6dc7b/ Log: Add DeprecationWarning for invalid escapes in str literals, similarly to bytes literals diff --git a/pypy/interpreter/pyparser/test/apptest_parsestring.py b/pypy/interpreter/pyparser/test/apptest_parsestring.py --- a/pypy/interpreter/pyparser/test/apptest_parsestring.py +++ b/pypy/interpreter/pyparser/test/apptest_parsestring.py @@ -8,3 +8,11 @@ eval("b'''\n\\z'''") assert not w assert excinfo.value.filename == '' + +def test_str_invalid_escape(): + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('error', category=DeprecationWarning) + with raises(SyntaxError) as excinfo: + eval("'''\n\\z'''") + assert not w + assert excinfo.value.filename == '' diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -130,6 +130,15 @@ final=True, errorhandler=state.decode_error_handler, ud_handler=unicodedata_handler) + if first_escape_error_char is not None: + msg = "invalid escape sequence '%s'" + try: + space.warn(space.newtext(msg % first_escape_error_char), space.w_DeprecationWarning) + except OperationError as e: + if e.match(space, space.w_DeprecationWarning): + raise oefmt(space.w_SyntaxError, msg, first_escape_error_char) + else: + raise return s, ulen, blen def decode_raw_unicode_escape(space, string): From pypy.commits at gmail.com Thu Sep 19 13:29:02 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 19 Sep 2019 10:29:02 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: start addressing some comments by Anto Message-ID: <5d83bade.1c69fb81.2de06.0e78@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: json-decoder-maps Changeset: r97542:243adfa1677a Date: 2019-09-19 16:31 +0200 http://bitbucket.org/pypy/pypy/changeset/243adfa1677a/ Log: start addressing some comments by Anto diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -87,7 +87,7 @@ self.intcache = space.fromcache(IntCache) # two caches, one for keys, one for general strings. they both have the - # form {hash-as-int: CacheEntry} and they don't deal with + # form {hash-as-int: StringCacheEntry} and they don't deal with # collisions at all. For every hash there is simply one string stored. # # if I understand it correctly, the point is not only to @@ -597,7 +597,7 @@ if ((contextmap is not None and contextmap.decoded_strings < self.STRING_CACHE_EVALUATION_SIZE) or strhash in self.lru_cache): - entry = CacheEntry( + entry = StringCacheEntry( self.getslice(start, start + length), w_res) self.cache_wrapped[strhash] = entry else: @@ -656,7 +656,7 @@ entry = self.cache[strhash] except KeyError: w_res = self._create_string_wrapped(start, i, nonascii) - entry = CacheEntry( + entry = StringCacheEntry( self.getslice(start, start + length), w_res) self.cache[strhash] = entry return w_res @@ -676,8 +676,7 @@ return self._decode_key_string(i) -# maybe this should be called StringCacheEntry? -class CacheEntry(object): +class StringCacheEntry(object): """ A cache entry, bundling the encoded version of a string, and its wrapped decoded variant. """ def __init__(self, repr, w_uni): @@ -814,7 +813,7 @@ self.single_nextmap = next else: if self.all_next is None: - # 2nd transition ever seen (comment added by , please review) + # 2nd transition ever seen self.all_next = objectmodel.r_dict(unicode_eq, unicode_hash, force_non_null=True, simple_hash_eq=True) self.all_next[single_nextmap.w_key] = single_nextmap @@ -822,7 +821,8 @@ next = self.all_next.get(w_key, None) if next is not None: return next - # if we are at this point we didn't find the transition yet, so create a new one (comment added by , please review) + # if we are at this point we didn't find the transition yet, so + # create a new one next = self._make_next_map(w_key, string[start:stop]) self.all_next[w_key] = next @@ -853,7 +853,7 @@ if single_nextmap.key_repr_cmp(ll_chars, position): decoder.pos = position + len(single_nextmap.key_repr) return single_nextmap - # return None explicitly? + return None def observe_transition(self, newmap, terminator): """ observe a transition from self to newmap. From pypy.commits at gmail.com Thu Sep 19 14:08:48 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 19 Sep 2019 11:08:48 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: some comments, rename a few attributes Message-ID: <5d83c430.1c69fb81.96da1.a896@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: json-decoder-maps Changeset: r97543:5a9168e9cb01 Date: 2019-09-19 19:40 +0200 http://bitbucket.org/pypy/pypy/changeset/5a9168e9cb01/ Log: some comments, rename a few attributes diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -88,15 +88,14 @@ # two caches, one for keys, one for general strings. they both have the # form {hash-as-int: StringCacheEntry} and they don't deal with - # collisions at all. For every hash there is simply one string stored. - # - # if I understand it correctly, the point is not only to - # cache the wrapped strings, but also to avoid to memcpy them out of - # the original string in the common case. Maybe this should be - # explained here. - self.cache = {} - self.cache_wrapped = {} + # collisions at all. For every hash there is simply one string stored + # and we ignore collisions. + self.cache_keys = {} + self.cache_values = {} + # we don't cache *all* non-key strings, that would be too expensive. + # instead, keep a cache of the last 16 strings hashes around and add a + # string to the cache only if its hash is seen a second time self.lru_cache = [0] * self.LRU_SIZE self.lru_index = 0 @@ -553,7 +552,8 @@ def decode_string(self, i, contextmap=None): """ Decode a string at position i (which is right after the opening "). Optionally pass a contextmap, if the value is decoded as the value of a - dict. """ + dict.""" + ll_chars = self.ll_chars start = i ch = ll_chars[i] @@ -563,6 +563,14 @@ cache = True if contextmap is not None: + # keep some statistics about the usefulness of the string cache on + # the contextmap + # the intuition about the contextmap is as follows: + # often there are string values stored in dictionaries that can + # never be usefully cached, like unique ids of objects. Then the + # strings *in those fields* of all objects should never be cached. + # However, the content of other fields can still be useful to + # cache. contextmap.decoded_strings += 1 if not contextmap.should_cache_strings(): cache = False @@ -589,17 +597,19 @@ # check cache first: try: - entry = self.cache_wrapped[strhash] + entry = self.cache_values[strhash] except KeyError: w_res = self._create_string_wrapped(start, i, nonascii) # only add *some* strings to the cache, because keeping them all is - # way too expensive + # way too expensive. first we check if the contextmap has caching + # disabled completely. if not, we check whether we have recently + # seen the same hash already, if yes, we cache the string. if ((contextmap is not None and contextmap.decoded_strings < self.STRING_CACHE_EVALUATION_SIZE) or strhash in self.lru_cache): entry = StringCacheEntry( self.getslice(start, start + length), w_res) - self.cache_wrapped[strhash] = entry + self.cache_values[strhash] = entry else: self.lru_cache[self.lru_index] = strhash self.lru_index = (self.lru_index + 1) & self.LRU_MASK @@ -620,7 +630,7 @@ def _decode_key_map(self, i, currmap): ll_chars = self.ll_chars - # first try to see whether we happen to find currmap.single_nextmap + # first try to see whether we happen to find currmap.nextmap_first nextmap = currmap.fast_path_key_parse(self, i) if nextmap is not None: return nextmap @@ -653,12 +663,12 @@ self.pos = i + 1 # check cache first: try: - entry = self.cache[strhash] + entry = self.cache_keys[strhash] except KeyError: w_res = self._create_string_wrapped(start, i, nonascii) entry = StringCacheEntry( self.getslice(start, start + length), w_res) - self.cache[strhash] = entry + self.cache_keys[strhash] = entry return w_res if not entry.compare(ll_chars, start, length): # collision! hopefully rare @@ -677,8 +687,8 @@ class StringCacheEntry(object): - """ A cache entry, bundling the encoded version of a string, and its wrapped - decoded variant. """ + """ A cache entry, bundling the encoded version of a string as it appears + in the input string, and its wrapped decoded variant. """ def __init__(self, repr, w_uni): # repr is the escaped string self.repr = repr @@ -725,7 +735,7 @@ # preliminary maps. When we have too many fringe maps, we remove the least # commonly instantiated fringe map and mark it as blocked. - # allowed graph edges or nodes in all_next: + # allowed graph edges or nodes in nextmap_all: # USEFUL ------- # / \ \ # v v v @@ -747,7 +757,7 @@ # v v # BLOCKED - # the single_nextmap edge can only be these graph edges: + # the nextmap_first edge can only be these graph edges: # USEFUL # | # v @@ -773,14 +783,12 @@ def __init__(self, space): self.space = space - # what about calling this "first_nextmap"? Or, even better: - # nextmap_first and nextmap_all - # a single transition is stored in .single_nextmap - self.single_nextmap = None + # a single transition is stored in .nextmap_first + self.nextmap_first = None - # all_next is only initialized after seeing the *second* transition - # but then it also contains .single_nextmap - self.all_next = None # later dict {key: nextmap} + # nextmap_all is only initialized after seeing the *second* transition + # but then it also contains .nextmap_first + self.nextmap_all = None # later dict {key: nextmap} # keep some statistics about every map: how often it was instantiated # and how many non-blocked leaves the map transition tree has, starting @@ -789,42 +797,42 @@ self.number_of_leaves = 1 def _check_invariants(self): - if self.all_next: - for next in self.all_next.itervalues(): + if self.nextmap_all: + for next in self.nextmap_all.itervalues(): next._check_invariants() - elif self.single_nextmap: - self.single_nextmap._check_invariants() + elif self.nextmap_first: + self.nextmap_first._check_invariants() def get_next(self, w_key, string, start, stop, terminator): from pypy.objspace.std.dictmultiobject import unicode_hash, unicode_eq if isinstance(self, JSONMap): assert not self.state == MapBase.BLOCKED - single_nextmap = self.single_nextmap - if (single_nextmap is not None and - single_nextmap.w_key.eq_w(w_key)): - return single_nextmap + nextmap_first = self.nextmap_first + if (nextmap_first is not None and + nextmap_first.w_key.eq_w(w_key)): + return nextmap_first assert stop >= 0 assert start >= 0 - if single_nextmap is None: - # first transition ever seen, don't initialize all_next + if nextmap_first is None: + # first transition ever seen, don't initialize nextmap_all next = self._make_next_map(w_key, string[start:stop]) - self.single_nextmap = next + self.nextmap_first = next else: - if self.all_next is None: + if self.nextmap_all is None: # 2nd transition ever seen - self.all_next = objectmodel.r_dict(unicode_eq, unicode_hash, + self.nextmap_all = objectmodel.r_dict(unicode_eq, unicode_hash, force_non_null=True, simple_hash_eq=True) - self.all_next[single_nextmap.w_key] = single_nextmap + self.nextmap_all[nextmap_first.w_key] = nextmap_first else: - next = self.all_next.get(w_key, None) + next = self.nextmap_all.get(w_key, None) if next is not None: return next # if we are at this point we didn't find the transition yet, so # create a new one next = self._make_next_map(w_key, string[start:stop]) - self.all_next[w_key] = next + self.nextmap_all[w_key] = next # one new leaf has been created self.change_number_of_leaves(1) @@ -846,13 +854,13 @@ """ Fast path when parsing the next key: We speculate that we will always see a commonly seen next key, and use strcmp (implemented in key_repr_cmp) to check whether that is the case. """ - single_nextmap = self.single_nextmap - if single_nextmap: + nextmap_first = self.nextmap_first + if nextmap_first: ll_chars = decoder.ll_chars - assert isinstance(single_nextmap, JSONMap) - if single_nextmap.key_repr_cmp(ll_chars, position): - decoder.pos = position + len(single_nextmap.key_repr) - return single_nextmap + assert isinstance(nextmap_first, JSONMap) + if nextmap_first.key_repr_cmp(ll_chars, position): + decoder.pos = position + len(nextmap_first.key_repr) + return nextmap_first return None def observe_transition(self, newmap, terminator): @@ -871,18 +879,18 @@ def _all_dot(self, output): identity = objectmodel.compute_unique_id(self) output.append('%s [shape=box%s];' % (identity, self._get_dot_text())) - if self.all_next: - for w_key, value in self.all_next.items(): + if self.nextmap_all: + for w_key, value in self.nextmap_all.items(): assert isinstance(value, JSONMap) - if value is self.single_nextmap: + if value is self.nextmap_first: color = ", color=blue" else: color = "" output.append('%s -> %s [label="%s"%s];' % ( identity, objectmodel.compute_unique_id(value), value.w_key._utf8, color)) value._all_dot(output) - elif self.single_nextmap is not None: - value = self.single_nextmap + elif self.nextmap_first is not None: + value = self.nextmap_first output.append('%s -> %s [label="%s", color=blue];' % ( identity, objectmodel.compute_unique_id(value), value.w_key._utf8)) value._all_dot(output) @@ -1000,8 +1008,8 @@ assert False, "should be unreachable" if self.state == MapBase.BLOCKED: - assert self.single_nextmap is None - assert self.all_next is None + assert self.nextmap_first is None + assert self.nextmap_all is None elif self.state == MapBase.FRINGE: assert self in self._get_terminator().current_fringe @@ -1016,19 +1024,19 @@ if was_fringe: terminator.remove_from_fringe(self) # find the most commonly instantiated child, store it into - # single_nextmap and mark it useful, recursively - maxchild = self.single_nextmap - if self.all_next is not None: - for child in self.all_next.itervalues(): + # nextmap_first and mark it useful, recursively + maxchild = self.nextmap_first + if self.nextmap_all is not None: + for child in self.nextmap_all.itervalues(): if child.instantiation_count > maxchild.instantiation_count: maxchild = child if maxchild is not None: maxchild.mark_useful(terminator) - if self.all_next: - for child in self.all_next.itervalues(): + if self.nextmap_all: + for child in self.nextmap_all.itervalues(): if child is not maxchild: terminator.register_potential_fringe(child) - self.single_nextmap = maxchild + self.nextmap_first = maxchild def mark_blocked(self, terminator): """ mark self and recursively all its children as blocked.""" @@ -1036,13 +1044,13 @@ self.state = MapBase.BLOCKED if was_fringe: terminator.remove_from_fringe(self) - if self.all_next: - for next in self.all_next.itervalues(): + if self.nextmap_all: + for next in self.nextmap_all.itervalues(): next.mark_blocked(terminator) - elif self.single_nextmap: - self.single_nextmap.mark_blocked(terminator) - self.single_nextmap = None - self.all_next = None + elif self.nextmap_first: + self.nextmap_first.mark_blocked(terminator) + self.nextmap_first = None + self.nextmap_all = None self.change_number_of_leaves(-self.number_of_leaves + 1) def is_state_blocked(self): @@ -1123,10 +1131,10 @@ # _____________________________________________________ def _get_dot_text(self): - if self.all_next is None: - l = int(self.single_nextmap is not None) + if self.nextmap_all is None: + l = int(self.nextmap_first is not None) else: - l = len(self.all_next) + l = len(self.nextmap_all) extra = "" if self.decoded_strings: extra = "\\n%s/%s (%s%%)" % (self.cache_hits, self.decoded_strings, self.cache_hits/float(self.decoded_strings)) diff --git a/pypy/module/_pypyjson/test/test__pypyjson.py b/pypy/module/_pypyjson/test/test__pypyjson.py --- a/pypy/module/_pypyjson/test/test__pypyjson.py +++ b/pypy/module/_pypyjson/test/test__pypyjson.py @@ -21,26 +21,26 @@ w_c = self.space.newutf8("c", 1) m1 = m.get_next(w_a, '"a"', 0, 3, m) assert m1.w_key == w_a - assert m1.single_nextmap is None + assert m1.nextmap_first is None assert m1.key_repr == '"a"' assert m1.key_repr_cmp('"a": 123', 0) assert not m1.key_repr_cmp('b": 123', 0) - assert m.single_nextmap.w_key == w_a + assert m.nextmap_first.w_key == w_a m2 = m.get_next(w_a, '"a"', 0, 3, m) assert m2 is m1 m3 = m.get_next(w_b, '"b"', 0, 3, m) assert m3.w_key == w_b - assert m3.single_nextmap is None + assert m3.nextmap_first is None assert m3.key_repr == '"b"' - assert m.single_nextmap is m1 + assert m.nextmap_first is m1 m4 = m3.get_next(w_c, '"c"', 0, 3, m) assert m4.w_key == w_c - assert m4.single_nextmap is None + assert m4.nextmap_first is None assert m4.key_repr == '"c"' - assert m3.single_nextmap is m4 + assert m3.nextmap_first is m4 def test_json_map_get_index(self): m = Terminator(self.space) @@ -121,7 +121,7 @@ assert m3.state == MapBase.PRELIMINARY m3.instantiation_count = 2 - assert m2.single_nextmap is m3 + assert m2.nextmap_first is m3 assert m4.state == MapBase.PRELIMINARY m4.instantiation_count = 4 @@ -131,7 +131,7 @@ assert m2.state == MapBase.USEFUL assert m3.state == MapBase.FRINGE assert m4.state == MapBase.USEFUL - assert m2.single_nextmap is m4 + assert m2.nextmap_first is m4 assert m1.number_of_leaves == 2 base._check_invariants() @@ -194,11 +194,11 @@ base.cleanup_fringe() assert base.current_fringe == dict.fromkeys([m1, m2, m3]) assert m4.state == MapBase.BLOCKED - assert m4.single_nextmap is None - assert m4.all_next is None + assert m4.nextmap_first is None + assert m4.nextmap_all is None assert m5.state == MapBase.BLOCKED - assert m5.single_nextmap is None - assert m5.all_next is None + assert m5.nextmap_first is None + assert m5.nextmap_all is None def test_deal_with_blocked(self): w_a = self.space.newutf8("a", 1) From pypy.commits at gmail.com Thu Sep 19 14:08:50 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 19 Sep 2019 11:08:50 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: explain MIN_SIZE_FOR_STRING_CACHE Message-ID: <5d83c432.1c69fb81.ed61b.83bf@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: json-decoder-maps Changeset: r97544:434116a59d15 Date: 2019-09-19 19:54 +0200 http://bitbucket.org/pypy/pypy/changeset/434116a59d15/ Log: explain MIN_SIZE_FOR_STRING_CACHE diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -59,7 +59,10 @@ DEFAULT_SIZE_SCRATCH = 20 - # put a comment explaining what it does and why this is a reasonable number + # string caching is only used if the total size of the message is larger + # than a megabyte. Below that, there can't be that many repeated big + # strings anyway (some experiments showed this to be a reasonable cutoff + # size) MIN_SIZE_FOR_STRING_CACHE = 1024 * 1024 # evaluate the string cache for 200 strings, before looking at the hit rate From pypy.commits at gmail.com Thu Sep 19 14:08:52 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 19 Sep 2019 11:08:52 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: fix two, add one reply Message-ID: <5d83c434.1c69fb81.c3ae3.b511@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: json-decoder-maps Changeset: r97545:863872b6a655 Date: 2019-09-19 20:01 +0200 http://bitbucket.org/pypy/pypy/changeset/863872b6a655/ Log: fix two, add one reply diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -394,6 +394,9 @@ def _switch_to_dict(self, currmap, values_w, nextindex): # not sure if this is a problem, but it's something which I # noticed and I think it's worth thinking about it for 5 minutes. + # are you also concerned about the fact that jsonmap dicts + # have their keys in the opposite order generally? or just the weird + # "c b a | d e f" effect? # # In Python3 dicts preserve the order of keys; this means that a # "naive" json parser produces dicts whose keys are in the same order @@ -1081,8 +1084,8 @@ self.cache_hits * JSONDecoder.STRING_CACHE_USEFULNESS_FACTOR < self.decoded_strings) def key_repr_cmp(self, ll_chars, i): - # isn't there a way to use a "real" strcmp/memcmp? Maybe - # (ab)using llstr/rstr._get_raw_buf or similar? + # XXX should we use "real" memcmp (here in particular, and in other + # places in RPython in general)? for j, c in enumerate(self.key_repr): if ll_chars[i] != c: return False From pypy.commits at gmail.com Thu Sep 19 14:08:54 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 19 Sep 2019 11:08:54 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: address two comments Message-ID: <5d83c436.1c69fb81.4686.9383@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: json-decoder-maps Changeset: r97546:d2524657b1d4 Date: 2019-09-19 20:08 +0200 http://bitbucket.org/pypy/pypy/changeset/d2524657b1d4/ Log: address two comments (the "obscure hack to help the cpu cache in withintprebuiltint doesn't apply here, because the json decoder *doesn't* touch the boxed ints again) diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -25,19 +25,15 @@ return x * NEG_POW_10[exp] -# This is basically the same logic that we use to implement -# objspace.std.withintprebuilt. On one hand, it would be nice to have only a -# single implementation. On the other hand, since it is disabled by default, -# it doesn't change much at runtime. However, in intobject.wrapint there is an -# "obscure hack to help the CPU cache": it might be useful here as well? -# -# this is more a feature than a review but: I wonder whether it is -# worth to also have a per-decoder int cache which caches all the ints, not -# only the small ones. I suppose it might be useful in case you have a big -# json file with e.g. unique ids which might be repeated here and there. class IntCache(object): """ A cache for wrapped ints between START and END """ + # I also tried various combinations of having an LRU cache for ints as + # well, didn't really help. + + # XXX one thing to do would be to use withintprebuilt in general again, + # hidden behind a 'we_are_jitted' + START = -10 END = 256 From pypy.commits at gmail.com Thu Sep 19 14:55:26 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 19 Sep 2019 11:55:26 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default Message-ID: <5d83cf1e.1c69fb81.5645e.c938@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97551:02f4b7934b7f Date: 2019-09-19 20:54 +0200 http://bitbucket.org/pypy/pypy/changeset/02f4b7934b7f/ Log: merge default diff --git a/LICENSE b/LICENSE --- a/LICENSE +++ b/LICENSE @@ -40,11 +40,11 @@ Armin Rigo Maciej Fijalkowski Carl Friedrich Bolz-Tereick + Matti Picus Antonio Cuni Amaury Forgeot d'Arc - Matti Picus + Ronan Lamy Samuele Pedroni - Ronan Lamy Alex Gaynor Philip Jenvey Richard Plangger @@ -94,6 +94,7 @@ Jason Creighton Mark Young Alex Martelli + Andrew Lawrence Spenser Bauman Michal Bendowski Jan de Mooij @@ -106,11 +107,11 @@ Stefan Schwarzer Tomek Meka Valentino Volonghi + Stefan Beyer Patrick Maupin Devin Jeanpierre Bob Ippolito Bruno Gola - Andrew Lawrence David Malcolm Squeaky Edd Barrett @@ -124,7 +125,6 @@ Wenzhu Man Konstantin Lopuhin John Witulski - Stefan Beyer Jeremy Thurgood Greg Price Ivan Sichmann Freitas @@ -138,6 +138,7 @@ Pavel Vinogradov William Leslie Paweł Piotr Przeradowski + Stian Andreassen marky1991 Ilya Osadchiy Tobias Oberstein @@ -146,14 +147,13 @@ Taavi Burns Adrian Kuhn tav - Stian Andreassen Georg Brandl Joannah Nanjekye + Julian Berman Bert Freudenberg Wanja Saatkamp Mike Blume Gerald Klix - Julian Berman Oscar Nierstrasz Rami Chowdhury Stefan H. Muller @@ -204,6 +204,7 @@ Andrews Medina Aaron Iles Toby Watson + Lin Cheng Daniel Patrick Stuart Williams Antoine Pitrou @@ -245,6 +246,7 @@ Valentina Mukhamedzhanova Stefano Parmesan touilleMan + Anthony Sottile Marc Abramowitz Arjun Naik Aaron Gallagher @@ -254,7 +256,6 @@ Omer Katz Jacek Generowicz Tomasz Dziopa - Lin Cheng Sylvain Thenault Jakub Stasiak Andrew Dalke @@ -285,7 +286,6 @@ Lene Wagner Tomo Cocoa Miro Hrončok - Anthony Sottile David Lievens Neil Blakey-Milner Henrik Vendelbo @@ -294,11 +294,14 @@ Christoph Gerum Miguel de Val Borro Artur Lisiecki + joserubiovidales at gmail.com afteryu Toni Mattis + Vincent Michel Laurens Van Houtven Bobby Impollonia Roberto De Ioris + Yannick Jadoul Jeong YunWon Christopher Armstrong Aaron Tubbs @@ -312,6 +315,7 @@ Fabio Niephaus Akira Li Gustavo Niemeyer + joachim-ballmann at bitbucket.org Nate Bragg Lucas Stadler roberto at goyle @@ -331,8 +335,12 @@ Ben Darnell Juan Francisco Cantero Hurtado Godefroid Chappelle + Paul Ganssle + Michal Kuffa Stephan Busemann + Bystroushaak Dan Colish + Ram Rachum timo Volodymyr Vladymyrov Daniel Neuhäuser @@ -342,18 +350,22 @@ Chris Lambacher John Aldis coolbutuseless at gmail.com + Yasen Kiprov Mike Bayer Rodrigo Araújo Daniil Yarancev Min RK OlivierBlanvillain + dakarpov at gmail.com Jonas Pfannschmidt Zearin Johan Forsberg Andrey Churin Dan Crosta reubano at gmail.com + Ryan Hileman Stanisław Halik + DeVerne Jones Julien Phalip Roman Podoliaka Steve Papanik @@ -369,17 +381,20 @@ Jim Hunziker shoma hosaka Buck Golemon + whitequark Iraklis D. JohnDoe yrttyr Michael Chermside Anna Ravencroft remarkablerocket + Ivan Petre Vijiac Berker Peksag Christian Muirhead soareschen Matthew Miller + Jesdi Konrad Delong Dinu Gherman pizi @@ -398,13 +413,16 @@ Markus Unterwaditzer Kristoffer Kleine Graham Markall + paugier Dan Loewenherz werat Filip Salomonsson Niclas Olofsson + Zsolt Cserna Chris Pressey Tobias Diaz Paul Graydon + mkuffa Nikolaos-Digenis Karagiannis Kurt Griffiths Ben Mather diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py --- a/pypy/doc/conf.py +++ b/pypy/doc/conf.py @@ -71,9 +71,9 @@ # module/cpyext/include/patchlevel.h # # The short X.Y version. -version = '7.2' +version = '7.3' # The full version, including alpha/beta/rc tags. -release = '7.2.0' +release = '7.3.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/pypy/doc/contributor.rst b/pypy/doc/contributor.rst --- a/pypy/doc/contributor.rst +++ b/pypy/doc/contributor.rst @@ -7,11 +7,11 @@ Armin Rigo Maciej Fijalkowski Carl Friedrich Bolz-Tereick + Matti Picus Antonio Cuni Amaury Forgeot d'Arc - Matti Picus + Ronan Lamy Samuele Pedroni - Ronan Lamy Alex Gaynor Philip Jenvey Richard Plangger @@ -61,6 +61,7 @@ Jason Creighton Mark Young Alex Martelli + Andrew Lawrence Spenser Bauman Michal Bendowski Jan de Mooij @@ -73,11 +74,11 @@ Stefan Schwarzer Tomek Meka Valentino Volonghi + Stefan Beyer Patrick Maupin Devin Jeanpierre Bob Ippolito Bruno Gola - Andrew Lawrence David Malcolm Squeaky Edd Barrett @@ -91,7 +92,6 @@ Wenzhu Man Konstantin Lopuhin John Witulski - Stefan Beyer Jeremy Thurgood Greg Price Ivan Sichmann Freitas @@ -105,6 +105,7 @@ Pavel Vinogradov William Leslie Paweł Piotr Przeradowski + Stian Andreassen marky1991 Ilya Osadchiy Tobias Oberstein @@ -113,14 +114,13 @@ Taavi Burns Adrian Kuhn tav - Stian Andreassen Georg Brandl Joannah Nanjekye + Julian Berman Bert Freudenberg Wanja Saatkamp Mike Blume Gerald Klix - Julian Berman Oscar Nierstrasz Rami Chowdhury Stefan H. Muller @@ -171,6 +171,7 @@ Andrews Medina Aaron Iles Toby Watson + Lin Cheng Daniel Patrick Stuart Williams Antoine Pitrou @@ -212,6 +213,7 @@ Valentina Mukhamedzhanova Stefano Parmesan touilleMan + Anthony Sottile Marc Abramowitz Arjun Naik Aaron Gallagher @@ -221,7 +223,6 @@ Omer Katz Jacek Generowicz Tomasz Dziopa - Lin Cheng Sylvain Thenault Jakub Stasiak Andrew Dalke @@ -261,11 +262,14 @@ Christoph Gerum Miguel de Val Borro Artur Lisiecki + joserubiovidales at gmail.com afteryu Toni Mattis + Vincent Michel Laurens Van Houtven Bobby Impollonia Roberto De Ioris + Yannick Jadoul Jeong YunWon Christopher Armstrong Aaron Tubbs @@ -279,6 +283,7 @@ Fabio Niephaus Akira Li Gustavo Niemeyer + joachim-ballmann at bitbucket.org Nate Bragg Lucas Stadler roberto at goyle @@ -298,8 +303,12 @@ Ben Darnell Juan Francisco Cantero Hurtado Godefroid Chappelle + Paul Ganssle + Michal Kuffa Stephan Busemann + Bystroushaak Dan Colish + Ram Rachum timo Volodymyr Vladymyrov Daniel Neuhäuser @@ -309,18 +318,22 @@ Chris Lambacher John Aldis coolbutuseless at gmail.com + Yasen Kiprov Mike Bayer Rodrigo Araújo Daniil Yarancev Min RK OlivierBlanvillain + dakarpov at gmail.com Jonas Pfannschmidt Zearin Johan Forsberg Andrey Churin Dan Crosta reubano at gmail.com + Ryan Hileman Stanisław Halik + DeVerne Jones Julien Phalip Roman Podoliaka Steve Papanik @@ -336,17 +349,20 @@ Jim Hunziker shoma hosaka Buck Golemon + whitequark Iraklis D. JohnDoe yrttyr Michael Chermside Anna Ravencroft remarkablerocket + Ivan Petre Vijiac Berker Peksag Christian Muirhead soareschen Matthew Miller + Jesdi Konrad Delong Dinu Gherman pizi @@ -365,13 +381,16 @@ Markus Unterwaditzer Kristoffer Kleine Graham Markall + paugier Dan Loewenherz werat Filip Salomonsson Niclas Olofsson + Zsolt Cserna Chris Pressey Tobias Diaz Paul Graydon + mkuffa Nikolaos-Digenis Karagiannis Kurt Griffiths Ben Mather diff --git a/pypy/doc/index-of-release-notes.rst b/pypy/doc/index-of-release-notes.rst --- a/pypy/doc/index-of-release-notes.rst +++ b/pypy/doc/index-of-release-notes.rst @@ -6,6 +6,7 @@ .. toctree:: + release-v7.2.0.rst release-v7.1.1.rst release-v7.1.0.rst release-v7.0.0.rst diff --git a/pypy/doc/index-of-whatsnew.rst b/pypy/doc/index-of-whatsnew.rst --- a/pypy/doc/index-of-whatsnew.rst +++ b/pypy/doc/index-of-whatsnew.rst @@ -7,6 +7,7 @@ .. toctree:: whatsnew-head.rst + whatsnew-pypy2-7.2.0.rst whatsnew-pypy2-7.1.0.rst whatsnew-pypy2-7.0.0.rst whatsnew-pypy2-6.0.0.rst @@ -37,12 +38,17 @@ whatsnew-1.9.rst +CPython 3.6 compatible versions +------------------------------- + +.. toctree:: + whatsnew-pypy3-head.rst + CPython 3.5 compatible versions ------------------------------- .. toctree:: - whatsnew-pypy3-head.rst whatsnew-pypy3-7.0.0.rst whatsnew-pypy3-5.9.0.rst whatsnew-pypy3-5.8.0.rst diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst new file mode 100644 --- /dev/null +++ b/pypy/doc/release-v7.2.0.rst @@ -0,0 +1,270 @@ +==================================== +PyPy v7.2.0: release of 2.7, and 3.6 +==================================== + +The PyPy team is proud to release the version 7.2.0 of PyPy, which includes +two different interpreters: + + - PyPy2.7, which is an interpreter supporting the syntax and the features of + Python 2.7 including the stdlib for CPython 2.7.13 + + - PyPy3.6: which is an interpreter supporting the syntax and the features of + Python 3.6, including the stdlib for CPython 3.6.9. + +The interpreters are based on much the same codebase, thus the double +release. + +This release removes the "beta" tag from PyPy3.6. While there may still be some +small corner-case incompatibilities (around the exact error messages in +exceptions and the handling of faulty codec errorhandlers) we are happy with +the quality of the 3.6 series and are looking forward to working on a Python +3.7 interpreter. + +With the support of the ARM foundation, this release supports the 64-bit +``aarch64`` ARM architecture. + +We updated our benchmark runner at https://speed.pypy.org to a more modern +machine and updated the baseline python to CPython 2.7.11. Thanks to `Baroque +Software` for maintaining the benchmark runner. + +The CFFI-based ``_ssl`` module was backported to PyPy2.7 and updated to use +`cryptography`_ version 2.7. Additionally the `_hashlib`, and ``crypt`` (or +``_crypt`` on Python3) modules were converted to CFFI. This has two +consequences. End users and packagers can more easily update these libraries +for their platform by executing ``(cd lib_pypy; ../bin/pypy _*_build.py)``. +More significantly, since PyPy itself links to fewer system shared objects +(DLLs), on platforms with a single runtime namespace like linux different CFFI +and c-extension modules can load different versions of the same shared object +into PyPy without collision (`issue 2617`_). + +Until downstream providers begin to distribute c-extension builds with PyPy, we +have made packages for some common packages `available as wheels`_. + +The `CFFI`_ backend has been updated to version 1.13.0. We recommend using CFFI +rather than c-extensions to interact with C, and `cppyy`_ for interacting with +C++ code. + +Thanks to Anvil_, we revived the `PyPy Sandbox`_, which allows total control +over a python interpreter's interactions with the external world. + +As always, this release is 100% compatible with the previous one and fixed +several issues and bugs raised by the growing community of PyPy users. +We strongly recommend updating. Many of the fixes are the direct result of +end-user bug reports, so please continue reporting issues as they crop up. + +You can download the v7.2 releases here: + + http://pypy.org/download.html + +We would like to thank our donors for the continued support of the PyPy +project. If PyPy is not quite good enough for your needs, we are available for +direct consulting work. + +We would also like to thank our contributors and encourage new people to join +the project. PyPy has many layers and we need help with all of them: `PyPy`_ +and `RPython`_ documentation improvements, tweaking popular modules to run +on pypy, or general `help`_ with making RPython's JIT even better. Since the +previous release, we have accepted contributions from 27 new contributors, +thanks for pitching in. + +.. _`PyPy`: index.html +.. _`RPython`: https://rpython.readthedocs.org +.. _`help`: project-ideas.html +.. _`CFFI`: http://cffi.readthedocs.io +.. _`cppyy`: https://cppyy.readthedocs.io +.. _`available as wheels`: https://github.com/antocuni/pypy-wheels +.. _`Baroque Software`: https://baroquesoftware.com +.. _Anvil: https://anvil.works +.. _`PyPy Sandbox`: https://morepypy.blogspot.com/2019/08 + +What is PyPy? +============= + +PyPy is a very compliant Python interpreter, almost a drop-in replacement for +CPython 2.7, 3.6. It's fast (`PyPy and CPython 2.7.x`_ performance +comparison) due to its integrated tracing JIT compiler. + +We also welcome developers of other `dynamic languages`_ to see what RPython +can do for them. + +This PyPy release supports: + + * **x86** machines on most common operating systems + (Linux 32/64 bits, Mac OS X 64 bits, Windows 32 bits, OpenBSD, FreeBSD) + + * big- and little-endian variants of **PPC64** running Linux, + + * **s390x** running Linux + + * 64-bit **ARM** machines running Linux. + +Unfortunately at the moment of writing our ARM buildbots are out of service, +so for now we are **not** releasing any binary for the ARM architecture (32 +bit), although PyPy does support ARM 32 bit processors. + +.. _`PyPy and CPython 2.7.x`: http://speed.pypy.org +.. _`dynamic languages`: http://rpython.readthedocs.io/en/latest/examples.html + + +Changelog +========= + +Changes released in v7.1.1 +-------------------------- + +* Improve performance of ``u''.append`` +* Prevent a crash in ``zlib`` when flushing a closed stream +* Fix a few corner cases when encountering unicode values above 0x110000 +* Teach the JIT how to handle very large constant lists, sets, or dicts +* Fix building on ARM32 (`issue 2984`_) +* Fix a bug in register assignment in ARM32 +* Package windows DLLs needed by cffi modules next to the cffi c-extensions + (`issue 2988`_) +* Cleanup and refactor JIT code to remove ``rpython.jit.metainterp.typesystem`` +* Fix memoryviews of ctype structures with padding, (cpython issue 32780_) + +Changes to Python 3.6 released in v7.1.1 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* On win32, override some ``errno.E*`` values that were added to MSVC in v2010 + so that ``errno.E* == errno.WSAE*`` as in CPython +* Do the same optimization that CPython does for ``(1, 2, 3, *a)`` (but at the + AST level) +* Raise a ``TypeError`` when using buffers and unicode such as ``''.strip(buffer)`` + and ``'a' < buffer`` +* Support ``_overlapped`` and asyncio on win32 +* Fix an issue where ``''.join(list_of_strings)`` would rarely confuse utf8 and + bytes (`issue 2997`_) +* Fix ``io.IncrementalNewlineDecoder`` interaction with ``\r`` (`issue 3012`_) + +Changes shared across versions +------------------------------ + +* Update ``cffi`` to 1.13.0 +* Add support for ARM aarch64 +* Many internal changes to the utf-8 processing code, since now unicode strings + are stored internally as utf-8. A few corner cases were fixed, and performance + bottlenecks were improved. Specifically, issues were fixed with ``maketrans``, + ``strip``, comparison with ``bytearray``, use in ``array.array``, ``join``, + ``translate``, forrmatting, ``__int__``, ``str()``, ``startswith``, + ``endswith``, +* Reduce the probability of a deadlock when acquiring a semaphore by + moving global state changes closer to the actual aquire (`issue 2953`_) +* Cleanup and refactor parts of the JIT code +* Cleanup ``optimizeopt`` +* Support the ``z15`` variant of the ``s390x`` CPU. +* Fixes to ``_ctypes`` handling of memoryviews +* Fix a shadowstack overflow when using ``sys.setrecurtionlimit`` (`issue 2722`) +* Fix a bug that prevent memory-tracking in vmprof working on PyPy +* Improve the speed and memory use of the ``_pypyjson`` JSON decoder. The + resulting dictionaries that come out of the JSON decoder have faster lookups too +* ``struct.unpack`` of a sliced ``bytearray`` exposed a subtle bug where the + JIT's ``gc_load`` family of calls must force some lazy code (`issue 3014`_) +* Remove ``copystrcontent`` and ``copyunicodecontent`` in the backends. + Instead, replace it in ``rewrite.py`` with a direct call to ``memcpy()`` and + a new basic operation, ``load_effective_address``, which the backend can + even decide not to implement. +* Allow 2d indexing in ``memoryview.__setitem__`` (`issue 3028`_) +* Speed up 'bytearray += bytes' and other similar combinations +* Compute the greatest common divisor of two RPython ``rbigint`` instances + using `Lehmer's algorithm`_ and use it in the ``math`` module +* Add ``RFile.closed`` to mirror standard `file` behaviour +* Add a ``-D`` pytest option to run tests directly on the host python without + any knowlege of PyPy internals. This allows using ``pypy3 pytest.py ...`` + for a subset of tests (called **app-level testing**) +* Accept arguments to ``subprocess.Popen`` that are not directly subscriptable + (like iterators) (`issue 3050`_) +* Catch more low-level ``SocketError`` exceptions and turn them into app-level + exceptions (`issue 3049`_) +* Fix formatting of a ``memoryview``: ``b"<%s>" % memoryview(b"X")`` +* Correctly wrap the I/O errors we can get when importing modules +* Fix bad output from JSON with ``'skipkeys=True'`` (`issue 3052`_) +* Fix compatibility with latest virtualenv HEAD + +C-API (cpyext) and c-extensions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* Add ``DateTime_FromTimestamp`` and ``Date_FromTimestamp`` to the + ``PyDateTime_CAPI`` struct + +* Add constants and macros needed to build opencv2_ with PyPy2.7 +* Add more constants to `sysconfig``. Set ``MACOSX_DEPLOYMENT_TARGET`` for + darwin (`issue 2994`_) +* fix ``CBuffer.buffer_attach`` + +Python 3.6 only +--------------- + +* Accept ``a, b = (*x, 2)`` (`issue 2995`_) +* Class methods with the signature ``def meth(*args, **kwargs)`` were not adding + an implied ``self`` argument (`issue 2996`_) +* Fix handling of ``__fpath__`` (`issue 2985`_) +* Disable ``assert`` when run with ``-O`` (`issue 3000`_) +* ``codecs.encode``, ``codecs.decode`` can behave differently than + ``ustr.encode``, ``bytes.decode`` (`issue 3001`_) +* Putting ``pdb.set_trace`` call in a threaded program did not work (`issue + 3003`_) +* Fix parsing for converting strings with underscore into ints +* Add ``memoryview.obj`` which stores a reference, (`issue 3016`_) +* Fix datetime.fromtimestamp for win32 (cpython issue 29097_) +* Improve multiprocessing support on win32 +* Support negative offsets in ``lnotab`` (`issue 2943`_) +* Fix leak of file descriptor with `_io.FileIO('dir/')` +* Fix ``float.__round__(None)`` (`issue 3033`_) +* Fix for when we should use the Universal Newline mode on Windows for + stdin/stdout/stderr (`issue 3007`_) +* Fix ImportError invalid arguments error wording +* Ignore GeneratorExit when throwing into the aclose coroutine of an + asynchronous generator (CPython issue 35409_) +* Improve the pure-python ``faulthander`` module +* Properly raise an exception when a ``BlockingIOError`` exception escapes + from ``W_BufferedReader.readline_w()`` (`issue 3042`_) +* Fix a code path only used in ``zipimport`` (`issue 3034`_) +* Update the stdlib to 3.6.9, fix many failing tests +* Fix handling of ``__debug__``, ``-O``, and ``sys.flags.optimizeOptimize`` + (CPython issue 27169_) +* Fix raising ``SystemExit`` in ``atexit`` +* Fix case where ``int()`` would go into infinite recursion +* Don't ignore fold parameter in ``(date,)time.replace()`` +* Fix logic bug for ``memoryview.cast`` (when ``view.format`` is not ``'B'``) + +Python 3.6 c-API +~~~~~~~~~~~~~~~~ + +* Add ``PyStructSequence_InitType2``, ``Py_RETURN_NOTIMPLEMENTED``, + ``PyGILState_Check``, ``PyUnicode_AsUCS4``, ``PyUnicode_AsUCS4Copy`` +* Sync the various ``Py**Flag`` constants with CPython + +.. _`Lehmer's algorithm`: https://en.wikipedia.org/wiki/Lehmer's_GCD_algorithm +.. _29097: https://bugs.python.org/issue29097 +.. _32780: https://bugs.python.org/issue32780 +.. _35409 : https://bugs.python.org/issue35409 +.. _27169 : https://bugs.python.org/issue27169 +.. _opencv2: https://github.com/skvark/opencv-python/ +.. _`issue 2617`: https://bitbucket.com/pypy/pypy/issues/2617 +.. _`issue 2722`: https://bitbucket.com/pypy/pypy/issues/2722 +.. _`issue 2953`: https://bitbucket.com/pypy/pypy/issues/2953 +.. _`issue 2943`: https://bitbucket.com/pypy/pypy/issues/2943 +.. _`issue 2980`: https://bitbucket.com/pypy/pypy/issues/2980 +.. _`issue 2984`: https://bitbucket.com/pypy/pypy/issues/2984 +.. _`issue 2994`: https://bitbucket.com/pypy/pypy/issues/2994 +.. _`issue 2995`: https://bitbucket.com/pypy/pypy/issues/2995 +.. _`issue 2996`: https://bitbucket.com/pypy/pypy/issues/2995 +.. _`issue 2997`: https://bitbucket.com/pypy/pypy/issues/2995 +.. _`issue 2988`: https://bitbucket.com/pypy/pypy/issues/2988 +.. _`issue 2985`: https://bitbucket.com/pypy/pypy/issues/2985 +.. _`issue 2986`: https://bitbucket.com/pypy/pypy/issues/2986 +.. _`issue 3000`: https://bitbucket.com/pypy/pypy/issues/3000 +.. _`issue 3001`: https://bitbucket.com/pypy/pypy/issues/3001 +.. _`issue 3003`: https://bitbucket.com/pypy/pypy/issues/3003 +.. _`issue 3007`: https://bitbucket.com/pypy/pypy/issues/3007 +.. _`issue 3012`: https://bitbucket.com/pypy/pypy/issues/3012 +.. _`issue 3014`: https://bitbucket.com/pypy/pypy/issues/3014 +.. _`issue 3016`: https://bitbucket.com/pypy/pypy/issues/3016 +.. _`issue 3028`: https://bitbucket.com/pypy/pypy/issues/3028 +.. _`issue 3033`: https://bitbucket.com/pypy/pypy/issues/3033 +.. _`issue 3034`: https://bitbucket.com/pypy/pypy/issues/3034 +.. _`issue 3042`: https://bitbucket.com/pypy/pypy/issues/3042 +.. _`issue 3049`: https://bitbucket.com/pypy/pypy/issues/3049 +.. _`issue 3050`: https://bitbucket.com/pypy/pypy/issues/3050 +.. _`issue 3052`: https://bitbucket.com/pypy/pypy/issues/3052 diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -1,84 +1,7 @@ ========================== -What's new in PyPy2.7 7.1+ +What's new in PyPy2.7 7.3+ ========================== -.. this is a revision shortly after release-pypy-7.1.0 -.. startrev: d3aefbf6dae7 +.. this is a revision shortly after release-pypy-7.2.0 +.. startrev: 78cd4acbcbec -.. branch: Twirrim/minor-typo-fix-1553456951526 - -Fix typo - -.. branch: jit-cleanup - -Remove rpython.jit.metainterp.typesystem and clean up related code in rpython/jit/ - -.. branch: datetime_api_27 - -Add ``DateTime_FromTimestamp`` and ``Date_FromTimestamp`` - -.. branch: issue2968 - -Fix segfault in cpyext_tp_new_tupl - -.. branch: semlock-deadlock - -Test and reduce the probability of a deadlock when acquiring a semaphore by -moving global state changes closer to the actual aquire. - -.. branch: shadowstack-issue2722 - -Make the shadowstack size more dynamic - -.. branch: cffi-libs - -Move _ssl and _hashlib from rpython to a cffi-based module, like on python3. -Reduces the number of problematic linked-in libraries (libssl, libcrypto) - -.. branch: fix-vmprof-memory-tracking - -Fix a bug that prevent memory-tracking in vmprof working on PyPy. - -.. branch: optimizeopt-cleanup - -Cleanup optimizeopt - -.. branch: copystrcontents-in-rewrite - -Remove ``copystrcontent`` and ``copyunicodecontent`` in the backends. -Instead, replace it in ``rewrite.py`` with a direct call to ``memcpy()`` and -new basic operation, ``load_effective_address``, which the backend can -even decide not to implement. - -.. branch: arm64 - -Add a JIT backend for ARM64 (aarch64) - -.. branch: fix-test-vmprof-closed-file - - -.. branch: fix_darwin_list_dir_test - -.. branch: apptest-file - -New mechanism for app-level testing using -D to test all apptest_*.py files - -.. branch: feature_closed_prop_to_rfile - -Add RFile.closed - -.. branch: cryptograhpt-2.7 - -Update vendored cryptography used for _ssl to 2.7 - -.. branch: compile_ncurses_tcl_tk_suse_latest - -Check for headers and runtime libraries in more locations to support other linuxes - -.. branch: openssl-for-macos - -Update _ssl on macos to statically link to openssl-1.1.1c - -.. branch: more-cpyext - -Add more datetime C functions and definitions diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-pypy2-7.2.0.rst copy from pypy/doc/whatsnew-head.rst copy to pypy/doc/whatsnew-pypy2-7.2.0.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-pypy2-7.2.0.rst @@ -1,6 +1,6 @@ -========================== -What's new in PyPy2.7 7.1+ -========================== +=========================== +What's new in PyPy2.7 7.2.0 +=========================== .. this is a revision shortly after release-pypy-7.1.0 .. startrev: d3aefbf6dae7 diff --git a/pypy/interpreter/astcompiler/astbuilder.py b/pypy/interpreter/astcompiler/astbuilder.py --- a/pypy/interpreter/astcompiler/astbuilder.py +++ b/pypy/interpreter/astcompiler/astbuilder.py @@ -118,7 +118,8 @@ def error(self, msg, n): """Raise a SyntaxError with the lineno and column set to n's.""" raise SyntaxError(msg, n.get_lineno(), n.get_column(), - filename=self.compile_info.filename) + filename=self.compile_info.filename, + text=n.get_line()) def error_ast(self, msg, ast_node): raise SyntaxError(msg, ast_node.lineno, ast_node.col_offset, diff --git a/pypy/interpreter/astcompiler/test/test_astbuilder.py b/pypy/interpreter/astcompiler/test/test_astbuilder.py --- a/pypy/interpreter/astcompiler/test/test_astbuilder.py +++ b/pypy/interpreter/astcompiler/test/test_astbuilder.py @@ -2,7 +2,7 @@ import random import string import sys -import py +import pytest from pypy.interpreter.baseobjspace import W_Root from pypy.interpreter.pyparser import pyparse from pypy.interpreter.pyparser.error import SyntaxError @@ -135,7 +135,9 @@ assert a1.asname is None assert a2.name == "y" assert a2.asname == "w" - exc = py.test.raises(SyntaxError, self.get_ast, "import x a b").value + with pytest.raises(SyntaxError) as excinfo: + self.get_ast("import x a b") + assert excinfo.value.text == "import x a b\n" def test_from_import(self): im = self.get_first_stmt("from x import y") @@ -180,12 +182,18 @@ assert a1.asname == "b" assert a2.name == "w" assert a2.asname is None + input = "from x import y a b" - exc = py.test.raises(SyntaxError, self.get_ast, input).value + with pytest.raises(SyntaxError) as excinfo: + self.get_ast(input) + assert excinfo.value.text == input + "\n" + input = "from x import a, b," - exc = py.test.raises(SyntaxError, self.get_ast, input).value - assert exc.msg == "trailing comma is only allowed with surronding " \ + with pytest.raises(SyntaxError) as excinfo: + self.get_ast(input) + assert excinfo.value.msg == "trailing comma is only allowed with surronding " \ "parenthesis" + assert excinfo.value.text == input + "\n" def test_global(self): glob = self.get_first_stmt("global x") @@ -418,7 +426,8 @@ assert wi.items[0].optional_vars.ctx == ast.Store assert wi.items[0].optional_vars.elts[0].ctx == ast.Store input = "with x hi y: pass" - exc = py.test.raises(SyntaxError, self.get_ast, input).value + with pytest.raises(SyntaxError) as excinfo: + self.get_ast(input) wi = self.get_first_stmt("with x as y, b: pass") assert isinstance(wi, ast.With) assert len(wi.items) == 2 @@ -508,8 +517,13 @@ assert args.vararg.arg == "e" assert args.kwarg.arg == "f" input = "def f(a=b, c): pass" - exc = py.test.raises(SyntaxError, self.get_ast, input).value - assert exc.msg == "non-default argument follows default argument" + with pytest.raises(SyntaxError) as excinfo: + self.get_ast(input) + assert excinfo.value.msg == "non-default argument follows default argument" + input = "def f((x)=23): pass" + with pytest.raises(SyntaxError) as excinfo: + self.get_ast(input) + assert excinfo.value.msg == "invalid syntax" def test_kwonly_arguments(self): fn = self.get_first_stmt("def f(a, b, c, *, kwarg): pass") @@ -532,7 +546,7 @@ assert len(fn.args.kw_defaults) == 1 assert isinstance(fn.args.kw_defaults[0], ast.Num) input = "def f(p1, *, **k1): pass" - exc = py.test.raises(SyntaxError, self.get_ast, input).value + exc = pytest.raises(SyntaxError, self.get_ast, input).value assert exc.msg == "named arguments must follows bare *" def test_function_annotation(self): @@ -556,13 +570,13 @@ for i in range(255): fundef += "i%d, "%i fundef += "*, key=100):\n pass\n" - py.test.raises(SyntaxError, self.get_first_stmt, fundef) + pytest.raises(SyntaxError, self.get_first_stmt, fundef) fundef2 = "def foo(i,*," for i in range(255): fundef2 += "i%d, "%i fundef2 += "lastarg):\n pass\n" - py.test.raises(SyntaxError, self.get_first_stmt, fundef) + pytest.raises(SyntaxError, self.get_first_stmt, fundef) fundef3 = "def f(i,*," for i in range(253): @@ -642,13 +656,13 @@ assert isinstance(subscript, ast.AnnAssign) assert isinstance(subscript.target, ast.Subscript) - exc_tuple = py.test.raises(SyntaxError, self.get_ast, 'a, b: int').value + exc_tuple = pytest.raises(SyntaxError, self.get_ast, 'a, b: int').value assert exc_tuple.msg == "only single target (not tuple) can be annotated" - exc_list = py.test.raises(SyntaxError, self.get_ast, '[]: int').value + exc_list = pytest.raises(SyntaxError, self.get_ast, '[]: int').value assert exc_list.msg == "only single target (not list) can be annotated" - exc_bad_target = py.test.raises(SyntaxError, self.get_ast, '{}: int').value + exc_bad_target = pytest.raises(SyntaxError, self.get_ast, '{}: int').value assert exc_bad_target.msg == "illegal target for annoation" @@ -824,8 +838,9 @@ for ctx_type, template in test_contexts: for expr, type_str in invalid_stores: input = template % (expr,) - exc = py.test.raises(SyntaxError, self.get_ast, input).value - assert exc.msg == "can't %s %s" % (ctx_type, type_str) + with pytest.raises(SyntaxError) as excinfo: + self.get_ast(input) + assert excinfo.value.msg == "can't %s %s" % (ctx_type, type_str) def test_assignment_to_forbidden_names(self): invalid = ( @@ -848,8 +863,9 @@ for name in "__debug__",: for template in invalid: input = template % (name,) - exc = py.test.raises(SyntaxError, self.get_ast, input).value - assert exc.msg == "cannot assign to %s" % (name,) + with pytest.raises(SyntaxError) as excinfo: + self.get_ast(input) + assert excinfo.value.msg == "cannot assign to %s" % (name,) def test_lambda(self): lam = self.get_first_expr("lambda x: expr") @@ -870,8 +886,9 @@ assert len(lam.args.defaults) == 1 assert isinstance(lam.args.defaults[0], ast.Name) input = "f(lambda x: x[0] = y)" - exc = py.test.raises(SyntaxError, self.get_ast, input).value - assert exc.msg == "lambda cannot contain assignment" + with pytest.raises(SyntaxError) as excinfo: + self.get_ast(input) + assert excinfo.value.msg == "lambda cannot contain assignment" def test_ifexp(self): ifexp = self.get_first_expr("x if y else g") @@ -939,7 +956,7 @@ def test_flufl(self): source = "x <> y" - py.test.raises(SyntaxError, self.get_ast, source) + pytest.raises(SyntaxError, self.get_ast, source) comp = self.get_first_expr(source, flags=consts.CO_FUTURE_BARRY_AS_BDFL) assert isinstance(comp, ast.Compare) @@ -1053,16 +1070,16 @@ assert len(call.args) == 1 assert isinstance(call.args[0], ast.GeneratorExp) input = "f(x for x in y, 1)" - exc = py.test.raises(SyntaxError, self.get_ast, input).value + exc = pytest.raises(SyntaxError, self.get_ast, input).value assert exc.msg == "Generator expression must be parenthesized if not " \ "sole argument" many_args = ", ".join("x%i" % i for i in range(256)) input = "f(%s)" % (many_args,) - exc = py.test.raises(SyntaxError, self.get_ast, input).value + exc = pytest.raises(SyntaxError, self.get_ast, input).value assert exc.msg == "more than 255 arguments" - exc = py.test.raises(SyntaxError, self.get_ast, "f((a+b)=c)").value + exc = pytest.raises(SyntaxError, self.get_ast, "f((a+b)=c)").value assert exc.msg == "keyword can't be an expression" - exc = py.test.raises(SyntaxError, self.get_ast, "f(a=c, a=d)").value + exc = pytest.raises(SyntaxError, self.get_ast, "f(a=c, a=d)").value assert exc.msg == "keyword argument repeated" def test_attribute(self): @@ -1167,7 +1184,7 @@ s = self.get_first_expr("b'hi' b' implicitly' b' extra'") assert isinstance(s, ast.Bytes) assert space.eq_w(s.s, space.newbytes("hi implicitly extra")) - py.test.raises(SyntaxError, self.get_first_expr, "b'hello' 'world'") + pytest.raises(SyntaxError, self.get_first_expr, "b'hello' 'world'") sentence = u"Die Männer ärgern sich!" source = u"# coding: utf-7\nstuff = '%s'" % (sentence,) info = pyparse.CompileInfo("", "exec") @@ -1258,15 +1275,15 @@ for num in ("0b00101", "0B00101", "0b101", "0B101"): assert space.eq_w(get_num(num), space.wrap(5)) - py.test.raises(SyntaxError, self.get_ast, "0x") - py.test.raises(SyntaxError, self.get_ast, "0b") - py.test.raises(SyntaxError, self.get_ast, "0o") - py.test.raises(SyntaxError, self.get_ast, "32L") - py.test.raises(SyntaxError, self.get_ast, "32l") - py.test.raises(SyntaxError, self.get_ast, "0L") - py.test.raises(SyntaxError, self.get_ast, "-0xAAAAAAL") - py.test.raises(SyntaxError, self.get_ast, "053") - py.test.raises(SyntaxError, self.get_ast, "00053") + pytest.raises(SyntaxError, self.get_ast, "0x") + pytest.raises(SyntaxError, self.get_ast, "0b") + pytest.raises(SyntaxError, self.get_ast, "0o") + pytest.raises(SyntaxError, self.get_ast, "32L") + pytest.raises(SyntaxError, self.get_ast, "32l") + pytest.raises(SyntaxError, self.get_ast, "0L") + pytest.raises(SyntaxError, self.get_ast, "-0xAAAAAAL") + pytest.raises(SyntaxError, self.get_ast, "053") + pytest.raises(SyntaxError, self.get_ast, "00053") def check_comprehension(self, brackets, ast_type): def brack(s): @@ -1362,8 +1379,8 @@ assert isinstance(if2, ast.Name) def test_cpython_issue12983(self): - py.test.raises(SyntaxError, self.get_ast, r"""b'\x'""") - py.test.raises(SyntaxError, self.get_ast, r"""b'\x0'""") + pytest.raises(SyntaxError, self.get_ast, r"""b'\x'""") + pytest.raises(SyntaxError, self.get_ast, r"""b'\x0'""") def test_matmul(self): mod = self.get_ast("a @ b") @@ -1461,17 +1478,17 @@ def test_decode_error_in_string_literal(self): input = "u'\\x'" - exc = py.test.raises(SyntaxError, self.get_ast, input).value + exc = pytest.raises(SyntaxError, self.get_ast, input).value assert exc.msg == ("(unicode error) 'unicodeescape' codec can't decode" " bytes in position 0-1: truncated \\xXX escape") input = "u'\\x1'" - exc = py.test.raises(SyntaxError, self.get_ast, input).value + exc = pytest.raises(SyntaxError, self.get_ast, input).value assert exc.msg == ("(unicode error) 'unicodeescape' codec can't decode" " bytes in position 0-2: truncated \\xXX escape") def test_decode_error_in_string_literal_correct_line(self): input = "u'a' u'b'\\\n u'c' u'\\x'" - exc = py.test.raises(SyntaxError, self.get_ast, input).value + exc = pytest.raises(SyntaxError, self.get_ast, input).value assert exc.msg == ("(unicode error) 'unicodeescape' codec can't decode" " bytes in position 0-1: truncated \\xXX escape") assert exc.lineno == 2 diff --git a/pypy/interpreter/pyparser/parser.py b/pypy/interpreter/pyparser/parser.py --- a/pypy/interpreter/pyparser/parser.py +++ b/pypy/interpreter/pyparser/parser.py @@ -136,19 +136,24 @@ def get_column(self): raise NotImplementedError("abstract base class") + def get_line(self): + raise NotImplementedError("abstract base class") + class Terminal(Node): - __slots__ = ("value", "lineno", "column") - def __init__(self, type, value, lineno, column): + __slots__ = ("value", "lineno", "column", "line") + def __init__(self, type, value, lineno, column, line=None): Node.__init__(self, type) self.value = value self.lineno = lineno self.column = column + self.line = line @staticmethod def fromtoken(token): return Terminal( - token.token_type, token.value, token.lineno, token.column) + token.token_type, token.value, token.lineno, token.column, + token.line) def __repr__(self): return "Terminal(type=%s, value=%r)" % (self.type, self.value) @@ -168,6 +173,8 @@ def get_column(self): return self.column + def get_line(self): + return self.line class AbstractNonterminal(Node): __slots__ = () @@ -178,6 +185,9 @@ def get_column(self): return self.get_child(0).get_column() + def get_line(self): + return self.get_child(0).get_line() + def __eq__(self, other): # For tests. # grumble, annoying diff --git a/pypy/interpreter/pyparser/test/test_parser.py b/pypy/interpreter/pyparser/test/test_parser.py --- a/pypy/interpreter/pyparser/test/test_parser.py +++ b/pypy/interpreter/pyparser/test/test_parser.py @@ -330,3 +330,13 @@ info = py.test.raises(parser.ParseError, p.parse, "if 42 42") info.value.expected_str == '+' + + def test_line_attached_to_terminal(self): + p, gram = self.parser_for( + "foo: 'if' NUMBER '+' NUMBER" + ) + input = "if 53 + 65" + tree = p.parse(input) + assert tree.get_child(0).line == input + "\n" + assert tree.get_line() == input + "\n" + diff --git a/pypy/module/cpyext/include/patchlevel.h b/pypy/module/cpyext/include/patchlevel.h --- a/pypy/module/cpyext/include/patchlevel.h +++ b/pypy/module/cpyext/include/patchlevel.h @@ -32,8 +32,8 @@ * module/sys/version.py * doc/conf.py */ -#define PYPY_VERSION "7.2.0-alpha0" -#define PYPY_VERSION_NUM 0x07020000 +#define PYPY_VERSION "7.3.0-alpha0" +#define PYPY_VERSION_NUM 0x07030000 /* Defined to mean a PyPy where cpyext holds more regular references to PyObjects, e.g. staying alive as long as the internal PyPy object stays alive. */ diff --git a/pypy/module/sys/version.py b/pypy/module/sys/version.py --- a/pypy/module/sys/version.py +++ b/pypy/module/sys/version.py @@ -13,7 +13,7 @@ # make sure to keep PYPY_VERSION in sync with: # module/cpyext/include/patchlevel.h # doc/conf.py -PYPY_VERSION = (7, 2, 0, "alpha", 0) +PYPY_VERSION = (7, 3, 0, "alpha", 0) import pypy diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py --- a/rpython/rlib/rutf8.py +++ b/rpython/rlib/rutf8.py @@ -438,18 +438,7 @@ return result def has_surrogates(utf8): - # a surrogate starts with 0xed in utf-8 encoding - pos = 0 - while True: - pos = utf8.find("\xed", pos) - if pos < 0: - return False - assert pos <= len(utf8) - 1 # otherwise invalid utf-8 - ordch2 = ord(utf8[pos + 1]) - if _invalid_byte_2_of_3(0xed, ordch2, allow_surrogates=False): - return True - pos += 1 - return False + return surrogate_in_utf8(utf8) >= 0 def reencode_utf8_with_surrogates(utf8): """ Receiving valid UTF8 which contains surrogates, combine surrogate @@ -498,13 +487,22 @@ @jit.elidable -def surrogate_in_utf8(value): +def surrogate_in_utf8(utf8): """Check if the UTF-8 byte string 'value' contains a surrogate. The 'value' argument must be otherwise correctly formed for UTF-8. + Returns the position of the first surrogate, otherwise -1. """ - for i in range(len(value) - 2): - if value[i] == '\xed' and value[i + 1] >= '\xa0': - return i + # a surrogate starts with 0xed in utf-8 encoding + pos = 0 + while True: + pos = utf8.find("\xed", pos) + if pos < 0: + return -1 + assert pos <= len(utf8) - 1 # otherwise invalid utf-8 + ordch2 = ord(utf8[pos + 1]) + if _invalid_byte_2_of_3(0xed, ordch2, allow_surrogates=False): + return pos + pos += 1 return -1 From pypy.commits at gmail.com Thu Sep 19 15:18:14 2019 From: pypy.commits at gmail.com (stevie_92) Date: Thu, 19 Sep 2019 12:18:14 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Fixed TODOs for rrc mark and incmark for modern finalizers Message-ID: <5d83d476.1c69fb81.e0308.9f2e@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97552:9ce0c4b2a38c Date: 2019-09-07 12:01 +0200 http://bitbucket.org/pypy/pypy/changeset/9ce0c4b2a38c/ Log: Fixed TODOs for rrc mark and incmark for modern finalizers diff --git a/rpython/memory/gc/rrc/incmark.py b/rpython/memory/gc/rrc/incmark.py --- a/rpython/memory/gc/rrc/incmark.py +++ b/rpython/memory/gc/rrc/incmark.py @@ -25,8 +25,13 @@ # this cycle. if not self._gc_list_is_empty(self.pyobj_old_list): self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) - # TODO: take snapshot of pyobj_old_list and perform _collect_roots - # incrementally (own phase) + # TODO: use separate list and process it after pyobj_list has been + # fully processed (just before modern finalizers) if references + # to separate list are encountered during take_snapshot + # move them to pyobj_list and include them in the snapshot. + # For the remaining list (before modern finalizers), check + # if there are external references from marked non-rc objects + # (rc objects were already detected during take_snapshot) # Untrack all tuples with only non-gc rrc objects and # promote all other tuples to the pyobj_list diff --git a/rpython/memory/gc/rrc/mark.py b/rpython/memory/gc/rrc/mark.py --- a/rpython/memory/gc/rrc/mark.py +++ b/rpython/memory/gc/rrc/mark.py @@ -26,6 +26,9 @@ dead_list_empty = True if not self._gc_list_is_empty(self.pyobj_old_list): dead_list_empty = self._check_finalizer() + # TODO: cannot work this way -> must first do full collection of + # new graph, bc back ref over non-rrc from new rrc graph (#1) + # TODO: see incmark (instead of take_snapshot during collect_roots) # collect all rawrefcounted roots self._collect_roots() From pypy.commits at gmail.com Thu Sep 19 15:18:16 2019 From: pypy.commits at gmail.com (stevie_92) Date: Thu, 19 Sep 2019 12:18:16 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Include p_list in snapshot of rrc incmark Message-ID: <5d83d478.1c69fb81.30900.93ea@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97553:73cc4bd3f3ca Date: 2019-09-19 10:25 +0200 http://bitbucket.org/pypy/pypy/changeset/73cc4bd3f3ca/ Log: Include p_list in snapshot of rrc incmark Fixed some other issues and added some TODOs diff --git a/rpython/memory/gc/rrc/base.py b/rpython/memory/gc/rrc/base.py --- a/rpython/memory/gc/rrc/base.py +++ b/rpython/memory/gc/rrc/base.py @@ -41,8 +41,8 @@ PYOBJ_SNAPSHOT_OBJ = lltype.Struct('PyObject_Snapshot', ('pyobj', llmemory.Address), ('status', lltype.Signed), + ('refcnt_original', lltype.Signed), ('refcnt', lltype.Signed), - ('refcnt_external', lltype.Signed), ('refs_index', lltype.Signed), ('refs_len', lltype.Signed), ('pypy_link', lltype.Signed)) @@ -345,6 +345,7 @@ def _major_trace(self, pyobject, flags): from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT + # TODO: add flag; if set: if marked, keep rc-proxy (use_cylicrefcnt, use_dict) = flags # pyobj = self._pyobj(pyobject) @@ -360,7 +361,10 @@ else: rc = pyobj.c_ob_refcnt else: - rc = pyobj.c_ob_refcnt + if use_dict: + rc = pyobj.c_ob_pypy_link + else: + rc = pyobj.c_ob_refcnt if rc == REFCNT_FROM_PYPY or rc == REFCNT_FROM_PYPY_LIGHT or rc == 0: pass # the corresponding object may die @@ -374,7 +378,7 @@ intobj = pyobj.c_ob_pypy_link obj = llmemory.cast_int_to_adr(intobj) self.gc.objects_to_trace.append(obj) - self.gc.visit_all_objects() + self.gc.visit_all_objects() # TODO: execute incrementally? def _major_trace_nongc(self, pyobject, use_dict): from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY @@ -416,8 +420,7 @@ self.p_dict = new_p_dict = self.gc.AddressDict(length_estimate) new_p_list = self.gc.AddressStack() while self.p_list_old.non_empty(): - self._major_free(self.p_list_old.pop(), new_p_list, - new_p_dict) + self._major_free(self.p_list_old.pop(), new_p_list, new_p_dict) self.p_list_old.delete() self.p_list_old = new_p_list # diff --git a/rpython/memory/gc/rrc/incmark.py b/rpython/memory/gc/rrc/incmark.py --- a/rpython/memory/gc/rrc/incmark.py +++ b/rpython/memory/gc/rrc/incmark.py @@ -59,8 +59,8 @@ # all objects have been marked, dead objects will stay dead self._debug_check_consistency(print_label="before-fin") self.state = self.STATE_GARBAGE_MARKING - - return False + else: + return False # we are finished with marking, now finish things up ll_assert(self.state == self.STATE_GARBAGE_MARKING, "invalid state") @@ -75,16 +75,16 @@ pygchdr = self.pyobj_list.c_gc_next consistent = True self.snapshot_consistent = True - while pygchdr <> self.pyobj_list: + while pygchdr <> self.pyobj_list: # TODO: also sync p_list next_old = pygchdr.c_gc_next if pygchdr.c_gc_refs > 0: # object is in snapshot snapobj = self.snapshot_objs[pygchdr.c_gc_refs - 1] - pygchdr.c_gc_refs = snapobj.refcnt_external - if snapobj.refcnt_external == 0: # object considered dead + pygchdr.c_gc_refs = snapobj.refcnt + if snapobj.refcnt == 0: # object considered dead # check consistency (dead subgraphs can never change): pyobj = self.gc_as_pyobj(pygchdr) # refcount equal - consistent = snapobj.refcnt == pyobj.c_ob_refcnt + consistent = snapobj.refcnt_original == pyobj.c_ob_refcnt if not consistent: break # outgoing (internal) references equal @@ -99,6 +99,7 @@ self._gc_list_add(self.pyobj_old_list, pygchdr) else: pygchdr.c_gc_refs = 1 # new object, keep alive + # TODO: also keep reachable objects alive (in case rc proxy -> non-rc -> non-rc proxy -> rc obj!!!) pygchdr = next_old self._debug_check_consistency(print_label="end-check-consistency") @@ -148,7 +149,7 @@ addr = self.snapshot_refs[obj.refs_index + j] obj_ref = llmemory.cast_adr_to_ptr(addr, self.PYOBJ_SNAPSHOT_OBJ_PTR) - obj_ref.refcnt_external -= 1 + obj_ref.refcnt -= 1 # now all rawrefcounted roots or live border objects have a # refcount > 0 @@ -176,21 +177,21 @@ if snapobj.status == 0: # already processed return False - alive = snapobj.refcnt_external > 0 + alive = snapobj.refcnt > 0 if snapobj.pypy_link <> 0: intobj = snapobj.pypy_link obj = llmemory.cast_int_to_adr(intobj) if not alive and self.gc.header(obj).tid & ( self.GCFLAG_VISITED | self.GCFLAG_NO_HEAP_PTRS): alive = True - snapobj.refcnt_external += 1 + snapobj.refcnt += 1 if alive: # increment refcounts for j in range(0, snapobj.refs_len): addr = self.snapshot_refs[snapobj.refs_index + j] obj_ref = llmemory.cast_adr_to_ptr(addr, self.PYOBJ_SNAPSHOT_OBJ_PTR) - obj_ref.refcnt_external += 1 + obj_ref.refcnt += 1 # mark recursively, if it is a pypyobj if snapobj.pypy_link <> 0: intobj = snapobj.pypy_link @@ -204,7 +205,8 @@ def _take_snapshot(self, pygclist): from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT - # + + # calculate size of memory buffer for snapshot total_refcnt = 0 total_objs = 0 pygchdr = pygclist.c_gc_next @@ -217,6 +219,13 @@ total_refcnt += refcnt total_objs += 1 pygchdr = pygchdr.c_gc_next + self.p_list_count = 0 + self.p_list_refcnt = 0 + self.p_list_old.foreach(self._take_snapshot_count, None) + total_objs += self.p_list_count + total_refcnt += self.p_list_refcnt + + # initialize memory self.snapshot_refs = lltype.malloc(self._ADDRARRAY, total_refcnt, flavor='raw', track_allocation=False) @@ -224,9 +233,13 @@ flavor='raw', track_allocation=False) self.total_objs = total_objs + self.objs_index = 0 + self.refs_index = 0 - objs_index = 0 - refs_index = 0 + # take snapshot of p_list_old + self.p_list_old.foreach(self._take_snapshot_pyobject, None) + + # take snapshot of gc objs pygchdr = pygclist.c_gc_next while pygchdr <> pygclist: pyobj = self.gc_as_pyobj(pygchdr) @@ -240,26 +253,93 @@ if self.gc.header(addr).tid & (self.GCFLAG_VISITED | self.GCFLAG_NO_HEAP_PTRS): refcnt += 1 - pygchdr.c_gc_refs = objs_index + 1 - obj = self.snapshot_objs[objs_index] + pygchdr.c_gc_refs = self.objs_index + 1 + obj = self.snapshot_objs[self.objs_index] obj.pyobj = llmemory.cast_ptr_to_adr(pyobj) obj.status = 1 - obj.refcnt = pyobj.c_ob_refcnt - obj.refcnt_external = refcnt - obj.refs_index = refs_index + obj.refcnt_original = pyobj.c_ob_refcnt + obj.refcnt = refcnt + obj.refs_index = self.refs_index obj.refs_len = 0 obj.pypy_link = pyobj.c_ob_pypy_link self.snapshot_curr = obj self._take_snapshot_traverse(pyobj) - objs_index += 1 - refs_index += obj.refs_len + self.objs_index += 1 + self.refs_index += obj.refs_len pygchdr = pygchdr.c_gc_next - for i in range(0, refs_index): + + # fix references + for i in range(0, self.refs_index): addr = self.snapshot_refs[i] - pyobj = llmemory.cast_adr_to_ptr(addr, self.PYOBJ_GC_HDR_PTR) - obj = self.snapshot_objs[pyobj.c_gc_refs - 1] + pyobj = llmemory.cast_adr_to_ptr(addr, self.PYOBJ_HDR_PTR) + pygchdr = self.pyobj_as_gc(pyobj) + if (pygchdr <> lltype.nullptr(self.PYOBJ_GC_HDR) and + pygchdr.c_gc_refs != self.RAWREFCOUNT_REFS_UNTRACKED): + obj = self.snapshot_objs[pygchdr.c_gc_refs - 1] + else: + obj = self.snapshot_objs[pyobj.c_ob_pypy_link - 1] self.snapshot_refs[i] = llmemory.cast_ptr_to_adr(obj) + # fix links of p_list_old back + self.p_list_old.foreach(self._take_snapshot_fixlink, None) + + def _take_snapshot_count(self, pyobject, foo): + from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY + from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT + # + pyobj = self._pyobj(pyobject) + pygchdr = self.pyobj_as_gc(pyobj) + # only include non-gc + if (pygchdr == lltype.nullptr(self.PYOBJ_GC_HDR) or + pygchdr.c_gc_refs == self.RAWREFCOUNT_REFS_UNTRACKED): + self.p_list_count += 1 + refcnt = pyobj.c_ob_refcnt + if refcnt >= REFCNT_FROM_PYPY_LIGHT: + refcnt -= REFCNT_FROM_PYPY_LIGHT + elif refcnt >= REFCNT_FROM_PYPY: + refcnt -= REFCNT_FROM_PYPY + self.p_list_refcnt += refcnt + + def _take_snapshot_pyobject(self, pyobject, foo): + from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY + from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT + # + pyobj = self._pyobj(pyobject) + pygchdr = self.pyobj_as_gc(pyobj) + # only include non-gc + if (pygchdr == lltype.nullptr(self.PYOBJ_GC_HDR) or + pygchdr.c_gc_refs == self.RAWREFCOUNT_REFS_UNTRACKED): + refcnt = pyobj.c_ob_refcnt + if refcnt >= REFCNT_FROM_PYPY_LIGHT: + refcnt -= REFCNT_FROM_PYPY_LIGHT + elif refcnt >= REFCNT_FROM_PYPY: + refcnt -= REFCNT_FROM_PYPY + if pyobj.c_ob_pypy_link != 0: + addr = llmemory.cast_int_to_adr(pyobj.c_ob_pypy_link) + if self.gc.header(addr).tid & (self.GCFLAG_VISITED | + self.GCFLAG_NO_HEAP_PTRS): + refcnt += 1 + obj = self.snapshot_objs[self.objs_index] + obj.pyobj = llmemory.cast_ptr_to_adr(pyobj) + obj.status = 1 + obj.refcnt_original = pyobj.c_ob_refcnt + obj.refcnt = refcnt + obj.refs_index = 0 + obj.refs_len = 0 + obj.pypy_link = pyobj.c_ob_pypy_link + pyobj.c_ob_pypy_link = self.objs_index + 1 + self.objs_index += 1 + + def _take_snapshot_fixlink(self, pyobject, foo): + pyobj = self._pyobj(pyobject) + pygchdr = self.pyobj_as_gc(pyobj) + # only include non-gc + if (pygchdr == lltype.nullptr(self.PYOBJ_GC_HDR) or + pygchdr.c_gc_refs == self.RAWREFCOUNT_REFS_UNTRACKED): + obj_index = pyobj.c_ob_pypy_link - 1 + obj = self.snapshot_objs[obj_index] + pyobj.c_ob_pypy_link = obj.pypy_link + def _take_snapshot_visit(pyobj, self_ptr): from rpython.rtyper.annlowlevel import cast_adr_to_nongc_instance # @@ -270,11 +350,12 @@ def _take_snapshot_visit_action(self, pyobj, ignore): pygchdr = self.pyobj_as_gc(pyobj) - if pygchdr <> lltype.nullptr(self.PYOBJ_GC_HDR) and \ - pygchdr.c_gc_refs != self.RAWREFCOUNT_REFS_UNTRACKED: - curr = self.snapshot_curr - index = curr.refs_index + curr.refs_len - self.snapshot_refs[index] = llmemory.cast_ptr_to_adr(pygchdr) + curr = self.snapshot_curr + index = curr.refs_index + curr.refs_len + if ((pygchdr <> lltype.nullptr(self.PYOBJ_GC_HDR) and + pygchdr.c_gc_refs != self.RAWREFCOUNT_REFS_UNTRACKED) or + pyobj.c_ob_pypy_link != 0): + self.snapshot_refs[index] = llmemory.cast_ptr_to_adr(pyobj) curr.refs_len += 1 def _take_snapshot_traverse(self, pyobj): diff --git a/rpython/memory/gc/rrc/mark.py b/rpython/memory/gc/rrc/mark.py --- a/rpython/memory/gc/rrc/mark.py +++ b/rpython/memory/gc/rrc/mark.py @@ -60,19 +60,21 @@ self.pyobj_isolate_list) use_cylicrc = not found_finalizer self._debug_check_consistency(print_label="end-mark-cyclic") + + # mark all pypy objects at the border which are linked to non-gc + # pyobjs which are not directly referenced by any gc pyobj + debug_print("use_cylicrc", use_cylicrc) + self.p_list_old.foreach(self._major_trace, (use_cylicrc, True)) # TODO: set flag to keep marked, check other occurences + self._debug_check_consistency(print_label="end-mark") + + # fix refcnt back + self.refcnt_dict.foreach(self._fix_refcnt_back, None) + self.refcnt_dict.delete() + self.refcnt_dict = self.gc.AddressDict() + self.use_refcntdict = False else: - use_cylicrc = False # don't sweep any objects in cyclic isolates - - # now mark all pypy objects at the border, depending on the results - debug_print("use_cylicrc", use_cylicrc) - self.p_list_old.foreach(self._major_trace, (use_cylicrc, True)) - self._debug_check_consistency(print_label="end-mark") - - # fix refcnt back - self.refcnt_dict.foreach(self._fix_refcnt_back, None) - self.refcnt_dict.delete() - self.refcnt_dict = self.gc.AddressDict() - self.use_refcntdict = False + self.p_list_old.foreach(self._major_trace, (False, False)) # TODO: set flag to keep marked, check other occurences + self._debug_check_consistency(print_label="end-mark") self.state = self.STATE_DEFAULT return True @@ -89,7 +91,11 @@ # Initialize the cyclic refcount with the real refcount. self._collect_roots_init_list(self.pyobj_list) - # Save the real refcount of objects at border + # Save the real refcount of objects at border (they don't necessarily + # have a rrc header, as not all of them are garbage collected on the + # rrc side, so we need to store their cyclic refcount somewhere else; + # we choose the pypy_link field and use a dict to lookup the pypy_link, + # if necessary) self.p_list_old.foreach(self._obj_save_refcnt, None) self.o_list_old.foreach(self._obj_save_refcnt, None) self.use_refcntdict = True From pypy.commits at gmail.com Thu Sep 19 15:18:18 2019 From: pypy.commits at gmail.com (stevie_92) Date: Thu, 19 Sep 2019 12:18:18 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Fixed tests for non-gc proxies in mark Message-ID: <5d83d47a.1c69fb81.b9938.63bd@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97554:a84af3d1e5c1 Date: 2019-09-19 12:46 +0200 http://bitbucket.org/pypy/pypy/changeset/a84af3d1e5c1/ Log: Fixed tests for non-gc proxies in mark Added some TODOs and comments diff --git a/rpython/memory/gc/rrc/base.py b/rpython/memory/gc/rrc/base.py --- a/rpython/memory/gc/rrc/base.py +++ b/rpython/memory/gc/rrc/base.py @@ -388,11 +388,11 @@ pygchdr = self.pyobj_as_gc(pyobj) if pygchdr != lltype.nullptr(self.PYOBJ_GC_HDR): if pygchdr.c_gc_refs != self.RAWREFCOUNT_REFS_UNTRACKED: - rc = 0 + rc = 0 # do not mark, we will mark them later else: - rc = pyobj.c_ob_refcnt + rc = pyobj.c_ob_refcnt # take cyclic refcount else: - rc = pyobj.c_ob_refcnt + rc = pyobj.c_ob_refcnt # take cyclic refcount if rc == REFCNT_FROM_PYPY or rc == REFCNT_FROM_PYPY_LIGHT or rc == 0: pass # the corresponding object may die diff --git a/rpython/memory/gc/rrc/incmark.py b/rpython/memory/gc/rrc/incmark.py --- a/rpython/memory/gc/rrc/incmark.py +++ b/rpython/memory/gc/rrc/incmark.py @@ -239,7 +239,7 @@ # take snapshot of p_list_old self.p_list_old.foreach(self._take_snapshot_pyobject, None) - # take snapshot of gc objs + # take snapshot of gc objs TODO: include finalizer_list from last cycle pygchdr = pygclist.c_gc_next while pygchdr <> pygclist: pyobj = self.gc_as_pyobj(pygchdr) diff --git a/rpython/memory/gc/rrc/mark.py b/rpython/memory/gc/rrc/mark.py --- a/rpython/memory/gc/rrc/mark.py +++ b/rpython/memory/gc/rrc/mark.py @@ -61,8 +61,8 @@ use_cylicrc = not found_finalizer self._debug_check_consistency(print_label="end-mark-cyclic") - # mark all pypy objects at the border which are linked to non-gc - # pyobjs which are not directly referenced by any gc pyobj + # mark all pypy objects at the border which are linked to live + # non-gc pyobjs which are not directly referenced by any gc pyobj debug_print("use_cylicrc", use_cylicrc) self.p_list_old.foreach(self._major_trace, (use_cylicrc, True)) # TODO: set flag to keep marked, check other occurences self._debug_check_consistency(print_label="end-mark") @@ -149,8 +149,6 @@ def _obj_fix_refcnt(self, pyobject, ignore): pyobj = self._pyobj(pyobject) - #intobj = pyobj.c_ob_pypy_link - #obj = llmemory.cast_int_to_adr(intobj) obj = self.refcnt_dict.get(pyobject) gchdr = self.pyobj_as_gc(pyobj) if gchdr <> lltype.nullptr(self.PYOBJ_GC_HDR): @@ -167,6 +165,11 @@ self.GCFLAG_NO_HEAP_PTRS): refcnt += 1 self._pyobj_gc_refcnt_set(gchdr, refcnt) + else: + debug_print("non gc obj", obj, "real-rc", pyobj.c_ob_refcnt) + if self.gc.header(obj).tid & (self.GCFLAG_VISITED | + self.GCFLAG_NO_HEAP_PTRS): + pyobj.c_ob_refcnt += 1 def _mark_rawrefcount(self): if self._gc_list_is_empty(self.pyobj_list): diff --git a/rpython/memory/gc/test/dot/free_cross_simple_2.dot b/rpython/memory/gc/test/dot/free_cross_nogc_1.dot copy from rpython/memory/gc/test/dot/free_cross_simple_2.dot copy to rpython/memory/gc/test/dot/free_cross_nogc_1.dot --- a/rpython/memory/gc/test/dot/free_cross_simple_2.dot +++ b/rpython/memory/gc/test/dot/free_cross_nogc_1.dot @@ -2,7 +2,7 @@ "a" [type=P, alive=n]; "b" [type=B, alive=n]; "c" [type=C, alive=n]; - "d" [type=B, alive=n]; + "d" [type=B, alive=n, gc=n]; "a" -> "b"; "b" -> "c"; "c" -> "d"; diff --git a/rpython/memory/gc/test/dot/free_cross_simple_2.dot b/rpython/memory/gc/test/dot/keep_cross_nogc_1.dot copy from rpython/memory/gc/test/dot/free_cross_simple_2.dot copy to rpython/memory/gc/test/dot/keep_cross_nogc_1.dot --- a/rpython/memory/gc/test/dot/free_cross_simple_2.dot +++ b/rpython/memory/gc/test/dot/keep_cross_nogc_1.dot @@ -1,10 +1,12 @@ digraph G { - "a" [type=P, alive=n]; - "b" [type=B, alive=n]; - "c" [type=C, alive=n]; - "d" [type=B, alive=n]; + "a" [type=P, alive=y]; + "b" [type=B, alive=y]; + "c" [type=C, alive=y]; + "d" [type=B, alive=y, gc=n]; + "e" [type=P, alive=y, rooted=y]; "a" -> "b"; "b" -> "c"; "c" -> "d"; "d" -> "a"; + "e" -> "d"; } diff --git a/rpython/memory/gc/test/test_rawrefcount.py b/rpython/memory/gc/test/test_rawrefcount.py --- a/rpython/memory/gc/test/test_rawrefcount.py +++ b/rpython/memory/gc/test/test_rawrefcount.py @@ -26,8 +26,8 @@ class TestRawRefCount(BaseDirectGCTest): GCClass = IncMiniMark - RRCGCClass = RawRefCountIncMarkGC - #RRCGCClass = RawRefCountMarkGC + #RRCGCClass = RawRefCountIncMarkGC + RRCGCClass = RawRefCountMarkGC def setup_method(self, method): BaseDirectGCTest.setup_method(self, method) @@ -60,10 +60,7 @@ def rawrefcount_pyobj_as_gc(pyobj): index = self.pyobjs.index(pyobj) - if self.is_pygc[index]: - return self.gcobjs[index] - else: - return lltype.nullptr(PYOBJ_GC_HDR) + return self.gcobjs[index] def rawrefcount_finalizer_type(gc): pyobj = self.pyobjs[self.gcobjs.index(gc)] @@ -166,6 +163,8 @@ if is_gc: self._rawrefcount_add_gc(tracked, tuple) + else: + self.gcobjs.append(lltype.nullptr(PYOBJ_GC_HDR)) self.pyobjs.append(r1) self.is_pygc.append(is_gc) @@ -214,6 +213,8 @@ if is_gc: self._rawrefcount_add_gc(tracked, tuple) + else: + self.gcobjs.append(lltype.nullptr(PYOBJ_GC_HDR)) self.pyobjs.append(r1) self.is_pygc.append(is_gc) @@ -510,7 +511,7 @@ class NodeInfo: def __init__(self, type, alive, ext_refcnt, finalizer, resurrect, - delete, garbage, tuple): + delete, garbage, tuple, gc): self.type = type self.alive = alive self.ext_refcnt = ext_refcnt @@ -519,6 +520,7 @@ self.delete = delete self.garbage = garbage self.tuple = tuple + self.gc = gc class WeakrefNode(BorderNode): def __init__(self, p, pref, r, raddr, check_alive, info, r_dest, @@ -556,8 +558,9 @@ delete = attr['delete'] if 'delete' in attr else None garbage = True if 'garbage' in attr else False tuple = attr['tuple'] == "y" if 'tuple' in attr else False + gc = attr['gc'] == "y" if 'gc' in attr else True info = NodeInfo(type, alive, ext_refcnt, finalizer, resurrect, - delete, garbage, tuple) + delete, garbage, tuple, gc) if type == "C": r, raddr, check_alive = self._rawrefcount_pyobj( tracked=tracked, tuple=tuple) @@ -569,11 +572,11 @@ create_old=True) nodes[name] = PyPyNode(p, pref, check_alive, info) i += 1 - elif type == "B": + elif type == "B": # TODO: add to correct list (now always p_list) p, pref, r, raddr, check_alive =\ self._rawrefcount_pair(42 + i, rooted=rooted, create_old=True, tracked=tracked, - tuple=tuple) + tuple=tuple, is_gc=gc) r.c_ob_refcnt += ext_refcnt nodes[name] = BorderNode(p, pref, r, raddr, check_alive, info) i += 1 From pypy.commits at gmail.com Thu Sep 19 16:05:28 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 19 Sep 2019 13:05:28 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: really hope this finally fixes test_sys Message-ID: <5d83df88.1c69fb81.ef58b.0a3c@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97555:c61c6e7c5d66 Date: 2019-09-19 22:04 +0200 http://bitbucket.org/pypy/pypy/changeset/c61c6e7c5d66/ Log: really hope this finally fixes test_sys diff --git a/pypy/module/sys/app.py b/pypy/module/sys/app.py --- a/pypy/module/sys/app.py +++ b/pypy/module/sys/app.py @@ -38,7 +38,7 @@ # because there is indeed no traceback. # the traceback module don't care for line in format_exception_only(exctype, value): - print(line, end="") + print(line, end="", file=sys.stderr) else: print_exception(exctype, value, traceback) diff --git a/pypy/module/sys/test/test_sysmodule.py b/pypy/module/sys/test/test_sysmodule.py --- a/pypy/module/sys/test/test_sysmodule.py +++ b/pypy/module/sys/test/test_sysmodule.py @@ -415,6 +415,7 @@ eh(*sys.exc_info()) msg = err.getvalue() assert "Traceback (most recent call last):" not in msg + assert "ValueError" in msg sys.stderr = savestderr del sys.tracebacklimit From pypy.commits at gmail.com Thu Sep 19 18:06:50 2019 From: pypy.commits at gmail.com (cfbolz) Date: Thu, 19 Sep 2019 15:06:50 -0700 (PDT) Subject: [pypy-commit] pypy default: produce syntax errors with the failing line attached even if the error comes Message-ID: <5d83fbfa.1c69fb81.8be3.0292@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97556:df419b83d7f9 Date: 2019-09-20 00:03 +0200 http://bitbucket.org/pypy/pypy/changeset/df419b83d7f9/ Log: produce syntax errors with the failing line attached even if the error comes from the astbuilder diff --git a/pypy/interpreter/pycompiler.py b/pypy/interpreter/pycompiler.py --- a/pypy/interpreter/pycompiler.py +++ b/pypy/interpreter/pycompiler.py @@ -125,13 +125,13 @@ info = pyparse.CompileInfo(filename, mode, flags, future_pos) return self._compile_ast(node, info) - def _compile_ast(self, node, info): + def _compile_ast(self, node, info, source=None): space = self.space try: mod = optimize.optimize_ast(space, node, info) code = codegen.compile_ast(space, mod, info) except parseerror.SyntaxError as e: - raise OperationError(space.w_SyntaxError, e.wrap_info(space)) + raise OperationError(space.w_SyntaxError, e.wrap_info(space, source)) return code def compile_to_ast(self, source, filename, mode, flags): @@ -146,11 +146,11 @@ except parseerror.IndentationError as e: raise OperationError(space.w_IndentationError, e.wrap_info(space)) except parseerror.SyntaxError as e: - raise OperationError(space.w_SyntaxError, e.wrap_info(space)) + raise OperationError(space.w_SyntaxError, e.wrap_info(space, source)) return mod def compile(self, source, filename, mode, flags, hidden_applevel=False): info = pyparse.CompileInfo(filename, mode, flags, hidden_applevel=hidden_applevel) mod = self._compile_to_ast(source, info) - return self._compile_ast(mod, info) + return self._compile_ast(mod, info, source) diff --git a/pypy/interpreter/pyparser/error.py b/pypy/interpreter/pyparser/error.py --- a/pypy/interpreter/pyparser/error.py +++ b/pypy/interpreter/pyparser/error.py @@ -12,9 +12,13 @@ self.filename = filename self.lastlineno = lastlineno - def wrap_info(self, space): + def wrap_info(self, space, source=None): + text = self.text + if text is None and source is not None and self.lineno: + lines = source.splitlines(True) + text = lines[self.lineno - 1] w_filename = space.newtext_or_none(self.filename) - w_text = space.newtext_or_none(self.text) + w_text = space.newtext_or_none(text) return space.newtuple([space.newtext(self.msg), space.newtuple([w_filename, space.newint(self.lineno), diff --git a/pypy/interpreter/test/test_compiler.py b/pypy/interpreter/test/test_compiler.py --- a/pypy/interpreter/test/test_compiler.py +++ b/pypy/interpreter/test/test_compiler.py @@ -1111,3 +1111,9 @@ skip() code = 'u"""\\\n# -*- coding: utf-8 -*-\n\xc2\xa4"""\n' assert eval(code) == u'# -*- coding: utf-8 -*-\n\xc2\xa4' + + def test_asterror_has_line_without_file(self): + code = u"print(1)\na/2 = 5\n" + with raises(SyntaxError) as excinfo: + compile(code, 'not a file!', 'exec') + assert excinfo.value.text == "a/2 = 5\n" diff --git a/pypy/interpreter/test/test_syntax.py b/pypy/interpreter/test/test_syntax.py --- a/pypy/interpreter/test/test_syntax.py +++ b/pypy/interpreter/test/test_syntax.py @@ -659,7 +659,7 @@ exec program except SyntaxError as e: assert e.lineno == 1 - assert e.text is None + assert e.text == program else: raise Exception("no SyntaxError??") From pypy.commits at gmail.com Fri Sep 20 01:31:48 2019 From: pypy.commits at gmail.com (mattip) Date: Thu, 19 Sep 2019 22:31:48 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix whatsnew fwiw Message-ID: <5d846444.1c69fb81.5528f.3225@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97557:f98d9defef9b Date: 2019-09-20 08:31 +0300 http://bitbucket.org/pypy/pypy/changeset/f98d9defef9b/ Log: fix whatsnew fwiw diff --git a/pypy/doc/whatsnew-pypy3-head.rst b/pypy/doc/whatsnew-pypy3-head.rst --- a/pypy/doc/whatsnew-pypy3-head.rst +++ b/pypy/doc/whatsnew-pypy3-head.rst @@ -39,3 +39,13 @@ Fix handling of __debug__, sys.flags.optimize, and '-O' command-line flag to match CPython 3.6. + +.. branch: more-cpyext + +Add ``PyErr_SetFromWindowsErr`` and ``pytime.h``, ``pytime.c``. Fix order of +fields in ``Py_buffer``. + +.. branch: Ryan-Hileman/add-support-for-zipfile-stdlib-1562420744699 + +Add support for the entire stdlib being inside a zipfile + From pypy.commits at gmail.com Fri Sep 20 02:01:04 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Thu, 19 Sep 2019 23:01:04 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Added some more tests Message-ID: <5d846b20.1c69fb81.3f53.3df8@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97558:9210c8d4569e Date: 2019-09-20 06:58 +0100 http://bitbucket.org/pypy/pypy/changeset/9210c8d4569e/ Log: Added some more tests diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -12,6 +12,7 @@ from rpython.rlib._os_support import _preferred_traits from rpython.rlib import rwin32 from rpython.rlib.rwin32file import make_win32_traits + from rpython.rtyper.tool import rffi_platform as platform import unicodedata @@ -164,9 +165,6 @@ self.writable = False self.closehandle = False self.blksize = 0 - - # def _internal_close(self, space): - # pass def _copyfrombuf(self, buf, len): n = 0 @@ -200,6 +198,9 @@ try: if space.isinstance_w(w_nameobj, space.w_int): self.fd = space.int_w(w_nameobj) + if self.fd < 0: + raise oefmt(space.w_ValueError, + "negative file descriptor") # make the flow analysis happy,otherwise it thinks w_path # is undefined later @@ -325,11 +326,13 @@ return space.newtext("<%s name=%s>" % (typename, name_repr)) def fileno_w(self, space): + traits = _preferred_traits(u"") + win32traits = make_win32_traits(traits) if self.fd < 0 and self.handle != rwin32.INVALID_HANDLE_VALUE: if self.writable: - self.fd = rwin32.open_osfhandle(self.handle, rwin32._O_WRONLY | rwin32._O_BINARY) + self.fd = rwin32.open_osfhandle(self.handle, win32traits._O_WRONLY | win32traits._O_BINARY) else: - self.fd = rwin32.open_osfhandle(self.handle, rwin32._O_RDONLY | rwin32._O_BINARY) + self.fd = rwin32.open_osfhandle(self.handle, win32traits._O_RDONLY | win32traits._O_BINARY) if self.fd < 0: return err_mode(space, "fileno") return space.newint(self.fd) @@ -438,9 +441,9 @@ err_closed(space) bufsize = BUFSIZ - buf = lltype.malloc(rffi.CWCHARP, bufsize + 1, flavor='raw') + buf = lltype.malloc(rffi.CWCHARP.TO, bufsize + 1, flavor='raw') len = 0 - n = lltype.malloc(rffi.CWCHARP, 1, flavor='raw') + n = lltype.malloc(rwin32.LPDWORD.TO, 1, flavor='raw') n[0] = 0 try: @@ -456,7 +459,7 @@ "than a Python bytes object can hold") bufsize = newsize lltype.free(buf, flavor='raw') - buf = lltype.malloc(rffi.CWCHARP, bufsize + 1, flavor='raw') + buf = lltype.malloc(rffi.CWCHARP.TO, bufsize + 1, flavor='raw') subbuf = read_console_w(self.handle, bufsize - len, n) if n > 0: @@ -485,7 +488,7 @@ bytes_size += self._buflen() # Create destination buffer and convert the bytes - bytes = lltype.malloc(rffi.CCHARP, bytes_size, flavor='raw') + bytes = lltype.malloc(rffi.CCHARP.TO, bytes_size, flavor='raw') rn = self._copyfrombuf(bytes, bytes_size) if len: @@ -509,60 +512,60 @@ def write_w(self, space, w_data): buffer = space.charbuf_w(w_data) - n = lltype.malloc(rwin32.LPDWORD.TO, 0, flavor='raw') + with lltype.scoped_alloc(rwin32.LPDWORD.TO, 1) as n: - if self.handle == rwin32.INVALID_HANDLE_VALUE: - return err_closed(space) + if self.handle == rwin32.INVALID_HANDLE_VALUE: + return err_closed(space) - if not self.writable: - return err_mode(space,"writing") + if not self.writable: + return err_mode(space,"writing") - if not len(buffer): - return 0 + if not len(buffer): + lltype.free(n, flavor='raw') + return space.newint(0) - if len(buffer) > BUFMAX: - buflen = BUFMAX - else: - buflen = len(buffer) + if len(buffer) > BUFMAX: + buflen = BUFMAX + else: + buflen = len(buffer) - wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, rffi.NULL, 0) + wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, rffi.NULL, 0) - while wlen > (32766 / rffi.sizeof(rffi.CWCHARP)): - buflen /= 2 - wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, rffi.NULL, 0) + while wlen > (32766 / rffi.sizeof(rffi.CWCHARP)): + buflen /= 2 + wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, rffi.NULL, 0) - if not wlen: - lltype.free(n, flavor='raw') - raise WindowsError("Failed to convert bytes to wide characters") + if not wlen: + lltype.free(n, flavor='raw') + raise WindowsError("Failed to convert bytes to wide characters") - with lltype.scoped_alloc(rffi.CWCHARP, wlen) as wbuf: - wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, wbuf, wlen) - if wlen: - res = rwin32.WriteConsoleW(self.handle, wbuf, wlen, n , rffi.NULL) + with lltype.scoped_alloc(rffi.CWCHARP.TO, wlen) as wbuf: + wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, wbuf, wlen) + if wlen: + res = rwin32.WriteConsoleW(self.handle, rffi.cast(rwin32.LPVOID, wbuf), wlen, n , rffi.NULL) - if res and n < wlen: - buflen = rwin32.WideCharToMultiByte(rwin32.CP_UTF8, 0, wbuf, n, - rffi.NULL, 0, rffi.NULL, rffi.NULL) + if res and n < wlen: + buflen = rwin32.WideCharToMultiByte(rwin32.CP_UTF8, 0, wbuf, n, + rffi.NULL, 0, rffi.NULL, rffi.NULL) - if buflen: - wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0, buffer, - buflen, rffi.NULL, 0) - assert len == wlen + if buflen: + wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0, buffer, + buflen, rffi.NULL, 0) + assert buflen == wlen - else: - res = 0 + else: + res = 0 - if not res: - err = rwin32.GetLastError_saved() - lltype.free(n, flavor='raw') - raise WindowsError(err, "Failed to convert multi byte string to wide characters") + if not res: + err = rwin32.GetLastError_saved() + raise WindowsError(err, "Failed to convert multi byte string to wide characters") - lltype.free(n, flavor='raw') - return space.newint(len) + return space.newint(buflen) def get_blksize(self,space): return space.newint(self.blksize) + W_WinConsoleIO.typedef = TypeDef( '_io.WinConsoleIO', W_RawIOBase.typedef, __new__ = generic_new_descr(W_WinConsoleIO), @@ -574,7 +577,8 @@ isatty = interp2app(W_WinConsoleIO.isatty_w), read = interp2app(W_WinConsoleIO.read_w), readall = interp2app(W_WinConsoleIO.readall_w), - readinto = interp2app(W_WinConsoleIO.readinto_w), + readinto = interp2app(W_WinConsoleIO.readinto_w), + fileno = interp2app(W_WinConsoleIO.fileno_w), write = interp2app(W_WinConsoleIO.write_w), _blksize = GetSetProperty(W_WinConsoleIO.get_blksize), ) diff --git a/pypy/module/_io/test/test_win32consoleio.py b/pypy/module/_io/test/test_win32consoleio.py --- a/pypy/module/_io/test/test_win32consoleio.py +++ b/pypy/module/_io/test/test_win32consoleio.py @@ -1,32 +1,32 @@ +from rpython.tool.udir import udir + class AppTestWinConsoleIO: - spaceconfig = dict(usemodules=['_io', '_locale', 'array']) + spaceconfig = dict(usemodules=['_io']) - def setup_class(cls): - from rpython.rlib.rarithmetic import INT_MAX, UINT_MAX - space = cls.space - cls.w_INT_MAX = space.wrap(INT_MAX) - cls.w_UINT_MAX = space.wrap(UINT_MAX) + def setup_method(self, meth): + tmpfile = udir.join('tmpfile') + tmpfile.write("a\nb\nc", mode='wb') + self.tmpfile = tmpfile + self.conout_path = self.space.wrap(str(udir.join('CONOUT$'))) def test_open_fd(self): import _io + + w_fd = self.fileno() + # Windows 10: "Cannot open non-console file" + # Earlier: "Cannot open console output buffer for reading" + raises(ValueError, _io._WindowsConsoleIO, fd) + raises(ValueError, _io._WindowsConsoleIO, -1) - fd, _ = tempfile.mkstemp() - try: - # Windows 10: "Cannot open non-console file" - # Earlier: "Cannot open console output buffer for reading" - raises(ValueError, _io._WindowsConsoleIO, fd) - finally: - os.close(fd) - try: f = _io._WindowsConsoleIO(0) except ValueError: # cannot open console because it's not a real console pass else: - assert f.readable() == True - assert f.writable() == False + assert f.readable() + assert not f.writable() assert 0 == f.fileno() f.close() # multiple close should not crash f.close() @@ -37,8 +37,8 @@ # cannot open console because it's not a real console pass else: - assert f.readable() == False - assert True == f.writable() + assert not f.readable() + assert f.writable() assert 1 == f.fileno() f.close() f.close() @@ -49,12 +49,57 @@ # cannot open console because it's not a real console pass else: - assert False == f.readable() - assert True == f.writable() + assert not f.readable() + assert f.writable() assert 2 == f.fileno() f.close() f.close() def test_constructor(self): import _io - t = _io._WindowsConsoleIO("CONIN$") + + f = _io._WindowsConsoleIO("CON") + assert f.readable() + assert not f.writable() + assert f.fileno() != None + f.close() # multiple close should not crash + f.close() + + f = _io._WindowsConsoleIO('CONIN$') + assert f.readable() + assert not f.writable() + assert f.fileno() != None + f.close() + f.close() + + f = _io._WindowsConsoleIO('CONOUT$', 'w') + assert not f.readable() + assert f.writable() + assert f.fileno() != None + f.close() + f.close() + + f = open('C:/con', 'rb', buffering=0) + assert f is _io._WindowsConsoleIO + f.close() + + def test_conin_conout_names(self): + import _io + f = open(r'\\.\conin$', 'rb', buffering=0) + assert type(f) is _io._WindowsConsoleIO + f.close() + + f = open('//?/conout$', 'wb', buffering=0) + assert type(f) is _io._WindowsConsoleIO + f.close() + + def test_conout_path(self): + import _io + + with open(self.conout_path, 'wb', buffering=0) as f: + assert type(f) is _io._WindowsConsoleIO + + def test_write_empty_data(self): + import _io + with _io._WindowsConsoleIO('CONOUT$', 'w') as f: + assert f.write(b'') == 0 \ No newline at end of file diff --git a/rpython/rlib/rwin32.py b/rpython/rlib/rwin32.py --- a/rpython/rlib/rwin32.py +++ b/rpython/rlib/rwin32.py @@ -252,6 +252,7 @@ _open_osfhandle = rffi.llexternal('_open_osfhandle', [rffi.INTP, rffi.INT], rffi.INT) def open_osfhandle(handle, flags): + from rpython.rlib.rposix import FdValidator fd = _open_osfhandle(handle, flags) with FdValidator(fd): return fd diff --git a/rpython/rlib/rwin32file.py b/rpython/rlib/rwin32file.py --- a/rpython/rlib/rwin32file.py +++ b/rpython/rlib/rwin32file.py @@ -46,6 +46,7 @@ _O_RDWR = platform.ConstantInteger('_O_RDWR') _O_TRUNC = platform.ConstantInteger('_O_TRUNC') _O_WRONLY = platform.ConstantInteger('_O_WRONLY') + _O_BINARY = platform.ConstantInteger('_O_BINARY') FILE_TYPE_UNKNOWN = platform.ConstantInteger('FILE_TYPE_UNKNOWN') FILE_TYPE_CHAR = platform.ConstantInteger('FILE_TYPE_CHAR') FILE_TYPE_PIPE = platform.ConstantInteger('FILE_TYPE_PIPE') @@ -140,6 +141,7 @@ ERROR_FILE_NOT_FOUND ERROR_NO_MORE_FILES ERROR_SHARING_VIOLATION MOVEFILE_REPLACE_EXISTING ERROR_ACCESS_DENIED + _O_RDONLY _O_WRONLY _O_BINARY '''.split(): locals()[name] = config[name] LPWIN32_FIND_DATA = lltype.Ptr(WIN32_FIND_DATA) From pypy.commits at gmail.com Fri Sep 20 02:12:26 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Thu, 19 Sep 2019 23:12:26 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Removed extraneous frees Message-ID: <5d846dca.1c69fb81.d9861.2e30@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97559:162b9ddd10a3 Date: 2019-09-20 07:11 +0100 http://bitbucket.org/pypy/pypy/changeset/162b9ddd10a3/ Log: Removed extraneous frees diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -521,7 +521,6 @@ return err_mode(space,"writing") if not len(buffer): - lltype.free(n, flavor='raw') return space.newint(0) if len(buffer) > BUFMAX: @@ -536,7 +535,6 @@ wlen = rwin32.MultiByteToWideChar(rwin32.CP_UTF8, 0 , buffer, buflen, rffi.NULL, 0) if not wlen: - lltype.free(n, flavor='raw') raise WindowsError("Failed to convert bytes to wide characters") with lltype.scoped_alloc(rffi.CWCHARP.TO, wlen) as wbuf: diff --git a/pypy/module/_io/test/test_win32consoleio.py b/pypy/module/_io/test/test_win32consoleio.py --- a/pypy/module/_io/test/test_win32consoleio.py +++ b/pypy/module/_io/test/test_win32consoleio.py @@ -12,7 +12,7 @@ def test_open_fd(self): import _io - w_fd = self.fileno() + w_fd = self.tempfile.fileno() # Windows 10: "Cannot open non-console file" # Earlier: "Cannot open console output buffer for reading" raises(ValueError, _io._WindowsConsoleIO, fd) From pypy.commits at gmail.com Fri Sep 20 04:18:50 2019 From: pypy.commits at gmail.com (mattip) Date: Fri, 20 Sep 2019 01:18:50 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: changeset abe60bf6dc7b broke re.compile('([ \t]*line\W)|([ \t]*\d+)') in cffi Message-ID: <5d848b6a.1c69fb81.eb9c5.4427@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97560:b2dd9b388196 Date: 2019-09-20 09:51 +0300 http://bitbucket.org/pypy/pypy/changeset/b2dd9b388196/ Log: changeset abe60bf6dc7b broke re.compile('([ \t]*line\W)|([ \t]*\d+)') in cffi diff --git a/pypy/interpreter/pyparser/test/apptest_parsestring.py b/pypy/interpreter/pyparser/test/apptest_parsestring.py --- a/pypy/interpreter/pyparser/test/apptest_parsestring.py +++ b/pypy/interpreter/pyparser/test/apptest_parsestring.py @@ -8,11 +8,3 @@ eval("b'''\n\\z'''") assert not w assert excinfo.value.filename == '' - -def test_str_invalid_escape(): - with warnings.catch_warnings(record=True) as w: - warnings.simplefilter('error', category=DeprecationWarning) - with raises(SyntaxError) as excinfo: - eval("'''\n\\z'''") - assert not w - assert excinfo.value.filename == '' diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -130,15 +130,6 @@ final=True, errorhandler=state.decode_error_handler, ud_handler=unicodedata_handler) - if first_escape_error_char is not None: - msg = "invalid escape sequence '%s'" - try: - space.warn(space.newtext(msg % first_escape_error_char), space.w_DeprecationWarning) - except OperationError as e: - if e.match(space, space.w_DeprecationWarning): - raise oefmt(space.w_SyntaxError, msg, first_escape_error_char) - else: - raise return s, ulen, blen def decode_raw_unicode_escape(space, string): From pypy.commits at gmail.com Fri Sep 20 04:18:52 2019 From: pypy.commits at gmail.com (mattip) Date: Fri, 20 Sep 2019 01:18:52 -0700 (PDT) Subject: [pypy-commit] pypy default: Updates from review Message-ID: <5d848b6c.1c69fb81.51636.80da@mx.google.com> Author: Matti Picus Branch: Changeset: r97561:ff708db85023 Date: 2019-09-20 11:18 +0300 http://bitbucket.org/pypy/pypy/changeset/ff708db85023/ Log: Updates from review diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst --- a/pypy/doc/release-v7.2.0.rst +++ b/pypy/doc/release-v7.2.0.rst @@ -14,21 +14,23 @@ The interpreters are based on much the same codebase, thus the double release. +With the support of ARM Holdings Ltd. and `Crossbar.io`_, this release supports +the 64-bit ``aarch64`` ARM architecture. More about the work and the +performance data around this welcome development can be found in the `blog +post`_. + This release removes the "beta" tag from PyPy3.6. While there may still be some small corner-case incompatibilities (around the exact error messages in exceptions and the handling of faulty codec errorhandlers) we are happy with the quality of the 3.6 series and are looking forward to working on a Python 3.7 interpreter. -With the support of the ARM foundation, this release supports the 64-bit -``aarch64`` ARM architecture. - We updated our benchmark runner at https://speed.pypy.org to a more modern machine and updated the baseline python to CPython 2.7.11. Thanks to `Baroque -Software` for maintaining the benchmark runner. +Software`_ for maintaining the benchmark runner. The CFFI-based ``_ssl`` module was backported to PyPy2.7 and updated to use -`cryptography`_ version 2.7. Additionally the `_hashlib`, and ``crypt`` (or +cryptography_ version 2.7. Additionally the ``_hashlib``, and ``crypt`` (or ``_crypt`` on Python3) modules were converted to CFFI. This has two consequences. End users and packagers can more easily update these libraries for their platform by executing ``(cd lib_pypy; ../bin/pypy _*_build.py)``. @@ -76,6 +78,9 @@ .. _`Baroque Software`: https://baroquesoftware.com .. _Anvil: https://anvil.works .. _`PyPy Sandbox`: https://morepypy.blogspot.com/2019/08 +.. _`Crossbar.io`: https://crossbario.com +.. _`blog post`: https://morepypy.blogspot.com/2019/07/pypy-jit-for-aarch64.html +.. _cryptography: https://cryptography.io/en/latest What is PyPy? ============= @@ -154,7 +159,7 @@ * Cleanup ``optimizeopt`` * Support the ``z15`` variant of the ``s390x`` CPU. * Fixes to ``_ctypes`` handling of memoryviews -* Fix a shadowstack overflow when using ``sys.setrecurtionlimit`` (`issue 2722`) +* Fix a shadowstack overflow when using ``sys.setrecursionlimit`` (`issue 2722`) * Fix a bug that prevent memory-tracking in vmprof working on PyPy * Improve the speed and memory use of the ``_pypyjson`` JSON decoder. The resulting dictionaries that come out of the JSON decoder have faster lookups too From pypy.commits at gmail.com Fri Sep 20 05:24:04 2019 From: pypy.commits at gmail.com (mattip) Date: Fri, 20 Sep 2019 02:24:04 -0700 (PDT) Subject: [pypy-commit] pypy default: test that pycparser is latest version Message-ID: <5d849ab4.1c69fb81.e555d.6071@mx.google.com> Author: Matti Picus Branch: Changeset: r97562:bcb0c566c840 Date: 2019-09-20 12:21 +0300 http://bitbucket.org/pypy/pypy/changeset/bcb0c566c840/ Log: test that pycparser is latest version diff --git a/extra_tests/cffi_tests/test_egg_version.py b/extra_tests/cffi_tests/test_version.py rename from extra_tests/cffi_tests/test_egg_version.py rename to extra_tests/cffi_tests/test_version.py --- a/extra_tests/cffi_tests/test_egg_version.py +++ b/extra_tests/cffi_tests/test_version.py @@ -1,6 +1,7 @@ from email.parser import Parser import py +import urllib2 import cffi import pypy @@ -10,3 +11,12 @@ def test_egg_version(): info = Parser().parsestr(egg_info.read()) assert info['version'] == cffi.__version__ + +def test_pycparser_version(): + url = 'https://raw.githubusercontent.com/eliben/pycparser/master/pycparser/__init__.py' + source = urllib2.urlopen(url).read() + dest = py.path.local(__file__).join('..', '..', '..', 'lib_pypy', 'cffi', + '_pycparser', '__init__.py').read() + # if this fails, the vendored pycparser is not the latest version + assert source.strip() == dest.strip() + From pypy.commits at gmail.com Fri Sep 20 05:24:06 2019 From: pypy.commits at gmail.com (mattip) Date: Fri, 20 Sep 2019 02:24:06 -0700 (PDT) Subject: [pypy-commit] pypy default: update pycparser to latest version Message-ID: <5d849ab6.1c69fb81.67fdd.5b0c@mx.google.com> Author: Matti Picus Branch: Changeset: r97563:af4a8595c924 Date: 2019-09-20 12:20 +0300 http://bitbucket.org/pypy/pypy/changeset/af4a8595c924/ Log: update pycparser to latest version diff too long, truncating to 2000 out of 8412 lines diff --git a/lib_pypy/cffi/_pycparser/__init__.py b/lib_pypy/cffi/_pycparser/__init__.py --- a/lib_pypy/cffi/_pycparser/__init__.py +++ b/lib_pypy/cffi/_pycparser/__init__.py @@ -4,12 +4,14 @@ # This package file exports some convenience functions for # interacting with pycparser # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- __all__ = ['c_lexer', 'c_parser', 'c_ast'] -__version__ = '2.14' +__version__ = '2.19' +import io +from subprocess import check_output from .c_parser import CParser @@ -27,7 +29,6 @@ When successful, returns the preprocessed file's contents. Errors from cpp will be printed out. """ - from subprocess import Popen, PIPE path_list = [cpp_path] if isinstance(cpp_args, list): path_list += cpp_args @@ -38,11 +39,7 @@ try: # Note the use of universal_newlines to treat all newlines # as \n for Python's purpose - # - pipe = Popen( path_list, - stdout=PIPE, - universal_newlines=True) - text = pipe.communicate()[0] + text = check_output(path_list, universal_newlines=True) except OSError as e: raise RuntimeError("Unable to invoke 'cpp'. " + 'Make sure its path was passed correctly\n' + @@ -85,7 +82,7 @@ if use_cpp: text = preprocess_file(filename, cpp_path, cpp_args) else: - with open(filename, 'rU') as f: + with io.open(filename) as f: text = f.read() if parser is None: diff --git a/lib_pypy/cffi/_pycparser/_ast_gen.py b/lib_pypy/cffi/_pycparser/_ast_gen.py --- a/lib_pypy/cffi/_pycparser/_ast_gen.py +++ b/lib_pypy/cffi/_pycparser/_ast_gen.py @@ -7,7 +7,7 @@ # The design of this module was inspired by astgen.py from the # Python 2.5 code-base. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- import pprint @@ -63,6 +63,7 @@ contents: a list of contents - attributes and child nodes See comment at the top of the configuration file for details. """ + def __init__(self, name, contents): self.name = name self.all_entries = [] @@ -84,6 +85,8 @@ def generate_source(self): src = self._gen_init() src += '\n' + self._gen_children() + src += '\n' + self._gen_iter() + src += '\n' + self._gen_attr_names() return src @@ -131,6 +134,33 @@ return src + def _gen_iter(self): + src = ' def __iter__(self):\n' + + if self.all_entries: + for child in self.child: + src += ( + ' if self.%(child)s is not None:\n' + + ' yield self.%(child)s\n') % (dict(child=child)) + + for seq_child in self.seq_child: + src += ( + ' for child in (self.%(child)s or []):\n' + ' yield child\n') % (dict(child=seq_child)) + + if not (self.child or self.seq_child): + # Empty generator + src += ( + ' return\n' + + ' yield\n') + else: + # Empty generator + src += ( + ' return\n' + + ' yield\n') + + return src + def _gen_attr_names(self): src = " attr_names = (" + ''.join("%r, " % nm for nm in self.attr) + ')' return src @@ -150,7 +180,7 @@ # # AST Node classes. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- @@ -159,11 +189,38 @@ _PROLOGUE_CODE = r''' import sys +def _repr(obj): + """ + Get the representation of an object, with dedicated pprint-like format for lists. + """ + if isinstance(obj, list): + return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' + else: + return repr(obj) class Node(object): __slots__ = () """ Abstract base class for AST nodes. """ + def __repr__(self): + """ Generates a python representation of the current node + """ + result = self.__class__.__name__ + '(' + + indent = '' + separator = '' + for name in self.__slots__[:-2]: + result += separator + result += indent + result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) + + separator = ',' + indent = '\n ' + (' ' * len(self.__class__.__name__)) + + result += indent + ')' + + return result + def children(self): """ A sequence of all children that are Nodes """ @@ -253,26 +310,29 @@ * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) """ + + _method_cache = None + def visit(self, node): """ Visit a node. """ - method = 'visit_' + node.__class__.__name__ - visitor = getattr(self, method, self.generic_visit) + + if self._method_cache is None: + self._method_cache = {} + + visitor = self._method_cache.get(node.__class__.__name__, None) + if visitor is None: + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + self._method_cache[node.__class__.__name__] = visitor + return visitor(node) def generic_visit(self, node): """ Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. """ - for c_name, c in node.children(): + for c in node: self.visit(c) - ''' - - -if __name__ == "__main__": - import sys - ast_gen = ASTCodeGenerator('_c_ast.cfg') - ast_gen.generate(open('c_ast.py', 'w')) - diff --git a/lib_pypy/cffi/_pycparser/_build_tables.py b/lib_pypy/cffi/_pycparser/_build_tables.py --- a/lib_pypy/cffi/_pycparser/_build_tables.py +++ b/lib_pypy/cffi/_pycparser/_build_tables.py @@ -6,17 +6,21 @@ # Also generates AST code from the configuration file. # Should be called from the pycparser directory. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- +# Insert '.' and '..' as first entries to the search path for modules. +# Restricted environments like embeddable python do not include the +# current working directory on startup. +import sys +sys.path[0:0] = ['.', '..'] + # Generate c_ast.py from _ast_gen import ASTCodeGenerator ast_gen = ASTCodeGenerator('_c_ast.cfg') ast_gen.generate(open('c_ast.py', 'w')) -import sys -sys.path[0:0] = ['.', '..'] from pycparser import c_parser # Generates the tables diff --git a/lib_pypy/cffi/_pycparser/ast_transforms.py b/lib_pypy/cffi/_pycparser/ast_transforms.py --- a/lib_pypy/cffi/_pycparser/ast_transforms.py +++ b/lib_pypy/cffi/_pycparser/ast_transforms.py @@ -3,7 +3,7 @@ # # Some utilities used by the parser to create a friendlier AST. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ @@ -43,7 +43,7 @@ Default: break - The goal of this transform it to fix this mess, turning it into the + The goal of this transform is to fix this mess, turning it into the following: Switch @@ -74,7 +74,8 @@ # Goes over the children of the Compound below the Switch, adding them # either directly below new_compound or below the last Case as appropriate - for child in switch_node.stmt.block_items: + # (for `switch(cond) {}`, block_items would have been None) + for child in (switch_node.stmt.block_items or []): if isinstance(child, (c_ast.Case, c_ast.Default)): # If it's a Case/Default: # 1. Add it to the Compound and mark as "last case" diff --git a/lib_pypy/cffi/_pycparser/c_ast.py b/lib_pypy/cffi/_pycparser/c_ast.py --- a/lib_pypy/cffi/_pycparser/c_ast.py +++ b/lib_pypy/cffi/_pycparser/c_ast.py @@ -11,18 +11,45 @@ # # AST Node classes. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- import sys +def _repr(obj): + """ + Get the representation of an object, with dedicated pprint-like format for lists. + """ + if isinstance(obj, list): + return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' + else: + return repr(obj) class Node(object): __slots__ = () """ Abstract base class for AST nodes. """ + def __repr__(self): + """ Generates a python representation of the current node + """ + result = self.__class__.__name__ + '(' + + indent = '' + separator = '' + for name in self.__slots__[:-2]: + result += separator + result += indent + result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) + + separator = ',' + indent = '\n ' + (' ' * len(self.__class__.__name__)) + + result += indent + ')' + + return result + def children(self): """ A sequence of all children that are Nodes """ @@ -112,21 +139,31 @@ * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) """ + + _method_cache = None + def visit(self, node): """ Visit a node. """ - method = 'visit_' + node.__class__.__name__ - visitor = getattr(self, method, self.generic_visit) + + if self._method_cache is None: + self._method_cache = {} + + visitor = self._method_cache.get(node.__class__.__name__, None) + if visitor is None: + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + self._method_cache[node.__class__.__name__] = visitor + return visitor(node) def generic_visit(self, node): """ Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. """ - for c_name, c in node.children(): + for c in node: self.visit(c) - class ArrayDecl(Node): __slots__ = ('type', 'dim', 'dim_quals', 'coord', '__weakref__') def __init__(self, type, dim, dim_quals, coord=None): @@ -141,6 +178,12 @@ if self.dim is not None: nodelist.append(("dim", self.dim)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + if self.dim is not None: + yield self.dim + attr_names = ('dim_quals', ) class ArrayRef(Node): @@ -156,6 +199,12 @@ if self.subscript is not None: nodelist.append(("subscript", self.subscript)) return tuple(nodelist) + def __iter__(self): + if self.name is not None: + yield self.name + if self.subscript is not None: + yield self.subscript + attr_names = () class Assignment(Node): @@ -172,6 +221,12 @@ if self.rvalue is not None: nodelist.append(("rvalue", self.rvalue)) return tuple(nodelist) + def __iter__(self): + if self.lvalue is not None: + yield self.lvalue + if self.rvalue is not None: + yield self.rvalue + attr_names = ('op', ) class BinaryOp(Node): @@ -188,6 +243,12 @@ if self.right is not None: nodelist.append(("right", self.right)) return tuple(nodelist) + def __iter__(self): + if self.left is not None: + yield self.left + if self.right is not None: + yield self.right + attr_names = ('op', ) class Break(Node): @@ -198,6 +259,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class Case(Node): @@ -214,6 +279,12 @@ nodelist.append(("stmts[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + for child in (self.stmts or []): + yield child + attr_names = () class Cast(Node): @@ -229,6 +300,12 @@ if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) + def __iter__(self): + if self.to_type is not None: + yield self.to_type + if self.expr is not None: + yield self.expr + attr_names = () class Compound(Node): @@ -243,6 +320,10 @@ nodelist.append(("block_items[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.block_items or []): + yield child + attr_names = () class CompoundLiteral(Node): @@ -258,6 +339,12 @@ if self.init is not None: nodelist.append(("init", self.init)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + if self.init is not None: + yield self.init + attr_names = () class Constant(Node): @@ -271,6 +358,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('type', 'value', ) class Continue(Node): @@ -281,6 +372,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class Decl(Node): @@ -302,6 +397,14 @@ if self.bitsize is not None: nodelist.append(("bitsize", self.bitsize)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + if self.init is not None: + yield self.init + if self.bitsize is not None: + yield self.bitsize + attr_names = ('name', 'quals', 'storage', 'funcspec', ) class DeclList(Node): @@ -316,6 +419,10 @@ nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.decls or []): + yield child + attr_names = () class Default(Node): @@ -330,6 +437,10 @@ nodelist.append(("stmts[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.stmts or []): + yield child + attr_names = () class DoWhile(Node): @@ -345,6 +456,12 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + attr_names = () class EllipsisParam(Node): @@ -355,6 +472,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class EmptyStatement(Node): @@ -365,6 +486,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class Enum(Node): @@ -379,6 +504,10 @@ if self.values is not None: nodelist.append(("values", self.values)) return tuple(nodelist) + def __iter__(self): + if self.values is not None: + yield self.values + attr_names = ('name', ) class Enumerator(Node): @@ -393,6 +522,10 @@ if self.value is not None: nodelist.append(("value", self.value)) return tuple(nodelist) + def __iter__(self): + if self.value is not None: + yield self.value + attr_names = ('name', ) class EnumeratorList(Node): @@ -407,6 +540,10 @@ nodelist.append(("enumerators[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.enumerators or []): + yield child + attr_names = () class ExprList(Node): @@ -421,6 +558,10 @@ nodelist.append(("exprs[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.exprs or []): + yield child + attr_names = () class FileAST(Node): @@ -435,6 +576,10 @@ nodelist.append(("ext[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.ext or []): + yield child + attr_names = () class For(Node): @@ -454,6 +599,16 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.init is not None: + yield self.init + if self.cond is not None: + yield self.cond + if self.next is not None: + yield self.next + if self.stmt is not None: + yield self.stmt + attr_names = () class FuncCall(Node): @@ -469,6 +624,12 @@ if self.args is not None: nodelist.append(("args", self.args)) return tuple(nodelist) + def __iter__(self): + if self.name is not None: + yield self.name + if self.args is not None: + yield self.args + attr_names = () class FuncDecl(Node): @@ -484,6 +645,12 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.args is not None: + yield self.args + if self.type is not None: + yield self.type + attr_names = () class FuncDef(Node): @@ -502,6 +669,14 @@ nodelist.append(("param_decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + if self.decl is not None: + yield self.decl + if self.body is not None: + yield self.body + for child in (self.param_decls or []): + yield child + attr_names = () class Goto(Node): @@ -514,6 +689,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('name', ) class ID(Node): @@ -526,6 +705,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('name', ) class IdentifierType(Node): @@ -538,6 +721,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('names', ) class If(Node): @@ -555,6 +742,14 @@ if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.iftrue is not None: + yield self.iftrue + if self.iffalse is not None: + yield self.iffalse + attr_names = () class InitList(Node): @@ -569,6 +764,10 @@ nodelist.append(("exprs[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.exprs or []): + yield child + attr_names = () class Label(Node): @@ -583,6 +782,10 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.stmt is not None: + yield self.stmt + attr_names = ('name', ) class NamedInitializer(Node): @@ -599,6 +802,12 @@ nodelist.append(("name[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + for child in (self.name or []): + yield child + attr_names = () class ParamList(Node): @@ -613,6 +822,10 @@ nodelist.append(("params[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.params or []): + yield child + attr_names = () class PtrDecl(Node): @@ -627,6 +840,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('quals', ) class Return(Node): @@ -640,6 +857,10 @@ if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + attr_names = () class Struct(Node): @@ -655,6 +876,10 @@ nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.decls or []): + yield child + attr_names = ('name', ) class StructRef(Node): @@ -671,6 +896,12 @@ if self.field is not None: nodelist.append(("field", self.field)) return tuple(nodelist) + def __iter__(self): + if self.name is not None: + yield self.name + if self.field is not None: + yield self.field + attr_names = ('type', ) class Switch(Node): @@ -686,6 +917,12 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + attr_names = () class TernaryOp(Node): @@ -703,6 +940,14 @@ if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.iftrue is not None: + yield self.iftrue + if self.iffalse is not None: + yield self.iffalse + attr_names = () class TypeDecl(Node): @@ -718,6 +963,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('declname', 'quals', ) class Typedef(Node): @@ -734,6 +983,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('name', 'quals', 'storage', ) class Typename(Node): @@ -749,6 +1002,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('name', 'quals', ) class UnaryOp(Node): @@ -763,6 +1020,10 @@ if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + attr_names = ('op', ) class Union(Node): @@ -778,6 +1039,10 @@ nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.decls or []): + yield child + attr_names = ('name', ) class While(Node): @@ -793,5 +1058,27 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + attr_names = () +class Pragma(Node): + __slots__ = ('string', 'coord', '__weakref__') + def __init__(self, string, coord=None): + self.string = string + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('string', ) + diff --git a/lib_pypy/cffi/_pycparser/c_generator.py b/lib_pypy/cffi/_pycparser/c_generator.py --- a/lib_pypy/cffi/_pycparser/c_generator.py +++ b/lib_pypy/cffi/_pycparser/c_generator.py @@ -3,7 +3,7 @@ # # C code generator from pycparser AST nodes. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ from . import c_ast @@ -40,6 +40,12 @@ def visit_ID(self, n): return n.name + def visit_Pragma(self, n): + ret = '#pragma' + if n.string: + ret += ' ' + n.string + return ret + def visit_ArrayRef(self, n): arrref = self._parenthesize_unless_simple(n.name) return arrref + '[' + self.visit(n.subscript) + ']' @@ -113,7 +119,7 @@ return s def visit_Cast(self, n): - s = '(' + self._generate_type(n.to_type) + ')' + s = '(' + self._generate_type(n.to_type, emit_declname=False) + ')' return s + ' ' + self._parenthesize_unless_simple(n.expr) def visit_ExprList(self, n): @@ -129,18 +135,20 @@ return ', '.join(visited_subexprs) def visit_Enum(self, n): - s = 'enum' - if n.name: s += ' ' + n.name - if n.values: - s += ' {' - for i, enumerator in enumerate(n.values.enumerators): - s += enumerator.name - if enumerator.value: - s += ' = ' + self.visit(enumerator.value) - if i != len(n.values.enumerators) - 1: - s += ', ' - s += '}' - return s + return self._generate_struct_union_enum(n, name='enum') + + def visit_Enumerator(self, n): + if not n.value: + return '{indent}{name},\n'.format( + indent=self._make_indent(), + name=n.name, + ) + else: + return '{indent}{name} = {value},\n'.format( + indent=self._make_indent(), + name=n.name, + value=self.visit(n.value), + ) def visit_FuncDef(self, n): decl = self.visit(n.decl) @@ -157,6 +165,8 @@ for ext in n.ext: if isinstance(ext, c_ast.FuncDef): s += self.visit(ext) + elif isinstance(ext, c_ast.Pragma): + s += self.visit(ext) + '\n' else: s += self.visit(ext) + ';\n' return s @@ -170,6 +180,10 @@ s += self._make_indent() + '}\n' return s + def visit_CompoundLiteral(self, n): + return '(' + self.visit(n.type) + '){' + self.visit(n.init) + '}' + + def visit_EmptyStatement(self, n): return ';' @@ -188,9 +202,9 @@ return 'continue;' def visit_TernaryOp(self, n): - s = self._visit_expr(n.cond) + ' ? ' - s += self._visit_expr(n.iftrue) + ' : ' - s += self._visit_expr(n.iffalse) + s = '(' + self._visit_expr(n.cond) + ') ? ' + s += '(' + self._visit_expr(n.iftrue) + ') : ' + s += '(' + self._visit_expr(n.iffalse) + ')' return s def visit_If(self, n): @@ -256,43 +270,67 @@ return '...' def visit_Struct(self, n): - return self._generate_struct_union(n, 'struct') + return self._generate_struct_union_enum(n, 'struct') def visit_Typename(self, n): return self._generate_type(n.type) def visit_Union(self, n): - return self._generate_struct_union(n, 'union') + return self._generate_struct_union_enum(n, 'union') def visit_NamedInitializer(self, n): s = '' for name in n.name: if isinstance(name, c_ast.ID): s += '.' + name.name - elif isinstance(name, c_ast.Constant): - s += '[' + name.value + ']' - s += ' = ' + self.visit(n.expr) + else: + s += '[' + self.visit(name) + ']' + s += ' = ' + self._visit_expr(n.expr) return s def visit_FuncDecl(self, n): return self._generate_type(n) - def _generate_struct_union(self, n, name): - """ Generates code for structs and unions. name should be either - 'struct' or union. + def visit_ArrayDecl(self, n): + return self._generate_type(n, emit_declname=False) + + def visit_TypeDecl(self, n): + return self._generate_type(n, emit_declname=False) + + def visit_PtrDecl(self, n): + return self._generate_type(n, emit_declname=False) + + def _generate_struct_union_enum(self, n, name): + """ Generates code for structs, unions, and enums. name should be + 'struct', 'union', or 'enum'. """ + if name in ('struct', 'union'): + members = n.decls + body_function = self._generate_struct_union_body + else: + assert name == 'enum' + members = None if n.values is None else n.values.enumerators + body_function = self._generate_enum_body s = name + ' ' + (n.name or '') - if n.decls: + if members is not None: + # None means no members + # Empty sequence means an empty list of members s += '\n' s += self._make_indent() self.indent_level += 2 s += '{\n' - for decl in n.decls: - s += self._generate_stmt(decl) + s += body_function(members) self.indent_level -= 2 s += self._make_indent() + '}' return s + def _generate_struct_union_body(self, members): + return ''.join(self._generate_stmt(decl) for decl in members) + + def _generate_enum_body(self, members): + # `[:-2] + '\n'` removes the final `,` from the enumerator list + return ''.join(self.visit(value) for value in members)[:-2] + '\n' + def _generate_stmt(self, n, add_indent=False): """ Generation from a statement node. This method exists as a wrapper for individual visit_* methods to handle different treatment of @@ -330,7 +368,7 @@ s += self._generate_type(n.type) return s - def _generate_type(self, n, modifiers=[]): + def _generate_type(self, n, modifiers=[], emit_declname = True): """ Recursive generation from a type node. n is the type node. modifiers collects the PtrDecl, ArrayDecl and FuncDecl modifiers encountered on the way down to a TypeDecl, to allow proper @@ -344,23 +382,29 @@ if n.quals: s += ' '.join(n.quals) + ' ' s += self.visit(n.type) - nstr = n.declname if n.declname else '' + nstr = n.declname if n.declname and emit_declname else '' # Resolve modifiers. # Wrap in parens to distinguish pointer to array and pointer to # function syntax. # for i, modifier in enumerate(modifiers): if isinstance(modifier, c_ast.ArrayDecl): - if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): - nstr = '(' + nstr + ')' - nstr += '[' + self.visit(modifier.dim) + ']' + if (i != 0 and + isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '[' + if modifier.dim_quals: + nstr += ' '.join(modifier.dim_quals) + ' ' + nstr += self.visit(modifier.dim) + ']' elif isinstance(modifier, c_ast.FuncDecl): - if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): - nstr = '(' + nstr + ')' + if (i != 0 and + isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' nstr += '(' + self.visit(modifier.args) + ')' elif isinstance(modifier, c_ast.PtrDecl): if modifier.quals: - nstr = '* %s %s' % (' '.join(modifier.quals), nstr) + nstr = '* %s%s' % (' '.join(modifier.quals), + ' ' + nstr if nstr else '') else: nstr = '*' + nstr if nstr: s += ' ' + nstr @@ -368,11 +412,12 @@ elif typ == c_ast.Decl: return self._generate_decl(n.type) elif typ == c_ast.Typename: - return self._generate_type(n.type) + return self._generate_type(n.type, emit_declname = emit_declname) elif typ == c_ast.IdentifierType: return ' '.join(n.names) + ' ' elif typ in (c_ast.ArrayDecl, c_ast.PtrDecl, c_ast.FuncDecl): - return self._generate_type(n.type, modifiers + [n]) + return self._generate_type(n.type, modifiers + [n], + emit_declname = emit_declname) else: return self.visit(n) @@ -395,5 +440,5 @@ """ Returns True for nodes that are "simple" - i.e. nodes that always have higher precedence than operators. """ - return isinstance(n,( c_ast.Constant, c_ast.ID, c_ast.ArrayRef, - c_ast.StructRef, c_ast.FuncCall)) + return isinstance(n, (c_ast.Constant, c_ast.ID, c_ast.ArrayRef, + c_ast.StructRef, c_ast.FuncCall)) diff --git a/lib_pypy/cffi/_pycparser/c_lexer.py b/lib_pypy/cffi/_pycparser/c_lexer.py --- a/lib_pypy/cffi/_pycparser/c_lexer.py +++ b/lib_pypy/cffi/_pycparser/c_lexer.py @@ -3,7 +3,7 @@ # # CLexer class: lexer for the C language # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ import re @@ -19,7 +19,7 @@ tokens. The public attribute filename can be set to an initial - filaneme, but the lexer will update it upon #line + filename, but the lexer will update it upon #line directives. """ def __init__(self, error_func, on_lbrace_func, on_rbrace_func, @@ -52,8 +52,8 @@ # Allow either "# line" or "# " to support GCC's # cpp output # - self.line_pattern = re.compile('([ \t]*line\W)|([ \t]*\d+)') - self.pragma_pattern = re.compile('[ \t]*pragma\W') + self.line_pattern = re.compile(r'([ \t]*line\W)|([ \t]*\d+)') + self.pragma_pattern = re.compile(r'[ \t]*pragma\W') def build(self, **kwargs): """ Builds the lexer from the specification. Must be @@ -102,11 +102,11 @@ keywords = ( '_BOOL', '_COMPLEX', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN', - 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', + 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', 'REGISTER', 'OFFSETOF', 'RESTRICT', 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', 'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID', - 'VOLATILE', 'WHILE', + 'VOLATILE', 'WHILE', '__INT128', ) keyword_map = {} @@ -171,7 +171,9 @@ 'ELLIPSIS', # pre-processor - 'PPHASH', # '#' + 'PPHASH', # '#' + 'PPPRAGMA', # 'pragma' + 'PPPRAGMASTR', ) ## @@ -203,12 +205,37 @@ # parse all correct code, even if it means to sometimes parse incorrect # code. # - simple_escape = r"""([a-zA-Z._~!=&\^\-\\?'"])""" - decimal_escape = r"""(\d+)""" - hex_escape = r"""(x[0-9a-fA-F]+)""" - bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])""" + # The original regexes were taken verbatim from the C syntax definition, + # and were later modified to avoid worst-case exponential running time. + # + # simple_escape = r"""([a-zA-Z._~!=&\^\-\\?'"])""" + # decimal_escape = r"""(\d+)""" + # hex_escape = r"""(x[0-9a-fA-F]+)""" + # bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])""" + # + # The following modifications were made to avoid the ambiguity that allowed backtracking: + # (https://github.com/eliben/pycparser/issues/61) + # + # - \x was removed from simple_escape, unless it was not followed by a hex digit, to avoid ambiguity with hex_escape. + # - hex_escape allows one or more hex characters, but requires that the next character(if any) is not hex + # - decimal_escape allows one or more decimal characters, but requires that the next character(if any) is not a decimal + # - bad_escape does not allow any decimals (8-9), to avoid conflicting with the permissive decimal_escape. + # + # Without this change, python's `re` module would recursively try parsing each ambiguous escape sequence in multiple ways. + # e.g. `\123` could be parsed as `\1`+`23`, `\12`+`3`, and `\123`. + + simple_escape = r"""([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))""" + decimal_escape = r"""(\d+)(?!\d)""" + hex_escape = r"""(x[0-9a-fA-F]+)(?![0-9a-fA-F])""" + bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-9])""" escape_sequence = r"""(\\("""+simple_escape+'|'+decimal_escape+'|'+hex_escape+'))' + + # This complicated regex with lookahead might be slow for strings, so because all of the valid escapes (including \x) allowed + # 0 or more non-escaped characters after the first character, simple_escape+decimal_escape+hex_escape got simplified to + + escape_sequence_start_in_string = r"""(\\[0-9a-zA-Z._~!=&\^\-\\?'"])""" + cconst_char = r"""([^'\\\n]|"""+escape_sequence+')' char_const = "'"+cconst_char+"'" wchar_const = 'L'+char_const @@ -216,7 +243,7 @@ bad_char_const = r"""('"""+cconst_char+"""[^'\n]+')|('')|('"""+bad_escape+r"""[^'\n]*')""" # string literals (K&R2: A.2.6) - string_char = r"""([^"\\\n]|"""+escape_sequence+')' + string_char = r"""([^"\\\n]|"""+escape_sequence_start_in_string+')' string_literal = '"'+string_char+'*"' wstring_literal = 'L'+string_literal bad_string_literal = '"'+string_char+'*'+bad_escape+string_char+'*"' @@ -274,7 +301,6 @@ def t_ppline_NEWLINE(self, t): r'\n' - if self.pp_line is None: self._error('line number missing in #line', t) else: @@ -304,15 +330,14 @@ def t_pppragma_PPPRAGMA(self, t): r'pragma' - pass + return t - t_pppragma_ignore = ' \t<>.-{}();=+-*/$%@&^~!?:,0123456789' + t_pppragma_ignore = ' \t' - @TOKEN(string_literal) - def t_pppragma_STR(self, t): pass - - @TOKEN(identifier) - def t_pppragma_ID(self, t): pass + def t_pppragma_STR(self, t): + '.+' + t.type = 'PPPRAGMASTR' + return t def t_pppragma_error(self, t): self._error('invalid #pragma directive', t) @@ -482,4 +507,3 @@ def t_error(self, t): msg = 'Illegal character %s' % repr(t.value[0]) self._error(msg, t) - diff --git a/lib_pypy/cffi/_pycparser/c_parser.py b/lib_pypy/cffi/_pycparser/c_parser.py --- a/lib_pypy/cffi/_pycparser/c_parser.py +++ b/lib_pypy/cffi/_pycparser/c_parser.py @@ -3,7 +3,7 @@ # # CParser class: Parser and AST builder for the C language # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ import re @@ -12,14 +12,16 @@ from . import c_ast from .c_lexer import CLexer -from .plyparser import PLYParser, Coord, ParseError +from .plyparser import PLYParser, Coord, ParseError, parameterized, template from .ast_transforms import fix_switch_cases + at template class CParser(PLYParser): def __init__( self, lex_optimize=True, + lexer=CLexer, lextab='cffi._pycparser.lextab', yacc_optimize=True, yacctab='cffi._pycparser.yacctab', @@ -42,6 +44,10 @@ to save the re-generation of the lexer table on each run. + lexer: + Set this parameter to define the lexer to use if + you're not using the default CLexer. + lextab: Points to the lex table that's used for optimized mode. Only if you're modifying the lexer and want @@ -70,7 +76,7 @@ Set this parameter to control the location of generated lextab and yacctab files. """ - self.clex = CLexer( + self.clex = lexer( error_func=self._lex_error_func, on_lbrace_func=self._lex_on_lbrace_func, on_rbrace_func=self._lex_on_rbrace_func, @@ -86,14 +92,14 @@ 'abstract_declarator', 'assignment_expression', 'declaration_list', - 'declaration_specifiers', + 'declaration_specifiers_no_type', 'designation', 'expression', 'identifier_list', 'init_declarator_list', + 'id_init_declarator_list', 'initializer_list', 'parameter_type_list', - 'specifier_qualifier_list', 'block_item_list', 'type_qualifier_list', 'struct_declarator_list' @@ -342,7 +348,7 @@ coord=typename[0].coord) return decl - def _add_declaration_specifier(self, declspec, newspec, kind): + def _add_declaration_specifier(self, declspec, newspec, kind, append=False): """ Declaration specifiers are represented by a dictionary with the entries: * qual: a list of type qualifiers @@ -352,11 +358,18 @@ This method is given a declaration specifier, and a new specifier of a given kind. + If `append` is True, the new specifier is added to the end of + the specifiers list, otherwise it's added at the beginning. Returns the declaration specifier, with the new specifier incorporated. """ spec = declspec or dict(qual=[], storage=[], type=[], function=[]) - spec[kind].insert(0, newspec) + + if append: + spec[kind].append(newspec) + else: + spec[kind].insert(0, newspec) + return spec def _build_declarations(self, spec, decls, typedef_namespace=False): @@ -516,8 +529,7 @@ def p_translation_unit_2(self, p): """ translation_unit : translation_unit external_declaration """ - if p[2] is not None: - p[1].extend(p[2]) + p[1].extend(p[2]) p[0] = p[1] # Declarations always come as lists (because they can be @@ -537,32 +549,42 @@ def p_external_declaration_3(self, p): """ external_declaration : pp_directive + | pppragma_directive """ - p[0] = p[1] + p[0] = [p[1]] def p_external_declaration_4(self, p): """ external_declaration : SEMI """ - p[0] = None + p[0] = [] def p_pp_directive(self, p): """ pp_directive : PPHASH """ self._parse_error('Directives not supported yet', - self._coord(p.lineno(1))) + self._token_coord(p, 1)) + + def p_pppragma_directive(self, p): + """ pppragma_directive : PPPRAGMA + | PPPRAGMA PPPRAGMASTR + """ + if len(p) == 3: + p[0] = c_ast.Pragma(p[2], self._token_coord(p, 2)) + else: + p[0] = c_ast.Pragma("", self._token_coord(p, 1)) # In function definitions, the declarator can be followed by # a declaration list, for old "K&R style" function definitios. # def p_function_definition_1(self, p): - """ function_definition : declarator declaration_list_opt compound_statement + """ function_definition : id_declarator declaration_list_opt compound_statement """ # no declaration specifiers - 'int' becomes the default type spec = dict( qual=[], storage=[], type=[c_ast.IdentifierType(['int'], - coord=self._coord(p.lineno(1)))], + coord=self._token_coord(p, 1))], function=[]) p[0] = self._build_function_definition( @@ -572,7 +594,7 @@ body=p[3]) def p_function_definition_2(self, p): - """ function_definition : declaration_specifiers declarator declaration_list_opt compound_statement + """ function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement """ spec = p[1] @@ -589,9 +611,63 @@ | selection_statement | iteration_statement | jump_statement + | pppragma_directive """ p[0] = p[1] + # A pragma is generally considered a decorator rather than an actual statement. + # Still, for the purposes of analyzing an abstract syntax tree of C code, + # pragma's should not be ignored and were previously treated as a statement. + # This presents a problem for constructs that take a statement such as labeled_statements, + # selection_statements, and iteration_statements, causing a misleading structure + # in the AST. For example, consider the following C code. + # + # for (int i = 0; i < 3; i++) + # #pragma omp critical + # sum += 1; + # + # This code will compile and execute "sum += 1;" as the body of the for loop. + # Previous implementations of PyCParser would render the AST for this + # block of code as follows: + # + # For: + # DeclList: + # Decl: i, [], [], [] + # TypeDecl: i, [] + # IdentifierType: ['int'] + # Constant: int, 0 + # BinaryOp: < + # ID: i + # Constant: int, 3 + # UnaryOp: p++ + # ID: i + # Pragma: omp critical + # Assignment: += + # ID: sum + # Constant: int, 1 + # + # This AST misleadingly takes the Pragma as the body of the loop and the + # assignment then becomes a sibling of the loop. + # + # To solve edge cases like these, the pragmacomp_or_statement rule groups + # a pragma and its following statement (which would otherwise be orphaned) + # using a compound block, effectively turning the above code into: + # + # for (int i = 0; i < 3; i++) { + # #pragma omp critical + # sum += 1; + # } + def p_pragmacomp_or_statement(self, p): + """ pragmacomp_or_statement : pppragma_directive statement + | statement + """ + if isinstance(p[1], c_ast.Pragma) and len(p) == 3: + p[0] = c_ast.Compound( + block_items=[p[1], p[2]], + coord=self._token_coord(p, 1)) + else: + p[0] = p[1] + # In C, declarations can come several in a line: # int x, *px, romulo = 5; # @@ -603,6 +679,7 @@ # def p_decl_body(self, p): """ decl_body : declaration_specifiers init_declarator_list_opt + | declaration_specifiers_no_type id_init_declarator_list_opt """ spec = p[1] @@ -675,26 +752,58 @@ """ p[0] = p[1] if len(p) == 2 else p[1] + p[2] - def p_declaration_specifiers_1(self, p): - """ declaration_specifiers : type_qualifier declaration_specifiers_opt + # To know when declaration-specifiers end and declarators begin, + # we require declaration-specifiers to have at least one + # type-specifier, and disallow typedef-names after we've seen any + # type-specifier. These are both required by the spec. + # + def p_declaration_specifiers_no_type_1(self, p): + """ declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'qual') - def p_declaration_specifiers_2(self, p): - """ declaration_specifiers : type_specifier declaration_specifiers_opt - """ - p[0] = self._add_declaration_specifier(p[2], p[1], 'type') - - def p_declaration_specifiers_3(self, p): - """ declaration_specifiers : storage_class_specifier declaration_specifiers_opt + def p_declaration_specifiers_no_type_2(self, p): + """ declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'storage') - def p_declaration_specifiers_4(self, p): - """ declaration_specifiers : function_specifier declaration_specifiers_opt + def p_declaration_specifiers_no_type_3(self, p): + """ declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'function') + + def p_declaration_specifiers_1(self, p): + """ declaration_specifiers : declaration_specifiers type_qualifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_declaration_specifiers_2(self, p): + """ declaration_specifiers : declaration_specifiers storage_class_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'storage', append=True) + + def p_declaration_specifiers_3(self, p): + """ declaration_specifiers : declaration_specifiers function_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'function', append=True) + + def p_declaration_specifiers_4(self, p): + """ declaration_specifiers : declaration_specifiers type_specifier_no_typeid + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_declaration_specifiers_5(self, p): + """ declaration_specifiers : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_declaration_specifiers_6(self, p): + """ declaration_specifiers : declaration_specifiers_no_type type_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_storage_class_specifier(self, p): """ storage_class_specifier : AUTO | REGISTER @@ -709,25 +818,27 @@ """ p[0] = p[1] - def p_type_specifier_1(self, p): - """ type_specifier : VOID - | _BOOL - | CHAR - | SHORT - | INT - | LONG - | FLOAT - | DOUBLE - | _COMPLEX - | SIGNED - | UNSIGNED + def p_type_specifier_no_typeid(self, p): + """ type_specifier_no_typeid : VOID + | _BOOL + | CHAR + | SHORT + | INT + | LONG + | FLOAT + | DOUBLE + | _COMPLEX + | SIGNED + | UNSIGNED + | __INT128 """ - p[0] = c_ast.IdentifierType([p[1]], coord=self._coord(p.lineno(1))) + p[0] = c_ast.IdentifierType([p[1]], coord=self._token_coord(p, 1)) - def p_type_specifier_2(self, p): + def p_type_specifier(self, p): """ type_specifier : typedef_name | enum_specifier | struct_or_union_specifier + | type_specifier_no_typeid """ p[0] = p[1] @@ -738,30 +849,12 @@ """ p[0] = p[1] - def p_init_declarator_list_1(self, p): + def p_init_declarator_list(self, p): """ init_declarator_list : init_declarator | init_declarator_list COMMA init_declarator """ p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] - # If the code is declaring a variable that was declared a typedef in an - # outer scope, yacc will think the name is part of declaration_specifiers, - # not init_declarator, and will then get confused by EQUALS. Pass None - # up in place of declarator, and handle this at a higher level. - # - def p_init_declarator_list_2(self, p): - """ init_declarator_list : EQUALS initializer - """ - p[0] = [dict(decl=None, init=p[2])] - - # Similarly, if the code contains duplicate typedefs of, for example, - # array types, the array portion will appear as an abstract declarator. - # - def p_init_declarator_list_3(self, p): - """ init_declarator_list : abstract_declarator - """ - p[0] = [dict(decl=p[1], init=None)] - # Returns a {decl= : init=} dictionary # If there's no initializer, uses None # @@ -771,15 +864,40 @@ """ p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + def p_id_init_declarator_list(self, p): + """ id_init_declarator_list : id_init_declarator + | id_init_declarator_list COMMA init_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + def p_id_init_declarator(self, p): + """ id_init_declarator : id_declarator + | id_declarator EQUALS initializer + """ + p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + + # Require at least one type specifier in a specifier-qualifier-list + # def p_specifier_qualifier_list_1(self, p): - """ specifier_qualifier_list : type_qualifier specifier_qualifier_list_opt + """ specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid """ - p[0] = self._add_declaration_specifier(p[2], p[1], 'qual') + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) def p_specifier_qualifier_list_2(self, p): - """ specifier_qualifier_list : type_specifier specifier_qualifier_list_opt + """ specifier_qualifier_list : specifier_qualifier_list type_qualifier """ - p[0] = self._add_declaration_specifier(p[2], p[1], 'type') + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_specifier_qualifier_list_3(self, p): + """ specifier_qualifier_list : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_specifier_qualifier_list_4(self, p): + """ specifier_qualifier_list : type_qualifier_list type_specifier + """ + spec = dict(qual=p[1], storage=[], type=[], function=[]) + p[0] = self._add_declaration_specifier(spec, p[2], 'type', append=True) # TYPEID is allowed here (and in other struct/enum related tag names), because # struct/enum tags reside in their own namespace and can be named the same as types @@ -789,29 +907,48 @@ | struct_or_union TYPEID """ klass = self._select_struct_union_class(p[1]) + # None means no list of members p[0] = klass( name=p[2], decls=None, - coord=self._coord(p.lineno(2))) + coord=self._token_coord(p, 2)) def p_struct_or_union_specifier_2(self, p): """ struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close + | struct_or_union brace_open brace_close """ klass = self._select_struct_union_class(p[1]) - p[0] = klass( - name=None, - decls=p[3], - coord=self._coord(p.lineno(2))) + if len(p) == 4: + # Empty sequence means an empty list of members + p[0] = klass( + name=None, + decls=[], + coord=self._token_coord(p, 2)) + else: + p[0] = klass( + name=None, + decls=p[3], + coord=self._token_coord(p, 2)) + def p_struct_or_union_specifier_3(self, p): """ struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close + | struct_or_union ID brace_open brace_close | struct_or_union TYPEID brace_open struct_declaration_list brace_close + | struct_or_union TYPEID brace_open brace_close """ klass = self._select_struct_union_class(p[1]) - p[0] = klass( - name=p[2], - decls=p[4], - coord=self._coord(p.lineno(2))) + if len(p) == 5: + # Empty sequence means an empty list of members + p[0] = klass( + name=p[2], + decls=[], + coord=self._token_coord(p, 2)) + else: + p[0] = klass( + name=p[2], + decls=p[4], + coord=self._token_coord(p, 2)) def p_struct_or_union(self, p): """ struct_or_union : STRUCT @@ -825,7 +962,10 @@ """ struct_declaration_list : struct_declaration | struct_declaration_list struct_declaration """ - p[0] = p[1] if len(p) == 2 else p[1] + p[2] + if len(p) == 2: + p[0] = p[1] or [] + else: + p[0] = p[1] + (p[2] or []) def p_struct_declaration_1(self, p): """ struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI @@ -866,18 +1006,14 @@ p[0] = decls def p_struct_declaration_2(self, p): - """ struct_declaration : specifier_qualifier_list abstract_declarator SEMI + """ struct_declaration : SEMI """ - # "Abstract declarator?!", you ask? Structure members can have the - # same names as typedefs. The trouble is that the member's name gets - # grouped into specifier_qualifier_list, leaving any remainder to - # appear as an abstract declarator, as in: - # typedef int Foo; - # struct { Foo Foo[3]; }; - # - p[0] = self._build_declarations( - spec=p[1], - decls=[dict(decl=p[2], init=None)]) + p[0] = None + + def p_struct_declaration_3(self, p): + """ struct_declaration : pppragma_directive + """ + p[0] = [p[1]] def p_struct_declarator_list(self, p): """ struct_declarator_list : struct_declarator @@ -906,18 +1042,18 @@ """ enum_specifier : ENUM ID | ENUM TYPEID """ - p[0] = c_ast.Enum(p[2], None, self._coord(p.lineno(1))) + p[0] = c_ast.Enum(p[2], None, self._token_coord(p, 1)) def p_enum_specifier_2(self, p): """ enum_specifier : ENUM brace_open enumerator_list brace_close """ - p[0] = c_ast.Enum(None, p[3], self._coord(p.lineno(1))) + p[0] = c_ast.Enum(None, p[3], self._token_coord(p, 1)) def p_enum_specifier_3(self, p): """ enum_specifier : ENUM ID brace_open enumerator_list brace_close | ENUM TYPEID brace_open enumerator_list brace_close """ - p[0] = c_ast.Enum(p[2], p[4], self._coord(p.lineno(1))) + p[0] = c_ast.Enum(p[2], p[4], self._token_coord(p, 1)) def p_enumerator_list(self, p): """ enumerator_list : enumerator @@ -939,56 +1075,52 @@ if len(p) == 2: enumerator = c_ast.Enumerator( p[1], None, - self._coord(p.lineno(1))) + self._token_coord(p, 1)) else: enumerator = c_ast.Enumerator( p[1], p[3], - self._coord(p.lineno(1))) + self._token_coord(p, 1)) self._add_identifier(enumerator.name, enumerator.coord) p[0] = enumerator - def p_declarator_1(self, p): - """ declarator : direct_declarator + def p_declarator(self, p): + """ declarator : id_declarator + | typeid_declarator """ p[0] = p[1] - def p_declarator_2(self, p): - """ declarator : pointer direct_declarator + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_1(self, p): + """ xxx_declarator : direct_xxx_declarator + """ + p[0] = p[1] + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_2(self, p): + """ xxx_declarator : pointer direct_xxx_declarator """ p[0] = self._type_modify_decl(p[2], p[1]) - # Since it's impossible for a type to be specified after a pointer, assume - # it's intended to be the name for this declaration. _add_identifier will - # raise an error if this TYPEID can't be redeclared. - # - def p_declarator_3(self, p): - """ declarator : pointer TYPEID - """ - decl = c_ast.TypeDecl( - declname=p[2], - type=None, - quals=None, - coord=self._coord(p.lineno(2))) - - p[0] = self._type_modify_decl(decl, p[1]) - - def p_direct_declarator_1(self, p): - """ direct_declarator : ID + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_1(self, p): + """ direct_xxx_declarator : yyy """ p[0] = c_ast.TypeDecl( declname=p[1], type=None, quals=None, - coord=self._coord(p.lineno(1))) + coord=self._token_coord(p, 1)) - def p_direct_declarator_2(self, p): - """ direct_declarator : LPAREN declarator RPAREN + @parameterized(('id', 'ID'), ('typeid', 'TYPEID')) + def p_direct_xxx_declarator_2(self, p): + """ direct_xxx_declarator : LPAREN xxx_declarator RPAREN """ p[0] = p[2] - def p_direct_declarator_3(self, p): - """ direct_declarator : direct_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_3(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET """ quals = (p[3] if len(p) > 5 else []) or [] # Accept dimension qualifiers @@ -1001,9 +1133,10 @@ p[0] = self._type_modify_decl(decl=p[1], modifier=arr) - def p_direct_declarator_4(self, p): - """ direct_declarator : direct_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET - | direct_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_4(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET + | direct_xxx_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET """ # Using slice notation for PLY objects doesn't work in Python 3 for the # version of PLY embedded with pycparser; see PLY Google Code issue 30. @@ -1022,20 +1155,22 @@ # Special for VLAs # - def p_direct_declarator_5(self, p): - """ direct_declarator : direct_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_5(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET """ arr = c_ast.ArrayDecl( type=None, - dim=c_ast.ID(p[4], self._coord(p.lineno(4))), + dim=c_ast.ID(p[4], self._token_coord(p, 4)), dim_quals=p[3] if p[3] != None else [], coord=p[1].coord) p[0] = self._type_modify_decl(decl=p[1], modifier=arr) - def p_direct_declarator_6(self, p): - """ direct_declarator : direct_declarator LPAREN parameter_type_list RPAREN - | direct_declarator LPAREN identifier_list_opt RPAREN + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_6(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LPAREN parameter_type_list RPAREN + | direct_xxx_declarator LPAREN identifier_list_opt RPAREN """ func = c_ast.FuncDecl( args=p[3], @@ -1065,7 +1200,7 @@ """ pointer : TIMES type_qualifier_list_opt | TIMES type_qualifier_list_opt pointer """ - coord = self._coord(p.lineno(1)) + coord = self._token_coord(p, 1) # Pointer decls nest from inside out. This is important when different # levels have different qualifiers. For example: # @@ -1073,7 +1208,7 @@ # # Means "pointer to const pointer to char" # - # While: + # While: # # char ** const p; # @@ -1102,7 +1237,7 @@ | parameter_list COMMA ELLIPSIS """ if len(p) > 2: - p[1].params.append(c_ast.EllipsisParam(self._coord(p.lineno(3)))) + p[1].params.append(c_ast.EllipsisParam(self._token_coord(p, 3))) From pypy.commits at gmail.com Fri Sep 20 05:48:43 2019 From: pypy.commits at gmail.com (cfbolz) Date: Fri, 20 Sep 2019 02:48:43 -0700 (PDT) Subject: [pypy-commit] pypy default: should fix the encoding errors Message-ID: <5d84a07b.1c69fb81.2cad0.720b@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97564:648820f106b9 Date: 2019-09-20 11:44 +0200 http://bitbucket.org/pypy/pypy/changeset/648820f106b9/ Log: should fix the encoding errors diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py b/pypy/module/pypyjit/test_pypy_c/test_string.py --- a/pypy/module/pypyjit/test_pypy_c/test_string.py +++ b/pypy/module/pypyjit/test_pypy_c/test_string.py @@ -224,7 +224,8 @@ def test_unicode_indexing_makes_no_bridges(self): log = self.run(""" - u = u"aaaaaä👩‍👩‍👧‍👦" * 1000 + b = b"b'aaaaa\xc3\xa4\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa7\xe2\x80\x8d\xf0\x9f\x91\xa6'" + u = b.decode("utf-8") * 1000 def main(): for j in range(10): for i in range(len(u)): @@ -271,7 +272,8 @@ def test_unicode_slicing_small_constant_indices(self): log = self.run(""" def main(n): - u = u"abä👩‍👩‍👧‍👦éé–—¿" * 1000 + b = b'ab\xc3\xa4\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa7\xe2\x80\x8d\xf0\x9f\x91\xa6' + u = b.decode("utf-8") * 1000 global s count = 0 while u: From pypy.commits at gmail.com Fri Sep 20 06:39:59 2019 From: pypy.commits at gmail.com (cfbolz) Date: Fri, 20 Sep 2019 03:39:59 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: remove usage of get_nonmovingbuffer_final_null Message-ID: <5d84ac7f.1c69fb81.c2adb.6286@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: json-decoder-maps Changeset: r97565:42f36c45bad2 Date: 2019-09-20 12:31 +0200 http://bitbucket.org/pypy/pypy/changeset/42f36c45bad2/ Log: remove usage of get_nonmovingbuffer_final_null diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -80,7 +80,7 @@ # 1) we automatically get the '\0' sentinel at the end of the string, # which means that we never have to check for the "end of string" # 2) we can pass the buffer directly to strtod - self.ll_chars, self.flag = rffi.get_nonmovingbuffer_final_null(self.s) + self.ll_chars, self.llobj, self.flag = rffi.get_nonmovingbuffer_ll_final_null(self.s) self.end_ptr = lltype.malloc(rffi.CCHARPP.TO, 1, flavor='raw') self.pos = 0 self.intcache = space.fromcache(IntCache) @@ -111,7 +111,7 @@ def close(self): - rffi.free_nonmovingbuffer(self.s, self.ll_chars, self.flag) + rffi.free_nonmovingbuffer_ll(self.ll_chars, self.llobj, self.flag) lltype.free(self.end_ptr, flavor='raw') # clean up objects that are instances of now blocked maps for w_obj in self.unclear_objects: diff --git a/pypy/module/_pypyjson/test/test_simd.py b/pypy/module/_pypyjson/test/test_simd.py --- a/pypy/module/_pypyjson/test/test_simd.py +++ b/pypy/module/_pypyjson/test/test_simd.py @@ -24,19 +24,19 @@ def string_to_word(s): assert len(s) == WORD_SIZE - ll_chars, flag = rffi.get_nonmovingbuffer_final_null(s) + ll_chars, llobj, flag = rffi.get_nonmovingbuffer_ll_final_null(s) try: wordarray = rffi.cast(rffi.ULONGP, ll_chars) return wordarray[0] finally: - rffi.free_nonmovingbuffer(s, ll_chars, flag) + rffi.free_nonmovingbuffer_ll(ll_chars, llobj, flag) def ll(callable, string, *args): - ll_chars, flag = rffi.get_nonmovingbuffer_final_null(string) + ll_chars, llobj, flag = rffi.get_nonmovingbuffer_ll_final_null(string) try: return callable(ll_chars, *args) finally: - rffi.free_nonmovingbuffer(string, ll_chars, flag) + rffi.free_nonmovingbuffer_ll(ll_chars, llobj, flag) word = strategies.builds( r_uint, strategies.integers(min_value=-sys.maxint-1, max_value=sys.maxint)) From pypy.commits at gmail.com Fri Sep 20 06:40:02 2019 From: pypy.commits at gmail.com (cfbolz) Date: Fri, 20 Sep 2019 03:40:02 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: fix bytes/WORD_SIZE confusion (thanks Armin) Message-ID: <5d84ac82.1c69fb81.257f3.4f8a@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: json-decoder-maps Changeset: r97566:3a51f8eb6272 Date: 2019-09-20 12:32 +0200 http://bitbucket.org/pypy/pypy/changeset/3a51f8eb6272/ Log: fix bytes/WORD_SIZE confusion (thanks Armin) diff --git a/pypy/module/_pypyjson/simd.py b/pypy/module/_pypyjson/simd.py --- a/pypy/module/_pypyjson/simd.py +++ b/pypy/module/_pypyjson/simd.py @@ -194,8 +194,8 @@ bits |= ord(ch) word |= ord(ch) << shift - shift += WORD_SIZE - if shift == WORD_SIZE * WORD_SIZE: + shift += 8 + if shift == WORD_SIZE * 8: strhash = intmask((1000003 * strhash) ^ word) shift = 0 word = 0 From pypy.commits at gmail.com Fri Sep 20 07:15:16 2019 From: pypy.commits at gmail.com (arigo) Date: Fri, 20 Sep 2019 04:15:16 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: Review, minor tweaks Message-ID: <5d84b4c4.1c69fb81.3e26e.56f7@mx.google.com> Author: Armin Rigo Branch: json-decoder-maps Changeset: r97567:a6922067f4ef Date: 2019-09-20 13:14 +0200 http://bitbucket.org/pypy/pypy/changeset/a6922067f4ef/ Log: Review, minor tweaks diff --git a/pypy/module/_pypyjson/simd.py b/pypy/module/_pypyjson/simd.py --- a/pypy/module/_pypyjson/simd.py +++ b/pypy/module/_pypyjson/simd.py @@ -68,9 +68,9 @@ word >>= 8 assert 0 # XXX ??? -def splice_words(word, offset, other): - mask = ((~r_uint(0)) << (8 * offset)) - return (word & mask) | (other & ~mask) +def set_high_bytes_to_zero(word, keep_bytes): + mask = ((~r_uint(0)) << (8 * keep_bytes)) + return word & ~mask @@ -107,11 +107,13 @@ # didn't find end of string yet, look at remaining chars word = 0 shift = 0 - i = 0 - for i in range(num_safe_reads * WORD_SIZE + startpos, length + 1): + i = startpos + num_safe_reads * WORD_SIZE + while True: # this loop should run at most WORD_SIZE times, + # if we assume that ll_chars[length] == '\x00' ch = ll_chars[i] if ch == '"' or ch == '\\' or ch < '\x20': break + i += 1 bits |= ord(ch) word |= ord(ch) << shift shift += 8 @@ -125,7 +127,7 @@ nonzero = index_nonzero(cond) endposition = startpos + i * WORD_SIZE + nonzero if nonzero: - word = splice_words(r_uint(0), nonzero, word) + word = set_high_bytes_to_zero(word, nonzero) bits |= word strhash = intmask((1000003 * strhash) ^ intmask(word)) @@ -149,16 +151,14 @@ bits |= word else: # didn't find end of string yet, look at remaining chars - word = 0 - shift = 0 - i = 0 - for i in range(num_safe_reads * WORD_SIZE + startpos, length + 1): + i = startpos + num_safe_reads * WORD_SIZE + while True: # this loop should run at most WORD_SIZE times, + # if we assume that ll_chars[length] == '\x00' ch = ll_chars[i] if ch == '"' or ch == '\\' or ch < '\x20': break + i += 1 bits |= ord(ch) - word |= ord(ch) << shift - shift += WORD_SIZE nonascii = bool(bits & char_repeated_word_width(chr(0x80))) return nonascii, i @@ -167,7 +167,7 @@ nonzero = index_nonzero(cond) endposition = startpos + i * WORD_SIZE + nonzero if nonzero: - word = splice_words(r_uint(0), nonzero, word) + word = set_high_bytes_to_zero(word, nonzero) bits |= word nonascii = bool(bits & char_repeated_word_width(chr(0x80))) @@ -204,15 +204,22 @@ strhash = intmask((1000003 * strhash) ^ word) return strhash, bool(bits & 0x80), i + at objectmodel.always_inline +def find_end_of_string_slow_no_hash(ll_chars, i, length): + bits = 0 + while True: + # this loop is a fast path for strings which do not contain escape + # characters + ch = ll_chars[i] + if ch == '"' or ch == '\\' or ch < '\x20': + break + i += 1 + bits |= ord(ch) + return bool(bits & 0x80), i + if USE_SIMD: find_end_of_string = find_end_of_string_simd_unaligned find_end_of_string_no_hash = find_end_of_string_simd_unaligned_no_hash else: find_end_of_string = find_end_of_string_slow - - @objectmodel.always_inline - def find_end_of_string_no_hash(ll_chars, i, length): - _, nonascii, i = find_end_of_string_slow(ll_chars, i, length) - return (nonascii, i) - - + find_end_of_string_no_hash = find_end_of_string_slow_no_hash diff --git a/pypy/module/_pypyjson/test/test_simd.py b/pypy/module/_pypyjson/test/test_simd.py --- a/pypy/module/_pypyjson/test/test_simd.py +++ b/pypy/module/_pypyjson/test/test_simd.py @@ -5,6 +5,7 @@ from pypy.module._pypyjson.simd import USE_SIMD from pypy.module._pypyjson.simd import find_end_of_string_slow +from pypy.module._pypyjson.simd import find_end_of_string_slow_no_hash from pypy.module._pypyjson.simd import print_chars from pypy.module._pypyjson.simd import find_end_of_string_simd_unaligned, WORD_SIZE from pypy.module._pypyjson.simd import find_end_of_string_simd_unaligned_no_hash @@ -74,6 +75,8 @@ (string, startindex) = a res = ll(find_end_of_string_slow, string, startindex, len(string)) hash, nonascii1, endposition1 = res + res2 = ll(find_end_of_string_slow_no_hash, string, startindex, len(string)) + assert res2 == (nonascii1, endposition1) ch = string[endposition1] assert ch == '"' or ch == '\\' or ch < '\x20' for ch in string[startindex:endposition1]: From pypy.commits at gmail.com Fri Sep 20 10:10:02 2019 From: pypy.commits at gmail.com (cfbolz) Date: Fri, 20 Sep 2019 07:10:02 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default Message-ID: <5d84ddba.1c69fb81.1c19d.c0cc@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97568:65e4ad6eb6b8 Date: 2019-09-20 12:43 +0200 http://bitbucket.org/pypy/pypy/changeset/65e4ad6eb6b8/ Log: merge default diff too long, truncating to 2000 out of 8630 lines diff --git a/extra_tests/cffi_tests/test_egg_version.py b/extra_tests/cffi_tests/test_version.py rename from extra_tests/cffi_tests/test_egg_version.py rename to extra_tests/cffi_tests/test_version.py --- a/extra_tests/cffi_tests/test_egg_version.py +++ b/extra_tests/cffi_tests/test_version.py @@ -1,6 +1,7 @@ from email.parser import Parser import py +import urllib2 import cffi import pypy @@ -10,3 +11,12 @@ def test_egg_version(): info = Parser().parsestr(egg_info.read()) assert info['version'] == cffi.__version__ + +def test_pycparser_version(): + url = 'https://raw.githubusercontent.com/eliben/pycparser/master/pycparser/__init__.py' + source = urllib2.urlopen(url).read() + dest = py.path.local(__file__).join('..', '..', '..', 'lib_pypy', 'cffi', + '_pycparser', '__init__.py').read() + # if this fails, the vendored pycparser is not the latest version + assert source.strip() == dest.strip() + diff --git a/lib_pypy/cffi/_pycparser/__init__.py b/lib_pypy/cffi/_pycparser/__init__.py --- a/lib_pypy/cffi/_pycparser/__init__.py +++ b/lib_pypy/cffi/_pycparser/__init__.py @@ -4,12 +4,14 @@ # This package file exports some convenience functions for # interacting with pycparser # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- __all__ = ['c_lexer', 'c_parser', 'c_ast'] -__version__ = '2.14' +__version__ = '2.19' +import io +from subprocess import check_output from .c_parser import CParser @@ -27,7 +29,6 @@ When successful, returns the preprocessed file's contents. Errors from cpp will be printed out. """ - from subprocess import Popen, PIPE path_list = [cpp_path] if isinstance(cpp_args, list): path_list += cpp_args @@ -38,11 +39,7 @@ try: # Note the use of universal_newlines to treat all newlines # as \n for Python's purpose - # - pipe = Popen( path_list, - stdout=PIPE, - universal_newlines=True) - text = pipe.communicate()[0] + text = check_output(path_list, universal_newlines=True) except OSError as e: raise RuntimeError("Unable to invoke 'cpp'. " + 'Make sure its path was passed correctly\n' + @@ -85,7 +82,7 @@ if use_cpp: text = preprocess_file(filename, cpp_path, cpp_args) else: - with open(filename, 'rU') as f: + with io.open(filename) as f: text = f.read() if parser is None: diff --git a/lib_pypy/cffi/_pycparser/_ast_gen.py b/lib_pypy/cffi/_pycparser/_ast_gen.py --- a/lib_pypy/cffi/_pycparser/_ast_gen.py +++ b/lib_pypy/cffi/_pycparser/_ast_gen.py @@ -7,7 +7,7 @@ # The design of this module was inspired by astgen.py from the # Python 2.5 code-base. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- import pprint @@ -63,6 +63,7 @@ contents: a list of contents - attributes and child nodes See comment at the top of the configuration file for details. """ + def __init__(self, name, contents): self.name = name self.all_entries = [] @@ -84,6 +85,8 @@ def generate_source(self): src = self._gen_init() src += '\n' + self._gen_children() + src += '\n' + self._gen_iter() + src += '\n' + self._gen_attr_names() return src @@ -131,6 +134,33 @@ return src + def _gen_iter(self): + src = ' def __iter__(self):\n' + + if self.all_entries: + for child in self.child: + src += ( + ' if self.%(child)s is not None:\n' + + ' yield self.%(child)s\n') % (dict(child=child)) + + for seq_child in self.seq_child: + src += ( + ' for child in (self.%(child)s or []):\n' + ' yield child\n') % (dict(child=seq_child)) + + if not (self.child or self.seq_child): + # Empty generator + src += ( + ' return\n' + + ' yield\n') + else: + # Empty generator + src += ( + ' return\n' + + ' yield\n') + + return src + def _gen_attr_names(self): src = " attr_names = (" + ''.join("%r, " % nm for nm in self.attr) + ')' return src @@ -150,7 +180,7 @@ # # AST Node classes. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- @@ -159,11 +189,38 @@ _PROLOGUE_CODE = r''' import sys +def _repr(obj): + """ + Get the representation of an object, with dedicated pprint-like format for lists. + """ + if isinstance(obj, list): + return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' + else: + return repr(obj) class Node(object): __slots__ = () """ Abstract base class for AST nodes. """ + def __repr__(self): + """ Generates a python representation of the current node + """ + result = self.__class__.__name__ + '(' + + indent = '' + separator = '' + for name in self.__slots__[:-2]: + result += separator + result += indent + result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) + + separator = ',' + indent = '\n ' + (' ' * len(self.__class__.__name__)) + + result += indent + ')' + + return result + def children(self): """ A sequence of all children that are Nodes """ @@ -253,26 +310,29 @@ * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) """ + + _method_cache = None + def visit(self, node): """ Visit a node. """ - method = 'visit_' + node.__class__.__name__ - visitor = getattr(self, method, self.generic_visit) + + if self._method_cache is None: + self._method_cache = {} + + visitor = self._method_cache.get(node.__class__.__name__, None) + if visitor is None: + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + self._method_cache[node.__class__.__name__] = visitor + return visitor(node) def generic_visit(self, node): """ Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. """ - for c_name, c in node.children(): + for c in node: self.visit(c) - ''' - - -if __name__ == "__main__": - import sys - ast_gen = ASTCodeGenerator('_c_ast.cfg') - ast_gen.generate(open('c_ast.py', 'w')) - diff --git a/lib_pypy/cffi/_pycparser/_build_tables.py b/lib_pypy/cffi/_pycparser/_build_tables.py --- a/lib_pypy/cffi/_pycparser/_build_tables.py +++ b/lib_pypy/cffi/_pycparser/_build_tables.py @@ -6,17 +6,21 @@ # Also generates AST code from the configuration file. # Should be called from the pycparser directory. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- +# Insert '.' and '..' as first entries to the search path for modules. +# Restricted environments like embeddable python do not include the +# current working directory on startup. +import sys +sys.path[0:0] = ['.', '..'] + # Generate c_ast.py from _ast_gen import ASTCodeGenerator ast_gen = ASTCodeGenerator('_c_ast.cfg') ast_gen.generate(open('c_ast.py', 'w')) -import sys -sys.path[0:0] = ['.', '..'] from pycparser import c_parser # Generates the tables diff --git a/lib_pypy/cffi/_pycparser/ast_transforms.py b/lib_pypy/cffi/_pycparser/ast_transforms.py --- a/lib_pypy/cffi/_pycparser/ast_transforms.py +++ b/lib_pypy/cffi/_pycparser/ast_transforms.py @@ -3,7 +3,7 @@ # # Some utilities used by the parser to create a friendlier AST. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ @@ -43,7 +43,7 @@ Default: break - The goal of this transform it to fix this mess, turning it into the + The goal of this transform is to fix this mess, turning it into the following: Switch @@ -74,7 +74,8 @@ # Goes over the children of the Compound below the Switch, adding them # either directly below new_compound or below the last Case as appropriate - for child in switch_node.stmt.block_items: + # (for `switch(cond) {}`, block_items would have been None) + for child in (switch_node.stmt.block_items or []): if isinstance(child, (c_ast.Case, c_ast.Default)): # If it's a Case/Default: # 1. Add it to the Compound and mark as "last case" diff --git a/lib_pypy/cffi/_pycparser/c_ast.py b/lib_pypy/cffi/_pycparser/c_ast.py --- a/lib_pypy/cffi/_pycparser/c_ast.py +++ b/lib_pypy/cffi/_pycparser/c_ast.py @@ -11,18 +11,45 @@ # # AST Node classes. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- import sys +def _repr(obj): + """ + Get the representation of an object, with dedicated pprint-like format for lists. + """ + if isinstance(obj, list): + return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' + else: + return repr(obj) class Node(object): __slots__ = () """ Abstract base class for AST nodes. """ + def __repr__(self): + """ Generates a python representation of the current node + """ + result = self.__class__.__name__ + '(' + + indent = '' + separator = '' + for name in self.__slots__[:-2]: + result += separator + result += indent + result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) + + separator = ',' + indent = '\n ' + (' ' * len(self.__class__.__name__)) + + result += indent + ')' + + return result + def children(self): """ A sequence of all children that are Nodes """ @@ -112,21 +139,31 @@ * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) """ + + _method_cache = None + def visit(self, node): """ Visit a node. """ - method = 'visit_' + node.__class__.__name__ - visitor = getattr(self, method, self.generic_visit) + + if self._method_cache is None: + self._method_cache = {} + + visitor = self._method_cache.get(node.__class__.__name__, None) + if visitor is None: + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + self._method_cache[node.__class__.__name__] = visitor + return visitor(node) def generic_visit(self, node): """ Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. """ - for c_name, c in node.children(): + for c in node: self.visit(c) - class ArrayDecl(Node): __slots__ = ('type', 'dim', 'dim_quals', 'coord', '__weakref__') def __init__(self, type, dim, dim_quals, coord=None): @@ -141,6 +178,12 @@ if self.dim is not None: nodelist.append(("dim", self.dim)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + if self.dim is not None: + yield self.dim + attr_names = ('dim_quals', ) class ArrayRef(Node): @@ -156,6 +199,12 @@ if self.subscript is not None: nodelist.append(("subscript", self.subscript)) return tuple(nodelist) + def __iter__(self): + if self.name is not None: + yield self.name + if self.subscript is not None: + yield self.subscript + attr_names = () class Assignment(Node): @@ -172,6 +221,12 @@ if self.rvalue is not None: nodelist.append(("rvalue", self.rvalue)) return tuple(nodelist) + def __iter__(self): + if self.lvalue is not None: + yield self.lvalue + if self.rvalue is not None: + yield self.rvalue + attr_names = ('op', ) class BinaryOp(Node): @@ -188,6 +243,12 @@ if self.right is not None: nodelist.append(("right", self.right)) return tuple(nodelist) + def __iter__(self): + if self.left is not None: + yield self.left + if self.right is not None: + yield self.right + attr_names = ('op', ) class Break(Node): @@ -198,6 +259,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class Case(Node): @@ -214,6 +279,12 @@ nodelist.append(("stmts[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + for child in (self.stmts or []): + yield child + attr_names = () class Cast(Node): @@ -229,6 +300,12 @@ if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) + def __iter__(self): + if self.to_type is not None: + yield self.to_type + if self.expr is not None: + yield self.expr + attr_names = () class Compound(Node): @@ -243,6 +320,10 @@ nodelist.append(("block_items[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.block_items or []): + yield child + attr_names = () class CompoundLiteral(Node): @@ -258,6 +339,12 @@ if self.init is not None: nodelist.append(("init", self.init)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + if self.init is not None: + yield self.init + attr_names = () class Constant(Node): @@ -271,6 +358,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('type', 'value', ) class Continue(Node): @@ -281,6 +372,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class Decl(Node): @@ -302,6 +397,14 @@ if self.bitsize is not None: nodelist.append(("bitsize", self.bitsize)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + if self.init is not None: + yield self.init + if self.bitsize is not None: + yield self.bitsize + attr_names = ('name', 'quals', 'storage', 'funcspec', ) class DeclList(Node): @@ -316,6 +419,10 @@ nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.decls or []): + yield child + attr_names = () class Default(Node): @@ -330,6 +437,10 @@ nodelist.append(("stmts[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.stmts or []): + yield child + attr_names = () class DoWhile(Node): @@ -345,6 +456,12 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + attr_names = () class EllipsisParam(Node): @@ -355,6 +472,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class EmptyStatement(Node): @@ -365,6 +486,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class Enum(Node): @@ -379,6 +504,10 @@ if self.values is not None: nodelist.append(("values", self.values)) return tuple(nodelist) + def __iter__(self): + if self.values is not None: + yield self.values + attr_names = ('name', ) class Enumerator(Node): @@ -393,6 +522,10 @@ if self.value is not None: nodelist.append(("value", self.value)) return tuple(nodelist) + def __iter__(self): + if self.value is not None: + yield self.value + attr_names = ('name', ) class EnumeratorList(Node): @@ -407,6 +540,10 @@ nodelist.append(("enumerators[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.enumerators or []): + yield child + attr_names = () class ExprList(Node): @@ -421,6 +558,10 @@ nodelist.append(("exprs[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.exprs or []): + yield child + attr_names = () class FileAST(Node): @@ -435,6 +576,10 @@ nodelist.append(("ext[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.ext or []): + yield child + attr_names = () class For(Node): @@ -454,6 +599,16 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.init is not None: + yield self.init + if self.cond is not None: + yield self.cond + if self.next is not None: + yield self.next + if self.stmt is not None: + yield self.stmt + attr_names = () class FuncCall(Node): @@ -469,6 +624,12 @@ if self.args is not None: nodelist.append(("args", self.args)) return tuple(nodelist) + def __iter__(self): + if self.name is not None: + yield self.name + if self.args is not None: + yield self.args + attr_names = () class FuncDecl(Node): @@ -484,6 +645,12 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.args is not None: + yield self.args + if self.type is not None: + yield self.type + attr_names = () class FuncDef(Node): @@ -502,6 +669,14 @@ nodelist.append(("param_decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + if self.decl is not None: + yield self.decl + if self.body is not None: + yield self.body + for child in (self.param_decls or []): + yield child + attr_names = () class Goto(Node): @@ -514,6 +689,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('name', ) class ID(Node): @@ -526,6 +705,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('name', ) class IdentifierType(Node): @@ -538,6 +721,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('names', ) class If(Node): @@ -555,6 +742,14 @@ if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.iftrue is not None: + yield self.iftrue + if self.iffalse is not None: + yield self.iffalse + attr_names = () class InitList(Node): @@ -569,6 +764,10 @@ nodelist.append(("exprs[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.exprs or []): + yield child + attr_names = () class Label(Node): @@ -583,6 +782,10 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.stmt is not None: + yield self.stmt + attr_names = ('name', ) class NamedInitializer(Node): @@ -599,6 +802,12 @@ nodelist.append(("name[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + for child in (self.name or []): + yield child + attr_names = () class ParamList(Node): @@ -613,6 +822,10 @@ nodelist.append(("params[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.params or []): + yield child + attr_names = () class PtrDecl(Node): @@ -627,6 +840,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('quals', ) class Return(Node): @@ -640,6 +857,10 @@ if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + attr_names = () class Struct(Node): @@ -655,6 +876,10 @@ nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.decls or []): + yield child + attr_names = ('name', ) class StructRef(Node): @@ -671,6 +896,12 @@ if self.field is not None: nodelist.append(("field", self.field)) return tuple(nodelist) + def __iter__(self): + if self.name is not None: + yield self.name + if self.field is not None: + yield self.field + attr_names = ('type', ) class Switch(Node): @@ -686,6 +917,12 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + attr_names = () class TernaryOp(Node): @@ -703,6 +940,14 @@ if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.iftrue is not None: + yield self.iftrue + if self.iffalse is not None: + yield self.iffalse + attr_names = () class TypeDecl(Node): @@ -718,6 +963,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('declname', 'quals', ) class Typedef(Node): @@ -734,6 +983,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('name', 'quals', 'storage', ) class Typename(Node): @@ -749,6 +1002,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('name', 'quals', ) class UnaryOp(Node): @@ -763,6 +1020,10 @@ if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + attr_names = ('op', ) class Union(Node): @@ -778,6 +1039,10 @@ nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.decls or []): + yield child + attr_names = ('name', ) class While(Node): @@ -793,5 +1058,27 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + attr_names = () +class Pragma(Node): + __slots__ = ('string', 'coord', '__weakref__') + def __init__(self, string, coord=None): + self.string = string + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('string', ) + diff --git a/lib_pypy/cffi/_pycparser/c_generator.py b/lib_pypy/cffi/_pycparser/c_generator.py --- a/lib_pypy/cffi/_pycparser/c_generator.py +++ b/lib_pypy/cffi/_pycparser/c_generator.py @@ -3,7 +3,7 @@ # # C code generator from pycparser AST nodes. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ from . import c_ast @@ -40,6 +40,12 @@ def visit_ID(self, n): return n.name + def visit_Pragma(self, n): + ret = '#pragma' + if n.string: + ret += ' ' + n.string + return ret + def visit_ArrayRef(self, n): arrref = self._parenthesize_unless_simple(n.name) return arrref + '[' + self.visit(n.subscript) + ']' @@ -113,7 +119,7 @@ return s def visit_Cast(self, n): - s = '(' + self._generate_type(n.to_type) + ')' + s = '(' + self._generate_type(n.to_type, emit_declname=False) + ')' return s + ' ' + self._parenthesize_unless_simple(n.expr) def visit_ExprList(self, n): @@ -129,18 +135,20 @@ return ', '.join(visited_subexprs) def visit_Enum(self, n): - s = 'enum' - if n.name: s += ' ' + n.name - if n.values: - s += ' {' - for i, enumerator in enumerate(n.values.enumerators): - s += enumerator.name - if enumerator.value: - s += ' = ' + self.visit(enumerator.value) - if i != len(n.values.enumerators) - 1: - s += ', ' - s += '}' - return s + return self._generate_struct_union_enum(n, name='enum') + + def visit_Enumerator(self, n): + if not n.value: + return '{indent}{name},\n'.format( + indent=self._make_indent(), + name=n.name, + ) + else: + return '{indent}{name} = {value},\n'.format( + indent=self._make_indent(), + name=n.name, + value=self.visit(n.value), + ) def visit_FuncDef(self, n): decl = self.visit(n.decl) @@ -157,6 +165,8 @@ for ext in n.ext: if isinstance(ext, c_ast.FuncDef): s += self.visit(ext) + elif isinstance(ext, c_ast.Pragma): + s += self.visit(ext) + '\n' else: s += self.visit(ext) + ';\n' return s @@ -170,6 +180,10 @@ s += self._make_indent() + '}\n' return s + def visit_CompoundLiteral(self, n): + return '(' + self.visit(n.type) + '){' + self.visit(n.init) + '}' + + def visit_EmptyStatement(self, n): return ';' @@ -188,9 +202,9 @@ return 'continue;' def visit_TernaryOp(self, n): - s = self._visit_expr(n.cond) + ' ? ' - s += self._visit_expr(n.iftrue) + ' : ' - s += self._visit_expr(n.iffalse) + s = '(' + self._visit_expr(n.cond) + ') ? ' + s += '(' + self._visit_expr(n.iftrue) + ') : ' + s += '(' + self._visit_expr(n.iffalse) + ')' return s def visit_If(self, n): @@ -256,43 +270,67 @@ return '...' def visit_Struct(self, n): - return self._generate_struct_union(n, 'struct') + return self._generate_struct_union_enum(n, 'struct') def visit_Typename(self, n): return self._generate_type(n.type) def visit_Union(self, n): - return self._generate_struct_union(n, 'union') + return self._generate_struct_union_enum(n, 'union') def visit_NamedInitializer(self, n): s = '' for name in n.name: if isinstance(name, c_ast.ID): s += '.' + name.name - elif isinstance(name, c_ast.Constant): - s += '[' + name.value + ']' - s += ' = ' + self.visit(n.expr) + else: + s += '[' + self.visit(name) + ']' + s += ' = ' + self._visit_expr(n.expr) return s def visit_FuncDecl(self, n): return self._generate_type(n) - def _generate_struct_union(self, n, name): - """ Generates code for structs and unions. name should be either - 'struct' or union. + def visit_ArrayDecl(self, n): + return self._generate_type(n, emit_declname=False) + + def visit_TypeDecl(self, n): + return self._generate_type(n, emit_declname=False) + + def visit_PtrDecl(self, n): + return self._generate_type(n, emit_declname=False) + + def _generate_struct_union_enum(self, n, name): + """ Generates code for structs, unions, and enums. name should be + 'struct', 'union', or 'enum'. """ + if name in ('struct', 'union'): + members = n.decls + body_function = self._generate_struct_union_body + else: + assert name == 'enum' + members = None if n.values is None else n.values.enumerators + body_function = self._generate_enum_body s = name + ' ' + (n.name or '') - if n.decls: + if members is not None: + # None means no members + # Empty sequence means an empty list of members s += '\n' s += self._make_indent() self.indent_level += 2 s += '{\n' - for decl in n.decls: - s += self._generate_stmt(decl) + s += body_function(members) self.indent_level -= 2 s += self._make_indent() + '}' return s + def _generate_struct_union_body(self, members): + return ''.join(self._generate_stmt(decl) for decl in members) + + def _generate_enum_body(self, members): + # `[:-2] + '\n'` removes the final `,` from the enumerator list + return ''.join(self.visit(value) for value in members)[:-2] + '\n' + def _generate_stmt(self, n, add_indent=False): """ Generation from a statement node. This method exists as a wrapper for individual visit_* methods to handle different treatment of @@ -330,7 +368,7 @@ s += self._generate_type(n.type) return s - def _generate_type(self, n, modifiers=[]): + def _generate_type(self, n, modifiers=[], emit_declname = True): """ Recursive generation from a type node. n is the type node. modifiers collects the PtrDecl, ArrayDecl and FuncDecl modifiers encountered on the way down to a TypeDecl, to allow proper @@ -344,23 +382,29 @@ if n.quals: s += ' '.join(n.quals) + ' ' s += self.visit(n.type) - nstr = n.declname if n.declname else '' + nstr = n.declname if n.declname and emit_declname else '' # Resolve modifiers. # Wrap in parens to distinguish pointer to array and pointer to # function syntax. # for i, modifier in enumerate(modifiers): if isinstance(modifier, c_ast.ArrayDecl): - if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): - nstr = '(' + nstr + ')' - nstr += '[' + self.visit(modifier.dim) + ']' + if (i != 0 and + isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '[' + if modifier.dim_quals: + nstr += ' '.join(modifier.dim_quals) + ' ' + nstr += self.visit(modifier.dim) + ']' elif isinstance(modifier, c_ast.FuncDecl): - if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): - nstr = '(' + nstr + ')' + if (i != 0 and + isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' nstr += '(' + self.visit(modifier.args) + ')' elif isinstance(modifier, c_ast.PtrDecl): if modifier.quals: - nstr = '* %s %s' % (' '.join(modifier.quals), nstr) + nstr = '* %s%s' % (' '.join(modifier.quals), + ' ' + nstr if nstr else '') else: nstr = '*' + nstr if nstr: s += ' ' + nstr @@ -368,11 +412,12 @@ elif typ == c_ast.Decl: return self._generate_decl(n.type) elif typ == c_ast.Typename: - return self._generate_type(n.type) + return self._generate_type(n.type, emit_declname = emit_declname) elif typ == c_ast.IdentifierType: return ' '.join(n.names) + ' ' elif typ in (c_ast.ArrayDecl, c_ast.PtrDecl, c_ast.FuncDecl): - return self._generate_type(n.type, modifiers + [n]) + return self._generate_type(n.type, modifiers + [n], + emit_declname = emit_declname) else: return self.visit(n) @@ -395,5 +440,5 @@ """ Returns True for nodes that are "simple" - i.e. nodes that always have higher precedence than operators. """ - return isinstance(n,( c_ast.Constant, c_ast.ID, c_ast.ArrayRef, - c_ast.StructRef, c_ast.FuncCall)) + return isinstance(n, (c_ast.Constant, c_ast.ID, c_ast.ArrayRef, + c_ast.StructRef, c_ast.FuncCall)) diff --git a/lib_pypy/cffi/_pycparser/c_lexer.py b/lib_pypy/cffi/_pycparser/c_lexer.py --- a/lib_pypy/cffi/_pycparser/c_lexer.py +++ b/lib_pypy/cffi/_pycparser/c_lexer.py @@ -3,7 +3,7 @@ # # CLexer class: lexer for the C language # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ import re @@ -19,7 +19,7 @@ tokens. The public attribute filename can be set to an initial - filaneme, but the lexer will update it upon #line + filename, but the lexer will update it upon #line directives. """ def __init__(self, error_func, on_lbrace_func, on_rbrace_func, @@ -52,8 +52,8 @@ # Allow either "# line" or "# " to support GCC's # cpp output # - self.line_pattern = re.compile('([ \t]*line\W)|([ \t]*\d+)') - self.pragma_pattern = re.compile('[ \t]*pragma\W') + self.line_pattern = re.compile(r'([ \t]*line\W)|([ \t]*\d+)') + self.pragma_pattern = re.compile(r'[ \t]*pragma\W') def build(self, **kwargs): """ Builds the lexer from the specification. Must be @@ -102,11 +102,11 @@ keywords = ( '_BOOL', '_COMPLEX', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN', - 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', + 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', 'REGISTER', 'OFFSETOF', 'RESTRICT', 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', 'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID', - 'VOLATILE', 'WHILE', + 'VOLATILE', 'WHILE', '__INT128', ) keyword_map = {} @@ -171,7 +171,9 @@ 'ELLIPSIS', # pre-processor - 'PPHASH', # '#' + 'PPHASH', # '#' + 'PPPRAGMA', # 'pragma' + 'PPPRAGMASTR', ) ## @@ -203,12 +205,37 @@ # parse all correct code, even if it means to sometimes parse incorrect # code. # - simple_escape = r"""([a-zA-Z._~!=&\^\-\\?'"])""" - decimal_escape = r"""(\d+)""" - hex_escape = r"""(x[0-9a-fA-F]+)""" - bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])""" + # The original regexes were taken verbatim from the C syntax definition, + # and were later modified to avoid worst-case exponential running time. + # + # simple_escape = r"""([a-zA-Z._~!=&\^\-\\?'"])""" + # decimal_escape = r"""(\d+)""" + # hex_escape = r"""(x[0-9a-fA-F]+)""" + # bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])""" + # + # The following modifications were made to avoid the ambiguity that allowed backtracking: + # (https://github.com/eliben/pycparser/issues/61) + # + # - \x was removed from simple_escape, unless it was not followed by a hex digit, to avoid ambiguity with hex_escape. + # - hex_escape allows one or more hex characters, but requires that the next character(if any) is not hex + # - decimal_escape allows one or more decimal characters, but requires that the next character(if any) is not a decimal + # - bad_escape does not allow any decimals (8-9), to avoid conflicting with the permissive decimal_escape. + # + # Without this change, python's `re` module would recursively try parsing each ambiguous escape sequence in multiple ways. + # e.g. `\123` could be parsed as `\1`+`23`, `\12`+`3`, and `\123`. + + simple_escape = r"""([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))""" + decimal_escape = r"""(\d+)(?!\d)""" + hex_escape = r"""(x[0-9a-fA-F]+)(?![0-9a-fA-F])""" + bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-9])""" escape_sequence = r"""(\\("""+simple_escape+'|'+decimal_escape+'|'+hex_escape+'))' + + # This complicated regex with lookahead might be slow for strings, so because all of the valid escapes (including \x) allowed + # 0 or more non-escaped characters after the first character, simple_escape+decimal_escape+hex_escape got simplified to + + escape_sequence_start_in_string = r"""(\\[0-9a-zA-Z._~!=&\^\-\\?'"])""" + cconst_char = r"""([^'\\\n]|"""+escape_sequence+')' char_const = "'"+cconst_char+"'" wchar_const = 'L'+char_const @@ -216,7 +243,7 @@ bad_char_const = r"""('"""+cconst_char+"""[^'\n]+')|('')|('"""+bad_escape+r"""[^'\n]*')""" # string literals (K&R2: A.2.6) - string_char = r"""([^"\\\n]|"""+escape_sequence+')' + string_char = r"""([^"\\\n]|"""+escape_sequence_start_in_string+')' string_literal = '"'+string_char+'*"' wstring_literal = 'L'+string_literal bad_string_literal = '"'+string_char+'*'+bad_escape+string_char+'*"' @@ -274,7 +301,6 @@ def t_ppline_NEWLINE(self, t): r'\n' - if self.pp_line is None: self._error('line number missing in #line', t) else: @@ -304,15 +330,14 @@ def t_pppragma_PPPRAGMA(self, t): r'pragma' - pass + return t - t_pppragma_ignore = ' \t<>.-{}();=+-*/$%@&^~!?:,0123456789' + t_pppragma_ignore = ' \t' - @TOKEN(string_literal) - def t_pppragma_STR(self, t): pass - - @TOKEN(identifier) - def t_pppragma_ID(self, t): pass + def t_pppragma_STR(self, t): + '.+' + t.type = 'PPPRAGMASTR' + return t def t_pppragma_error(self, t): self._error('invalid #pragma directive', t) @@ -482,4 +507,3 @@ def t_error(self, t): msg = 'Illegal character %s' % repr(t.value[0]) self._error(msg, t) - diff --git a/lib_pypy/cffi/_pycparser/c_parser.py b/lib_pypy/cffi/_pycparser/c_parser.py --- a/lib_pypy/cffi/_pycparser/c_parser.py +++ b/lib_pypy/cffi/_pycparser/c_parser.py @@ -3,7 +3,7 @@ # # CParser class: Parser and AST builder for the C language # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ import re @@ -12,14 +12,16 @@ from . import c_ast from .c_lexer import CLexer -from .plyparser import PLYParser, Coord, ParseError +from .plyparser import PLYParser, Coord, ParseError, parameterized, template from .ast_transforms import fix_switch_cases + at template class CParser(PLYParser): def __init__( self, lex_optimize=True, + lexer=CLexer, lextab='cffi._pycparser.lextab', yacc_optimize=True, yacctab='cffi._pycparser.yacctab', @@ -42,6 +44,10 @@ to save the re-generation of the lexer table on each run. + lexer: + Set this parameter to define the lexer to use if + you're not using the default CLexer. + lextab: Points to the lex table that's used for optimized mode. Only if you're modifying the lexer and want @@ -70,7 +76,7 @@ Set this parameter to control the location of generated lextab and yacctab files. """ - self.clex = CLexer( + self.clex = lexer( error_func=self._lex_error_func, on_lbrace_func=self._lex_on_lbrace_func, on_rbrace_func=self._lex_on_rbrace_func, @@ -86,14 +92,14 @@ 'abstract_declarator', 'assignment_expression', 'declaration_list', - 'declaration_specifiers', + 'declaration_specifiers_no_type', 'designation', 'expression', 'identifier_list', 'init_declarator_list', + 'id_init_declarator_list', 'initializer_list', 'parameter_type_list', - 'specifier_qualifier_list', 'block_item_list', 'type_qualifier_list', 'struct_declarator_list' @@ -342,7 +348,7 @@ coord=typename[0].coord) return decl - def _add_declaration_specifier(self, declspec, newspec, kind): + def _add_declaration_specifier(self, declspec, newspec, kind, append=False): """ Declaration specifiers are represented by a dictionary with the entries: * qual: a list of type qualifiers @@ -352,11 +358,18 @@ This method is given a declaration specifier, and a new specifier of a given kind. + If `append` is True, the new specifier is added to the end of + the specifiers list, otherwise it's added at the beginning. Returns the declaration specifier, with the new specifier incorporated. """ spec = declspec or dict(qual=[], storage=[], type=[], function=[]) - spec[kind].insert(0, newspec) + + if append: + spec[kind].append(newspec) + else: + spec[kind].insert(0, newspec) + return spec def _build_declarations(self, spec, decls, typedef_namespace=False): @@ -516,8 +529,7 @@ def p_translation_unit_2(self, p): """ translation_unit : translation_unit external_declaration """ - if p[2] is not None: - p[1].extend(p[2]) + p[1].extend(p[2]) p[0] = p[1] # Declarations always come as lists (because they can be @@ -537,32 +549,42 @@ def p_external_declaration_3(self, p): """ external_declaration : pp_directive + | pppragma_directive """ - p[0] = p[1] + p[0] = [p[1]] def p_external_declaration_4(self, p): """ external_declaration : SEMI """ - p[0] = None + p[0] = [] def p_pp_directive(self, p): """ pp_directive : PPHASH """ self._parse_error('Directives not supported yet', - self._coord(p.lineno(1))) + self._token_coord(p, 1)) + + def p_pppragma_directive(self, p): + """ pppragma_directive : PPPRAGMA + | PPPRAGMA PPPRAGMASTR + """ + if len(p) == 3: + p[0] = c_ast.Pragma(p[2], self._token_coord(p, 2)) + else: + p[0] = c_ast.Pragma("", self._token_coord(p, 1)) # In function definitions, the declarator can be followed by # a declaration list, for old "K&R style" function definitios. # def p_function_definition_1(self, p): - """ function_definition : declarator declaration_list_opt compound_statement + """ function_definition : id_declarator declaration_list_opt compound_statement """ # no declaration specifiers - 'int' becomes the default type spec = dict( qual=[], storage=[], type=[c_ast.IdentifierType(['int'], - coord=self._coord(p.lineno(1)))], + coord=self._token_coord(p, 1))], function=[]) p[0] = self._build_function_definition( @@ -572,7 +594,7 @@ body=p[3]) def p_function_definition_2(self, p): - """ function_definition : declaration_specifiers declarator declaration_list_opt compound_statement + """ function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement """ spec = p[1] @@ -589,9 +611,63 @@ | selection_statement | iteration_statement | jump_statement + | pppragma_directive """ p[0] = p[1] + # A pragma is generally considered a decorator rather than an actual statement. + # Still, for the purposes of analyzing an abstract syntax tree of C code, + # pragma's should not be ignored and were previously treated as a statement. + # This presents a problem for constructs that take a statement such as labeled_statements, + # selection_statements, and iteration_statements, causing a misleading structure + # in the AST. For example, consider the following C code. + # + # for (int i = 0; i < 3; i++) + # #pragma omp critical + # sum += 1; + # + # This code will compile and execute "sum += 1;" as the body of the for loop. + # Previous implementations of PyCParser would render the AST for this + # block of code as follows: + # + # For: + # DeclList: + # Decl: i, [], [], [] + # TypeDecl: i, [] + # IdentifierType: ['int'] + # Constant: int, 0 + # BinaryOp: < + # ID: i + # Constant: int, 3 + # UnaryOp: p++ + # ID: i + # Pragma: omp critical + # Assignment: += + # ID: sum + # Constant: int, 1 + # + # This AST misleadingly takes the Pragma as the body of the loop and the + # assignment then becomes a sibling of the loop. + # + # To solve edge cases like these, the pragmacomp_or_statement rule groups + # a pragma and its following statement (which would otherwise be orphaned) + # using a compound block, effectively turning the above code into: + # + # for (int i = 0; i < 3; i++) { + # #pragma omp critical + # sum += 1; + # } + def p_pragmacomp_or_statement(self, p): + """ pragmacomp_or_statement : pppragma_directive statement + | statement + """ + if isinstance(p[1], c_ast.Pragma) and len(p) == 3: + p[0] = c_ast.Compound( + block_items=[p[1], p[2]], + coord=self._token_coord(p, 1)) + else: + p[0] = p[1] + # In C, declarations can come several in a line: # int x, *px, romulo = 5; # @@ -603,6 +679,7 @@ # def p_decl_body(self, p): """ decl_body : declaration_specifiers init_declarator_list_opt + | declaration_specifiers_no_type id_init_declarator_list_opt """ spec = p[1] @@ -675,26 +752,58 @@ """ p[0] = p[1] if len(p) == 2 else p[1] + p[2] - def p_declaration_specifiers_1(self, p): - """ declaration_specifiers : type_qualifier declaration_specifiers_opt + # To know when declaration-specifiers end and declarators begin, + # we require declaration-specifiers to have at least one + # type-specifier, and disallow typedef-names after we've seen any + # type-specifier. These are both required by the spec. + # + def p_declaration_specifiers_no_type_1(self, p): + """ declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'qual') - def p_declaration_specifiers_2(self, p): - """ declaration_specifiers : type_specifier declaration_specifiers_opt - """ - p[0] = self._add_declaration_specifier(p[2], p[1], 'type') - - def p_declaration_specifiers_3(self, p): - """ declaration_specifiers : storage_class_specifier declaration_specifiers_opt + def p_declaration_specifiers_no_type_2(self, p): + """ declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'storage') - def p_declaration_specifiers_4(self, p): - """ declaration_specifiers : function_specifier declaration_specifiers_opt + def p_declaration_specifiers_no_type_3(self, p): + """ declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'function') + + def p_declaration_specifiers_1(self, p): + """ declaration_specifiers : declaration_specifiers type_qualifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_declaration_specifiers_2(self, p): + """ declaration_specifiers : declaration_specifiers storage_class_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'storage', append=True) + + def p_declaration_specifiers_3(self, p): + """ declaration_specifiers : declaration_specifiers function_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'function', append=True) + + def p_declaration_specifiers_4(self, p): + """ declaration_specifiers : declaration_specifiers type_specifier_no_typeid + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_declaration_specifiers_5(self, p): + """ declaration_specifiers : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_declaration_specifiers_6(self, p): + """ declaration_specifiers : declaration_specifiers_no_type type_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_storage_class_specifier(self, p): """ storage_class_specifier : AUTO | REGISTER @@ -709,25 +818,27 @@ """ p[0] = p[1] - def p_type_specifier_1(self, p): - """ type_specifier : VOID - | _BOOL - | CHAR - | SHORT - | INT - | LONG - | FLOAT - | DOUBLE - | _COMPLEX - | SIGNED - | UNSIGNED + def p_type_specifier_no_typeid(self, p): + """ type_specifier_no_typeid : VOID + | _BOOL + | CHAR + | SHORT + | INT + | LONG + | FLOAT + | DOUBLE + | _COMPLEX + | SIGNED + | UNSIGNED + | __INT128 """ - p[0] = c_ast.IdentifierType([p[1]], coord=self._coord(p.lineno(1))) + p[0] = c_ast.IdentifierType([p[1]], coord=self._token_coord(p, 1)) - def p_type_specifier_2(self, p): + def p_type_specifier(self, p): """ type_specifier : typedef_name | enum_specifier | struct_or_union_specifier + | type_specifier_no_typeid """ p[0] = p[1] @@ -738,30 +849,12 @@ """ p[0] = p[1] - def p_init_declarator_list_1(self, p): + def p_init_declarator_list(self, p): """ init_declarator_list : init_declarator | init_declarator_list COMMA init_declarator """ p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] - # If the code is declaring a variable that was declared a typedef in an - # outer scope, yacc will think the name is part of declaration_specifiers, - # not init_declarator, and will then get confused by EQUALS. Pass None - # up in place of declarator, and handle this at a higher level. - # - def p_init_declarator_list_2(self, p): - """ init_declarator_list : EQUALS initializer - """ - p[0] = [dict(decl=None, init=p[2])] - - # Similarly, if the code contains duplicate typedefs of, for example, - # array types, the array portion will appear as an abstract declarator. - # - def p_init_declarator_list_3(self, p): - """ init_declarator_list : abstract_declarator - """ - p[0] = [dict(decl=p[1], init=None)] - # Returns a {decl= : init=} dictionary # If there's no initializer, uses None # @@ -771,15 +864,40 @@ """ p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + def p_id_init_declarator_list(self, p): + """ id_init_declarator_list : id_init_declarator + | id_init_declarator_list COMMA init_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + def p_id_init_declarator(self, p): + """ id_init_declarator : id_declarator + | id_declarator EQUALS initializer + """ + p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + + # Require at least one type specifier in a specifier-qualifier-list + # def p_specifier_qualifier_list_1(self, p): - """ specifier_qualifier_list : type_qualifier specifier_qualifier_list_opt + """ specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid """ - p[0] = self._add_declaration_specifier(p[2], p[1], 'qual') + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) def p_specifier_qualifier_list_2(self, p): - """ specifier_qualifier_list : type_specifier specifier_qualifier_list_opt + """ specifier_qualifier_list : specifier_qualifier_list type_qualifier """ - p[0] = self._add_declaration_specifier(p[2], p[1], 'type') + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_specifier_qualifier_list_3(self, p): + """ specifier_qualifier_list : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_specifier_qualifier_list_4(self, p): + """ specifier_qualifier_list : type_qualifier_list type_specifier + """ + spec = dict(qual=p[1], storage=[], type=[], function=[]) + p[0] = self._add_declaration_specifier(spec, p[2], 'type', append=True) # TYPEID is allowed here (and in other struct/enum related tag names), because # struct/enum tags reside in their own namespace and can be named the same as types @@ -789,29 +907,48 @@ | struct_or_union TYPEID """ klass = self._select_struct_union_class(p[1]) + # None means no list of members p[0] = klass( name=p[2], decls=None, - coord=self._coord(p.lineno(2))) + coord=self._token_coord(p, 2)) def p_struct_or_union_specifier_2(self, p): """ struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close + | struct_or_union brace_open brace_close """ klass = self._select_struct_union_class(p[1]) - p[0] = klass( - name=None, - decls=p[3], - coord=self._coord(p.lineno(2))) + if len(p) == 4: + # Empty sequence means an empty list of members + p[0] = klass( + name=None, + decls=[], + coord=self._token_coord(p, 2)) + else: + p[0] = klass( + name=None, + decls=p[3], + coord=self._token_coord(p, 2)) + def p_struct_or_union_specifier_3(self, p): """ struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close + | struct_or_union ID brace_open brace_close | struct_or_union TYPEID brace_open struct_declaration_list brace_close + | struct_or_union TYPEID brace_open brace_close """ klass = self._select_struct_union_class(p[1]) - p[0] = klass( - name=p[2], - decls=p[4], - coord=self._coord(p.lineno(2))) + if len(p) == 5: + # Empty sequence means an empty list of members + p[0] = klass( + name=p[2], + decls=[], + coord=self._token_coord(p, 2)) + else: + p[0] = klass( + name=p[2], + decls=p[4], + coord=self._token_coord(p, 2)) def p_struct_or_union(self, p): """ struct_or_union : STRUCT @@ -825,7 +962,10 @@ """ struct_declaration_list : struct_declaration | struct_declaration_list struct_declaration """ - p[0] = p[1] if len(p) == 2 else p[1] + p[2] + if len(p) == 2: + p[0] = p[1] or [] + else: + p[0] = p[1] + (p[2] or []) def p_struct_declaration_1(self, p): """ struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI @@ -866,18 +1006,14 @@ p[0] = decls def p_struct_declaration_2(self, p): - """ struct_declaration : specifier_qualifier_list abstract_declarator SEMI + """ struct_declaration : SEMI """ - # "Abstract declarator?!", you ask? Structure members can have the - # same names as typedefs. The trouble is that the member's name gets - # grouped into specifier_qualifier_list, leaving any remainder to - # appear as an abstract declarator, as in: - # typedef int Foo; - # struct { Foo Foo[3]; }; - # - p[0] = self._build_declarations( - spec=p[1], - decls=[dict(decl=p[2], init=None)]) + p[0] = None + + def p_struct_declaration_3(self, p): + """ struct_declaration : pppragma_directive + """ + p[0] = [p[1]] def p_struct_declarator_list(self, p): """ struct_declarator_list : struct_declarator @@ -906,18 +1042,18 @@ """ enum_specifier : ENUM ID | ENUM TYPEID """ - p[0] = c_ast.Enum(p[2], None, self._coord(p.lineno(1))) + p[0] = c_ast.Enum(p[2], None, self._token_coord(p, 1)) def p_enum_specifier_2(self, p): """ enum_specifier : ENUM brace_open enumerator_list brace_close """ - p[0] = c_ast.Enum(None, p[3], self._coord(p.lineno(1))) + p[0] = c_ast.Enum(None, p[3], self._token_coord(p, 1)) def p_enum_specifier_3(self, p): """ enum_specifier : ENUM ID brace_open enumerator_list brace_close | ENUM TYPEID brace_open enumerator_list brace_close """ - p[0] = c_ast.Enum(p[2], p[4], self._coord(p.lineno(1))) + p[0] = c_ast.Enum(p[2], p[4], self._token_coord(p, 1)) def p_enumerator_list(self, p): """ enumerator_list : enumerator @@ -939,56 +1075,52 @@ if len(p) == 2: enumerator = c_ast.Enumerator( p[1], None, - self._coord(p.lineno(1))) + self._token_coord(p, 1)) else: enumerator = c_ast.Enumerator( p[1], p[3], - self._coord(p.lineno(1))) + self._token_coord(p, 1)) self._add_identifier(enumerator.name, enumerator.coord) p[0] = enumerator - def p_declarator_1(self, p): - """ declarator : direct_declarator + def p_declarator(self, p): + """ declarator : id_declarator + | typeid_declarator """ p[0] = p[1] - def p_declarator_2(self, p): - """ declarator : pointer direct_declarator + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_1(self, p): + """ xxx_declarator : direct_xxx_declarator + """ + p[0] = p[1] + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_2(self, p): + """ xxx_declarator : pointer direct_xxx_declarator """ p[0] = self._type_modify_decl(p[2], p[1]) - # Since it's impossible for a type to be specified after a pointer, assume - # it's intended to be the name for this declaration. _add_identifier will - # raise an error if this TYPEID can't be redeclared. - # - def p_declarator_3(self, p): - """ declarator : pointer TYPEID - """ - decl = c_ast.TypeDecl( - declname=p[2], - type=None, - quals=None, - coord=self._coord(p.lineno(2))) - - p[0] = self._type_modify_decl(decl, p[1]) - - def p_direct_declarator_1(self, p): - """ direct_declarator : ID + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_1(self, p): + """ direct_xxx_declarator : yyy """ p[0] = c_ast.TypeDecl( declname=p[1], type=None, quals=None, - coord=self._coord(p.lineno(1))) + coord=self._token_coord(p, 1)) - def p_direct_declarator_2(self, p): - """ direct_declarator : LPAREN declarator RPAREN + @parameterized(('id', 'ID'), ('typeid', 'TYPEID')) + def p_direct_xxx_declarator_2(self, p): + """ direct_xxx_declarator : LPAREN xxx_declarator RPAREN """ p[0] = p[2] - def p_direct_declarator_3(self, p): - """ direct_declarator : direct_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_3(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET """ quals = (p[3] if len(p) > 5 else []) or [] # Accept dimension qualifiers @@ -1001,9 +1133,10 @@ p[0] = self._type_modify_decl(decl=p[1], modifier=arr) - def p_direct_declarator_4(self, p): - """ direct_declarator : direct_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET - | direct_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_4(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET + | direct_xxx_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET """ # Using slice notation for PLY objects doesn't work in Python 3 for the # version of PLY embedded with pycparser; see PLY Google Code issue 30. @@ -1022,20 +1155,22 @@ # Special for VLAs # - def p_direct_declarator_5(self, p): - """ direct_declarator : direct_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_5(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET """ arr = c_ast.ArrayDecl( type=None, - dim=c_ast.ID(p[4], self._coord(p.lineno(4))), + dim=c_ast.ID(p[4], self._token_coord(p, 4)), dim_quals=p[3] if p[3] != None else [], coord=p[1].coord) p[0] = self._type_modify_decl(decl=p[1], modifier=arr) - def p_direct_declarator_6(self, p): - """ direct_declarator : direct_declarator LPAREN parameter_type_list RPAREN - | direct_declarator LPAREN identifier_list_opt RPAREN + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_6(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LPAREN parameter_type_list RPAREN + | direct_xxx_declarator LPAREN identifier_list_opt RPAREN """ func = c_ast.FuncDecl( From pypy.commits at gmail.com Fri Sep 20 11:08:35 2019 From: pypy.commits at gmail.com (cfbolz) Date: Fri, 20 Sep 2019 08:08:35 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: a test that devolving doesn't change the order Message-ID: <5d84eb73.1c69fb81.efd9.f6e0@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: json-decoder-maps Changeset: r97571:22fe436a1585 Date: 2019-09-20 16:40 +0200 http://bitbucket.org/pypy/pypy/changeset/22fe436a1585/ Log: a test that devolving doesn't change the order diff --git a/pypy/objspace/std/test/test_jsondict.py b/pypy/objspace/std/test/test_jsondict.py --- a/pypy/objspace/std/test/test_jsondict.py +++ b/pypy/objspace/std/test/test_jsondict.py @@ -71,7 +71,6 @@ assert d == {u"a": 1} def test_keys_value_items(self): - import __pypy__ import _pypyjson d = _pypyjson.loads('{"a": 1, "b": "x"}') @@ -80,10 +79,19 @@ assert d.items() == [(u"a", 1), (u"b", u"x")] def test_iter_keys_value_items(self): - import __pypy__ import _pypyjson d = _pypyjson.loads('{"a": 1, "b": "x"}') assert list(d.iterkeys()) == [u"a", u"b"] assert list(d.itervalues()) == [1, u"x"] assert list(d.iteritems()) == [(u"a", 1), (u"b", u"x")] + + def test_dict_order_retained_when_switching_strategies(self): + import _pypyjson + import __pypy__ + d = _pypyjson.loads('{"a": 1, "b": "x"}') + assert list(d) == [u"a", u"b"] + # devolve + assert not 1 in d + assert __pypy__.strategy(d) == "UnicodeDictStrategy" + assert list(d) == [u"a", u"b"] From pypy.commits at gmail.com Fri Sep 20 11:08:37 2019 From: pypy.commits at gmail.com (cfbolz) Date: Fri, 20 Sep 2019 08:08:37 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: fix remaining anto comment: when hitting a blocked map, insert keys in the Message-ID: <5d84eb75.1c69fb81.7ea98.959b@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: json-decoder-maps Changeset: r97572:06effcd1097c Date: 2019-09-20 17:07 +0200 http://bitbucket.org/pypy/pypy/changeset/06effcd1097c/ Log: fix remaining anto comment: when hitting a blocked map, insert keys in the correct order into the real dict, to preserve dict order diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -388,28 +388,8 @@ return get_jsonmap_from_dict(w_dict) def _switch_to_dict(self, currmap, values_w, nextindex): - # not sure if this is a problem, but it's something which I - # noticed and I think it's worth thinking about it for 5 minutes. - # are you also concerned about the fact that jsonmap dicts - # have their keys in the opposite order generally? or just the weird - # "c b a | d e f" effect? - # - # In Python3 dicts preserve the order of keys; this means that a - # "naive" json parser produces dicts whose keys are in the same order - # as in the source document (CPython 3.7 does this). I don't think it - # is guaranteed at all, but I'd not be surprised if real world - # programs will rely on this anyway. - # - # But with the logic here we get the weird effect that the resulting - # dicts contains the first keys in reversed order (up to when we reach - # the blocked state in the map), then the subsequent ones are in the - # "correct" order. dict_w = self._create_empty_dict() - index = nextindex - 1 - while isinstance(currmap, JSONMap): - dict_w[currmap.w_key] = values_w[index] - index -= 1 - currmap = currmap.prev + currmap.fill_dict(dict_w, values_w) assert len(dict_w) == nextindex return dict_w @@ -878,6 +858,11 @@ def _make_next_map(self, w_key, key_repr): return JSONMap(self.space, self, w_key, key_repr) + def fill_dict(self, dict_w, values_w): + """ recursively fill the dictionary dict_w in the correct order, + reading from values_w.""" + raise NotImplementedError("abstract base") + def _all_dot(self, output): identity = objectmodel.compute_unique_id(self) output.append('%s [shape=box%s];' % (identity, self._get_dot_text())) @@ -950,6 +935,11 @@ assert min_fringe min_fringe.mark_blocked(self) + def fill_dict(self, dict_w, values_w): + """ recursively fill the dictionary dict_w in the correct order, + reading from values_w.""" + return 0 + def _check_invariants(self): for fringe in self.current_fringe: assert fringe.state == MapBase.FRINGE @@ -1088,6 +1078,11 @@ i += 1 return True + def fill_dict(self, dict_w, values_w): + index = self.prev.fill_dict(dict_w, values_w) + dict_w[self.w_key] = values_w[index] + return index + 1 + # _____________________________________________________ # methods for JsonDictStrategy diff --git a/pypy/module/_pypyjson/test/test__pypyjson.py b/pypy/module/_pypyjson/test/test__pypyjson.py --- a/pypy/module/_pypyjson/test/test__pypyjson.py +++ b/pypy/module/_pypyjson/test/test__pypyjson.py @@ -60,6 +60,21 @@ assert m3.get_index(w_c) == 1 assert m3.get_index(w_a) == -1 + def test_jsonmap_fill_dict(self): + from collections import OrderedDict + m = Terminator(self.space) + space = self.space + w_a = space.newutf8("a", 1) + w_b = space.newutf8("b", 1) + w_c = space.newutf8("c", 1) + m1 = m.get_next(w_a, 'a"', 0, 2, m) + m2 = m1.get_next(w_b, 'b"', 0, 2, m) + m3 = m2.get_next(w_c, 'c"', 0, 2, m) + d = OrderedDict() + m3.fill_dict(d, [space.w_None, space.w_None, space.w_None]) + assert list(d) == [w_a, w_b, w_c] + + def test_decode_key_map(self): m = Terminator(self.space) m_diff = Terminator(self.space) From pypy.commits at gmail.com Fri Sep 20 12:14:58 2019 From: pypy.commits at gmail.com (arigo) Date: Fri, 20 Sep 2019 09:14:58 -0700 (PDT) Subject: [pypy-commit] cffi default: Add a few more whatsnew entries Message-ID: <5d84fb02.1c69fb81.a7fa4.4ee1@mx.google.com> Author: Armin Rigo Branch: Changeset: r3287:8976fd752614 Date: 2019-09-20 18:14 +0200 http://bitbucket.org/cffi/cffi/changeset/8976fd752614/ Log: Add a few more whatsnew entries diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst --- a/doc/source/whatsnew.rst +++ b/doc/source/whatsnew.rst @@ -16,6 +16,15 @@ * when calling cdata of "function pointer" type, give a RuntimeError instead of a crash if the pointer happens to be NULL +* support some more binary operations between constants in enum definitions + (PR #96) + +* silence a warning incorrectly emitted if you use a quote in a preprocessor + line + +* detect a corner case that would throw the C code into an infinite + recursion, with ``ffi.cdef("""struct X { void(*fnptr)(struct X); };""")`` + v1.12.3 ======= From pypy.commits at gmail.com Fri Sep 20 12:31:38 2019 From: pypy.commits at gmail.com (arigo) Date: Fri, 20 Sep 2019 09:31:38 -0700 (PDT) Subject: [pypy-commit] cffi release-1.13: Silence the warning Message-ID: <5d84feea.1c69fb81.a43fa.bed1@mx.google.com> Author: Armin Rigo Branch: release-1.13 Changeset: r3289:0512679a6efd Date: 2019-09-20 18:31 +0200 http://bitbucket.org/cffi/cffi/changeset/0512679a6efd/ Log: Silence the warning diff --git a/testing/cffi1/test_re_python.py b/testing/cffi1/test_re_python.py --- a/testing/cffi1/test_re_python.py +++ b/testing/cffi1/test_re_python.py @@ -17,7 +17,7 @@ int add43(int x, ...) { return x; } int globalvar42 = 1234; const int globalconst42 = 4321; - const char *const globalconsthello = "hello"; + const char *const globalconsthello; struct foo_s; typedef struct bar_s { int x; signed char a[]; } bar_t; enum foo_e { AA, BB, CC }; From pypy.commits at gmail.com Fri Sep 20 12:38:29 2019 From: pypy.commits at gmail.com (arigo) Date: Fri, 20 Sep 2019 09:38:29 -0700 (PDT) Subject: [pypy-commit] cffi release-1.13: oops Message-ID: <5d850085.1c69fb81.3086e.87e6@mx.google.com> Author: Armin Rigo Branch: release-1.13 Changeset: r3290:e9384e7fda85 Date: 2019-09-20 18:38 +0200 http://bitbucket.org/cffi/cffi/changeset/e9384e7fda85/ Log: oops diff --git a/testing/cffi1/test_re_python.py b/testing/cffi1/test_re_python.py --- a/testing/cffi1/test_re_python.py +++ b/testing/cffi1/test_re_python.py @@ -17,7 +17,7 @@ int add43(int x, ...) { return x; } int globalvar42 = 1234; const int globalconst42 = 4321; - const char *const globalconsthello; + const char *const globalconsthello = "hello"; struct foo_s; typedef struct bar_s { int x; signed char a[]; } bar_t; enum foo_e { AA, BB, CC }; @@ -65,7 +65,7 @@ int add43(int, ...); int globalvar42; const int globalconst42; - const char *const globalconsthello = "hello"; + const char *const globalconsthello; int no_such_function(int); int no_such_globalvar; struct foo_s; From pypy.commits at gmail.com Fri Sep 20 13:25:04 2019 From: pypy.commits at gmail.com (arigo) Date: Fri, 20 Sep 2019 10:25:04 -0700 (PDT) Subject: [pypy-commit] cffi release-1.13: Don't return a bool from __int__(), as it raises a (Pending?)DeprecationWarning Message-ID: <5d850b70.1c69fb81.a0d0c.2003@mx.google.com> Author: Armin Rigo Branch: release-1.13 Changeset: r3291:e295aee5c3ab Date: 2019-09-20 19:24 +0200 http://bitbucket.org/cffi/cffi/changeset/e295aee5c3ab/ Log: Don't return a bool from __int__(), as it raises a (Pending?)DeprecationWarning diff --git a/cffi/backend_ctypes.py b/cffi/backend_ctypes.py --- a/cffi/backend_ctypes.py +++ b/cffi/backend_ctypes.py @@ -403,7 +403,7 @@ source = _cast_source_to_int(source) return cls(bool(source)) def __int__(self): - return self._value + return int(self._value) if kind == 'char': @classmethod From pypy.commits at gmail.com Sat Sep 21 09:48:09 2019 From: pypy.commits at gmail.com (rlamy) Date: Sat, 21 Sep 2019 06:48:09 -0700 (PDT) Subject: [pypy-commit] pypy default: Remove unused tests that have been broken for years Message-ID: <5d862a19.1c69fb81.90cb6.657e@mx.google.com> Author: Ronan Lamy Branch: Changeset: r97576:fafd25cdc3dd Date: 2019-09-21 14:47 +0100 http://bitbucket.org/pypy/pypy/changeset/fafd25cdc3dd/ Log: Remove unused tests that have been broken for years diff --git a/pypy/tool/pypyjit.py b/pypy/tool/pypyjit.py deleted file mode 100644 --- a/pypy/tool/pypyjit.py +++ /dev/null @@ -1,118 +0,0 @@ -""" -A file that invokes translation of PyPy with the JIT enabled. - -Run it with py.test -s --pdb pypyjit.py - -""" - -import py, os - -try: - py.test.config.option.runappdirect -except AttributeError: - import sys - print >> sys.stderr, __doc__ - sys.exit(2) - -import sys -sys.setrecursionlimit(100000000) - -from pypy.objspace.std import Space -from rpython.config.translationoption import set_opt_level -from pypy.config.pypyoption import get_pypy_config, set_pypy_opt_level -from rpython.rtyper.annlowlevel import llhelper, llstr, hlstr -from rpython.rtyper.lltypesystem.rstr import STR -from rpython.rtyper.lltypesystem import lltype -from pypy.interpreter.pycode import PyCode -from rpython.translator.goal import unixcheckpoint -import pypy.module.pypyjit.interp_jit - -config = get_pypy_config(translating=True) -config.translation.backendopt.inline_threshold = 0.1 -config.translation.gc = 'boehm' -config.translating = True -config.translation.rweakref = False -set_opt_level(config, level='jit') -config.objspace.allworkingmodules = False -config.objspace.usemodules.pypyjit = True -config.objspace.usemodules.array = False -config.objspace.usemodules._weakref = False -config.objspace.usemodules.struct = True -config.objspace.usemodules.time = True -config.objspace.usemodules._sre = False -config.objspace.usemodules._lsprof = False -# -config.objspace.usemodules._rawffi = False -config.objspace.usemodules.micronumpy = False -# -set_pypy_opt_level(config, level='jit') - -print config - -import sys, pdb - -space = Space(config) -w_dict = space.newdict(module=True) - - -def readfile(filename): - fd = os.open(filename, os.O_RDONLY, 0) - blocks = [] - while True: - data = os.read(fd, 4096) - if not data: - break - blocks.append(data) - os.close(fd) - return ''.join(blocks) - -def read_code(): - from pypy.module.marshal.interp_marshal import dumps - - filename = 'pypyjit_demo.py' - source = readfile(filename) - ec = space.getexecutioncontext() - code = ec.compiler.compile(source, filename, 'exec', 0) - return llstr(space.str_w(dumps(space, code, space.wrap(2)))) - -FPTR = lltype.Ptr(lltype.FuncType([], lltype.Ptr(STR))) -read_code_ptr = llhelper(FPTR, read_code) - -def entry_point(): - space.startup() - from pypy.module.marshal.interp_marshal import loads - code = loads(space, space.wrap(hlstr(read_code_ptr()))) - assert isinstance(code, PyCode) - code.exec_code(space, w_dict, w_dict) - -def test_run_translation(): - from pypy.tool.ann_override import PyPyAnnotatorPolicy - from rpython.rtyper.test.test_llinterp import get_interpreter - - # first annotate and rtype - try: - interp, graph = get_interpreter(entry_point, [], backendopt=False, - config=config, - policy=PyPyAnnotatorPolicy(space)) - except Exception as e: - print '%s: %s' % (e.__class__, e) - pdb.post_mortem(sys.exc_info()[2]) - raise - - # parent process loop: spawn a child, wait for the child to finish, - # print a message, and restart - unixcheckpoint.restartable_point(auto='run') - - from rpython.jit.codewriter.codewriter import CodeWriter - CodeWriter.debug = True - from pypy.tool.pypyjit_child import run_child - run_child(globals(), locals()) - - -if __name__ == '__main__': - import sys - if len(sys.argv) > 1: - # debugging: run the code directly - entry_point() - else: - test_run_translation() diff --git a/pypy/tool/pypyjit_child.py b/pypy/tool/pypyjit_child.py deleted file mode 100644 --- a/pypy/tool/pypyjit_child.py +++ /dev/null @@ -1,25 +0,0 @@ -from pypy.conftest import option -from rpython.rtyper.lltypesystem import lltype -from rpython.jit.metainterp import warmspot -from pypy.module.pypyjit.policy import PyPyJitPolicy - - -def run_child(glob, loc): - import sys, pdb - interp = loc['interp'] - graph = loc['graph'] - interp.malloc_check = False - - from rpython.jit.backend.llgraph.runner import LLGraphCPU - #LLtypeCPU.supports_floats = False # for now - apply_jit(interp, graph, LLGraphCPU) - - -def apply_jit(interp, graph, CPUClass): - print 'warmspot.jittify_and_run() started...' - policy = PyPyJitPolicy() - option.view = True - warmspot.jittify_and_run(interp, graph, [], policy=policy, - listops=True, CPUClass=CPUClass, - backendopt=True, inline=True) - diff --git a/pypy/tool/pypyjit_demo.py b/pypy/tool/pypyjit_demo.py deleted file mode 100644 --- a/pypy/tool/pypyjit_demo.py +++ /dev/null @@ -1,31 +0,0 @@ - -import time -l = [] - -for i in range(100): - print i - t0 = time.time() - exec """ -def k(a, b, c): - pass - -def g(a, b, c): - k(a, b + 1, c + 2) - k(a, b + 1, c + 2) - k(a, b + 1, c + 2) - k(a, b + 1, c + 2) - k(a, b + 1, c + 2) - -def f(i): - g(i, i + 1, i + 2) - g(i, i + 1, i + 2) - g(i, i + 1, i + 2) - g(i, i + 1, i + 2) - g(i, i + 1, i + 2) - g(i, i + 1, i + 2) -for i in range(1000): - f(i) -""" - l.append(time.time() - t0) - -print l From pypy.commits at gmail.com Sat Sep 21 10:43:27 2019 From: pypy.commits at gmail.com (stevie_92) Date: Sat, 21 Sep 2019 07:43:27 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Fixed tests for non-gc proxies in incmark Message-ID: <5d86370f.1c69fb81.973f5.894b@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97577:2606a6511ff0 Date: 2019-09-21 09:43 +0200 http://bitbucket.org/pypy/pypy/changeset/2606a6511ff0/ Log: Fixed tests for non-gc proxies in incmark diff --git a/rpython/memory/gc/rrc/incmark.py b/rpython/memory/gc/rrc/incmark.py --- a/rpython/memory/gc/rrc/incmark.py +++ b/rpython/memory/gc/rrc/incmark.py @@ -13,11 +13,6 @@ return True if self.state == self.STATE_DEFAULT: - # For all non-gc pyobjects which have a refcount > 0, - # mark all reachable objects on the pypy side - self.p_list_old.foreach(self._major_trace_nongc, False) - # TODO: execute incrementally (own phase) - # Merge all objects whose finalizer have been executed to the # pyobj_list (to reprocess them again in the snapshot). Finalizers # can only be executed once, so termination will eventually happen. @@ -72,10 +67,29 @@ # * move all dead objects still in pyob_list to pyobj_old_list # * for all other objects (in snapshot and new), # set their cyclic refcount to > 0 to mark them as live - pygchdr = self.pyobj_list.c_gc_next consistent = True self.snapshot_consistent = True - while pygchdr <> self.pyobj_list: # TODO: also sync p_list + # simply iterate the snapshot for objects in p_list, as linked objects might not be freed, except by the gc + free_p_list = self.gc.AddressStack() + for i in range(0, self.total_objs): + snapobj = self.snapshot_objs[i] + if snapobj.pypy_link == 0: + break + pyobj = llmemory.cast_adr_to_ptr(snapobj.pyobj, self.PYOBJ_HDR_PTR) + pygchdr = self.pyobj_as_gc(pyobj) + if (pygchdr <> lltype.nullptr(self.PYOBJ_GC_HDR) and + pygchdr.c_gc_refs != self.RAWREFCOUNT_REFS_UNTRACKED): + break + if snapobj.refcnt == 0: + consistent = pyobj.c_ob_refcnt == snapobj.refcnt_original + if not consistent: + break + # move to separate list + free_p_list.append(snapobj.pyobj) + + # sync gc objects + pygchdr = self.pyobj_list.c_gc_next + while pygchdr <> self.pyobj_list and consistent: next_old = pygchdr.c_gc_next if pygchdr.c_gc_refs > 0: # object is in snapshot snapobj = self.snapshot_objs[pygchdr.c_gc_refs - 1] @@ -105,6 +119,8 @@ self._debug_check_consistency(print_label="end-check-consistency") if not consistent: # keep all objects alive + while free_p_list.non_empty(): + self.p_list_old.append(free_p_list.pop()) while pygchdr <> self.pyobj_list: # continue previous loop pygchdr.c_gc_refs = 1 pygchdr = pygchdr.c_gc_next @@ -114,6 +130,8 @@ pygchdr = pygchdr.c_gc_next if not self._gc_list_is_empty(self.pyobj_old_list): self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) + else: + free_p_list.foreach(self._free_p_list, None) self._debug_check_consistency(print_label="before-snap-discard") @@ -140,6 +158,19 @@ self._debug_check_consistency(print_label="end-mark") return True + def _free_p_list(self, pyobject, foo): + from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY + from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT + # unlink + self.p_list_old.remove(pyobject) + pyobj = llmemory.cast_adr_to_ptr(pyobject, self.PYOBJ_HDR_PTR) + refcnt = pyobj.c_ob_refcnt + if refcnt >= REFCNT_FROM_PYPY_LIGHT: + refcnt -= REFCNT_FROM_PYPY_LIGHT + elif refcnt >= REFCNT_FROM_PYPY: + refcnt -= REFCNT_FROM_PYPY + pyobj.c_ob_refcnt = refcnt + def _collect_roots(self): # Subtract all internal refcounts from the cyclic refcount # of rawrefcounted objects diff --git a/rpython/memory/gc/test/dot/keep_cross_nogc_1.dot b/rpython/memory/gc/test/dot/keep_nocycle_nogc_1.dot copy from rpython/memory/gc/test/dot/keep_cross_nogc_1.dot copy to rpython/memory/gc/test/dot/keep_nocycle_nogc_1.dot --- a/rpython/memory/gc/test/dot/keep_cross_nogc_1.dot +++ b/rpython/memory/gc/test/dot/keep_nocycle_nogc_1.dot @@ -1,12 +1,7 @@ digraph G { - "a" [type=P, alive=y]; - "b" [type=B, alive=y]; - "c" [type=C, alive=y]; - "d" [type=B, alive=y, gc=n]; - "e" [type=P, alive=y, rooted=y]; + "a" [type=C, alive=y, ext_refcnt=1]; + "b" [type=B, alive=y, gc=n]; + "c" [type=P, alive=y]; "a" -> "b"; "b" -> "c"; - "c" -> "d"; - "d" -> "a"; - "e" -> "d"; } diff --git a/rpython/memory/gc/test/test_rawrefcount.py b/rpython/memory/gc/test/test_rawrefcount.py --- a/rpython/memory/gc/test/test_rawrefcount.py +++ b/rpython/memory/gc/test/test_rawrefcount.py @@ -26,8 +26,8 @@ class TestRawRefCount(BaseDirectGCTest): GCClass = IncMiniMark - #RRCGCClass = RawRefCountIncMarkGC - RRCGCClass = RawRefCountMarkGC + RRCGCClass = RawRefCountIncMarkGC + #RRCGCClass = RawRefCountMarkGC def setup_method(self, method): BaseDirectGCTest.setup_method(self, method) @@ -773,24 +773,19 @@ for name in nodes: n = nodes[name] if n.info.alive: + print "Node", name, "should be alive." if n.info.type == "P": n.check_alive() else: n.check_alive(n.info.ext_refcnt) + print "Node", name, "is alive." else: + print "Node", name, "should be dead." if n.info.type == "P": py.test.raises(RuntimeError, "n.p.x") # dead else: py.test.raises(RuntimeError, "n.r.c_ob_refcnt") # dead - - # check if all callbacks from weakrefs from cyclic garbage structures, - # which should not be called because they could ressurrect dead - # objects, have been cleared and no other callbacks were cleared; see: - # https://github.com/python/cpython/blob/master/Modules/gc_weakref.txt - for weakrefs in self.pyobj_weakrefs: - for weakref in weakrefs: - pass # TODO fix - #assert weakref.callback_cleared == weakref.clear_callback + print "Node", name, "is dead." # check if unreachable objects in cyclic structures with legacy # finalizers and all otherwise unreachable objects reachable from them From pypy.commits at gmail.com Sat Sep 21 10:43:29 2019 From: pypy.commits at gmail.com (stevie_92) Date: Sat, 21 Sep 2019 07:43:29 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Fixed bugs in rrc incmark Message-ID: <5d863711.1c69fb81.89f26.5cca@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97578:9543fe367251 Date: 2019-09-21 16:42 +0200 http://bitbucket.org/pypy/pypy/changeset/9543fe367251/ Log: Fixed bugs in rrc incmark Added incremental rrc tests and debug output of snapshot diff --git a/rpython/memory/gc/rrc/incmark.py b/rpython/memory/gc/rrc/incmark.py --- a/rpython/memory/gc/rrc/incmark.py +++ b/rpython/memory/gc/rrc/incmark.py @@ -35,11 +35,13 @@ # Now take a snapshot self._take_snapshot(self.pyobj_list) + self._debug_print_snap(print_label="after-snapshot") # collect all rawrefcounted roots self._collect_roots() # TODO: execute incrementally (own phase, save index) + self._debug_print_snap(print_label="roots-marked") self._debug_check_consistency(print_label="roots-marked") self.state = self.STATE_MARKING return False @@ -52,6 +54,7 @@ if (all_rrc_marked and not self.gc.objects_to_trace.non_empty() and not self.gc.more_objects_to_trace.non_empty()): # all objects have been marked, dead objects will stay dead + self._debug_print_snap(print_label="before-fin") self._debug_check_consistency(print_label="before-fin") self.state = self.STATE_GARBAGE_MARKING else: @@ -112,7 +115,9 @@ self._gc_list_remove(pygchdr) self._gc_list_add(self.pyobj_old_list, pygchdr) else: - pygchdr.c_gc_refs = 1 # new object, keep alive + # new object, keep alive + pyobj = self.gc_as_pyobj(pygchdr) + pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT # TODO: also keep reachable objects alive (in case rc proxy -> non-rc -> non-rc proxy -> rc obj!!!) pygchdr = next_old @@ -122,11 +127,11 @@ while free_p_list.non_empty(): self.p_list_old.append(free_p_list.pop()) while pygchdr <> self.pyobj_list: # continue previous loop - pygchdr.c_gc_refs = 1 + pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT pygchdr = pygchdr.c_gc_next pygchdr = self.pyobj_old_list.c_gc_next while pygchdr <> self.pyobj_old_list: # resurrect "dead" objects - pygchdr.c_gc_refs = 1 + pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT pygchdr = pygchdr.c_gc_next if not self._gc_list_is_empty(self.pyobj_old_list): self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) @@ -158,6 +163,15 @@ self._debug_check_consistency(print_label="end-mark") return True + def _debug_print_snap(self, print_label=None): + debug_start("snap " + print_label) + for i in range(0, self.total_objs): + snapobj = self.snapshot_objs[i] + debug_print("item", snapobj.pyobj, ": snapobj", snapobj, + "refcnt", snapobj.refcnt, + "refcnt original", snapobj.refcnt_original, + "link", snapobj.pypy_link) + def _free_p_list(self, pyobject, foo): from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT @@ -186,7 +200,7 @@ # refcount > 0 def _mark_rawrefcount(self): - self._gc_list_init(self.pyobj_old_list) + self._gc_list_init(self.pyobj_old_list) # TODO: move??? # as long as new objects with cyclic a refcount > 0 or alive border # objects are found, increment the refcount of all referenced objects # of those newly found objects diff --git a/rpython/memory/gc/rrc/mark.py b/rpython/memory/gc/rrc/mark.py --- a/rpython/memory/gc/rrc/mark.py +++ b/rpython/memory/gc/rrc/mark.py @@ -198,8 +198,6 @@ pyobj = self.gc_as_pyobj(gchdr) obj = llmemory.NULL if pyobj.c_ob_pypy_link <> 0: - #intobj = pyobj.c_ob_pypy_link - #obj = llmemory.cast_int_to_adr(intobj) pyobject = llmemory.cast_ptr_to_adr(pyobj) obj = self.refcnt_dict.get(pyobject) if not alive and self.gc.header(obj).tid & ( @@ -218,8 +216,6 @@ self._traverse(pyobj, 1) # mark recursively, if it is a pypyobj if pyobj.c_ob_pypy_link <> 0: - #intobj = pyobj.c_ob_pypy_link - #obj = llmemory.cast_int_to_adr(intobj) self.gc.objects_to_trace.append(obj) self.gc.visit_all_objects() return alive diff --git a/rpython/memory/gc/test/dot/keep_cpython_self.dot b/rpython/memory/gc/test/dot/keep_cpython_inc_1.dot copy from rpython/memory/gc/test/dot/keep_cpython_self.dot copy to rpython/memory/gc/test/dot/keep_cpython_inc_1.dot --- a/rpython/memory/gc/test/dot/keep_cpython_self.dot +++ b/rpython/memory/gc/test/dot/keep_cpython_inc_1.dot @@ -1,4 +1,18 @@ digraph G { - "a" [type=C, alive=y, ext_refcnt=1]; - "a" -> "a"; + "a" [type=B, alive=y, ext_refcnt=1]; + "b" [type=P, alive=n]; + "c" [type=B, alive=y]; + "d" [type=P, alive=y]; + "e" [type=B, alive=y]; + "f" [type=C, alive=y]; + "g" [type=C, alive=y]; + "h" [type=C, alive=y, ext_refcnt=1]; + "a" -> "b" [removed=after_snap]; + "b"-> "c"; + "c" -> "d"; + "c" -> "f"; + "f" -> "c"; + "d" -> "e"; + "e" -> "g"; + "h" -> "f" [added=after_snap]; } diff --git a/rpython/memory/gc/test/dot/keep_cpython_self.dot b/rpython/memory/gc/test/dot/keep_cpython_inc_2.dot copy from rpython/memory/gc/test/dot/keep_cpython_self.dot copy to rpython/memory/gc/test/dot/keep_cpython_inc_2.dot --- a/rpython/memory/gc/test/dot/keep_cpython_self.dot +++ b/rpython/memory/gc/test/dot/keep_cpython_inc_2.dot @@ -1,4 +1,15 @@ digraph G { - "a" [type=C, alive=y, ext_refcnt=1]; - "a" -> "a"; + "a" [type=C, alive=y, ext_refcnt=1, added=after_snap]; + "b" [type=B, alive=y, added=after_snap]; + "c" [type=P, alive=y, added=after_snap]; + "d" [type=P, alive=y, added=after_snap]; + "e" [type=B, alive=y, added=after_snap]; + "f" [type=C, alive=y, added=after_snap]; + "g" [type=C, alive=y, added=after_snap]; + "a" -> "b" [added=after_snap]; + "b" -> "c" [added=after_snap]; + "c" -> "d" [added=after_snap]; + "d" -> "e" [added=after_snap]; + "e" -> "f" [added=after_snap]; + "f" -> "g" [added=after_snap]; } diff --git a/rpython/memory/gc/test/dot/keep_cpython_self.dot b/rpython/memory/gc/test/dot/keep_cpython_inc_3.dot copy from rpython/memory/gc/test/dot/keep_cpython_self.dot copy to rpython/memory/gc/test/dot/keep_cpython_inc_3.dot --- a/rpython/memory/gc/test/dot/keep_cpython_self.dot +++ b/rpython/memory/gc/test/dot/keep_cpython_inc_3.dot @@ -1,4 +1,15 @@ digraph G { - "a" [type=C, alive=y, ext_refcnt=1]; - "a" -> "a"; + "a" [type=B, alive=y, ext_refcnt=1]; + "b" [type=P, alive=n]; + "c" [type=P, alive=y]; + "d" [type=B, alive=y]; + "e" [type=C, alive=y]; + "f" [type=C, alive=y, ext_refcnt=1, added=after_snap]; + "g" [type=B, alive=y, added=linked_after_snap]; + "a" -> "b" [removed=after_snap]; + "b" -> "c"; + "c" -> "d"; + "d" -> "e"; + "f" -> "g" [added=after_snap]; + "g" -> "c" [added=after_snap]; } diff --git a/rpython/memory/gc/test/dot/keep_cross_simple.dot b/rpython/memory/gc/test/dot/keep_cross_simple_3a.dot copy from rpython/memory/gc/test/dot/keep_cross_simple.dot copy to rpython/memory/gc/test/dot/keep_cross_simple_3a.dot --- a/rpython/memory/gc/test/dot/keep_cross_simple.dot +++ b/rpython/memory/gc/test/dot/keep_cross_simple_3a.dot @@ -1,5 +1,5 @@ digraph G { "a" [type=B, alive=y, rooted=y]; - "b" [type=C, alive=y]; + "b" [type=B, alive=y]; "a" -> "b"; } diff --git a/rpython/memory/gc/test/dot/keep_cross_simple.dot b/rpython/memory/gc/test/dot/keep_cross_simple_3b.dot copy from rpython/memory/gc/test/dot/keep_cross_simple.dot copy to rpython/memory/gc/test/dot/keep_cross_simple_3b.dot --- a/rpython/memory/gc/test/dot/keep_cross_simple.dot +++ b/rpython/memory/gc/test/dot/keep_cross_simple_3b.dot @@ -1,5 +1,5 @@ digraph G { - "a" [type=B, alive=y, rooted=y]; - "b" [type=C, alive=y]; + "a" [type=B, alive=y, ext_refcnt=1]; + "b" [type=B, alive=y]; "a" -> "b"; } diff --git a/rpython/memory/gc/test/test_rawrefcount.py b/rpython/memory/gc/test/test_rawrefcount.py --- a/rpython/memory/gc/test/test_rawrefcount.py +++ b/rpython/memory/gc/test/test_rawrefcount.py @@ -511,7 +511,7 @@ class NodeInfo: def __init__(self, type, alive, ext_refcnt, finalizer, resurrect, - delete, garbage, tuple, gc): + delete, garbage, tuple, gc, rooted, tracked): self.type = type self.alive = alive self.ext_refcnt = ext_refcnt @@ -521,6 +521,8 @@ self.garbage = garbage self.tuple = tuple self.gc = gc + self.rooted = rooted + self.tracked = tracked class WeakrefNode(BorderNode): def __init__(self, p, pref, r, raddr, check_alive, info, r_dest, @@ -540,6 +542,13 @@ g = pydot.graph_from_dot_file(path)[0] nodes = {} + add_pyobj_after_snap = [] + add_pypy_after_snap = [] + add_border_after_snap = [] + add_linked_pyobj_after_snap = [] + add_after_snap = [] + remove_after_snap = [] + # create objects from graph (always create old to prevent moving) finalizers = False i = 0 @@ -559,27 +568,51 @@ garbage = True if 'garbage' in attr else False tuple = attr['tuple'] == "y" if 'tuple' in attr else False gc = attr['gc'] == "y" if 'gc' in attr else True + added = attr['added'] if 'added' in attr else None info = NodeInfo(type, alive, ext_refcnt, finalizer, resurrect, - delete, garbage, tuple, gc) + delete, garbage, tuple, gc, rooted, tracked) if type == "C": - r, raddr, check_alive = self._rawrefcount_pyobj( - tracked=tracked, tuple=tuple) - r.c_ob_refcnt += ext_refcnt - nodes[name] = CPythonNode(r, raddr, check_alive, info) + if added == "after_snap": + nodes[name] = CPythonNode(None, None, None, info) + add_pyobj_after_snap.append(nodes[name]) + else: + r, raddr, check_alive = self._rawrefcount_pyobj( + tracked=tracked, tuple=tuple) + r.c_ob_refcnt += ext_refcnt + nodes[name] = CPythonNode(r, raddr, check_alive, info) elif type == "P": - p, pref, check_alive = \ - self._rawrefcount_pypyobj(42 + i, rooted=rooted, - create_old=True) - nodes[name] = PyPyNode(p, pref, check_alive, info) - i += 1 + if added == "after_snap": + nodes[name] = PyPyNode(None, None, None, info) + add_pypy_after_snap.append(nodes[name]) + else: + p, pref, check_alive = \ + self._rawrefcount_pypyobj(42 + i, rooted=rooted, + create_old=True) + nodes[name] = PyPyNode(p, pref, check_alive, info) + i += 1 elif type == "B": # TODO: add to correct list (now always p_list) - p, pref, r, raddr, check_alive =\ - self._rawrefcount_pair(42 + i, rooted=rooted, - create_old=True, tracked=tracked, - tuple=tuple, is_gc=gc) - r.c_ob_refcnt += ext_refcnt - nodes[name] = BorderNode(p, pref, r, raddr, check_alive, info) - i += 1 + if added == "after_snap": + nodes[name] = BorderNode(None, None, None, None, None, + info) + add_border_after_snap.append(nodes[name]) + elif added == "linked_after_snap": + p, pref, check_alive = \ + self._rawrefcount_pypyobj(42 + i, rooted=rooted, + create_old=True) + nodes[name] = BorderNode(p, pref, None, None, check_alive, + info) + add_linked_pyobj_after_snap.append(nodes[name]) + i += 1 + else: + p, pref, r, raddr, check_alive =\ + self._rawrefcount_pair(42 + i, rooted=rooted, + create_old=True, + tracked=tracked, tuple=tuple, + is_gc=gc) + r.c_ob_refcnt += ext_refcnt + nodes[name] = BorderNode(p, pref, r, raddr, check_alive, + info) + i += 1 # add references between objects from graph for e in g.get_edges(): @@ -588,6 +621,8 @@ attr = e.obj_dict['attributes'] weakref = attr['weakref'] == "y" if 'weakref' in attr else False callback = attr['callback'] == "y" if 'callback' in attr else False + added = attr['added'] if 'added' in attr else None + removed = attr['removed'] if 'removed' in attr else None clear_callback = attr['clear_callback'] == "y" \ if 'clear_callback' in attr else False if source.info.type == "C" or dest.info.type == "C": @@ -602,21 +637,37 @@ self._rawrefcount_addweakref(source.r, weakref) i += 1 else: - self._rawrefcount_addref(source.r, dest.r) - if source.info.alive: - dest.info.ext_refcnt += 1 + if added == "after_snap": + add_after_snap.append(('C', source, dest)) + else: + self._rawrefcount_addref(source.r, dest.r) + if source.info.alive: + dest.info.ext_refcnt += 1 + if removed == "after_snap": + remove_after_snap.append(('C', source, dest)) elif source.info.type == "P" or dest.info.type == "P": - if llmemory.cast_ptr_to_adr(source.p.next) == llmemory.NULL: - source.p.next = dest.p + if (source.p is None or llmemory.cast_ptr_to_adr(source.p.next) + == llmemory.NULL): + if added == "after_snap": + add_after_snap.append(('P', 'next', source, dest)) + else: + source.p.next = dest.p + if removed == "after_snap": + remove_after_snap.append(('P', 'next', source)) elif llmemory.cast_ptr_to_adr(source.p.prev) == llmemory.NULL: - source.p.prev = dest.p + if added == "after_snap": + add_after_snap.append(('P', 'prev', source, dest)) + else: + source.p.prev = dest.p + if removed == "after_snap": + remove_after_snap.append(('P', 'prev', source)) else: assert False # only 2 refs supported from pypy obj in tests # add finalizers for name in nodes: n = nodes[name] - if hasattr(n, "r"): + if hasattr(n, "r") and n.r is not None: index = self.pyobjs.index(n.r) resurrect = n.info.resurrect delete = n.info.delete @@ -651,12 +702,15 @@ for wr in wrs: dests_by_source[source].append(wr.r) else: - dests_by_source[source].append(dest.r) + if attr['added'] != "after_snap" if "added" in attr else \ + True: + dests_by_source[source].append(dest.r) for source in dests_by_source: dests_target = dests_by_source[source] def append(pyobj, ignore): dests_target.remove(pyobj) - self.gc.rrc_gc.tp_traverse(source.r, append, None) + if source.r is not None: + self.gc.rrc_gc.tp_traverse(source.r, append, None) assert len(dests_target) == 0 garbage_pypy = [] @@ -756,7 +810,86 @@ # do a collection to find cyclic isolates and clean them, if there are # no finalizers - self.gc.collect() + if True: + from rpython.rlib import rgc + state = -1 + after_snap = False + while state <> 0: + states = self.gc.collect_step() + state = rgc.new_state(states) + if (self.gc.rrc_gc.state == RawRefCountBaseGC.STATE_MARKING and + not after_snap): + for obj in add_pyobj_after_snap: + r, raddr, check_alive = self._rawrefcount_pyobj( + tracked=obj.info.tracked, tuple=obj.info.tuple) + r.c_ob_refcnt += obj.info.ext_refcnt + obj.r = r + obj.raddr = raddr + obj.check_alive = check_alive + for obj in add_pypy_after_snap: + p, pref, check_alive = \ + self._rawrefcount_pypyobj(42 + i, rooted=obj.info + .rooted, create_old=True) + obj.p = p + obj.pref = pref + obj.check_alive = check_alive + i += 1 + for obj in add_border_after_snap: + p, pref, r, raddr, check_alive = \ + self._rawrefcount_pair(42 + i, rooted=obj.info + .rooted, create_old=True, + tracked=obj.info.tracked, + tuple=obj.info.tuple, + is_gc=obj.info.gc) + r.c_ob_refcnt += obj.info.ext_refcnt + obj.r = r + obj.raddr = raddr + obj.p = p + obj.pref = pref + obj.check_alive = check_alive + i += 1 + for obj in add_linked_pyobj_after_snap: + r, raddr, check_alive = self._rawrefcount_pyobj( + tracked=obj.info.tracked, tuple=obj.info.tuple) + r.c_ob_refcnt += obj.info.ext_refcnt + obj.r = r + obj.raddr = raddr + def double_check(): + obj.check_alive() + check_alive() + obj.check_alive = double_check + self.gc.rawrefcount_create_link_pypy(obj.pref, raddr) + + for add in add_after_snap: + if add[0] == "C": + (type, source, dest) = add + self._rawrefcount_addref(source.r, dest.r) + if source.info.alive: + dest.info.ext_refcnt += 1 + elif add[0] == "P": + (type, prop, source, dest) = add + if prop == "next": + source.p.next = dest.p + elif prop == "prev": + source.p.prev = dest.p + else: + assert False, "not yet supported" + else: + assert False, "not yet supported" + for remove in remove_after_snap: + if remove[0] == "P": + if remove[1] == "next": + remove[2].p.next = remove[2].p + elif prop == "prev": + remove[2].p.prev = remove[2].p + else: + assert False, "not yet supported" + else: + assert False, "not yet supported" + after_snap = True + else: + self.gc.collect() + self.gc.rrc_gc.invoke_callback() if self.trigger <> []: cleanup() From pypy.commits at gmail.com Sat Sep 21 10:44:10 2019 From: pypy.commits at gmail.com (rlamy) Date: Sat, 21 Sep 2019 07:44:10 -0700 (PDT) Subject: [pypy-commit] pypy default: kill obsolete tool (we can use hypothesis instead) Message-ID: <5d86373a.1c69fb81.a2de.ffb3@mx.google.com> Author: Ronan Lamy Branch: Changeset: r97579:7eb3b4f49cdd Date: 2019-09-21 15:43 +0100 http://bitbucket.org/pypy/pypy/changeset/7eb3b4f49cdd/ Log: kill obsolete tool (we can use hypothesis instead) diff --git a/pypy/tool/unicodefuzzer.py b/pypy/tool/unicodefuzzer.py deleted file mode 100644 --- a/pypy/tool/unicodefuzzer.py +++ /dev/null @@ -1,63 +0,0 @@ -import random, sys -random.seed(42) - -def make_random_encoded_string(length=10, variance=1): - s = [] - s.append(random.choice(["\xff\xfe", "\xfe\xff", ""])) # BOM - for i in range(length + random.randrange(-variance, variance)): - s.append(chr(random.randrange(256))) - return "".join(s) - -def make_random_unicode(length=10, variance=1): - s = [] - for i in range(length + random.randrange(-variance, variance)): - s.append(unichr(random.randrange(sys.maxunicode))) - return "".join(s) - -def check_encode(encoding, s): - try: - s.encode(encoding) - except UnicodeError: - pass - s.encode(encoding, "ignore") - s.encode(encoding, "replace") - -def check_decode(encoding, s): - try: - s.decode(encoding) - except UnicodeError: - pass - s.decode(encoding, "ignore") - s.decode(encoding, "replace") - -def check_with_length(length): - try: - s = make_random_encoded_string(length, 10) - for encoding in all_encodings: - check_decode(encoding, s) - except Exception as e: - print "decoding:", encoding, repr(s) - try: - s = make_random_unicode(length, 10) - for encoding in all_encodings: - check_encode(encoding, s) - except Exception as e: - print "encoding:", encoding, repr(s) - - -def main(): - for length in range(0, 1000, 10): - print length - for i in range(100): - check_with_length(length) - length = 1000 - for length in range(1000, 1000000, 1000): - print length - for i in range(100): - check_with_length(length) - -all_encodings = "utf-8 latin1 ascii utf-16 utf-16-be utf-16-le utf-7".split() - -if __name__ == '__main__': - main() - From pypy.commits at gmail.com Sat Sep 21 15:24:16 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 21 Sep 2019 12:24:16 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps: close to-be-merged branch Message-ID: <5d8678e0.1c69fb81.76dcd.95e7@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: json-decoder-maps Changeset: r97580:e63efbf454cd Date: 2019-09-21 20:50 +0200 http://bitbucket.org/pypy/pypy/changeset/e63efbf454cd/ Log: close to-be-merged branch From pypy.commits at gmail.com Sat Sep 21 15:24:18 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 21 Sep 2019 12:24:18 -0700 (PDT) Subject: [pypy-commit] pypy default: merge json-decoder-maps: Message-ID: <5d8678e2.1c69fb81.20a6d.774e@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97581:89a3715662ef Date: 2019-09-21 21:06 +0200 http://bitbucket.org/pypy/pypy/changeset/89a3715662ef/ Log: merge json-decoder-maps: implement a much faster json decoder (3x speedup for large json files, 2x less memory) used techniques: - SWAR (SIMD within a register) techniques for finding the end of whitespace and the end of strings - cache strings aggressively - use maps for representing the resulting objects. diff too long, truncating to 2000 out of 2102 lines diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -5,3 +5,9 @@ .. this is a revision shortly after release-pypy-7.2.0 .. startrev: 78cd4acbcbec + +.. branch: json-decoder-maps + +Much faster and more memory-efficient JSON decoding. The resulting +dictionaries that come out of the JSON decoder have faster lookups too. + diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -1,11 +1,13 @@ import sys from rpython.rlib.rstring import StringBuilder -from rpython.rlib.objectmodel import specialize, always_inline, r_dict -from rpython.rlib import rfloat, rutf8 +from rpython.rlib.objectmodel import specialize, always_inline +from rpython.rlib import rfloat, runicode, jit, objectmodel, rutf8 from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rlib.rarithmetic import r_uint from pypy.interpreter.error import oefmt from pypy.interpreter import unicodehelper +from pypy.interpreter.baseobjspace import W_Root +from pypy.module._pypyjson import simd OVF_DIGITS = len(str(sys.maxint)) @@ -15,45 +17,107 @@ # precomputing negative powers of 10 is MUCH faster than using e.g. math.pow # at runtime NEG_POW_10 = [10.0**-i for i in range(16)] +del i + def neg_pow_10(x, exp): if exp >= len(NEG_POW_10): return 0.0 return x * NEG_POW_10[exp] -def slice_eq(a, b): - (ll_chars1, start1, length1, _) = a - (ll_chars2, start2, length2, _) = b - if length1 != length2: - return False - j = start2 - for i in range(start1, start1 + length1): - if ll_chars1[i] != ll_chars2[j]: - return False - j += 1 - return True -def slice_hash(a): - (ll_chars, start, length, h) = a - return h +class IntCache(object): + """ A cache for wrapped ints between START and END """ -TYPE_UNKNOWN = 0 -TYPE_STRING = 1 -class JSONDecoder(object): + # I also tried various combinations of having an LRU cache for ints as + # well, didn't really help. + + # XXX one thing to do would be to use withintprebuilt in general again, + # hidden behind a 'we_are_jitted' + + START = -10 + END = 256 + + def __init__(self, space): + self.space = space + self.cache = [self.space.newint(i) + for i in range(self.START, self.END)] + + def newint(self, intval): + if self.START <= intval < self.END: + return self.cache[intval - self.START] + return self.space.newint(intval) + + +class JSONDecoder(W_Root): + + LRU_SIZE = 16 + LRU_MASK = LRU_SIZE - 1 + + DEFAULT_SIZE_SCRATCH = 20 + + # string caching is only used if the total size of the message is larger + # than a megabyte. Below that, there can't be that many repeated big + # strings anyway (some experiments showed this to be a reasonable cutoff + # size) + MIN_SIZE_FOR_STRING_CACHE = 1024 * 1024 + + # evaluate the string cache for 200 strings, before looking at the hit rate + # and deciding whether to keep doing it + STRING_CACHE_EVALUATION_SIZE = 200 + + # keep using the string cache if at least 25% of all decoded strings are a + # hit in the cache + STRING_CACHE_USEFULNESS_FACTOR = 4 + + def __init__(self, space, s): self.space = space + self.w_empty_string = space.newutf8("", 0) + self.s = s + # we put our string in a raw buffer so: # 1) we automatically get the '\0' sentinel at the end of the string, # which means that we never have to check for the "end of string" # 2) we can pass the buffer directly to strtod - self.ll_chars = rffi.str2charp(s) + self.ll_chars, self.llobj, self.flag = rffi.get_nonmovingbuffer_ll_final_null(self.s) self.end_ptr = lltype.malloc(rffi.CCHARPP.TO, 1, flavor='raw') self.pos = 0 - self.cache = r_dict(slice_eq, slice_hash, simple_hash_eq=True) + self.intcache = space.fromcache(IntCache) + + # two caches, one for keys, one for general strings. they both have the + # form {hash-as-int: StringCacheEntry} and they don't deal with + # collisions at all. For every hash there is simply one string stored + # and we ignore collisions. + self.cache_keys = {} + self.cache_values = {} + + # we don't cache *all* non-key strings, that would be too expensive. + # instead, keep a cache of the last 16 strings hashes around and add a + # string to the cache only if its hash is seen a second time + self.lru_cache = [0] * self.LRU_SIZE + self.lru_index = 0 + + self.startmap = self.space.fromcache(Terminator) + + # keep a list of objects that are created with maps that aren't clearly + # useful. If they turn out to be useful in the end we are good, + # otherwise convert them to dicts (see .close()) + self.unclear_objects = [] + + # this is a freelist of lists that store the decoded value of an + # object, before they get copied into the eventual dict + self.scratch = [[None] * self.DEFAULT_SIZE_SCRATCH] + def close(self): - rffi.free_charp(self.ll_chars) + rffi.free_nonmovingbuffer_ll(self.ll_chars, self.llobj, self.flag) lltype.free(self.end_ptr, flavor='raw') + # clean up objects that are instances of now blocked maps + for w_obj in self.unclear_objects: + jsonmap = self._get_jsonmap_from_dict(w_obj) + if jsonmap.is_state_blocked(): + self._devolve_jsonmap_dict(w_obj) def getslice(self, start, end): assert start >= 0 @@ -61,23 +125,22 @@ return self.s[start:end] def skip_whitespace(self, i): + ll_chars = self.ll_chars while True: - ch = self.ll_chars[i] + ch = ll_chars[i] if is_whitespace(ch): - i+=1 + i += 1 else: break return i - @specialize.arg(1) - def _raise(self, msg, *args): - raise oefmt(self.space.w_ValueError, msg, *args) - - def decode_any(self, i): + def decode_any(self, i, contextmap=None): + """ Decode an object at position i. Optionally pass a contextmap, if + the value is decoded as the value of a dict. """ i = self.skip_whitespace(i) ch = self.ll_chars[i] if ch == '"': - return self.decode_string(i+1) + return self.decode_string(i+1, contextmap) elif ch == '[': return self.decode_array(i+1) elif ch == '{': @@ -102,6 +165,11 @@ self._raise("No JSON object could be decoded: unexpected '%s' at char %d", ch, i) + + @specialize.arg(1) + def _raise(self, msg, *args): + raise oefmt(self.space.w_ValueError, msg, *args) + def decode_null(self, i): if (self.ll_chars[i] == 'u' and self.ll_chars[i+1] == 'l' and @@ -162,7 +230,7 @@ return self.decode_int_slow(start) self.pos = i - return self.space.newint(intval) + return self.intcache.newint(intval) def decode_float(self, i): from rpython.rlib import rdtoa @@ -214,7 +282,22 @@ ovf_maybe = (count >= OVF_DIGITS) return i, ovf_maybe, sign * intval + def _raise_control_char_in_string(self, ch, startindex, currindex): + if ch == '\0': + self._raise("Unterminated string starting at char %d", + startindex - 1) + else: + self._raise("Invalid control character at char %d", currindex-1) + + def _raise_object_error(self, ch, start, i): + if ch == '\0': + self._raise("Unterminated object starting at char %d", start) + else: + self._raise("Unexpected '%s' when decoding object (char %d)", + ch, i) + def decode_array(self, i): + """ Decode a list. i must be after the opening '[' """ w_list = self.space.newlist([]) start = i i = self.skip_whitespace(start) @@ -248,62 +331,116 @@ self.pos = i+1 return self.space.newdict() - d = self._create_empty_dict() + if self.scratch: + values_w = self.scratch.pop() + else: + values_w = [None] * self.DEFAULT_SIZE_SCRATCH + nextindex = 0 + currmap = self.startmap while True: # parse a key: value - w_name = self.decode_key(i) + currmap = self.decode_key_map(i, currmap) i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] if ch != ':': self._raise("No ':' found at char %d", i) i += 1 - i = self.skip_whitespace(i) - # - w_value = self.decode_any(i) - d[w_name] = w_value + + w_value = self.decode_any(i, currmap) + + if nextindex == len(values_w): # full + values_w = values_w + [None] * len(values_w) # double + values_w[nextindex] = w_value + nextindex += 1 i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] i += 1 if ch == '}': self.pos = i - return self._create_dict(d) + self.scratch.append(values_w) # can reuse next time + if currmap.is_state_blocked(): + dict_w = self._switch_to_dict(currmap, values_w, nextindex) + return self._create_dict(dict_w) + values_w = values_w[:nextindex] + w_res = self._create_dict_map(values_w, currmap) + if not currmap.is_state_useful(): + self.unclear_objects.append(w_res) + return w_res elif ch == ',': - pass - elif ch == '\0': - self._raise("Unterminated object starting at char %d", start) + i = self.skip_whitespace(i) + if currmap.is_state_blocked(): + self.scratch.append(values_w) # can reuse next time + dict_w = self._switch_to_dict(currmap, values_w, nextindex) + return self.decode_object_dict(i, start, dict_w) else: - self._raise("Unexpected '%s' when decoding object (char %d)", - ch, i-1) + self._raise_object_error(ch, start, i - 1) - def decode_string(self, i): - start = i - bits = 0 + def _create_dict_map(self, values_w, jsonmap): + from pypy.objspace.std.jsondict import from_values_and_jsonmap + return from_values_and_jsonmap(self.space, values_w, jsonmap) + + def _devolve_jsonmap_dict(self, w_dict): + from pypy.objspace.std.jsondict import devolve_jsonmap_dict + devolve_jsonmap_dict(w_dict) + + def _get_jsonmap_from_dict(self, w_dict): + from pypy.objspace.std.jsondict import get_jsonmap_from_dict + return get_jsonmap_from_dict(w_dict) + + def _switch_to_dict(self, currmap, values_w, nextindex): + dict_w = self._create_empty_dict() + currmap.fill_dict(dict_w, values_w) + assert len(dict_w) == nextindex + return dict_w + + def decode_object_dict(self, i, start, dict_w): while True: - # this loop is a fast path for strings which do not contain escape - # characters + # parse a key: value + w_key = self.decode_key_string(i) + i = self.skip_whitespace(self.pos) + ch = self.ll_chars[i] + if ch != ':': + self._raise("No ':' found at char %d", i) + i += 1 + + w_value = self.decode_any(i) + dict_w[w_key] = w_value + i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] i += 1 - bits |= ord(ch) - if ch == '"': + if ch == '}': self.pos = i - return self._create_string(start, i - 1, bits) - elif ch == '\\' or ch < '\x20': - self.pos = i-1 - return self.decode_string_escaped(start) + return self._create_dict(dict_w) + elif ch == ',': + i = self.skip_whitespace(i) + else: + self._raise_object_error(ch, start, i - 1) - def _create_string(self, start, end, bits): - if bits & 0x80: - # the 8th bit is set, it's an utf8 string - content_utf8 = self.getslice(start, end) + def decode_string_uncached(self, i): + start = i + ll_chars = self.ll_chars + nonascii, i = simd.find_end_of_string_no_hash(ll_chars, i, len(self.s)) + ch = ll_chars[i] + if ch == '\\': + self.pos = i + return self.decode_string_escaped(start, nonascii) + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + else: + assert ch == '"' + + self.pos = i + 1 + return self._create_string_wrapped(start, i, nonascii) + + def _create_string_wrapped(self, start, end, nonascii): + content = self.getslice(start, end) + if nonascii: + # contains non-ascii chars, we need to check that it's valid utf-8 lgt = unicodehelper.check_utf8_or_raise(self.space, - content_utf8) - return self.space.newutf8(content_utf8, lgt) + content) else: - # ascii only, fast path (ascii is a strict subset of - # latin1, and we already checked that all the chars are < - # 128) - return self.space.newutf8(self.getslice(start, end), - end - start) + lgt = end - start + return self.space.newutf8(content, lgt) def _create_dict(self, d): from pypy.objspace.std.dictmultiobject import from_unicode_key_dict @@ -313,8 +450,7 @@ from pypy.objspace.std.dictmultiobject import create_empty_unicode_key_dict return create_empty_unicode_key_dict(self.space) - - def decode_string_escaped(self, start): + def decode_string_escaped(self, start, nonascii): i = self.pos builder = StringBuilder((i - start) * 2) # just an estimate assert start >= 0 @@ -325,25 +461,21 @@ i += 1 if ch == '"': content_utf8 = builder.build() - lgt = unicodehelper.check_utf8_or_raise(self.space, + length = unicodehelper.check_utf8_or_raise(self.space, content_utf8) self.pos = i - return self.space.newutf8(content_utf8, lgt) + return self.space.newutf8(content_utf8, length) elif ch == '\\': - i = self.decode_escape_sequence(i, builder) + i = self.decode_escape_sequence_to_utf8(i, builder) elif ch < '\x20': - if ch == '\0': - self._raise("Unterminated string starting at char %d", - start - 1) - else: - self._raise("Invalid control character at char %d", i-1) + self._raise_control_char_in_string(ch, start, i) else: builder.append(ch) - def decode_escape_sequence(self, i, builder): + def decode_escape_sequence_to_utf8(self, i, stringbuilder): ch = self.ll_chars[i] i += 1 - put = builder.append + put = stringbuilder.append if ch == '\\': put('\\') elif ch == '"': put('"' ) elif ch == '/': put('/' ) @@ -353,22 +485,37 @@ elif ch == 'r': put('\r') elif ch == 't': put('\t') elif ch == 'u': - return self.decode_escape_sequence_unicode(i, builder) + # may be a surrogate pair + return self.decode_escape_sequence_unicode(i, stringbuilder) else: self._raise("Invalid \\escape: %s (char %d)", ch, i-1) return i + def _get_int_val_from_hex4(self, i): + ll_chars = self.ll_chars + res = 0 + for i in range(i, i + 4): + ch = ord(ll_chars[i]) + if ord('a') <= ch <= ord('f'): + digit = ch - ord('a') + 10 + elif ord('A') <= ch <= ord('F'): + digit = ch - ord('A') + 10 + elif ord('0') <= ch <= ord('9'): + digit = ch - ord('0') + else: + raise ValueError + res = (res << 4) + digit + return res + def decode_escape_sequence_unicode(self, i, builder): # at this point we are just after the 'u' of the \u1234 sequence. start = i i += 4 - hexdigits = self.getslice(start, i) try: - val = int(hexdigits, 16) + val = self._get_int_val_from_hex4(start) if (0xd800 <= val <= 0xdbff and self.ll_chars[i] == '\\' and self.ll_chars[i+1] == 'u'): - hexdigits = self.getslice(i+2, i+6) - lowsurr = int(hexdigits, 16) + lowsurr = self._get_int_val_from_hex4(i + 2) if 0xdc00 <= lowsurr <= 0xdfff: # decode surrogate pair val = 0x10000 + (((val - 0xd800) << 10) | @@ -383,45 +530,618 @@ builder.append(utf8_ch) return i - def decode_key(self, i): - """ returns a wrapped unicode """ - from rpython.rlib.rarithmetic import intmask - i = self.skip_whitespace(i) + def decode_string(self, i, contextmap=None): + """ Decode a string at position i (which is right after the opening "). + Optionally pass a contextmap, if the value is decoded as the value of a + dict.""" + + ll_chars = self.ll_chars + start = i + ch = ll_chars[i] + if ch == '"': + self.pos = i + 1 + return self.w_empty_string # surprisingly common + + cache = True + if contextmap is not None: + # keep some statistics about the usefulness of the string cache on + # the contextmap + # the intuition about the contextmap is as follows: + # often there are string values stored in dictionaries that can + # never be usefully cached, like unique ids of objects. Then the + # strings *in those fields* of all objects should never be cached. + # However, the content of other fields can still be useful to + # cache. + contextmap.decoded_strings += 1 + if not contextmap.should_cache_strings(): + cache = False + if len(self.s) < self.MIN_SIZE_FOR_STRING_CACHE: + cache = False + + if not cache: + return self.decode_string_uncached(i) + + strhash, nonascii, i = simd.find_end_of_string(ll_chars, i, len(self.s)) + ch = ll_chars[i] + if ch == '\\': + self.pos = i + return self.decode_string_escaped(start, nonascii) + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + else: + assert ch == '"' + + self.pos = i + 1 + + length = i - start + strhash ^= length + + # check cache first: + try: + entry = self.cache_values[strhash] + except KeyError: + w_res = self._create_string_wrapped(start, i, nonascii) + # only add *some* strings to the cache, because keeping them all is + # way too expensive. first we check if the contextmap has caching + # disabled completely. if not, we check whether we have recently + # seen the same hash already, if yes, we cache the string. + if ((contextmap is not None and + contextmap.decoded_strings < self.STRING_CACHE_EVALUATION_SIZE) or + strhash in self.lru_cache): + entry = StringCacheEntry( + self.getslice(start, start + length), w_res) + self.cache_values[strhash] = entry + else: + self.lru_cache[self.lru_index] = strhash + self.lru_index = (self.lru_index + 1) & self.LRU_MASK + return w_res + if not entry.compare(ll_chars, start, length): + # collision! hopefully rare + return self._create_string_wrapped(start, i, nonascii) + if contextmap is not None: + contextmap.cache_hits += 1 + return entry.w_uni + + def decode_key_map(self, i, currmap): + """ Given the current map currmap of an object, decode the next key at + position i. This returns the new map of the object. """ + newmap = self._decode_key_map(i, currmap) + currmap.observe_transition(newmap, self.startmap) + return newmap + + def _decode_key_map(self, i, currmap): + ll_chars = self.ll_chars + # first try to see whether we happen to find currmap.nextmap_first + nextmap = currmap.fast_path_key_parse(self, i) + if nextmap is not None: + return nextmap + + start = i + ch = ll_chars[i] + if ch != '"': + self._raise("Key name must be string at char %d", i) + i += 1 + w_key = self._decode_key_string(i) + return currmap.get_next(w_key, self.s, start, self.pos, self.startmap) + + def _decode_key_string(self, i): + """ decode key at position i as a string. Key strings are always + cached, since they repeat a lot. """ + ll_chars = self.ll_chars + start = i + + strhash, nonascii, i = simd.find_end_of_string(ll_chars, i, len(self.s)) + + ch = ll_chars[i] + if ch == '\\': + self.pos = i + w_key = self.decode_string_escaped(start, nonascii) + return w_key + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + length = i - start + strhash ^= length + self.pos = i + 1 + # check cache first: + try: + entry = self.cache_keys[strhash] + except KeyError: + w_res = self._create_string_wrapped(start, i, nonascii) + entry = StringCacheEntry( + self.getslice(start, start + length), w_res) + self.cache_keys[strhash] = entry + return w_res + if not entry.compare(ll_chars, start, length): + # collision! hopefully rare + w_res = self._create_string_wrapped(start, i, nonascii) + else: + w_res = entry.w_uni + return w_res + + def decode_key_string(self, i): ll_chars = self.ll_chars ch = ll_chars[i] if ch != '"': self._raise("Key name must be string at char %d", i) i += 1 + return self._decode_key_string(i) - start = i - bits = 0 - strhash = ord(ll_chars[i]) << 7 - while True: - ch = ll_chars[i] + +class StringCacheEntry(object): + """ A cache entry, bundling the encoded version of a string as it appears + in the input string, and its wrapped decoded variant. """ + def __init__(self, repr, w_uni): + # repr is the escaped string + self.repr = repr + # uni is the wrapped decoded string + self.w_uni = w_uni + + def compare(self, ll_chars, start, length): + """ Check whether self.repr occurs at ll_chars[start:start+length] """ + if length != len(self.repr): + return False + index = start + for c in self.repr: + if not ll_chars[index] == c: + return False + index += 1 + return True + + +class MapBase(object): + """ A map implementation to speed up parsing of json dicts, and to + represent the resulting dicts more compactly and make access faster. """ + + # the basic problem we are trying to solve is the following: dicts in + # json can either be used as objects, or as dictionaries with arbitrary + # string keys. We want to use maps for the former, but not for the + # latter. But we don't know in advance which kind of dict is which. + + # Therefore we create "preliminary" maps where we aren't quite sure yet + # whether they are really useful maps or not. If we see them used often + # enough, we promote them to "useful" maps, which we will actually + # instantiate objects with. + + # If we determine that a map is not used often enough, we can turn it + # into a "blocked" map, which is a point in the map tree where we will + # switch to regular dicts, when we reach that part of the tree. + + # One added complication: We want to keep the number of preliminary maps + # bounded to prevent generating tons of useless maps. but also not too + # small, to support having a json file that contains many uniform objects + # with tons of keys. That's where the idea of "fringe" maps comes into + # play. They are maps that sit between known useful nodes and preliminary + # nodes in the map transition tree. We bound only the number of fringe + # nodes we are considering (to MAX_FRINGE), but not the number of + # preliminary maps. When we have too many fringe maps, we remove the least + # commonly instantiated fringe map and mark it as blocked. + + # allowed graph edges or nodes in nextmap_all: + # USEFUL ------- + # / \ \ + # v v v + # FRINGE USEFUL BLOCKED + # | + # v + # PRELIMINARY + # | + # v + # PRELIMINARY + + # state transitions: + # PRELIMINARY + # / | \ + # | v v + # | FRINGE -> USEFUL + # | | + # \ | + # v v + # BLOCKED + + # the nextmap_first edge can only be these graph edges: + # USEFUL + # | + # v + # USEFUL + # + # FRINGE + # | + # v + # PRELIMINARY + # | + # v + # PRELIMINARY + + USEFUL = 'u' + PRELIMINARY = 'p' + FRINGE = 'f' # buffer between PRELIMINARY and USEFUL + BLOCKED = 'b' + + # tunable parameters + MAX_FRINGE = 40 + USEFUL_THRESHOLD = 5 + + def __init__(self, space): + self.space = space + + # a single transition is stored in .nextmap_first + self.nextmap_first = None + + # nextmap_all is only initialized after seeing the *second* transition + # but then it also contains .nextmap_first + self.nextmap_all = None # later dict {key: nextmap} + + # keep some statistics about every map: how often it was instantiated + # and how many non-blocked leaves the map transition tree has, starting + # from self + self.instantiation_count = 0 + self.number_of_leaves = 1 + + def _check_invariants(self): + if self.nextmap_all: + for next in self.nextmap_all.itervalues(): + next._check_invariants() + elif self.nextmap_first: + self.nextmap_first._check_invariants() + + def get_next(self, w_key, string, start, stop, terminator): + from pypy.objspace.std.dictmultiobject import unicode_hash, unicode_eq + if isinstance(self, JSONMap): + assert not self.state == MapBase.BLOCKED + nextmap_first = self.nextmap_first + if (nextmap_first is not None and + nextmap_first.w_key.eq_w(w_key)): + return nextmap_first + + assert stop >= 0 + assert start >= 0 + + if nextmap_first is None: + # first transition ever seen, don't initialize nextmap_all + next = self._make_next_map(w_key, string[start:stop]) + self.nextmap_first = next + else: + if self.nextmap_all is None: + # 2nd transition ever seen + self.nextmap_all = objectmodel.r_dict(unicode_eq, unicode_hash, + force_non_null=True, simple_hash_eq=True) + self.nextmap_all[nextmap_first.w_key] = nextmap_first + else: + next = self.nextmap_all.get(w_key, None) + if next is not None: + return next + # if we are at this point we didn't find the transition yet, so + # create a new one + next = self._make_next_map(w_key, string[start:stop]) + self.nextmap_all[w_key] = next + + # one new leaf has been created + self.change_number_of_leaves(1) + + terminator.register_potential_fringe(next) + return next + + def change_number_of_leaves(self, difference): + """ add difference to .number_of_leaves of self and its parents """ + if not difference: + return + parent = self + while isinstance(parent, JSONMap): + parent.number_of_leaves += difference + parent = parent.prev + parent.number_of_leaves += difference # terminator + + def fast_path_key_parse(self, decoder, position): + """ Fast path when parsing the next key: We speculate that we will + always see a commonly seen next key, and use strcmp (implemented in + key_repr_cmp) to check whether that is the case. """ + nextmap_first = self.nextmap_first + if nextmap_first: + ll_chars = decoder.ll_chars + assert isinstance(nextmap_first, JSONMap) + if nextmap_first.key_repr_cmp(ll_chars, position): + decoder.pos = position + len(nextmap_first.key_repr) + return nextmap_first + return None + + def observe_transition(self, newmap, terminator): + """ observe a transition from self to newmap. + This does a few things, including updating the self size estimate with + the knowledge that one object transitioned from self to newmap. + also it potentially decides that self should move to state USEFUL.""" + newmap.instantiation_count += 1 + if isinstance(self, JSONMap) and self.state == MapBase.FRINGE: + if self.is_useful(): + self.mark_useful(terminator) + + def _make_next_map(self, w_key, key_repr): + return JSONMap(self.space, self, w_key, key_repr) + + def fill_dict(self, dict_w, values_w): + """ recursively fill the dictionary dict_w in the correct order, + reading from values_w.""" + raise NotImplementedError("abstract base") + + def _all_dot(self, output): + identity = objectmodel.compute_unique_id(self) + output.append('%s [shape=box%s];' % (identity, self._get_dot_text())) + if self.nextmap_all: + for w_key, value in self.nextmap_all.items(): + assert isinstance(value, JSONMap) + if value is self.nextmap_first: + color = ", color=blue" + else: + color = "" + output.append('%s -> %s [label="%s"%s];' % ( + identity, objectmodel.compute_unique_id(value), value.w_key._utf8, color)) + value._all_dot(output) + elif self.nextmap_first is not None: + value = self.nextmap_first + output.append('%s -> %s [label="%s", color=blue];' % ( + identity, objectmodel.compute_unique_id(value), value.w_key._utf8)) + value._all_dot(output) + + + def _get_dot_text(self): + return ", label=base" + + def view(self): + from dotviewer import graphclient + import pytest + r = ["digraph G {"] + self._all_dot(r) + r.append("}") + p = pytest.ensuretemp("jsonmap").join("temp.dot") + p.write("\n".join(r)) + graphclient.display_dot_file(str(p)) + + +class Terminator(MapBase): + """ The root node of the map transition tree. """ + def __init__(self, space): + MapBase.__init__(self, space) + # a set of all map nodes that are currently in the FRINGE state + self.current_fringe = {} + + def register_potential_fringe(self, prelim): + """ add prelim to the fringe, if its prev is either a Terminator or + useful. """ + prev = prelim.prev + if (isinstance(prev, Terminator) or + isinstance(prev, JSONMap) and prev.state == MapBase.USEFUL): + assert prelim.state == MapBase.PRELIMINARY + prelim.state = MapBase.FRINGE + + if len(self.current_fringe) > MapBase.MAX_FRINGE: + self.cleanup_fringe() + self.current_fringe[prelim] = None + + def remove_from_fringe(self, former_fringe): + """ Remove former_fringe from self.current_fringe. """ + assert former_fringe.state in (MapBase.USEFUL, MapBase.BLOCKED) + del self.current_fringe[former_fringe] + + def cleanup_fringe(self): + """ remove the least-instantiated fringe map and block it.""" + min_fringe = None + min_avg = 1e200 + for f in self.current_fringe: + assert f.state == MapBase.FRINGE + avg = f.average_instantiation() + if avg < min_avg: + min_avg = avg + min_fringe = f + assert min_fringe + min_fringe.mark_blocked(self) + + def fill_dict(self, dict_w, values_w): + """ recursively fill the dictionary dict_w in the correct order, + reading from values_w.""" + return 0 + + def _check_invariants(self): + for fringe in self.current_fringe: + assert fringe.state == MapBase.FRINGE + +class JSONMap(MapBase): + """ A map implementation to speed up parsing """ + + def __init__(self, space, prev, w_key, key_repr): + MapBase.__init__(self, space) + + self.prev = prev + self.w_key = w_key + self.key_repr = key_repr + + self.state = MapBase.PRELIMINARY + + # key decoding stats + self.decoded_strings = 0 + self.cache_hits = 0 + + # for jsondict support + self.key_to_index = None + self.keys_in_order = None + self.strategy_instance = None + + def __repr__(self): + return "" % ( + self.key_repr, self.instantiation_count, self.number_of_leaves, self.prev) + + def _get_terminator(self): # only for _check_invariants + while isinstance(self, JSONMap): + self = self.prev + assert isinstance(self, Terminator) + return self + + def _check_invariants(self): + assert self.state in ( + MapBase.USEFUL, + MapBase.PRELIMINARY, + MapBase.FRINGE, + MapBase.BLOCKED, + ) + + prev = self.prev + if isinstance(prev, JSONMap): + prevstate = prev.state + else: + prevstate = MapBase.USEFUL + + if prevstate == MapBase.USEFUL: + assert self.state != MapBase.PRELIMINARY + elif prevstate == MapBase.PRELIMINARY: + assert self.state == MapBase.PRELIMINARY + elif prevstate == MapBase.FRINGE: + assert self.state == MapBase.PRELIMINARY + else: + # if prevstate is BLOCKED, we shouldn't have recursed here! + assert False, "should be unreachable" + + if self.state == MapBase.BLOCKED: + assert self.nextmap_first is None + assert self.nextmap_all is None + elif self.state == MapBase.FRINGE: + assert self in self._get_terminator().current_fringe + + MapBase._check_invariants(self) + + def mark_useful(self, terminator): + """ mark self as useful, and also the most commonly instantiated + children, recursively """ + was_fringe = self.state == MapBase.FRINGE + assert self.state in (MapBase.FRINGE, MapBase.PRELIMINARY) + self.state = MapBase.USEFUL + if was_fringe: + terminator.remove_from_fringe(self) + # find the most commonly instantiated child, store it into + # nextmap_first and mark it useful, recursively + maxchild = self.nextmap_first + if self.nextmap_all is not None: + for child in self.nextmap_all.itervalues(): + if child.instantiation_count > maxchild.instantiation_count: + maxchild = child + if maxchild is not None: + maxchild.mark_useful(terminator) + if self.nextmap_all: + for child in self.nextmap_all.itervalues(): + if child is not maxchild: + terminator.register_potential_fringe(child) + self.nextmap_first = maxchild + + def mark_blocked(self, terminator): + """ mark self and recursively all its children as blocked.""" + was_fringe = self.state == MapBase.FRINGE + self.state = MapBase.BLOCKED + if was_fringe: + terminator.remove_from_fringe(self) + if self.nextmap_all: + for next in self.nextmap_all.itervalues(): + next.mark_blocked(terminator) + elif self.nextmap_first: + self.nextmap_first.mark_blocked(terminator) + self.nextmap_first = None + self.nextmap_all = None + self.change_number_of_leaves(-self.number_of_leaves + 1) + + def is_state_blocked(self): + return self.state == MapBase.BLOCKED + + def is_state_useful(self): + return self.state == MapBase.USEFUL + + def average_instantiation(self): + """ the number of instantiations, divided by the number of leaves. We + want to favor nodes that have either a high instantiation count, or few + leaves below it. """ + return self.instantiation_count / float(self.number_of_leaves) + + def is_useful(self): + return self.average_instantiation() > self.USEFUL_THRESHOLD + + def should_cache_strings(self): + """ return whether strings parsed in the context of this map should be + cached. """ + # we should cache if either we've seen few strings so far (less than + # STRING_CACHE_EVALUATION_SIZE), or if we've seen many, and the cache + # hit rate has been high enough + return not (self.decoded_strings > JSONDecoder.STRING_CACHE_EVALUATION_SIZE and + self.cache_hits * JSONDecoder.STRING_CACHE_USEFULNESS_FACTOR < self.decoded_strings) + + def key_repr_cmp(self, ll_chars, i): + # XXX should we use "real" memcmp (here in particular, and in other + # places in RPython in general)? + for j, c in enumerate(self.key_repr): + if ll_chars[i] != c: + return False i += 1 - if ch == '"': - break - elif ch == '\\' or ch < '\x20': - self.pos = i-1 - return self.decode_string_escaped(start) - strhash = intmask((1000003 * strhash) ^ ord(ll_chars[i])) - bits |= ord(ch) - length = i - start - 1 - if length == 0: - strhash = -1 + return True + + def fill_dict(self, dict_w, values_w): + index = self.prev.fill_dict(dict_w, values_w) + dict_w[self.w_key] = values_w[index] + return index + 1 + + # _____________________________________________________ + # methods for JsonDictStrategy + + @jit.elidable + def get_index(self, w_key): + from pypy.objspace.std.unicodeobject import W_UnicodeObject + assert isinstance(w_key, W_UnicodeObject) + return self.get_key_to_index().get(w_key, -1) + + def get_key_to_index(self): + from pypy.objspace.std.dictmultiobject import unicode_hash, unicode_eq + key_to_index = self.key_to_index + if key_to_index is None: + key_to_index = self.key_to_index = objectmodel.r_dict(unicode_eq, unicode_hash, + force_non_null=True, simple_hash_eq=True) + # compute depth + curr = self + depth = 0 + while True: + depth += 1 + curr = curr.prev + if not isinstance(curr, JSONMap): + break + + curr = self + while depth: + depth -= 1 + key_to_index[curr.w_key] = depth + curr = curr.prev + if not isinstance(curr, JSONMap): + break + return key_to_index + + def get_keys_in_order(self): + keys_in_order = self.keys_in_order + if keys_in_order is None: + key_to_index = self.get_key_to_index() + keys_in_order = self.keys_in_order = [None] * len(key_to_index) + for w_key, index in key_to_index.iteritems(): + keys_in_order[index] = w_key + return keys_in_order + + # _____________________________________________________ + + def _get_dot_text(self): + if self.nextmap_all is None: + l = int(self.nextmap_first is not None) else: - strhash ^= length - strhash = intmask(strhash) - self.pos = i - # check cache first: - key = (ll_chars, start, length, strhash) - try: - return self.cache[key] - except KeyError: - pass - res = self._create_string(start, i - 1, bits) - self.cache[key] = res + l = len(self.nextmap_all) + extra = "" + if self.decoded_strings: + extra = "\\n%s/%s (%s%%)" % (self.cache_hits, self.decoded_strings, self.cache_hits/float(self.decoded_strings)) + res = ', label="#%s\\nchildren: %s%s"' % (self.instantiation_count, l, extra) + if self.state == MapBase.BLOCKED: + res += ", fillcolor=lightsalmon" + if self.state == MapBase.FRINGE: + res += ", fillcolor=lightgray" + if self.state == MapBase.PRELIMINARY: + res += ", fillcolor=lightslategray" return res @@ -442,3 +1162,4 @@ return w_res finally: decoder.close() + diff --git a/pypy/module/_pypyjson/simd.py b/pypy/module/_pypyjson/simd.py new file mode 100644 --- /dev/null +++ b/pypy/module/_pypyjson/simd.py @@ -0,0 +1,225 @@ +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib import objectmodel, unroll +from rpython.rlib.rarithmetic import r_uint, intmask, LONG_BIT +from rpython.jit.backend.detect_cpu import autodetect + +# accelerators for string operations using simd on regular word sizes (*not* +# SSE instructions). this style is sometimes called SWAR (SIMD Within A +# Register) or "broadword techniques" + +# XXX remove wordsize and endianness restrictions properly, so far only x86-64 +# is tested + +USE_SIMD = False +if LONG_BIT == 64: + WORD_SIZE = 8 + EVERY_BYTE_ONE = 0x0101010101010101 + EVERY_BYTE_HIGHEST_BIT = 0x8080808080808080 + if autodetect() == "x86-64": + USE_SIMD = True +else: + WORD_SIZE = 4 + EVERY_BYTE_ONE = 0x01010101 + EVERY_BYTE_HIGHEST_BIT = 0x80808080 + + +# helpers + +unrolling_wordsize = unroll.unrolling_iterable(range(WORD_SIZE)) + +def char_repeated_word_width(ch): + return r_uint(EVERY_BYTE_ONE) * ord(ch) + +def any_char_zero(word): + return (word - r_uint(EVERY_BYTE_ONE)) & ~word & r_uint(EVERY_BYTE_HIGHEST_BIT) + +def any_char_in_words_zero(*words): + return _any_char_in_any_word_zero_accum(0, *words) + +def _any_char_in_any_word_zero_accum(accum, word, *words): + accum |= (word - r_uint(EVERY_BYTE_ONE)) & ~word + if not words: + return accum & r_uint(EVERY_BYTE_HIGHEST_BIT) + return _any_char_in_any_word_zero_accum(accum, *words) + +def print_chars(word): + # for debugging + out = '' + for i in range(WORD_SIZE): + out += chr(word & 0xff) + word >>= 8 + return out + +def index_nonzero(word): + # XXX can be done very cheap in theory + assert word + for i in unrolling_wordsize: + if word & 0xff: + return i + word >>= 8 + assert 0 + +def index_zero(word): + # XXX can be done very cheap in theory + assert any_char_zero(word) + for i in unrolling_wordsize: + if not word & 0xff: + return i + word >>= 8 + assert 0 # XXX ??? + +def set_high_bytes_to_zero(word, keep_bytes): + mask = ((~r_uint(0)) << (8 * keep_bytes)) + return word & ~mask + + + + at objectmodel.always_inline +def position_string_ender(word): + maskquote = char_repeated_word_width('"') + maskbackslash = char_repeated_word_width('\\') + maskx20 = char_repeated_word_width(chr(0xff - 0x1f)) + # x1 and x2 check for equality, if a byte is 0 the corresponding + # char is equal to " or \ + x1 = maskquote ^ word + x2 = maskbackslash ^ word + # x3 checks for char < 0x20, the byte is 0 in that case + x3 = maskx20 & word + return any_char_in_words_zero(x1, x2, x3) + + at objectmodel.always_inline +def find_end_of_string_simd_unaligned(ll_chars, startpos, length): + ch = ll_chars[startpos] + strhash = (ord(ch) << 7) ^ 0x345678 + + wordarray = rffi.cast(rffi.ULONGP, rffi.ptradd(ll_chars, startpos)) + num_safe_reads = (length - startpos) // WORD_SIZE + + bits = 0 + for i in range(num_safe_reads): + word = wordarray[i] + cond = position_string_ender(word) + if cond: + break + bits |= word + strhash = intmask((1000003 * strhash) ^ intmask(word)) + else: + # didn't find end of string yet, look at remaining chars + word = 0 + shift = 0 + i = startpos + num_safe_reads * WORD_SIZE + while True: # this loop should run at most WORD_SIZE times, + # if we assume that ll_chars[length] == '\x00' + ch = ll_chars[i] + if ch == '"' or ch == '\\' or ch < '\x20': + break + i += 1 + bits |= ord(ch) + word |= ord(ch) << shift + shift += 8 + if shift: + strhash = intmask((1000003 * strhash) ^ intmask(word)) + + nonascii = bool(bits & char_repeated_word_width(chr(0x80))) + return strhash, nonascii, i + + # compute endposition + nonzero = index_nonzero(cond) + endposition = startpos + i * WORD_SIZE + nonzero + if nonzero: + word = set_high_bytes_to_zero(word, nonzero) + bits |= word + strhash = intmask((1000003 * strhash) ^ intmask(word)) + + nonascii = bool(bits & char_repeated_word_width(chr(0x80))) + + return strhash, nonascii, endposition + + at objectmodel.always_inline +def find_end_of_string_simd_unaligned_no_hash(ll_chars, startpos, length): + ch = ll_chars[startpos] + + wordarray = rffi.cast(rffi.ULONGP, rffi.ptradd(ll_chars, startpos)) + num_safe_reads = (length - startpos) // WORD_SIZE + + bits = 0 + for i in range(num_safe_reads): + word = wordarray[i] + cond = position_string_ender(word) + if cond: + break + bits |= word + else: + # didn't find end of string yet, look at remaining chars + i = startpos + num_safe_reads * WORD_SIZE + while True: # this loop should run at most WORD_SIZE times, + # if we assume that ll_chars[length] == '\x00' + ch = ll_chars[i] + if ch == '"' or ch == '\\' or ch < '\x20': + break + i += 1 + bits |= ord(ch) + + nonascii = bool(bits & char_repeated_word_width(chr(0x80))) + return nonascii, i + + # compute endposition + nonzero = index_nonzero(cond) + endposition = startpos + i * WORD_SIZE + nonzero + if nonzero: + word = set_high_bytes_to_zero(word, nonzero) + bits |= word + + nonascii = bool(bits & char_repeated_word_width(chr(0x80))) + + return nonascii, endposition + + + at objectmodel.always_inline +def find_end_of_string_slow(ll_chars, i, length): + ch = ll_chars[i] + strhash = (ord(ch) << 7) ^ 0x345678 + word = 0 + shift = 0 + + bits = 0 + + while True: + # this loop is a fast path for strings which do not contain escape + # characters + ch = ll_chars[i] + if ch == '"' or ch == '\\' or ch < '\x20': + break + i += 1 + bits |= ord(ch) + + word |= ord(ch) << shift + shift += 8 + if shift == WORD_SIZE * 8: + strhash = intmask((1000003 * strhash) ^ word) + shift = 0 + word = 0 + + if shift: + strhash = intmask((1000003 * strhash) ^ word) + return strhash, bool(bits & 0x80), i + + at objectmodel.always_inline +def find_end_of_string_slow_no_hash(ll_chars, i, length): + bits = 0 + while True: + # this loop is a fast path for strings which do not contain escape + # characters + ch = ll_chars[i] + if ch == '"' or ch == '\\' or ch < '\x20': + break + i += 1 + bits |= ord(ch) + return bool(bits & 0x80), i + +if USE_SIMD: + find_end_of_string = find_end_of_string_simd_unaligned + find_end_of_string_no_hash = find_end_of_string_simd_unaligned_no_hash +else: + find_end_of_string = find_end_of_string_slow + find_end_of_string_no_hash = find_end_of_string_slow_no_hash diff --git a/pypy/module/_pypyjson/test/test__pypyjson.py b/pypy/module/_pypyjson/test/test__pypyjson.py --- a/pypy/module/_pypyjson/test/test__pypyjson.py +++ b/pypy/module/_pypyjson/test/test__pypyjson.py @@ -1,31 +1,266 @@ # -*- encoding: utf-8 -*- -from pypy.module._pypyjson.interp_decoder import JSONDecoder +import pytest +from pypy.module._pypyjson.interp_decoder import JSONDecoder, Terminator, MapBase +from rpython.rtyper.lltypesystem import lltype, rffi -def test_skip_whitespace(): - s = ' hello ' - dec = JSONDecoder('fake space', s) - assert dec.pos == 0 - assert dec.skip_whitespace(0) == 3 - assert dec.skip_whitespace(3) == 3 - assert dec.skip_whitespace(8) == len(s) - dec.close() -class FakeSpace(object): - def newutf8(self, s, l): - return s +class TestJson(object): + def test_skip_whitespace(self): + s = ' hello ' + dec = JSONDecoder(self.space, s) + assert dec.pos == 0 + assert dec.skip_whitespace(0) == 3 + assert dec.skip_whitespace(3) == 3 + assert dec.skip_whitespace(8) == len(s) + dec.close() -def test_decode_key(): - s1 = "123" * 100 - s = ' "%s" "%s" ' % (s1, s1) - dec = JSONDecoder(FakeSpace(), s) - assert dec.pos == 0 - x = dec.decode_key(0) - assert x == s1 - # check caching - y = dec.decode_key(dec.pos) - assert y == s1 - assert y is x - dec.close() + def test_json_map(self): + m = Terminator(self.space) + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_c = self.space.newutf8("c", 1) + m1 = m.get_next(w_a, '"a"', 0, 3, m) + assert m1.w_key == w_a + assert m1.nextmap_first is None + assert m1.key_repr == '"a"' + assert m1.key_repr_cmp('"a": 123', 0) + assert not m1.key_repr_cmp('b": 123', 0) + assert m.nextmap_first.w_key == w_a + + m2 = m.get_next(w_a, '"a"', 0, 3, m) + assert m2 is m1 + + m3 = m.get_next(w_b, '"b"', 0, 3, m) + assert m3.w_key == w_b + assert m3.nextmap_first is None + assert m3.key_repr == '"b"' + assert m.nextmap_first is m1 + + m4 = m3.get_next(w_c, '"c"', 0, 3, m) + assert m4.w_key == w_c + assert m4.nextmap_first is None + assert m4.key_repr == '"c"' + assert m3.nextmap_first is m4 + + def test_json_map_get_index(self): + m = Terminator(self.space) + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_c = self.space.newutf8("c", 1) + m1 = m.get_next(w_a, 'a"', 0, 2, m) + assert m1.get_index(w_a) == 0 + assert m1.get_index(w_b) == -1 + + m2 = m.get_next(w_b, 'b"', 0, 2, m) + assert m2.get_index(w_b) == 0 + assert m2.get_index(w_a) == -1 + + m3 = m2.get_next(w_c, 'c"', 0, 2, m) + assert m3.get_index(w_b) == 0 + assert m3.get_index(w_c) == 1 + assert m3.get_index(w_a) == -1 + + def test_jsonmap_fill_dict(self): + from collections import OrderedDict + m = Terminator(self.space) + space = self.space + w_a = space.newutf8("a", 1) + w_b = space.newutf8("b", 1) + w_c = space.newutf8("c", 1) + m1 = m.get_next(w_a, 'a"', 0, 2, m) + m2 = m1.get_next(w_b, 'b"', 0, 2, m) + m3 = m2.get_next(w_c, 'c"', 0, 2, m) + d = OrderedDict() + m3.fill_dict(d, [space.w_None, space.w_None, space.w_None]) + assert list(d) == [w_a, w_b, w_c] + + + def test_decode_key_map(self): + m = Terminator(self.space) + m_diff = Terminator(self.space) + for s1 in ["abc", "1001" * 10, u"ä".encode("utf-8")]: + s = ' "%s" "%s" "%s"' % (s1, s1, s1) + dec = JSONDecoder(self.space, s) + assert dec.pos == 0 + m1 = dec.decode_key_map(dec.skip_whitespace(0), m) + assert m1.w_key._utf8 == s1 + assert m1.key_repr == '"%s"' % s1 + + # check caching on w_key level + m2 = dec.decode_key_map(dec.skip_whitespace(dec.pos), m_diff) + assert m1.w_key is m2.w_key + + # check caching on map level + m3 = dec.decode_key_map(dec.skip_whitespace(dec.pos), m_diff) + assert m3 is m2 + dec.close() + + def test_decode_string_caching(self): + for s1 in ["abc", u"ä".encode("utf-8")]: + s = '"%s" "%s" "%s"' % (s1, s1, s1) + dec = JSONDecoder(self.space, s) + dec.MIN_SIZE_FOR_STRING_CACHE = 0 + assert dec.pos == 0 + w_x = dec.decode_string(1) + w_y = dec.decode_string(dec.skip_whitespace(dec.pos) + 1) + assert w_x is not w_y + # check caching + w_z = dec.decode_string(dec.skip_whitespace(dec.pos) + 1) + assert w_z is w_y + dec.close() + + def _make_some_maps(self): + # base -> m1 -> m2 -> m3 + # \-> m4 + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_c = self.space.newutf8("c", 1) + w_d = self.space.newutf8("d", 1) + base = Terminator(self.space) + base.instantiation_count = 6 + m1 = base.get_next(w_a, 'a"', 0, 2, base) + m2 = m1.get_next(w_b, 'b"', 0, 2, base) + m3 = m2.get_next(w_c, 'c"', 0, 2, base) + m4 = m2.get_next(w_d, 'd"', 0, 2, base) + return base, m1, m2, m3, m4 + + # unit tests for map state transistions + def test_fringe_to_useful(self): + base, m1, m2, m3, m4 = self._make_some_maps() + base.instantiation_count = 6 + assert m1.state == MapBase.FRINGE + m1.instantiation_count = 6 + + assert m2.state == MapBase.PRELIMINARY + m2.instantiation_count = 6 + + assert m3.state == MapBase.PRELIMINARY + m3.instantiation_count = 2 + assert m2.nextmap_first is m3 + + assert m4.state == MapBase.PRELIMINARY + m4.instantiation_count = 4 + + m1.mark_useful(base) + assert m1.state == MapBase.USEFUL + assert m2.state == MapBase.USEFUL + assert m3.state == MapBase.FRINGE + assert m4.state == MapBase.USEFUL + assert m2.nextmap_first is m4 + + assert m1.number_of_leaves == 2 + base._check_invariants() + + def test_number_of_leaves(self): + w_x = self.space.newutf8("x", 1) + base, m1, m2, m3, m4 = self._make_some_maps() + assert base.number_of_leaves == 2 + assert m1.number_of_leaves == 2 + assert m2.number_of_leaves == 2 + assert m3.number_of_leaves == 1 + assert m4.number_of_leaves == 1 + m5 = m2.get_next(w_x, 'x"', 0, 2, base) + assert base.number_of_leaves == 3 + assert m1.number_of_leaves == 3 + assert m2.number_of_leaves == 3 + assert m5.number_of_leaves == 1 + + def test_number_of_leaves_after_mark_blocked(self): + w_x = self.space.newutf8("x", 1) + base, m1, m2, m3, m4 = self._make_some_maps() + m5 = m2.get_next(w_x, 'x"', 0, 2, base) + assert base.number_of_leaves == 3 + m2.mark_blocked(base) + assert base.number_of_leaves == 1 + + def test_mark_useful_cleans_fringe(self): + base, m1, m2, m3, m4 = self._make_some_maps() + base.instantiation_count = 6 + assert m1.state == MapBase.FRINGE + m1.instantiation_count = 6 + m2.instantiation_count = 6 + m3.instantiation_count = 2 + m4.instantiation_count = 4 + assert base.current_fringe == {m1: None} + + m1.mark_useful(base) + assert base.current_fringe == {m3: None} + + def test_cleanup_fringe(self): + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_c = self.space.newutf8("c", 1) + w_d = self.space.newutf8("d", 1) + base = Terminator(self.space) + base.instantiation_count = 6 + m1 = base.get_next(w_a, 'a"', 0, 2, base) + m2 = base.get_next(w_b, 'b"', 0, 2, base) + m3 = base.get_next(w_c, 'c"', 0, 2, base) + m4 = base.get_next(w_d, 'd"', 0, 2, base) + m5 = m4.get_next(w_a, 'a"', 0, 2, base) + base.instantiation_count = 7 + m1.instantiation_count = 2 + m2.instantiation_count = 2 + m3.instantiation_count = 2 + m4.instantiation_count = 1 + m5.instantiation_count = 1 + assert base.current_fringe == dict.fromkeys([m1, m2, m3, m4]) + + base.cleanup_fringe() + assert base.current_fringe == dict.fromkeys([m1, m2, m3]) + assert m4.state == MapBase.BLOCKED + assert m4.nextmap_first is None + assert m4.nextmap_all is None + assert m5.state == MapBase.BLOCKED + assert m5.nextmap_first is None + assert m5.nextmap_all is None + + def test_deal_with_blocked(self): + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_c = self.space.newutf8("c", 1) + space = self.space + s = '{"a": 1, "b": 2, "c": 3}' + dec = JSONDecoder(space, s) + dec.startmap = base = Terminator(space) + m1 = base.get_next(w_a, 'a"', 0, 2, base) + m2 = m1.get_next(w_b, 'b"', 0, 2, base) + m2.mark_blocked(base) + w_res = dec.decode_object(1) + assert space.int_w(space.len(w_res)) == 3 + assert space.int_w(space.getitem(w_res, w_a)) == 1 + assert space.int_w(space.getitem(w_res, w_b)) == 2 + assert space.int_w(space.getitem(w_res, w_c)) == 3 + dec.close() + + def test_deal_with_blocked_number_of_leaves(self): + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_x = self.space.newutf8("x", 1) + w_u = self.space.newutf8("u", 1) + space = self.space + base = Terminator(space) + m1 = base.get_next(w_a, 'a"', 0, 2, base) + m2 = m1.get_next(w_b, 'b"', 0, 2, base) + m2.get_next(w_x, 'x"', 0, 2, base) + m2.get_next(w_u, 'u"', 0, 2, base) + assert base.number_of_leaves == 2 + m2.mark_blocked(base) + assert base.number_of_leaves == 1 + + def test_instatiation_count(self): + m = Terminator(self.space) + dec = JSONDecoder(self.space, '"abc" "def"') + m1 = dec.decode_key_map(dec.skip_whitespace(0), m) + m2 = dec.decode_key_map(dec.skip_whitespace(6), m1) + m1 = dec.decode_key_map(dec.skip_whitespace(0), m) + m2 = dec.decode_key_map(dec.skip_whitespace(6), m1) + m1 = dec.decode_key_map(dec.skip_whitespace(0), m) + + assert m1.instantiation_count == 3 + assert m2.instantiation_count == 2 + dec.close() + class AppTest(object): spaceconfig = {"objspace.usemodules._pypyjson": True} @@ -55,7 +290,7 @@ raises(ValueError, _pypyjson.loads, 'fa') raises(ValueError, _pypyjson.loads, 'f') raises(ValueError, _pypyjson.loads, 'falXX') - + def test_decode_string(self): import _pypyjson @@ -85,7 +320,7 @@ import _pypyjson assert _pypyjson.loads(r'"\\"') == u'\\' assert _pypyjson.loads(r'"\""') == u'"' - assert _pypyjson.loads(r'"\/"') == u'/' + assert _pypyjson.loads(r'"\/"') == u'/' assert _pypyjson.loads(r'"\b"') == u'\b' assert _pypyjson.loads(r'"\f"') == u'\f' assert _pypyjson.loads(r'"\n"') == u'\n' @@ -101,12 +336,19 @@ import _pypyjson s = r'"hello\nworld' # missing the trailing " raises(ValueError, "_pypyjson.loads(s)") - + def test_escape_sequence_unicode(self): import _pypyjson s = r'"\u1234"' assert _pypyjson.loads(s) == u'\u1234' + def test_escape_sequence_mixed_with_utf8(self): + import _pypyjson + utf8 = u'ä"'.encode("utf-8") + assert _pypyjson.loads(r'"abc\\' + utf8) == u'abc\\ä' + assert _pypyjson.loads(r'"abc\"' + utf8) == u'abc"ä' + assert _pypyjson.loads(r'"def\u1234' + utf8) == u'def\u1234ä' + def test_invalid_utf_8(self): import _pypyjson s = '"\xe0"' # this is an invalid UTF8 sequence inside a string @@ -176,13 +418,18 @@ s = '{"hello": "world", "aaa": "bbb"}' assert _pypyjson.loads(s) == {'hello': 'world', 'aaa': 'bbb'} + assert _pypyjson.loads(s) == {'hello': 'world', + 'aaa': 'bbb'} raises(ValueError, _pypyjson.loads, '{"key"') raises(ValueError, _pypyjson.loads, '{"key": 42') + assert _pypyjson.loads('{"neighborhood": ""}') == { + "neighborhood": ""} + def test_decode_object_nonstring_key(self): import _pypyjson raises(ValueError, "_pypyjson.loads('{42: 43}')") - + def test_decode_array(self): import _pypyjson assert _pypyjson.loads('[]') == [] @@ -263,3 +510,4 @@ for inputtext, errmsg in test_cases: exc = raises(ValueError, _pypyjson.loads, inputtext) assert str(exc.value) == errmsg + diff --git a/pypy/module/_pypyjson/test/test_simd.py b/pypy/module/_pypyjson/test/test_simd.py new file mode 100644 --- /dev/null +++ b/pypy/module/_pypyjson/test/test_simd.py @@ -0,0 +1,110 @@ +import sys +import pytest +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.rarithmetic import r_uint, intmask + +from pypy.module._pypyjson.simd import USE_SIMD +from pypy.module._pypyjson.simd import find_end_of_string_slow +from pypy.module._pypyjson.simd import find_end_of_string_slow_no_hash +from pypy.module._pypyjson.simd import print_chars +from pypy.module._pypyjson.simd import find_end_of_string_simd_unaligned, WORD_SIZE +from pypy.module._pypyjson.simd import find_end_of_string_simd_unaligned_no_hash + +try: + from hypothesis import example, given, strategies +except ImportError: + pytest.skip("missing hypothesis!") + +if not USE_SIMD: + pytest.skip("only implemented for 64 bit for now") + +def fill_to_word_size(res, ch=" "): + if len(res) % WORD_SIZE != 0: + res += ch * (WORD_SIZE - (len(res) % WORD_SIZE)) + return res + +def string_to_word(s): + assert len(s) == WORD_SIZE + ll_chars, llobj, flag = rffi.get_nonmovingbuffer_ll_final_null(s) + try: + wordarray = rffi.cast(rffi.ULONGP, ll_chars) + return wordarray[0] + finally: + rffi.free_nonmovingbuffer_ll(ll_chars, llobj, flag) + +def ll(callable, string, *args): + ll_chars, llobj, flag = rffi.get_nonmovingbuffer_ll_final_null(string) + try: + return callable(ll_chars, *args) + finally: + rffi.free_nonmovingbuffer_ll(ll_chars, llobj, flag) + +word = strategies.builds( + r_uint, strategies.integers(min_value=-sys.maxint-1, max_value=sys.maxint)) + +def build_string(prefix, content, end, suffix): + res = prefix + '"' + "".join([chr(x) for x in content]) + end + suffix + return fill_to_word_size(res), len(prefix) + 1 + +string_in_context_strategy = strategies.builds( + build_string, prefix=strategies.binary(), + content=strategies.lists(strategies.integers(1, 255), min_size=1), + end=strategies.sampled_from('"\\\x00\x01'), + suffix=strategies.binary()) + +def compare(string, res1, res2): + hash1, nonascii1, endindex1 = res1 + hash2, nonascii2, endindex2 = res2 + assert endindex1 == endindex2 + if string[endindex1 - 1] == '"': + assert hash1 == hash2 + assert nonascii1 == nonascii2 + + + at example(('" \x80" ', 1)) + at example(('"\x01" ', 1)) + at example(('"aaaaaaaa"\x00\x00\x00\x00\x00\x00\x00 ', 1)) + at example(('"aaaaaaaa" ', 1)) + at example(('"12"', 1)) + at example(('"1234567abcdefghAB"', 1)) + at example(('"1234567abcdefgh"', 1)) + at example((' "123456ABCDEF" \x00', 2)) + at example((' "123456aaaaaaaaABCDEF"\x00', 2)) + at given(string_in_context_strategy) +def test_find_end_of_string(a): + (string, startindex) = a + res = ll(find_end_of_string_slow, string, startindex, len(string)) + hash, nonascii1, endposition1 = res + res2 = ll(find_end_of_string_slow_no_hash, string, startindex, len(string)) + assert res2 == (nonascii1, endposition1) + ch = string[endposition1] + assert ch == '"' or ch == '\\' or ch < '\x20' + for ch in string[startindex:endposition1]: + assert not (ch == '"' or ch == '\\' or ch < '\x20') + compare(string, res, ll(find_end_of_string_simd_unaligned, string, startindex, len(string))) + + nonascii2, endposition2 = ll(find_end_of_string_simd_unaligned_no_hash, string, startindex, len(string)) + assert nonascii1 == nonascii2 + assert endposition1 == endposition2 + + at given(string_in_context_strategy, strategies.binary(min_size=1)) +def test_find_end_of_string_position_invariance(a, prefix): + fn = find_end_of_string_simd_unaligned + (string, startindex) = a + h1, nonascii1, i1 = ll(fn, string, startindex, len(string)) + string2 = prefix + string + h2, nonascii2, i2 = ll(fn, string2, startindex + len(prefix), len(string) + len(prefix)) + assert h1 == h2 + assert nonascii1 == nonascii2 + assert i1 + len(prefix) == i2 + + at given(string_in_context_strategy, strategies.binary(min_size=1)) +def test_find_end_of_string_position_invariance_no_hash(a, prefix): + fn = find_end_of_string_simd_unaligned_no_hash + (string, startindex) = a + nonascii1, i1 = ll(fn, string, startindex, len(string)) + string2 = prefix + string + nonascii2, i2 = ll(fn, string2, startindex + len(prefix), len(string) + len(prefix)) + assert nonascii1 == nonascii2 + assert i1 + len(prefix) == i2 + diff --git a/pypy/objspace/std/jsondict.py b/pypy/objspace/std/jsondict.py new file mode 100644 --- /dev/null +++ b/pypy/objspace/std/jsondict.py @@ -0,0 +1,167 @@ +"""dict implementation specialized for object loaded by the _pypyjson module. + +Somewhat similar to MapDictStrategy, also uses a map. +""" + +from rpython.rlib import jit, rerased, objectmodel, debug + +from pypy.objspace.std.dictmultiobject import ( + UnicodeDictStrategy, DictStrategy, + create_iterator_classes, W_DictObject) + + +def from_values_and_jsonmap(space, values_w, jsonmap): + if not objectmodel.we_are_translated(): + assert len(values_w) == len(jsonmap.get_keys_in_order()) + assert len(values_w) != 0 + debug.make_sure_not_resized(values_w) + strategy = jsonmap.strategy_instance + if strategy is None: + jsonmap.strategy_instance = strategy = JsonDictStrategy(space, jsonmap) + storage = strategy.erase(values_w) + return W_DictObject(space, strategy, storage) + +def devolve_jsonmap_dict(w_dict): + assert isinstance(w_dict, W_DictObject) + strategy = w_dict.get_strategy() + assert isinstance(strategy, JsonDictStrategy) + strategy.switch_to_unicode_strategy(w_dict) + +def get_jsonmap_from_dict(w_dict): + assert isinstance(w_dict, W_DictObject) + strategy = w_dict.get_strategy() + assert isinstance(strategy, JsonDictStrategy) + return strategy.jsonmap + +class JsonDictStrategy(DictStrategy): + erase, unerase = rerased.new_erasing_pair("jsondict") + erase = staticmethod(erase) + unerase = staticmethod(unerase) + + _immutable_fields_ = ['jsonmap'] + + def __init__(self, space, jsonmap): + DictStrategy.__init__(self, space) + self.jsonmap = jsonmap + + def wrap(self, w_key): + return w_key + + def wrapkey(space, key): + return key + + def get_empty_storage(self): + raise NotImplementedError("should not be reachable") + + def is_correct_type(self, w_obj): + space = self.space + return space.is_w(space.type(w_obj), space.w_unicode) + + def _never_equal_to(self, w_lookup_type): + return False + + def length(self, w_dict): + return len(self.unerase(w_dict.dstorage)) + + def getitem(self, w_dict, w_key): + if self.is_correct_type(w_key): + return self.getitem_unicode(w_dict, w_key) + else: + self.switch_to_unicode_strategy(w_dict) + return w_dict.getitem(w_key) + + def getitem_unicode(self, w_dict, w_key): + storage_w = self.unerase(w_dict.dstorage) + if jit.isconstant(w_key): + jit.promote(self) + index = self.jsonmap.get_index(w_key) + if index == -1: + return None + return storage_w[index] + + def setitem(self, w_dict, w_key, w_value): + if self.is_correct_type(w_key): + storage_w = self.unerase(w_dict.dstorage) + index = self.jsonmap.get_index(w_key) + if index != -1: + storage_w[index] = w_value + return + self.switch_to_unicode_strategy(w_dict) + w_dict.setitem(w_key, w_value) + + def setdefault(self, w_dict, w_key, w_default): + if self.is_correct_type(w_key): + w_result = self.getitem_unicode(w_dict, w_key) + if w_result is not None: + return w_result + self.switch_to_unicode_strategy(w_dict) + return w_dict.setdefault(w_key, w_default) + + def delitem(self, w_dict, w_key): + self.switch_to_unicode_strategy(w_dict) + return w_dict.delitem(w_key) + + def popitem(self, w_dict): + self.switch_to_unicode_strategy(w_dict) + return w_dict.popitem() + + def switch_to_unicode_strategy(self, w_dict): + strategy = self.space.fromcache(UnicodeDictStrategy) + values_w = self.unerase(w_dict.dstorage) + storage = strategy.get_empty_storage() + d_new = strategy.unerase(storage) + keys_in_order = self.jsonmap.get_keys_in_order() + assert len(keys_in_order) == len(values_w) + for index, w_key in enumerate(keys_in_order): + assert w_key is not None + assert type(w_key) is self.space.UnicodeObjectCls + d_new[w_key] = values_w[index] + w_dict.set_strategy(strategy) + w_dict.dstorage = storage + + def w_keys(self, w_dict): + return self.space.newlist(self.jsonmap.get_keys_in_order()) + + def values(self, w_dict): + return self.unerase(w_dict.dstorage)[:] # to make resizable + + def items(self, w_dict): + space = self.space + storage_w = self.unerase(w_dict.dstorage) + res = [None] * len(storage_w) + for index, w_key in enumerate(self.jsonmap.get_keys_in_order()): + res[index] = space.newtuple([w_key, storage_w[index]]) + return res + + def getiterkeys(self, w_dict): + return iter(self.jsonmap.get_keys_in_order()) + + def getitervalues(self, w_dict): + storage_w = self.unerase(w_dict.dstorage) + return iter(storage_w) + + def getiteritems_with_hash(self, w_dict): + storage_w = self.unerase(w_dict.dstorage) + return ZipItemsWithHash(self.jsonmap.get_keys_in_order(), storage_w) + + +class ZipItemsWithHash(object): + def __init__(self, list1, list2): + assert len(list1) == len(list2) + self.list1 = list1 + self.list2 = list2 + self.i = 0 + + def __iter__(self): + return self + + def next(self): + i = self.i + if i >= len(self.list1): + raise StopIteration + self.i = i + 1 + w_key = self.list1[i] + return (w_key, self.list2[i], w_key.hash_w()) + + +create_iterator_classes(JsonDictStrategy) From pypy.commits at gmail.com Sat Sep 21 15:24:20 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 21 Sep 2019 12:24:20 -0700 (PDT) Subject: [pypy-commit] pypy json-decoder-maps-py3.6: close to-be-merged branch Message-ID: <5d8678e4.1c69fb81.1b2e0.08e4@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: json-decoder-maps-py3.6 Changeset: r97582:1e4284e750bb Date: 2019-09-21 21:07 +0200 http://bitbucket.org/pypy/pypy/changeset/1e4284e750bb/ Log: close to-be-merged branch From pypy.commits at gmail.com Sat Sep 21 15:24:22 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 21 Sep 2019 12:24:22 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge json-decoder-maps-py3.6 Message-ID: <5d8678e6.1c69fb81.60d73.a691@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97583:6ce7533a8d5e Date: 2019-09-21 21:19 +0200 http://bitbucket.org/pypy/pypy/changeset/6ce7533a8d5e/ Log: merge json-decoder-maps-py3.6 diff too long, truncating to 2000 out of 2157 lines diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -5,3 +5,9 @@ .. this is a revision shortly after release-pypy-7.2.0 .. startrev: 78cd4acbcbec + +.. branch: json-decoder-maps + +Much faster and more memory-efficient JSON decoding. The resulting +dictionaries that come out of the JSON decoder have faster lookups too. + diff --git a/pypy/doc/whatsnew-pypy3-head.rst b/pypy/doc/whatsnew-pypy3-head.rst --- a/pypy/doc/whatsnew-pypy3-head.rst +++ b/pypy/doc/whatsnew-pypy3-head.rst @@ -49,3 +49,10 @@ Add support for the entire stdlib being inside a zipfile + +.. branch: json-decoder-maps-py3.6 + +Much faster and more memory-efficient JSON decoding. The resulting +dictionaries that come out of the JSON decoder have faster lookups too. + + diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -1,11 +1,13 @@ import sys from rpython.rlib.rstring import StringBuilder -from rpython.rlib.objectmodel import specialize, always_inline, r_dict -from rpython.rlib import rfloat, rutf8 +from rpython.rlib.objectmodel import specialize, always_inline +from rpython.rlib import rfloat, runicode, jit, objectmodel, rutf8 from rpython.rtyper.lltypesystem import lltype, rffi from pypy.interpreter.error import oefmt, OperationError from rpython.rlib.rarithmetic import r_uint from pypy.interpreter import unicodehelper +from pypy.interpreter.baseobjspace import W_Root +from pypy.module._pypyjson import simd OVF_DIGITS = len(str(sys.maxint)) @@ -15,50 +17,111 @@ # precomputing negative powers of 10 is MUCH faster than using e.g. math.pow # at runtime NEG_POW_10 = [10.0**-i for i in range(16)] +del i + def neg_pow_10(x, exp): if exp >= len(NEG_POW_10): return 0.0 return x * NEG_POW_10[exp] -def slice_eq(a, b): - (ll_chars1, start1, length1, _) = a - (ll_chars2, start2, length2, _) = b - if length1 != length2: - return False - j = start2 - for i in range(start1, start1 + length1): - if ll_chars1[i] != ll_chars2[j]: - return False - j += 1 - return True -def slice_hash(a): - (ll_chars, start, length, h) = a - return h +class IntCache(object): + """ A cache for wrapped ints between START and END """ + + # I also tried various combinations of having an LRU cache for ints as + # well, didn't really help. + + # XXX one thing to do would be to use withintprebuilt in general again, + # hidden behind a 'we_are_jitted' + + START = -10 + END = 256 + + def __init__(self, space): + self.space = space + self.cache = [self.space.newint(i) + for i in range(self.START, self.END)] + + def newint(self, intval): + if self.START <= intval < self.END: + return self.cache[intval - self.START] + return self.space.newint(intval) class DecoderError(Exception): def __init__(self, msg, pos): self.msg = msg self.pos = pos -TYPE_UNKNOWN = 0 -TYPE_STRING = 1 -class JSONDecoder(object): +class JSONDecoder(W_Root): + + LRU_SIZE = 16 + LRU_MASK = LRU_SIZE - 1 + + DEFAULT_SIZE_SCRATCH = 20 + + # string caching is only used if the total size of the message is larger + # than a megabyte. Below that, there can't be that many repeated big + # strings anyway (some experiments showed this to be a reasonable cutoff + # size) + MIN_SIZE_FOR_STRING_CACHE = 1024 * 1024 + + # evaluate the string cache for 200 strings, before looking at the hit rate + # and deciding whether to keep doing it + STRING_CACHE_EVALUATION_SIZE = 200 + + # keep using the string cache if at least 25% of all decoded strings are a + # hit in the cache + STRING_CACHE_USEFULNESS_FACTOR = 4 + + def __init__(self, space, s): self.space = space + self.w_empty_string = space.newutf8("", 0) + self.s = s + # we put our string in a raw buffer so: # 1) we automatically get the '\0' sentinel at the end of the string, # which means that we never have to check for the "end of string" # 2) we can pass the buffer directly to strtod - self.ll_chars = rffi.str2charp(s) + self.ll_chars, self.llobj, self.flag = rffi.get_nonmovingbuffer_ll_final_null(self.s) self.end_ptr = lltype.malloc(rffi.CCHARPP.TO, 1, flavor='raw') self.pos = 0 - self.cache = r_dict(slice_eq, slice_hash, simple_hash_eq=True) + self.intcache = space.fromcache(IntCache) + + # two caches, one for keys, one for general strings. they both have the + # form {hash-as-int: StringCacheEntry} and they don't deal with + # collisions at all. For every hash there is simply one string stored + # and we ignore collisions. + self.cache_keys = {} + self.cache_values = {} + + # we don't cache *all* non-key strings, that would be too expensive. + # instead, keep a cache of the last 16 strings hashes around and add a + # string to the cache only if its hash is seen a second time + self.lru_cache = [0] * self.LRU_SIZE + self.lru_index = 0 + + self.startmap = self.space.fromcache(Terminator) + + # keep a list of objects that are created with maps that aren't clearly + # useful. If they turn out to be useful in the end we are good, + # otherwise convert them to dicts (see .close()) + self.unclear_objects = [] + + # this is a freelist of lists that store the decoded value of an + # object, before they get copied into the eventual dict + self.scratch = [[None] * self.DEFAULT_SIZE_SCRATCH] + def close(self): - rffi.free_charp(self.ll_chars) + rffi.free_nonmovingbuffer_ll(self.ll_chars, self.llobj, self.flag) lltype.free(self.end_ptr, flavor='raw') + # clean up objects that are instances of now blocked maps + for w_obj in self.unclear_objects: + jsonmap = self._get_jsonmap_from_dict(w_obj) + if jsonmap.is_state_blocked(): + self._devolve_jsonmap_dict(w_obj) def getslice(self, start, end): assert start >= 0 @@ -66,19 +129,22 @@ return self.s[start:end] def skip_whitespace(self, i): + ll_chars = self.ll_chars while True: - ch = self.ll_chars[i] + ch = ll_chars[i] if is_whitespace(ch): - i+=1 + i += 1 else: break return i - def decode_any(self, i): + def decode_any(self, i, contextmap=None): + """ Decode an object at position i. Optionally pass a contextmap, if + the value is decoded as the value of a dict. """ i = self.skip_whitespace(i) ch = self.ll_chars[i] if ch == '"': - return self.decode_string(i+1) + return self.decode_string(i+1, contextmap) elif ch == '[': return self.decode_array(i+1) elif ch == '{': @@ -100,7 +166,11 @@ elif ch.isdigit(): return self.decode_numeric(i) else: - raise DecoderError("Unexpected '%s' at" % ch, i) + raise DecoderError("Unexpected '%s'" % ch, i) + + + def _raise(self, msg, pos): + raise DecoderError(msg, pos) def decode_null(self, i): if (self.ll_chars[i] == 'u' and @@ -108,7 +178,7 @@ self.ll_chars[i+2] == 'l'): self.pos = i+3 return self.space.w_None - raise DecoderError("Error when decoding null at", i) + raise DecoderError("Error when decoding null", i) def decode_true(self, i): if (self.ll_chars[i] == 'r' and @@ -116,7 +186,7 @@ self.ll_chars[i+2] == 'e'): self.pos = i+3 return self.space.w_True - raise DecoderError("Error when decoding true at", i) + raise DecoderError("Error when decoding true", i) def decode_false(self, i): if (self.ll_chars[i] == 'a' and @@ -125,7 +195,7 @@ self.ll_chars[i+3] == 'e'): self.pos = i+4 return self.space.w_False - raise DecoderError("Error when decoding false at", i) + raise DecoderError("Error when decoding false", i) def decode_infinity(self, i, sign=1): if (self.ll_chars[i] == 'n' and @@ -137,14 +207,14 @@ self.ll_chars[i+6] == 'y'): self.pos = i+7 return self.space.newfloat(rfloat.INFINITY * sign) - raise DecoderError("Error when decoding Infinity at", i) + raise DecoderError("Error when decoding Infinity", i) def decode_nan(self, i): if (self.ll_chars[i] == 'a' and self.ll_chars[i+1] == 'N'): self.pos = i+2 return self.space.newfloat(rfloat.NAN) - raise DecoderError("Error when decoding NaN at", i) + raise DecoderError("Error when decoding NaN", i) def decode_numeric(self, i): start = i @@ -154,7 +224,7 @@ ch = self.ll_chars[i] if ch == '.': if not self.ll_chars[i+1].isdigit(): - raise DecoderError("Expected digit at", i+1) + raise DecoderError("Expected digit", i+1) return self.decode_float(start) elif ch == 'e' or ch == 'E': return self.decode_float(start) @@ -162,7 +232,7 @@ return self.decode_int_slow(start) self.pos = i - return self.space.newint(intval) + return self.intcache.newint(intval) def decode_float(self, i): from rpython.rlib import rdtoa @@ -208,13 +278,27 @@ break count = i - start if count == 0: - raise DecoderError("Expected digit at", i) + raise DecoderError("Expected digit", i) # if the number has more digits than OVF_DIGITS, it might have # overflowed ovf_maybe = (count >= OVF_DIGITS) return i, ovf_maybe, sign * intval + def _raise_control_char_in_string(self, ch, startindex, currindex): + if ch == '\0': + self._raise("Unterminated string starting at", + startindex - 1) + else: + self._raise("Invalid control character at", currindex-1) + + def _raise_object_error(self, ch, start, i): + if ch == '\0': + self._raise("Unterminated object starting at", start) + else: + self._raise("Unexpected '%s' when decoding object" % ch, i) + def decode_array(self, i): + """ Decode a list. i must be after the opening '[' """ w_list = self.space.newlist([]) start = i i = self.skip_whitespace(start) @@ -248,63 +332,116 @@ self.pos = i+1 return self.space.newdict() - d = self._create_empty_dict() + if self.scratch: + values_w = self.scratch.pop() + else: + values_w = [None] * self.DEFAULT_SIZE_SCRATCH + nextindex = 0 + currmap = self.startmap while True: # parse a key: value - w_name = self.decode_key(i) + currmap = self.decode_key_map(i, currmap) i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] if ch != ':': raise DecoderError("No ':' found at", i) i += 1 - i = self.skip_whitespace(i) - # - w_value = self.decode_any(i) - d[w_name] = w_value + + w_value = self.decode_any(i, currmap) + + if nextindex == len(values_w): # full + values_w = values_w + [None] * len(values_w) # double + values_w[nextindex] = w_value + nextindex += 1 i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] i += 1 if ch == '}': self.pos = i - return self._create_dict(d) + self.scratch.append(values_w) # can reuse next time + if currmap.is_state_blocked(): + dict_w = self._switch_to_dict(currmap, values_w, nextindex) + return self._create_dict(dict_w) + values_w = values_w[:nextindex] + w_res = self._create_dict_map(values_w, currmap) + if not currmap.is_state_useful(): + self.unclear_objects.append(w_res) + return w_res elif ch == ',': - pass - elif ch == '\0': - raise DecoderError("Unterminated object starting at", start) + i = self.skip_whitespace(i) + if currmap.is_state_blocked(): + self.scratch.append(values_w) # can reuse next time + dict_w = self._switch_to_dict(currmap, values_w, nextindex) + return self.decode_object_dict(i, start, dict_w) else: - raise DecoderError("Unexpected '%s' when decoding object" % ch, - i-1) + self._raise_object_error(ch, start, i - 1) - def decode_string(self, i): - start = i - bits = 0 + def _create_dict_map(self, values_w, jsonmap): + from pypy.objspace.std.jsondict import from_values_and_jsonmap + return from_values_and_jsonmap(self.space, values_w, jsonmap) + + def _devolve_jsonmap_dict(self, w_dict): + from pypy.objspace.std.jsondict import devolve_jsonmap_dict + devolve_jsonmap_dict(w_dict) + + def _get_jsonmap_from_dict(self, w_dict): + from pypy.objspace.std.jsondict import get_jsonmap_from_dict + return get_jsonmap_from_dict(w_dict) + + def _switch_to_dict(self, currmap, values_w, nextindex): + dict_w = self._create_empty_dict() + currmap.fill_dict(dict_w, values_w) + assert len(dict_w) == nextindex + return dict_w + + def decode_object_dict(self, i, start, dict_w): while True: - # this loop is a fast path for strings which do not contain escape - # characters + # parse a key: value + w_key = self.decode_key_string(i) + i = self.skip_whitespace(self.pos) + ch = self.ll_chars[i] + if ch != ':': + self._raise("No ':' found at", i) + i += 1 + + w_value = self.decode_any(i) + dict_w[w_key] = w_value + i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] i += 1 - bits |= ord(ch) - if ch == '"': + if ch == '}': self.pos = i - return self._create_string(start, i - 1, bits) - elif ch == '\\' or ch < '\x20': - self.pos = i-1 - return self.decode_string_escaped(start) + return self._create_dict(dict_w) + elif ch == ',': + i = self.skip_whitespace(i) + else: + self._raise_object_error(ch, start, i - 1) - def _create_string(self, start, end, bits): - if bits & 0x80: - # the 8th bit is set, it's an utf8 string - content_utf8 = self.getslice(start, end) + def decode_string_uncached(self, i): + start = i + ll_chars = self.ll_chars + nonascii, i = simd.find_end_of_string_no_hash(ll_chars, i, len(self.s)) + ch = ll_chars[i] + if ch == '\\': + self.pos = i + return self.decode_string_escaped(start, nonascii) + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + else: + assert ch == '"' + + self.pos = i + 1 + return self._create_string_wrapped(start, i, nonascii) + + def _create_string_wrapped(self, start, end, nonascii): + content = self.getslice(start, end) + if nonascii: + # contains non-ascii chars, we need to check that it's valid utf-8 lgt = unicodehelper.check_utf8_or_raise(self.space, - content_utf8) - return self.space.newutf8(content_utf8, lgt) + content) else: - # ascii only, fast path (ascii is a strict subset of - # latin1, and we already checked that all the chars are < - # 128) lgt = end - start - assert lgt >= 0 - return self.space.newutf8(self.getslice(start, end), lgt) + return self.space.newutf8(content, lgt) def _create_dict(self, d): from pypy.objspace.std.dictmultiobject import from_unicode_key_dict @@ -314,8 +451,7 @@ from pypy.objspace.std.dictmultiobject import create_empty_unicode_key_dict return create_empty_unicode_key_dict(self.space) - - def decode_string_escaped(self, start): + def decode_string_escaped(self, start, nonascii): i = self.pos builder = StringBuilder((i - start) * 2) # just an estimate assert start >= 0 @@ -326,25 +462,21 @@ i += 1 if ch == '"': content_utf8 = builder.build() - lgt = unicodehelper.check_utf8_or_raise(self.space, + length = unicodehelper.check_utf8_or_raise(self.space, content_utf8) self.pos = i - return self.space.newutf8(content_utf8, lgt) + return self.space.newutf8(content_utf8, length) elif ch == '\\': - i = self.decode_escape_sequence(i, builder) + i = self.decode_escape_sequence_to_utf8(i, builder) elif ch < '\x20': - if ch == '\0': - raise DecoderError("Unterminated string starting at", - start - 1) - else: - raise DecoderError("Invalid control character at", i-1) + self._raise_control_char_in_string(ch, start, i) else: builder.append(ch) - def decode_escape_sequence(self, i, builder): + def decode_escape_sequence_to_utf8(self, i, stringbuilder): ch = self.ll_chars[i] i += 1 - put = builder.append + put = stringbuilder.append if ch == '\\': put('\\') elif ch == '"': put('"' ) elif ch == '/': put('/' ) @@ -354,22 +486,37 @@ elif ch == 'r': put('\r') elif ch == 't': put('\t') elif ch == 'u': - return self.decode_escape_sequence_unicode(i, builder) + # may be a surrogate pair + return self.decode_escape_sequence_unicode(i, stringbuilder) else: raise DecoderError("Invalid \\escape: %s" % ch, i-1) return i + def _get_int_val_from_hex4(self, i): + ll_chars = self.ll_chars + res = 0 + for i in range(i, i + 4): + ch = ord(ll_chars[i]) + if ord('a') <= ch <= ord('f'): + digit = ch - ord('a') + 10 + elif ord('A') <= ch <= ord('F'): + digit = ch - ord('A') + 10 + elif ord('0') <= ch <= ord('9'): + digit = ch - ord('0') + else: + raise ValueError + res = (res << 4) + digit + return res + def decode_escape_sequence_unicode(self, i, builder): # at this point we are just after the 'u' of the \u1234 sequence. start = i i += 4 - hexdigits = self.getslice(start, i) try: - val = int(hexdigits, 16) + val = self._get_int_val_from_hex4(start) if (0xd800 <= val <= 0xdbff and self.ll_chars[i] == '\\' and self.ll_chars[i+1] == 'u'): - hexdigits = self.getslice(i+2, i+6) - lowsurr = int(hexdigits, 16) + lowsurr = self._get_int_val_from_hex4(i + 2) if 0xdc00 <= lowsurr <= 0xdfff: # decode surrogate pair val = 0x10000 + (((val - 0xd800) << 10) | @@ -384,45 +531,618 @@ builder.append(utf8_ch) return i - def decode_key(self, i): - """ returns a wrapped unicode """ - from rpython.rlib.rarithmetic import intmask - i = self.skip_whitespace(i) + def decode_string(self, i, contextmap=None): + """ Decode a string at position i (which is right after the opening "). + Optionally pass a contextmap, if the value is decoded as the value of a + dict.""" + ll_chars = self.ll_chars + start = i + ch = ll_chars[i] + if ch == '"': + self.pos = i + 1 + return self.w_empty_string # surprisingly common + + cache = True + if contextmap is not None: + # keep some statistics about the usefulness of the string cache on + # the contextmap + # the intuition about the contextmap is as follows: + # often there are string values stored in dictionaries that can + # never be usefully cached, like unique ids of objects. Then the + # strings *in those fields* of all objects should never be cached. + # However, the content of other fields can still be useful to + # cache. + contextmap.decoded_strings += 1 + if not contextmap.should_cache_strings(): + cache = False + if len(self.s) < self.MIN_SIZE_FOR_STRING_CACHE: + cache = False + + if not cache: + return self.decode_string_uncached(i) + + strhash, nonascii, i = simd.find_end_of_string(ll_chars, i, len(self.s)) + ch = ll_chars[i] + if ch == '\\': + self.pos = i + return self.decode_string_escaped(start, nonascii) + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + else: + assert ch == '"' + + self.pos = i + 1 + + length = i - start + strhash ^= length + + # check cache first: + try: + entry = self.cache_values[strhash] + except KeyError: + w_res = self._create_string_wrapped(start, i, nonascii) + # only add *some* strings to the cache, because keeping them all is + # way too expensive. first we check if the contextmap has caching + # disabled completely. if not, we check whether we have recently + # seen the same hash already, if yes, we cache the string. + if ((contextmap is not None and + contextmap.decoded_strings < self.STRING_CACHE_EVALUATION_SIZE) or + strhash in self.lru_cache): + entry = StringCacheEntry( + self.getslice(start, start + length), w_res) + self.cache_values[strhash] = entry + else: + self.lru_cache[self.lru_index] = strhash + self.lru_index = (self.lru_index + 1) & self.LRU_MASK + return w_res + if not entry.compare(ll_chars, start, length): + # collision! hopefully rare + return self._create_string_wrapped(start, i, nonascii) + if contextmap is not None: + contextmap.cache_hits += 1 + return entry.w_uni + + def decode_key_map(self, i, currmap): + """ Given the current map currmap of an object, decode the next key at + position i. This returns the new map of the object. """ + newmap = self._decode_key_map(i, currmap) + currmap.observe_transition(newmap, self.startmap) + return newmap + + def _decode_key_map(self, i, currmap): + ll_chars = self.ll_chars + # first try to see whether we happen to find currmap.nextmap_first + nextmap = currmap.fast_path_key_parse(self, i) + if nextmap is not None: + return nextmap + + start = i ch = ll_chars[i] if ch != '"': raise DecoderError("Key name must be string at char", i) i += 1 + w_key = self._decode_key_string(i) + return currmap.get_next(w_key, self.s, start, self.pos, self.startmap) + def _decode_key_string(self, i): + """ decode key at position i as a string. Key strings are always + cached, since they repeat a lot. """ + ll_chars = self.ll_chars start = i - bits = 0 - strhash = ord(ll_chars[i]) << 7 - while True: - ch = ll_chars[i] + + strhash, nonascii, i = simd.find_end_of_string(ll_chars, i, len(self.s)) + + ch = ll_chars[i] + if ch == '\\': + self.pos = i + w_key = self.decode_string_escaped(start, nonascii) + return w_key + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + length = i - start + strhash ^= length + self.pos = i + 1 + # check cache first: + try: + entry = self.cache_keys[strhash] + except KeyError: + w_res = self._create_string_wrapped(start, i, nonascii) + entry = StringCacheEntry( + self.getslice(start, start + length), w_res) + self.cache_keys[strhash] = entry + return w_res + if not entry.compare(ll_chars, start, length): + # collision! hopefully rare + w_res = self._create_string_wrapped(start, i, nonascii) + else: + w_res = entry.w_uni + return w_res + + def decode_key_string(self, i): + ll_chars = self.ll_chars + ch = ll_chars[i] + if ch != '"': + self._raise("Key name must be string at char %d", i) + i += 1 + return self._decode_key_string(i) + + +class StringCacheEntry(object): + """ A cache entry, bundling the encoded version of a string as it appears + in the input string, and its wrapped decoded variant. """ + def __init__(self, repr, w_uni): + # repr is the escaped string + self.repr = repr + # uni is the wrapped decoded string + self.w_uni = w_uni + + def compare(self, ll_chars, start, length): + """ Check whether self.repr occurs at ll_chars[start:start+length] """ + if length != len(self.repr): + return False + index = start + for c in self.repr: + if not ll_chars[index] == c: + return False + index += 1 + return True + + +class MapBase(object): + """ A map implementation to speed up parsing of json dicts, and to + represent the resulting dicts more compactly and make access faster. """ + + # the basic problem we are trying to solve is the following: dicts in + # json can either be used as objects, or as dictionaries with arbitrary + # string keys. We want to use maps for the former, but not for the + # latter. But we don't know in advance which kind of dict is which. + + # Therefore we create "preliminary" maps where we aren't quite sure yet + # whether they are really useful maps or not. If we see them used often + # enough, we promote them to "useful" maps, which we will actually + # instantiate objects with. + + # If we determine that a map is not used often enough, we can turn it + # into a "blocked" map, which is a point in the map tree where we will + # switch to regular dicts, when we reach that part of the tree. + + # One added complication: We want to keep the number of preliminary maps + # bounded to prevent generating tons of useless maps. but also not too + # small, to support having a json file that contains many uniform objects + # with tons of keys. That's where the idea of "fringe" maps comes into + # play. They are maps that sit between known useful nodes and preliminary + # nodes in the map transition tree. We bound only the number of fringe + # nodes we are considering (to MAX_FRINGE), but not the number of + # preliminary maps. When we have too many fringe maps, we remove the least + # commonly instantiated fringe map and mark it as blocked. + + # allowed graph edges or nodes in nextmap_all: + # USEFUL ------- + # / \ \ + # v v v + # FRINGE USEFUL BLOCKED + # | + # v + # PRELIMINARY + # | + # v + # PRELIMINARY + + # state transitions: + # PRELIMINARY + # / | \ + # | v v + # | FRINGE -> USEFUL + # | | + # \ | + # v v + # BLOCKED + + # the nextmap_first edge can only be these graph edges: + # USEFUL + # | + # v + # USEFUL + # + # FRINGE + # | + # v + # PRELIMINARY + # | + # v + # PRELIMINARY + + USEFUL = 'u' + PRELIMINARY = 'p' + FRINGE = 'f' # buffer between PRELIMINARY and USEFUL + BLOCKED = 'b' + + # tunable parameters + MAX_FRINGE = 40 + USEFUL_THRESHOLD = 5 + + def __init__(self, space): + self.space = space + + # a single transition is stored in .nextmap_first + self.nextmap_first = None + + # nextmap_all is only initialized after seeing the *second* transition + # but then it also contains .nextmap_first + self.nextmap_all = None # later dict {key: nextmap} + + # keep some statistics about every map: how often it was instantiated + # and how many non-blocked leaves the map transition tree has, starting + # from self + self.instantiation_count = 0 + self.number_of_leaves = 1 + + def _check_invariants(self): + if self.nextmap_all: + for next in self.nextmap_all.itervalues(): + next._check_invariants() + elif self.nextmap_first: + self.nextmap_first._check_invariants() + + def get_next(self, w_key, string, start, stop, terminator): + from pypy.objspace.std.dictmultiobject import unicode_hash, unicode_eq + if isinstance(self, JSONMap): + assert not self.state == MapBase.BLOCKED + nextmap_first = self.nextmap_first + if (nextmap_first is not None and + nextmap_first.w_key.eq_w(w_key)): + return nextmap_first + + assert stop >= 0 + assert start >= 0 + + if nextmap_first is None: + # first transition ever seen, don't initialize nextmap_all + next = self._make_next_map(w_key, string[start:stop]) + self.nextmap_first = next + else: + if self.nextmap_all is None: + # 2nd transition ever seen + self.nextmap_all = objectmodel.r_dict(unicode_eq, unicode_hash, + force_non_null=True, simple_hash_eq=True) + self.nextmap_all[nextmap_first.w_key] = nextmap_first + else: + next = self.nextmap_all.get(w_key, None) + if next is not None: + return next + # if we are at this point we didn't find the transition yet, so + # create a new one + next = self._make_next_map(w_key, string[start:stop]) + self.nextmap_all[w_key] = next + + # one new leaf has been created + self.change_number_of_leaves(1) + + terminator.register_potential_fringe(next) + return next + + def change_number_of_leaves(self, difference): + """ add difference to .number_of_leaves of self and its parents """ + if not difference: + return + parent = self + while isinstance(parent, JSONMap): + parent.number_of_leaves += difference + parent = parent.prev + parent.number_of_leaves += difference # terminator + + def fast_path_key_parse(self, decoder, position): + """ Fast path when parsing the next key: We speculate that we will + always see a commonly seen next key, and use strcmp (implemented in + key_repr_cmp) to check whether that is the case. """ + nextmap_first = self.nextmap_first + if nextmap_first: + ll_chars = decoder.ll_chars + assert isinstance(nextmap_first, JSONMap) + if nextmap_first.key_repr_cmp(ll_chars, position): + decoder.pos = position + len(nextmap_first.key_repr) + return nextmap_first + return None + + def observe_transition(self, newmap, terminator): + """ observe a transition from self to newmap. + This does a few things, including updating the self size estimate with + the knowledge that one object transitioned from self to newmap. + also it potentially decides that self should move to state USEFUL.""" + newmap.instantiation_count += 1 + if isinstance(self, JSONMap) and self.state == MapBase.FRINGE: + if self.is_useful(): + self.mark_useful(terminator) + + def _make_next_map(self, w_key, key_repr): + return JSONMap(self.space, self, w_key, key_repr) + + def fill_dict(self, dict_w, values_w): + """ recursively fill the dictionary dict_w in the correct order, + reading from values_w.""" + raise NotImplementedError("abstract base") + + def _all_dot(self, output): + identity = objectmodel.compute_unique_id(self) + output.append('%s [shape=box%s];' % (identity, self._get_dot_text())) + if self.nextmap_all: + for w_key, value in self.nextmap_all.items(): + assert isinstance(value, JSONMap) + if value is self.nextmap_first: + color = ", color=blue" + else: + color = "" + output.append('%s -> %s [label="%s"%s];' % ( + identity, objectmodel.compute_unique_id(value), value.w_key._utf8, color)) + value._all_dot(output) + elif self.nextmap_first is not None: + value = self.nextmap_first + output.append('%s -> %s [label="%s", color=blue];' % ( + identity, objectmodel.compute_unique_id(value), value.w_key._utf8)) + value._all_dot(output) + + + def _get_dot_text(self): + return ", label=base" + + def view(self): + from dotviewer import graphclient + import pytest + r = ["digraph G {"] + self._all_dot(r) + r.append("}") + p = pytest.ensuretemp("jsonmap").join("temp.dot") + p.write("\n".join(r)) + graphclient.display_dot_file(str(p)) + + +class Terminator(MapBase): + """ The root node of the map transition tree. """ + def __init__(self, space): + MapBase.__init__(self, space) + # a set of all map nodes that are currently in the FRINGE state + self.current_fringe = {} + + def register_potential_fringe(self, prelim): + """ add prelim to the fringe, if its prev is either a Terminator or + useful. """ + prev = prelim.prev + if (isinstance(prev, Terminator) or + isinstance(prev, JSONMap) and prev.state == MapBase.USEFUL): + assert prelim.state == MapBase.PRELIMINARY + prelim.state = MapBase.FRINGE + + if len(self.current_fringe) > MapBase.MAX_FRINGE: + self.cleanup_fringe() + self.current_fringe[prelim] = None + + def remove_from_fringe(self, former_fringe): + """ Remove former_fringe from self.current_fringe. """ + assert former_fringe.state in (MapBase.USEFUL, MapBase.BLOCKED) + del self.current_fringe[former_fringe] + + def cleanup_fringe(self): + """ remove the least-instantiated fringe map and block it.""" + min_fringe = None + min_avg = 1e200 + for f in self.current_fringe: + assert f.state == MapBase.FRINGE + avg = f.average_instantiation() + if avg < min_avg: + min_avg = avg + min_fringe = f + assert min_fringe + min_fringe.mark_blocked(self) + + def fill_dict(self, dict_w, values_w): + """ recursively fill the dictionary dict_w in the correct order, + reading from values_w.""" + return 0 + + def _check_invariants(self): + for fringe in self.current_fringe: + assert fringe.state == MapBase.FRINGE + +class JSONMap(MapBase): + """ A map implementation to speed up parsing """ + + def __init__(self, space, prev, w_key, key_repr): + MapBase.__init__(self, space) + + self.prev = prev + self.w_key = w_key + self.key_repr = key_repr + + self.state = MapBase.PRELIMINARY + + # key decoding stats + self.decoded_strings = 0 + self.cache_hits = 0 + + # for jsondict support + self.key_to_index = None + self.keys_in_order = None + self.strategy_instance = None + + def __repr__(self): + return "" % ( + self.key_repr, self.instantiation_count, self.number_of_leaves, self.prev) + + def _get_terminator(self): # only for _check_invariants + while isinstance(self, JSONMap): + self = self.prev + assert isinstance(self, Terminator) + return self + + def _check_invariants(self): + assert self.state in ( + MapBase.USEFUL, + MapBase.PRELIMINARY, + MapBase.FRINGE, + MapBase.BLOCKED, + ) + + prev = self.prev + if isinstance(prev, JSONMap): + prevstate = prev.state + else: + prevstate = MapBase.USEFUL + + if prevstate == MapBase.USEFUL: + assert self.state != MapBase.PRELIMINARY + elif prevstate == MapBase.PRELIMINARY: + assert self.state == MapBase.PRELIMINARY + elif prevstate == MapBase.FRINGE: + assert self.state == MapBase.PRELIMINARY + else: + # if prevstate is BLOCKED, we shouldn't have recursed here! + assert False, "should be unreachable" + + if self.state == MapBase.BLOCKED: + assert self.nextmap_first is None + assert self.nextmap_all is None + elif self.state == MapBase.FRINGE: + assert self in self._get_terminator().current_fringe + + MapBase._check_invariants(self) + + def mark_useful(self, terminator): + """ mark self as useful, and also the most commonly instantiated + children, recursively """ + was_fringe = self.state == MapBase.FRINGE + assert self.state in (MapBase.FRINGE, MapBase.PRELIMINARY) + self.state = MapBase.USEFUL + if was_fringe: + terminator.remove_from_fringe(self) + # find the most commonly instantiated child, store it into + # nextmap_first and mark it useful, recursively + maxchild = self.nextmap_first + if self.nextmap_all is not None: + for child in self.nextmap_all.itervalues(): + if child.instantiation_count > maxchild.instantiation_count: + maxchild = child + if maxchild is not None: + maxchild.mark_useful(terminator) + if self.nextmap_all: + for child in self.nextmap_all.itervalues(): + if child is not maxchild: + terminator.register_potential_fringe(child) + self.nextmap_first = maxchild + + def mark_blocked(self, terminator): + """ mark self and recursively all its children as blocked.""" + was_fringe = self.state == MapBase.FRINGE + self.state = MapBase.BLOCKED + if was_fringe: + terminator.remove_from_fringe(self) + if self.nextmap_all: + for next in self.nextmap_all.itervalues(): + next.mark_blocked(terminator) + elif self.nextmap_first: + self.nextmap_first.mark_blocked(terminator) + self.nextmap_first = None + self.nextmap_all = None + self.change_number_of_leaves(-self.number_of_leaves + 1) + + def is_state_blocked(self): + return self.state == MapBase.BLOCKED + + def is_state_useful(self): + return self.state == MapBase.USEFUL + + def average_instantiation(self): + """ the number of instantiations, divided by the number of leaves. We + want to favor nodes that have either a high instantiation count, or few + leaves below it. """ + return self.instantiation_count / float(self.number_of_leaves) + + def is_useful(self): + return self.average_instantiation() > self.USEFUL_THRESHOLD + + def should_cache_strings(self): + """ return whether strings parsed in the context of this map should be + cached. """ + # we should cache if either we've seen few strings so far (less than + # STRING_CACHE_EVALUATION_SIZE), or if we've seen many, and the cache + # hit rate has been high enough + return not (self.decoded_strings > JSONDecoder.STRING_CACHE_EVALUATION_SIZE and + self.cache_hits * JSONDecoder.STRING_CACHE_USEFULNESS_FACTOR < self.decoded_strings) + + def key_repr_cmp(self, ll_chars, i): + # XXX should we use "real" memcmp (here in particular, and in other + # places in RPython in general)? + for j, c in enumerate(self.key_repr): + if ll_chars[i] != c: + return False i += 1 - if ch == '"': - break - elif ch == '\\' or ch < '\x20': - self.pos = i-1 - return self.decode_string_escaped(start) - strhash = intmask((1000003 * strhash) ^ ord(ll_chars[i])) - bits |= ord(ch) - length = i - start - 1 - if length == 0: - strhash = -1 + return True + + def fill_dict(self, dict_w, values_w): + index = self.prev.fill_dict(dict_w, values_w) + dict_w[self.w_key] = values_w[index] + return index + 1 + + # _____________________________________________________ + # methods for JsonDictStrategy + + @jit.elidable + def get_index(self, w_key): + from pypy.objspace.std.unicodeobject import W_UnicodeObject + assert isinstance(w_key, W_UnicodeObject) + return self.get_key_to_index().get(w_key, -1) + + def get_key_to_index(self): + from pypy.objspace.std.dictmultiobject import unicode_hash, unicode_eq + key_to_index = self.key_to_index + if key_to_index is None: + key_to_index = self.key_to_index = objectmodel.r_dict(unicode_eq, unicode_hash, + force_non_null=True, simple_hash_eq=True) + # compute depth + curr = self + depth = 0 + while True: + depth += 1 + curr = curr.prev + if not isinstance(curr, JSONMap): + break + + curr = self + while depth: + depth -= 1 + key_to_index[curr.w_key] = depth + curr = curr.prev + if not isinstance(curr, JSONMap): + break + return key_to_index + + def get_keys_in_order(self): + keys_in_order = self.keys_in_order + if keys_in_order is None: + key_to_index = self.get_key_to_index() + keys_in_order = self.keys_in_order = [None] * len(key_to_index) + for w_key, index in key_to_index.iteritems(): + keys_in_order[index] = w_key + return keys_in_order + + # _____________________________________________________ + + def _get_dot_text(self): + if self.nextmap_all is None: + l = int(self.nextmap_first is not None) else: - strhash ^= length - strhash = intmask(strhash) - self.pos = i - # check cache first: - key = (ll_chars, start, length, strhash) - try: - return self.cache[key] - except KeyError: - pass - res = self._create_string(start, i - 1, bits) - self.cache[key] = res + l = len(self.nextmap_all) + extra = "" + if self.decoded_strings: + extra = "\\n%s/%s (%s%%)" % (self.cache_hits, self.decoded_strings, self.cache_hits/float(self.decoded_strings)) + res = ', label="#%s\\nchildren: %s%s"' % (self.instantiation_count, l, extra) + if self.state == MapBase.BLOCKED: + res += ", fillcolor=lightsalmon" + if self.state == MapBase.FRINGE: + res += ", fillcolor=lightgray" + if self.state == MapBase.PRELIMINARY: + res += ", fillcolor=lightslategray" return res def loads(space, w_s, w_errorcls=None): @@ -443,3 +1163,4 @@ raise OperationError(w_errorcls, w_e) finally: decoder.close() + diff --git a/pypy/module/_pypyjson/simd.py b/pypy/module/_pypyjson/simd.py new file mode 100644 --- /dev/null +++ b/pypy/module/_pypyjson/simd.py @@ -0,0 +1,225 @@ +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib import objectmodel, unroll +from rpython.rlib.rarithmetic import r_uint, intmask, LONG_BIT +from rpython.jit.backend.detect_cpu import autodetect + +# accelerators for string operations using simd on regular word sizes (*not* +# SSE instructions). this style is sometimes called SWAR (SIMD Within A +# Register) or "broadword techniques" + +# XXX remove wordsize and endianness restrictions properly, so far only x86-64 +# is tested + +USE_SIMD = False +if LONG_BIT == 64: + WORD_SIZE = 8 + EVERY_BYTE_ONE = 0x0101010101010101 + EVERY_BYTE_HIGHEST_BIT = 0x8080808080808080 + if autodetect() == "x86-64": + USE_SIMD = True +else: + WORD_SIZE = 4 + EVERY_BYTE_ONE = 0x01010101 + EVERY_BYTE_HIGHEST_BIT = 0x80808080 + + +# helpers + +unrolling_wordsize = unroll.unrolling_iterable(range(WORD_SIZE)) + +def char_repeated_word_width(ch): + return r_uint(EVERY_BYTE_ONE) * ord(ch) + +def any_char_zero(word): + return (word - r_uint(EVERY_BYTE_ONE)) & ~word & r_uint(EVERY_BYTE_HIGHEST_BIT) + +def any_char_in_words_zero(*words): + return _any_char_in_any_word_zero_accum(0, *words) + +def _any_char_in_any_word_zero_accum(accum, word, *words): + accum |= (word - r_uint(EVERY_BYTE_ONE)) & ~word + if not words: + return accum & r_uint(EVERY_BYTE_HIGHEST_BIT) + return _any_char_in_any_word_zero_accum(accum, *words) + +def print_chars(word): + # for debugging + out = '' + for i in range(WORD_SIZE): + out += chr(word & 0xff) + word >>= 8 + return out + +def index_nonzero(word): + # XXX can be done very cheap in theory + assert word + for i in unrolling_wordsize: + if word & 0xff: + return i + word >>= 8 + assert 0 + +def index_zero(word): + # XXX can be done very cheap in theory + assert any_char_zero(word) + for i in unrolling_wordsize: + if not word & 0xff: + return i + word >>= 8 + assert 0 # XXX ??? + +def set_high_bytes_to_zero(word, keep_bytes): + mask = ((~r_uint(0)) << (8 * keep_bytes)) + return word & ~mask + + + + at objectmodel.always_inline +def position_string_ender(word): + maskquote = char_repeated_word_width('"') + maskbackslash = char_repeated_word_width('\\') + maskx20 = char_repeated_word_width(chr(0xff - 0x1f)) + # x1 and x2 check for equality, if a byte is 0 the corresponding + # char is equal to " or \ + x1 = maskquote ^ word + x2 = maskbackslash ^ word + # x3 checks for char < 0x20, the byte is 0 in that case + x3 = maskx20 & word + return any_char_in_words_zero(x1, x2, x3) + + at objectmodel.always_inline +def find_end_of_string_simd_unaligned(ll_chars, startpos, length): + ch = ll_chars[startpos] + strhash = (ord(ch) << 7) ^ 0x345678 + + wordarray = rffi.cast(rffi.ULONGP, rffi.ptradd(ll_chars, startpos)) + num_safe_reads = (length - startpos) // WORD_SIZE + + bits = 0 + for i in range(num_safe_reads): + word = wordarray[i] + cond = position_string_ender(word) + if cond: + break + bits |= word + strhash = intmask((1000003 * strhash) ^ intmask(word)) + else: + # didn't find end of string yet, look at remaining chars + word = 0 + shift = 0 + i = startpos + num_safe_reads * WORD_SIZE + while True: # this loop should run at most WORD_SIZE times, + # if we assume that ll_chars[length] == '\x00' + ch = ll_chars[i] + if ch == '"' or ch == '\\' or ch < '\x20': + break + i += 1 + bits |= ord(ch) + word |= ord(ch) << shift + shift += 8 + if shift: + strhash = intmask((1000003 * strhash) ^ intmask(word)) + + nonascii = bool(bits & char_repeated_word_width(chr(0x80))) + return strhash, nonascii, i + + # compute endposition + nonzero = index_nonzero(cond) + endposition = startpos + i * WORD_SIZE + nonzero + if nonzero: + word = set_high_bytes_to_zero(word, nonzero) + bits |= word + strhash = intmask((1000003 * strhash) ^ intmask(word)) + + nonascii = bool(bits & char_repeated_word_width(chr(0x80))) + + return strhash, nonascii, endposition + + at objectmodel.always_inline +def find_end_of_string_simd_unaligned_no_hash(ll_chars, startpos, length): + ch = ll_chars[startpos] + + wordarray = rffi.cast(rffi.ULONGP, rffi.ptradd(ll_chars, startpos)) + num_safe_reads = (length - startpos) // WORD_SIZE + + bits = 0 + for i in range(num_safe_reads): + word = wordarray[i] + cond = position_string_ender(word) + if cond: + break + bits |= word + else: + # didn't find end of string yet, look at remaining chars + i = startpos + num_safe_reads * WORD_SIZE + while True: # this loop should run at most WORD_SIZE times, + # if we assume that ll_chars[length] == '\x00' + ch = ll_chars[i] + if ch == '"' or ch == '\\' or ch < '\x20': + break + i += 1 + bits |= ord(ch) + + nonascii = bool(bits & char_repeated_word_width(chr(0x80))) + return nonascii, i + + # compute endposition + nonzero = index_nonzero(cond) + endposition = startpos + i * WORD_SIZE + nonzero + if nonzero: + word = set_high_bytes_to_zero(word, nonzero) + bits |= word + + nonascii = bool(bits & char_repeated_word_width(chr(0x80))) + + return nonascii, endposition + + + at objectmodel.always_inline +def find_end_of_string_slow(ll_chars, i, length): + ch = ll_chars[i] + strhash = (ord(ch) << 7) ^ 0x345678 + word = 0 + shift = 0 + + bits = 0 + + while True: + # this loop is a fast path for strings which do not contain escape + # characters + ch = ll_chars[i] + if ch == '"' or ch == '\\' or ch < '\x20': + break + i += 1 + bits |= ord(ch) + + word |= ord(ch) << shift + shift += 8 + if shift == WORD_SIZE * 8: + strhash = intmask((1000003 * strhash) ^ word) + shift = 0 + word = 0 + + if shift: + strhash = intmask((1000003 * strhash) ^ word) + return strhash, bool(bits & 0x80), i + + at objectmodel.always_inline +def find_end_of_string_slow_no_hash(ll_chars, i, length): + bits = 0 + while True: + # this loop is a fast path for strings which do not contain escape + # characters + ch = ll_chars[i] + if ch == '"' or ch == '\\' or ch < '\x20': + break + i += 1 + bits |= ord(ch) + return bool(bits & 0x80), i + +if USE_SIMD: + find_end_of_string = find_end_of_string_simd_unaligned + find_end_of_string_no_hash = find_end_of_string_simd_unaligned_no_hash +else: + find_end_of_string = find_end_of_string_slow + find_end_of_string_no_hash = find_end_of_string_slow_no_hash diff --git a/pypy/module/_pypyjson/test/test__pypyjson.py b/pypy/module/_pypyjson/test/test__pypyjson.py --- a/pypy/module/_pypyjson/test/test__pypyjson.py +++ b/pypy/module/_pypyjson/test/test__pypyjson.py @@ -1,31 +1,266 @@ # -*- encoding: utf-8 -*- -from pypy.module._pypyjson.interp_decoder import JSONDecoder +import pytest +from pypy.module._pypyjson.interp_decoder import JSONDecoder, Terminator, MapBase +from rpython.rtyper.lltypesystem import lltype, rffi -def test_skip_whitespace(): - s = ' hello ' - dec = JSONDecoder('fake space', s) - assert dec.pos == 0 - assert dec.skip_whitespace(0) == 3 - assert dec.skip_whitespace(3) == 3 - assert dec.skip_whitespace(8) == len(s) - dec.close() -class FakeSpace(object): - def newutf8(self, s, l): - return s +class TestJson(object): + def test_skip_whitespace(self): + s = ' hello ' + dec = JSONDecoder(self.space, s) + assert dec.pos == 0 + assert dec.skip_whitespace(0) == 3 + assert dec.skip_whitespace(3) == 3 + assert dec.skip_whitespace(8) == len(s) + dec.close() -def test_decode_key(): - s1 = "123" * 100 - s = ' "%s" "%s" ' % (s1, s1) - dec = JSONDecoder(FakeSpace(), s) - assert dec.pos == 0 - x = dec.decode_key(0) - assert x == s1 - # check caching - y = dec.decode_key(dec.pos) - assert y == s1 - assert y is x - dec.close() + def test_json_map(self): + m = Terminator(self.space) + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_c = self.space.newutf8("c", 1) + m1 = m.get_next(w_a, '"a"', 0, 3, m) + assert m1.w_key == w_a + assert m1.nextmap_first is None + assert m1.key_repr == '"a"' + assert m1.key_repr_cmp('"a": 123', 0) + assert not m1.key_repr_cmp('b": 123', 0) + assert m.nextmap_first.w_key == w_a + + m2 = m.get_next(w_a, '"a"', 0, 3, m) + assert m2 is m1 + + m3 = m.get_next(w_b, '"b"', 0, 3, m) + assert m3.w_key == w_b + assert m3.nextmap_first is None + assert m3.key_repr == '"b"' + assert m.nextmap_first is m1 + + m4 = m3.get_next(w_c, '"c"', 0, 3, m) + assert m4.w_key == w_c + assert m4.nextmap_first is None + assert m4.key_repr == '"c"' + assert m3.nextmap_first is m4 + + def test_json_map_get_index(self): + m = Terminator(self.space) + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_c = self.space.newutf8("c", 1) + m1 = m.get_next(w_a, 'a"', 0, 2, m) + assert m1.get_index(w_a) == 0 + assert m1.get_index(w_b) == -1 + + m2 = m.get_next(w_b, 'b"', 0, 2, m) + assert m2.get_index(w_b) == 0 + assert m2.get_index(w_a) == -1 + + m3 = m2.get_next(w_c, 'c"', 0, 2, m) + assert m3.get_index(w_b) == 0 + assert m3.get_index(w_c) == 1 + assert m3.get_index(w_a) == -1 + + def test_jsonmap_fill_dict(self): + from collections import OrderedDict + m = Terminator(self.space) + space = self.space + w_a = space.newutf8("a", 1) + w_b = space.newutf8("b", 1) + w_c = space.newutf8("c", 1) + m1 = m.get_next(w_a, 'a"', 0, 2, m) + m2 = m1.get_next(w_b, 'b"', 0, 2, m) + m3 = m2.get_next(w_c, 'c"', 0, 2, m) + d = OrderedDict() + m3.fill_dict(d, [space.w_None, space.w_None, space.w_None]) + assert list(d) == [w_a, w_b, w_c] + + + def test_decode_key_map(self): + m = Terminator(self.space) + m_diff = Terminator(self.space) + for s1 in ["abc", "1001" * 10, u"ä".encode("utf-8")]: + s = ' "%s" "%s" "%s"' % (s1, s1, s1) + dec = JSONDecoder(self.space, s) + assert dec.pos == 0 + m1 = dec.decode_key_map(dec.skip_whitespace(0), m) + assert m1.w_key._utf8 == s1 + assert m1.key_repr == '"%s"' % s1 + + # check caching on w_key level + m2 = dec.decode_key_map(dec.skip_whitespace(dec.pos), m_diff) + assert m1.w_key is m2.w_key + + # check caching on map level + m3 = dec.decode_key_map(dec.skip_whitespace(dec.pos), m_diff) + assert m3 is m2 + dec.close() + + def test_decode_string_caching(self): + for s1 in ["abc", u"ä".encode("utf-8")]: + s = '"%s" "%s" "%s"' % (s1, s1, s1) + dec = JSONDecoder(self.space, s) + dec.MIN_SIZE_FOR_STRING_CACHE = 0 + assert dec.pos == 0 + w_x = dec.decode_string(1) + w_y = dec.decode_string(dec.skip_whitespace(dec.pos) + 1) + assert w_x is not w_y + # check caching + w_z = dec.decode_string(dec.skip_whitespace(dec.pos) + 1) + assert w_z is w_y + dec.close() + + def _make_some_maps(self): + # base -> m1 -> m2 -> m3 + # \-> m4 + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_c = self.space.newutf8("c", 1) + w_d = self.space.newutf8("d", 1) + base = Terminator(self.space) + base.instantiation_count = 6 + m1 = base.get_next(w_a, 'a"', 0, 2, base) + m2 = m1.get_next(w_b, 'b"', 0, 2, base) + m3 = m2.get_next(w_c, 'c"', 0, 2, base) + m4 = m2.get_next(w_d, 'd"', 0, 2, base) + return base, m1, m2, m3, m4 + + # unit tests for map state transistions + def test_fringe_to_useful(self): + base, m1, m2, m3, m4 = self._make_some_maps() + base.instantiation_count = 6 + assert m1.state == MapBase.FRINGE + m1.instantiation_count = 6 + + assert m2.state == MapBase.PRELIMINARY + m2.instantiation_count = 6 + + assert m3.state == MapBase.PRELIMINARY + m3.instantiation_count = 2 + assert m2.nextmap_first is m3 + + assert m4.state == MapBase.PRELIMINARY + m4.instantiation_count = 4 + + m1.mark_useful(base) + assert m1.state == MapBase.USEFUL + assert m2.state == MapBase.USEFUL + assert m3.state == MapBase.FRINGE + assert m4.state == MapBase.USEFUL + assert m2.nextmap_first is m4 + + assert m1.number_of_leaves == 2 + base._check_invariants() + + def test_number_of_leaves(self): + w_x = self.space.newutf8("x", 1) + base, m1, m2, m3, m4 = self._make_some_maps() + assert base.number_of_leaves == 2 + assert m1.number_of_leaves == 2 + assert m2.number_of_leaves == 2 + assert m3.number_of_leaves == 1 + assert m4.number_of_leaves == 1 + m5 = m2.get_next(w_x, 'x"', 0, 2, base) + assert base.number_of_leaves == 3 + assert m1.number_of_leaves == 3 + assert m2.number_of_leaves == 3 + assert m5.number_of_leaves == 1 + + def test_number_of_leaves_after_mark_blocked(self): + w_x = self.space.newutf8("x", 1) + base, m1, m2, m3, m4 = self._make_some_maps() + m5 = m2.get_next(w_x, 'x"', 0, 2, base) + assert base.number_of_leaves == 3 + m2.mark_blocked(base) + assert base.number_of_leaves == 1 + + def test_mark_useful_cleans_fringe(self): + base, m1, m2, m3, m4 = self._make_some_maps() + base.instantiation_count = 6 + assert m1.state == MapBase.FRINGE + m1.instantiation_count = 6 + m2.instantiation_count = 6 + m3.instantiation_count = 2 + m4.instantiation_count = 4 + assert base.current_fringe == {m1: None} + + m1.mark_useful(base) + assert base.current_fringe == {m3: None} + + def test_cleanup_fringe(self): + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_c = self.space.newutf8("c", 1) + w_d = self.space.newutf8("d", 1) + base = Terminator(self.space) + base.instantiation_count = 6 + m1 = base.get_next(w_a, 'a"', 0, 2, base) + m2 = base.get_next(w_b, 'b"', 0, 2, base) + m3 = base.get_next(w_c, 'c"', 0, 2, base) + m4 = base.get_next(w_d, 'd"', 0, 2, base) + m5 = m4.get_next(w_a, 'a"', 0, 2, base) + base.instantiation_count = 7 + m1.instantiation_count = 2 + m2.instantiation_count = 2 + m3.instantiation_count = 2 + m4.instantiation_count = 1 + m5.instantiation_count = 1 + assert base.current_fringe == dict.fromkeys([m1, m2, m3, m4]) + + base.cleanup_fringe() + assert base.current_fringe == dict.fromkeys([m1, m2, m3]) + assert m4.state == MapBase.BLOCKED + assert m4.nextmap_first is None + assert m4.nextmap_all is None + assert m5.state == MapBase.BLOCKED + assert m5.nextmap_first is None + assert m5.nextmap_all is None + + def test_deal_with_blocked(self): + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_c = self.space.newutf8("c", 1) + space = self.space + s = '{"a": 1, "b": 2, "c": 3}' + dec = JSONDecoder(space, s) + dec.startmap = base = Terminator(space) + m1 = base.get_next(w_a, 'a"', 0, 2, base) + m2 = m1.get_next(w_b, 'b"', 0, 2, base) + m2.mark_blocked(base) + w_res = dec.decode_object(1) + assert space.int_w(space.len(w_res)) == 3 + assert space.int_w(space.getitem(w_res, w_a)) == 1 + assert space.int_w(space.getitem(w_res, w_b)) == 2 + assert space.int_w(space.getitem(w_res, w_c)) == 3 + dec.close() + + def test_deal_with_blocked_number_of_leaves(self): + w_a = self.space.newutf8("a", 1) + w_b = self.space.newutf8("b", 1) + w_x = self.space.newutf8("x", 1) + w_u = self.space.newutf8("u", 1) + space = self.space + base = Terminator(space) + m1 = base.get_next(w_a, 'a"', 0, 2, base) + m2 = m1.get_next(w_b, 'b"', 0, 2, base) + m2.get_next(w_x, 'x"', 0, 2, base) + m2.get_next(w_u, 'u"', 0, 2, base) + assert base.number_of_leaves == 2 + m2.mark_blocked(base) + assert base.number_of_leaves == 1 + + def test_instatiation_count(self): + m = Terminator(self.space) + dec = JSONDecoder(self.space, '"abc" "def"') + m1 = dec.decode_key_map(dec.skip_whitespace(0), m) + m2 = dec.decode_key_map(dec.skip_whitespace(6), m1) + m1 = dec.decode_key_map(dec.skip_whitespace(0), m) + m2 = dec.decode_key_map(dec.skip_whitespace(6), m1) + m1 = dec.decode_key_map(dec.skip_whitespace(0), m) + + assert m1.instantiation_count == 3 + assert m2.instantiation_count == 2 + dec.close() + class AppTest(object): spaceconfig = {"usemodules": ['_pypyjson']} @@ -106,6 +341,12 @@ s = r'"\u1234"' assert _pypyjson.loads(s) == '\u1234' + def test_escape_sequence_mixed_with_unicode(self): + import _pypyjson + assert _pypyjson.loads(r'"abc\\' + u'ä"') == u'abc\\ä' + assert _pypyjson.loads(r'"abc\"' + u'ä"') == u'abc"ä' + assert _pypyjson.loads(r'"def\u1234' + u'ä"') == u'def\u1234ä' + def test_invalid_utf_8(self): import _pypyjson s = '"\xe0"' # this is an invalid UTF8 sequence inside a string @@ -175,9 +416,14 @@ s = '{"hello": "world", "aaa": "bbb"}' assert _pypyjson.loads(s) == {'hello': 'world', 'aaa': 'bbb'} + assert _pypyjson.loads(s) == {'hello': 'world', + 'aaa': 'bbb'} raises(ValueError, _pypyjson.loads, '{"key"') raises(ValueError, _pypyjson.loads, '{"key": 42') + assert _pypyjson.loads('{"neighborhood": ""}') == { + "neighborhood": ""} + def test_decode_object_nonstring_key(self): import _pypyjson raises(ValueError, "_pypyjson.loads('{42: 43}')") @@ -248,15 +494,16 @@ def test_error_position(self): import _pypyjson test_cases = [ - ('[,', "Unexpected ',' at", 1), - ('{"spam":[}', "Unexpected '}' at", 9), + ('[,', "Unexpected ','", 1), + ('{"spam":[}', "Unexpected '}'", 9), ('[42:', "Unexpected ':' when decoding array", 3), ('[42 "spam"', "Unexpected '\"' when decoding array", 4), - ('[42,]', "Unexpected ']' at", 4), + ('[42,]', "Unexpected ']'", 4), ('{"spam":[42}', "Unexpected '}' when decoding array", 11), ('["]', 'Unterminated string starting at', 1), ('["spam":', "Unexpected ':' when decoding array", 7), ('[{]', "Key name must be string at char", 2), + ('{"a": 1 "b": 2}', "Unexpected '\"' when decoding object", 8), ] for inputtext, errmsg, errpos in test_cases: exc = raises(ValueError, _pypyjson.loads, inputtext) @@ -275,4 +522,4 @@ class MyError(Exception): pass exc = raises(MyError, _pypyjson.loads, 'nul', MyError) - assert exc.value.args == ('Error when decoding null at', 'nul', 1) + assert exc.value.args == ('Error when decoding null', 'nul', 1) diff --git a/pypy/module/_pypyjson/test/test_simd.py b/pypy/module/_pypyjson/test/test_simd.py new file mode 100644 --- /dev/null +++ b/pypy/module/_pypyjson/test/test_simd.py @@ -0,0 +1,110 @@ +import sys +import pytest +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib.rarithmetic import r_uint, intmask + +from pypy.module._pypyjson.simd import USE_SIMD +from pypy.module._pypyjson.simd import find_end_of_string_slow +from pypy.module._pypyjson.simd import find_end_of_string_slow_no_hash +from pypy.module._pypyjson.simd import print_chars +from pypy.module._pypyjson.simd import find_end_of_string_simd_unaligned, WORD_SIZE +from pypy.module._pypyjson.simd import find_end_of_string_simd_unaligned_no_hash + +try: + from hypothesis import example, given, strategies +except ImportError: + pytest.skip("missing hypothesis!") + +if not USE_SIMD: + pytest.skip("only implemented for 64 bit for now") + +def fill_to_word_size(res, ch=" "): + if len(res) % WORD_SIZE != 0: + res += ch * (WORD_SIZE - (len(res) % WORD_SIZE)) + return res + +def string_to_word(s): + assert len(s) == WORD_SIZE + ll_chars, llobj, flag = rffi.get_nonmovingbuffer_ll_final_null(s) + try: + wordarray = rffi.cast(rffi.ULONGP, ll_chars) + return wordarray[0] + finally: + rffi.free_nonmovingbuffer_ll(ll_chars, llobj, flag) + +def ll(callable, string, *args): + ll_chars, llobj, flag = rffi.get_nonmovingbuffer_ll_final_null(string) + try: + return callable(ll_chars, *args) + finally: + rffi.free_nonmovingbuffer_ll(ll_chars, llobj, flag) + +word = strategies.builds( + r_uint, strategies.integers(min_value=-sys.maxint-1, max_value=sys.maxint)) + +def build_string(prefix, content, end, suffix): + res = prefix + '"' + "".join([chr(x) for x in content]) + end + suffix + return fill_to_word_size(res), len(prefix) + 1 + +string_in_context_strategy = strategies.builds( + build_string, prefix=strategies.binary(), + content=strategies.lists(strategies.integers(1, 255), min_size=1), + end=strategies.sampled_from('"\\\x00\x01'), + suffix=strategies.binary()) + +def compare(string, res1, res2): + hash1, nonascii1, endindex1 = res1 + hash2, nonascii2, endindex2 = res2 + assert endindex1 == endindex2 + if string[endindex1 - 1] == '"': + assert hash1 == hash2 + assert nonascii1 == nonascii2 + + + at example(('" \x80" ', 1)) + at example(('"\x01" ', 1)) + at example(('"aaaaaaaa"\x00\x00\x00\x00\x00\x00\x00 ', 1)) + at example(('"aaaaaaaa" ', 1)) + at example(('"12"', 1)) + at example(('"1234567abcdefghAB"', 1)) + at example(('"1234567abcdefgh"', 1)) + at example((' "123456ABCDEF" \x00', 2)) + at example((' "123456aaaaaaaaABCDEF"\x00', 2)) + at given(string_in_context_strategy) +def test_find_end_of_string(a): + (string, startindex) = a + res = ll(find_end_of_string_slow, string, startindex, len(string)) + hash, nonascii1, endposition1 = res + res2 = ll(find_end_of_string_slow_no_hash, string, startindex, len(string)) + assert res2 == (nonascii1, endposition1) + ch = string[endposition1] + assert ch == '"' or ch == '\\' or ch < '\x20' + for ch in string[startindex:endposition1]: + assert not (ch == '"' or ch == '\\' or ch < '\x20') + compare(string, res, ll(find_end_of_string_simd_unaligned, string, startindex, len(string))) + + nonascii2, endposition2 = ll(find_end_of_string_simd_unaligned_no_hash, string, startindex, len(string)) + assert nonascii1 == nonascii2 + assert endposition1 == endposition2 + + at given(string_in_context_strategy, strategies.binary(min_size=1)) +def test_find_end_of_string_position_invariance(a, prefix): + fn = find_end_of_string_simd_unaligned + (string, startindex) = a + h1, nonascii1, i1 = ll(fn, string, startindex, len(string)) + string2 = prefix + string + h2, nonascii2, i2 = ll(fn, string2, startindex + len(prefix), len(string) + len(prefix)) + assert h1 == h2 + assert nonascii1 == nonascii2 + assert i1 + len(prefix) == i2 + + at given(string_in_context_strategy, strategies.binary(min_size=1)) +def test_find_end_of_string_position_invariance_no_hash(a, prefix): + fn = find_end_of_string_simd_unaligned_no_hash + (string, startindex) = a + nonascii1, i1 = ll(fn, string, startindex, len(string)) + string2 = prefix + string + nonascii2, i2 = ll(fn, string2, startindex + len(prefix), len(string) + len(prefix)) + assert nonascii1 == nonascii2 + assert i1 + len(prefix) == i2 + diff --git a/pypy/objspace/std/jsondict.py b/pypy/objspace/std/jsondict.py new file mode 100644 --- /dev/null +++ b/pypy/objspace/std/jsondict.py @@ -0,0 +1,167 @@ +"""dict implementation specialized for object loaded by the _pypyjson module. + +Somewhat similar to MapDictStrategy, also uses a map. +""" + +from rpython.rlib import jit, rerased, objectmodel, debug + +from pypy.objspace.std.dictmultiobject import ( + UnicodeDictStrategy, DictStrategy, + create_iterator_classes, W_DictObject) + + +def from_values_and_jsonmap(space, values_w, jsonmap): + if not objectmodel.we_are_translated(): + assert len(values_w) == len(jsonmap.get_keys_in_order()) + assert len(values_w) != 0 + debug.make_sure_not_resized(values_w) + strategy = jsonmap.strategy_instance + if strategy is None: + jsonmap.strategy_instance = strategy = JsonDictStrategy(space, jsonmap) + storage = strategy.erase(values_w) + return W_DictObject(space, strategy, storage) + +def devolve_jsonmap_dict(w_dict): + assert isinstance(w_dict, W_DictObject) + strategy = w_dict.get_strategy() + assert isinstance(strategy, JsonDictStrategy) + strategy.switch_to_unicode_strategy(w_dict) + +def get_jsonmap_from_dict(w_dict): + assert isinstance(w_dict, W_DictObject) + strategy = w_dict.get_strategy() + assert isinstance(strategy, JsonDictStrategy) + return strategy.jsonmap + +class JsonDictStrategy(DictStrategy): + erase, unerase = rerased.new_erasing_pair("jsondict") + erase = staticmethod(erase) + unerase = staticmethod(unerase) + + _immutable_fields_ = ['jsonmap'] + + def __init__(self, space, jsonmap): + DictStrategy.__init__(self, space) + self.jsonmap = jsonmap + + def wrap(self, w_key): + return w_key + + def wrapkey(space, key): + return key + + def get_empty_storage(self): + raise NotImplementedError("should not be reachable") + + def is_correct_type(self, w_obj): + space = self.space + return space.is_w(space.type(w_obj), space.w_unicode) + + def _never_equal_to(self, w_lookup_type): + return False + + def length(self, w_dict): + return len(self.unerase(w_dict.dstorage)) + + def getitem(self, w_dict, w_key): + if self.is_correct_type(w_key): + return self.getitem_unicode(w_dict, w_key) + else: + self.switch_to_unicode_strategy(w_dict) + return w_dict.getitem(w_key) + + def getitem_unicode(self, w_dict, w_key): + storage_w = self.unerase(w_dict.dstorage) + if jit.isconstant(w_key): + jit.promote(self) + index = self.jsonmap.get_index(w_key) + if index == -1: + return None + return storage_w[index] + + def setitem(self, w_dict, w_key, w_value): + if self.is_correct_type(w_key): + storage_w = self.unerase(w_dict.dstorage) + index = self.jsonmap.get_index(w_key) + if index != -1: + storage_w[index] = w_value + return + self.switch_to_unicode_strategy(w_dict) + w_dict.setitem(w_key, w_value) + + def setdefault(self, w_dict, w_key, w_default): + if self.is_correct_type(w_key): + w_result = self.getitem_unicode(w_dict, w_key) + if w_result is not None: + return w_result + self.switch_to_unicode_strategy(w_dict) + return w_dict.setdefault(w_key, w_default) + + def delitem(self, w_dict, w_key): + self.switch_to_unicode_strategy(w_dict) + return w_dict.delitem(w_key) + + def popitem(self, w_dict): From pypy.commits at gmail.com Sat Sep 21 15:24:23 2019 From: pypy.commits at gmail.com (cfbolz) Date: Sat, 21 Sep 2019 12:24:23 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default Message-ID: <5d8678e7.1c69fb81.abf4d.abfb@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: py3.6 Changeset: r97584:eb8c500a7667 Date: 2019-09-21 21:23 +0200 http://bitbucket.org/pypy/pypy/changeset/eb8c500a7667/ Log: merge default diff --git a/pypy/tool/pypyjit.py b/pypy/tool/pypyjit.py deleted file mode 100644 --- a/pypy/tool/pypyjit.py +++ /dev/null @@ -1,118 +0,0 @@ -""" -A file that invokes translation of PyPy with the JIT enabled. - -Run it with py.test -s --pdb pypyjit.py - -""" - -import py, os - -try: - py.test.config.option.runappdirect -except AttributeError: - import sys - print >> sys.stderr, __doc__ - sys.exit(2) - -import sys -sys.setrecursionlimit(100000000) - -from pypy.objspace.std import Space -from rpython.config.translationoption import set_opt_level -from pypy.config.pypyoption import get_pypy_config, set_pypy_opt_level -from rpython.rtyper.annlowlevel import llhelper, llstr, hlstr -from rpython.rtyper.lltypesystem.rstr import STR -from rpython.rtyper.lltypesystem import lltype -from pypy.interpreter.pycode import PyCode -from rpython.translator.goal import unixcheckpoint -import pypy.module.pypyjit.interp_jit - -config = get_pypy_config(translating=True) -config.translation.backendopt.inline_threshold = 0.1 -config.translation.gc = 'boehm' -config.translating = True -config.translation.rweakref = False -set_opt_level(config, level='jit') -config.objspace.allworkingmodules = False -config.objspace.usemodules.pypyjit = True -config.objspace.usemodules.array = False -config.objspace.usemodules._weakref = False -config.objspace.usemodules.struct = True -config.objspace.usemodules.time = True -config.objspace.usemodules._sre = False -config.objspace.usemodules._lsprof = False -# -config.objspace.usemodules._rawffi = False -config.objspace.usemodules.micronumpy = False -# -set_pypy_opt_level(config, level='jit') - -print config - -import sys, pdb - -space = Space(config) -w_dict = space.newdict(module=True) - - -def readfile(filename): - fd = os.open(filename, os.O_RDONLY, 0) - blocks = [] - while True: - data = os.read(fd, 4096) - if not data: - break - blocks.append(data) - os.close(fd) - return ''.join(blocks) - -def read_code(): - from pypy.module.marshal.interp_marshal import dumps - - filename = 'pypyjit_demo.py' - source = readfile(filename) - ec = space.getexecutioncontext() - code = ec.compiler.compile(source, filename, 'exec', 0) - return llstr(space.str_w(dumps(space, code, space.wrap(2)))) - -FPTR = lltype.Ptr(lltype.FuncType([], lltype.Ptr(STR))) -read_code_ptr = llhelper(FPTR, read_code) - -def entry_point(): - space.startup() - from pypy.module.marshal.interp_marshal import loads - code = loads(space, space.wrap(hlstr(read_code_ptr()))) - assert isinstance(code, PyCode) - code.exec_code(space, w_dict, w_dict) - -def test_run_translation(): - from pypy.tool.ann_override import PyPyAnnotatorPolicy - from rpython.rtyper.test.test_llinterp import get_interpreter - - # first annotate and rtype - try: - interp, graph = get_interpreter(entry_point, [], backendopt=False, - config=config, - policy=PyPyAnnotatorPolicy(space)) - except Exception as e: - print '%s: %s' % (e.__class__, e) - pdb.post_mortem(sys.exc_info()[2]) - raise - - # parent process loop: spawn a child, wait for the child to finish, - # print a message, and restart - unixcheckpoint.restartable_point(auto='run') - - from rpython.jit.codewriter.codewriter import CodeWriter - CodeWriter.debug = True - from pypy.tool.pypyjit_child import run_child - run_child(globals(), locals()) - - -if __name__ == '__main__': - import sys - if len(sys.argv) > 1: - # debugging: run the code directly - entry_point() - else: - test_run_translation() diff --git a/pypy/tool/pypyjit_child.py b/pypy/tool/pypyjit_child.py deleted file mode 100644 --- a/pypy/tool/pypyjit_child.py +++ /dev/null @@ -1,25 +0,0 @@ -from pypy.conftest import option -from rpython.rtyper.lltypesystem import lltype -from rpython.jit.metainterp import warmspot -from pypy.module.pypyjit.policy import PyPyJitPolicy - - -def run_child(glob, loc): - import sys, pdb - interp = loc['interp'] - graph = loc['graph'] - interp.malloc_check = False - - from rpython.jit.backend.llgraph.runner import LLGraphCPU - #LLtypeCPU.supports_floats = False # for now - apply_jit(interp, graph, LLGraphCPU) - - -def apply_jit(interp, graph, CPUClass): - print 'warmspot.jittify_and_run() started...' - policy = PyPyJitPolicy() - option.view = True - warmspot.jittify_and_run(interp, graph, [], policy=policy, - listops=True, CPUClass=CPUClass, - backendopt=True, inline=True) - diff --git a/pypy/tool/pypyjit_demo.py b/pypy/tool/pypyjit_demo.py deleted file mode 100644 --- a/pypy/tool/pypyjit_demo.py +++ /dev/null @@ -1,31 +0,0 @@ - -import time -l = [] - -for i in range(100): - print i - t0 = time.time() - exec """ -def k(a, b, c): - pass - -def g(a, b, c): - k(a, b + 1, c + 2) - k(a, b + 1, c + 2) - k(a, b + 1, c + 2) - k(a, b + 1, c + 2) - k(a, b + 1, c + 2) - -def f(i): - g(i, i + 1, i + 2) - g(i, i + 1, i + 2) - g(i, i + 1, i + 2) - g(i, i + 1, i + 2) - g(i, i + 1, i + 2) - g(i, i + 1, i + 2) -for i in range(1000): - f(i) -""" - l.append(time.time() - t0) - -print l diff --git a/pypy/tool/unicodefuzzer.py b/pypy/tool/unicodefuzzer.py deleted file mode 100644 --- a/pypy/tool/unicodefuzzer.py +++ /dev/null @@ -1,63 +0,0 @@ -import random, sys -random.seed(42) - -def make_random_encoded_string(length=10, variance=1): - s = [] - s.append(random.choice(["\xff\xfe", "\xfe\xff", ""])) # BOM - for i in range(length + random.randrange(-variance, variance)): - s.append(chr(random.randrange(256))) - return "".join(s) - -def make_random_unicode(length=10, variance=1): - s = [] - for i in range(length + random.randrange(-variance, variance)): - s.append(unichr(random.randrange(sys.maxunicode))) - return "".join(s) - -def check_encode(encoding, s): - try: - s.encode(encoding) - except UnicodeError: - pass - s.encode(encoding, "ignore") - s.encode(encoding, "replace") - -def check_decode(encoding, s): - try: - s.decode(encoding) - except UnicodeError: - pass - s.decode(encoding, "ignore") - s.decode(encoding, "replace") - -def check_with_length(length): - try: - s = make_random_encoded_string(length, 10) - for encoding in all_encodings: - check_decode(encoding, s) - except Exception as e: - print "decoding:", encoding, repr(s) - try: - s = make_random_unicode(length, 10) - for encoding in all_encodings: - check_encode(encoding, s) - except Exception as e: - print "encoding:", encoding, repr(s) - - -def main(): - for length in range(0, 1000, 10): - print length - for i in range(100): - check_with_length(length) - length = 1000 - for length in range(1000, 1000000, 1000): - print length - for i in range(100): - check_with_length(length) - -all_encodings = "utf-8 latin1 ascii utf-16 utf-16-be utf-16-le utf-7".split() - -if __name__ == '__main__': - main() - From pypy.commits at gmail.com Sat Sep 21 17:46:47 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 21 Sep 2019 14:46:47 -0700 (PDT) Subject: [pypy-commit] pypy default: regenerate pycparser tables, update _c_ast.cfg Message-ID: <5d869a47.1c69fb81.b08c6.eb35@mx.google.com> Author: Matti Picus Branch: Changeset: r97585:a74a153bd623 Date: 2019-09-22 00:38 +0300 http://bitbucket.org/pypy/pypy/changeset/a74a153bd623/ Log: regenerate pycparser tables, update _c_ast.cfg diff --git a/lib_pypy/cffi/_pycparser/README b/lib_pypy/cffi/_pycparser/README --- a/lib_pypy/cffi/_pycparser/README +++ b/lib_pypy/cffi/_pycparser/README @@ -10,3 +10,8 @@ ^^^^^^^^^^^^^^^ yacctab='cffi._pycparser.yacctab', ^^^^^^^^^^^^^^^ + +Also, when updating the version of this in-place, you must regenerate the +lextab.py and yacctab.py files. They will be regenerated on import if they +are not found, so they should be removed, then regenrated, then the new +versions committed. diff --git a/lib_pypy/cffi/_pycparser/_c_ast.cfg b/lib_pypy/cffi/_pycparser/_c_ast.cfg --- a/lib_pypy/cffi/_pycparser/_c_ast.cfg +++ b/lib_pypy/cffi/_pycparser/_c_ast.cfg @@ -9,7 +9,7 @@ # ** - a sequence of child nodes # - an attribute # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- @@ -187,3 +187,5 @@ Union: [name, decls**] While: [cond*, stmt*] + +Pragma: [string] diff --git a/lib_pypy/cffi/_pycparser/lextab.py b/lib_pypy/cffi/_pycparser/lextab.py --- a/lib_pypy/cffi/_pycparser/lextab.py +++ b/lib_pypy/cffi/_pycparser/lextab.py @@ -1,9 +1,10 @@ -# pycparser.lextab.py. This file automatically created by PLY (version 3.4). Don't edit! -_tabversion = '3.4' -_lextokens = {'VOID': 1, 'LBRACKET': 1, 'WCHAR_CONST': 1, 'FLOAT_CONST': 1, 'MINUS': 1, 'RPAREN': 1, 'LONG': 1, 'PLUS': 1, 'ELLIPSIS': 1, 'GT': 1, 'GOTO': 1, 'ENUM': 1, 'PERIOD': 1, 'GE': 1, 'INT_CONST_DEC': 1, 'ARROW': 1, 'HEX_FLOAT_CONST': 1, 'DOUBLE': 1, 'MINUSEQUAL': 1, 'INT_CONST_OCT': 1, 'TIMESEQUAL': 1, 'OR': 1, 'SHORT': 1, 'RETURN': 1, 'RSHIFTEQUAL': 1, 'RESTRICT': 1, 'STATIC': 1, 'SIZEOF': 1, 'UNSIGNED': 1, 'UNION': 1, 'COLON': 1, 'WSTRING_LITERAL': 1, 'DIVIDE': 1, 'FOR': 1, 'PLUSPLUS': 1, 'EQUALS': 1, 'ELSE': 1, 'INLINE': 1, 'EQ': 1, 'AND': 1, 'TYPEID': 1, 'LBRACE': 1, 'PPHASH': 1, 'INT': 1, 'SIGNED': 1, 'CONTINUE': 1, 'NOT': 1, 'OREQUAL': 1, 'MOD': 1, 'RSHIFT': 1, 'DEFAULT': 1, 'CHAR': 1, 'WHILE': 1, 'DIVEQUAL': 1, 'EXTERN': 1, 'CASE': 1, 'LAND': 1, 'REGISTER': 1, 'MODEQUAL': 1, 'NE': 1, 'SWITCH': 1, 'INT_CONST_HEX': 1, '_COMPLEX': 1, 'PLUSEQUAL': 1, 'STRUCT': 1, 'CONDOP': 1, 'BREAK': 1, 'VOLATILE': 1, 'ANDEQUAL': 1, 'INT_CONST_BIN': 1, 'DO': 1, 'LNOT': 1, 'CONST': 1, 'LOR': 1, 'CHAR_CONST': 1, 'LSHIFT': 1, 'RBRACE': 1, '_BOOL': 1, 'LE': 1, 'SEMI': 1, 'LT': 1, 'COMMA': 1, 'OFFSETOF': 1, 'TYPEDEF': 1, 'XOR': 1, 'AUTO': 1, 'TIMES': 1, 'LPAREN': 1, 'MINUSMINUS': 1, 'ID': 1, 'IF': 1, 'STRING_LITERAL': 1, 'FLOAT': 1, 'XOREQUAL': 1, 'LSHIFTEQUAL': 1, 'RBRACKET': 1} -_lexreflags = 0 +# lextab.py. This file automatically created by PLY (version 3.10). Don't edit! +_tabversion = '3.10' +_lextokens = set(('_BOOL', '_COMPLEX', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN', 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', 'REGISTER', 'OFFSETOF', 'RESTRICT', 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', 'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID', 'VOLATILE', 'WHILE', '__INT128', 'ID', 'TYPEID', 'INT_CONST_DEC', 'INT_CONST_OCT', 'INT_CONST_HEX', 'INT_CONST_BIN', 'FLOAT_CONST', 'HEX_FLOAT_CONST', 'CHAR_CONST', 'WCHAR_CONST', 'STRING_LITERAL', 'WSTRING_LITERAL', 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MOD', 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', 'LOR', 'LAND', 'LNOT', 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', 'PLUSEQUAL', 'MINUSEQUAL', 'LSHIFTEQUAL', 'RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', 'OREQUAL', 'PLUSPLUS', 'MINUSMINUS', 'ARROW', 'CONDOP', 'LPAREN', 'RPAREN', 'LBRACKET', 'RBRACKET', 'LBRACE', 'RBRACE', 'COMMA', 'PERIOD', 'SEMI', 'COLON', 'ELLIPSIS', 'PPHASH', 'PPPRAGMA', 'PPPRAGMASTR')) +_lexreflags = 64 _lexliterals = '' -_lexstateinfo = {'ppline': 'exclusive', 'pppragma': 'exclusive', 'INITIAL': 'inclusive'} -_lexstatere = {'ppline': [('(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, None, None, None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR'), None, None, None, None, None, None, ('t_pppragma_ID', 'ID')])], 'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P\\.\\.\\.)|(?P\\+\\+)|(?P\\|\\|)|(?P\\^=)|(?P\\|=)|(?P<<=)|(?P>>=)|(?P\\+=)|(?P\\*=)|(?P\\+)|(?P%=)|(?P/=)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, None, None, None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, None, None, None, None, (None, 'ELLIPSIS'), (None, 'PLUSPLUS'), (None, 'LOR'), (None, 'XOREQUAL'), (None, 'OREQUAL'), (None, 'LSHIFTEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'PLUSEQUAL'), (None, 'TIMESEQUAL'), (None, 'PLUS'), (None, 'MODEQUAL'), (None, 'DIVEQUAL')]), ('(?P\\])|(?P\\?)|(?P\\^)|(?P<<)|(?P<=)|(?P\\()|(?P->)|(?P==)|(?P!=)|(?P--)|(?P\\|)|(?P\\*)|(?P\\[)|(?P>=)|(?P\\))|(?P&&)|(?P>>)|(?P-=)|(?P\\.)|(?P&=)|(?P=)|(?P<)|(?P,)|(?P/)|(?P&)|(?P%)|(?P;)|(?P-)|(?P>)|(?P:)|(?P~)|(?P!)', [None, (None, 'RBRACKET'), (None, 'CONDOP'), (None, 'XOR'), (None, 'LSHIFT'), (None, 'LE'), (None, 'LPAREN'), (None, 'ARROW'), (None, 'EQ'), (None, 'NE'), (None, 'MINUSMINUS'), (None, 'OR'), (None, 'TIMES'), (None, 'LBRACKET'), (None, 'GE'), (None, 'RPAREN'), (None, 'LAND'), (None, 'RSHIFT'), (None, 'MINUSEQUAL'), (None, 'PERIOD'), (None, 'ANDEQUAL'), (None, 'EQUALS'), (None, 'LT'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'AND'), (None, 'MOD'), (None, 'SEMI'), (None, 'MINUS'), (None, 'GT'), (None, 'COLON'), (None, 'NOT'), (None, 'LNOT')])]} -_lexstateignore = {'ppline': ' \t', 'pppragma': ' \t<>.-{}();=+-*/$%@&^~!?:,0123456789', 'INITIAL': ' \t'} -_lexstateerrorf = {'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error', 'INITIAL': 't_error'} +_lexstateinfo = {'INITIAL': 'inclusive', 'ppline': 'exclusive', 'pppragma': 'exclusive'} +_lexstatere = {'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-9])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-9])([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P\\.\\.\\.)|(?P\\|\\|)|(?P\\+\\+)|(?P<<=)|(?P\\|=)|(?P\\+=)|(?P>>=)|(?P\\*=)|(?P\\^=)|(?P&=)|(?P->)|(?P\\?)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, (None, 'ELLIPSIS'), (None, 'LOR'), (None, 'PLUSPLUS'), (None, 'LSHIFTEQUAL'), (None, 'OREQUAL'), (None, 'PLUSEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'TIMESEQUAL'), (None, 'XOREQUAL'), (None, 'ANDEQUAL'), (None, 'ARROW'), (None, 'CONDOP')]), ('(?P/=)|(?P==)|(?P>=)|(?P&&)|(?P\\[)|(?P<=)|(?P\\()|(?P<<)|(?P-=)|(?P--)|(?P%=)|(?P!=)|(?P\\|)|(?P\\.)|(?P\\+)|(?P\\])|(?P\\))|(?P>>)|(?P\\*)|(?P\\^)|(?P&)|(?P:)|(?P,)|(?P/)|(?P=)|(?P>)|(?P!)|(?P<)|(?P-)|(?P%)|(?P~)|(?P;)', [None, (None, 'DIVEQUAL'), (None, 'EQ'), (None, 'GE'), (None, 'LAND'), (None, 'LBRACKET'), (None, 'LE'), (None, 'LPAREN'), (None, 'LSHIFT'), (None, 'MINUSEQUAL'), (None, 'MINUSMINUS'), (None, 'MODEQUAL'), (None, 'NE'), (None, 'OR'), (None, 'PERIOD'), (None, 'PLUS'), (None, 'RBRACKET'), (None, 'RPAREN'), (None, 'RSHIFT'), (None, 'TIMES'), (None, 'XOR'), (None, 'AND'), (None, 'COLON'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'EQUALS'), (None, 'GT'), (None, 'LNOT'), (None, 'LT'), (None, 'MINUS'), (None, 'MOD'), (None, 'NOT'), (None, 'SEMI')])], 'ppline': [('(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P.+)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR')])]} +_lexstateignore = {'INITIAL': ' \t', 'ppline': ' \t', 'pppragma': ' \t'} +_lexstateerrorf = {'INITIAL': 't_error', 'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error'} +_lexstateeoff = {} diff --git a/lib_pypy/cffi/_pycparser/yacctab.py b/lib_pypy/cffi/_pycparser/yacctab.py --- a/lib_pypy/cffi/_pycparser/yacctab.py +++ b/lib_pypy/cffi/_pycparser/yacctab.py @@ -1,292 +1,338 @@ # yacctab.py # This file is automatically generated. Do not edit. -_tabversion = '3.2' +_tabversion = '3.10' _lr_method = 'LALR' -_lr_signature = '\x11\x82\x05\xfb:\x10\xfeo5\xb4\x11N\xe7S\xb4b' +_lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMOD_BOOL _COMPLEX AUTO BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM EXTERN FLOAT FOR GOTO IF INLINE INT LONG REGISTER OFFSETOF RESTRICT RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH TYPEDEF UNION UNSIGNED VOID VOLATILE WHILE __INT128 ID TYPEID INT_CONST_DEC INT_CONST_OCT INT_CONST_HEX INT_CONST_BIN FLOAT_CONST HEX_FLOAT_CONST CHAR_CONST WCHAR_CONST STRING_LITERAL WSTRING_LITERAL PLUS MINUS TIMES DIVIDE MOD OR AND NOT XOR LSHIFT RSHIFT LOR LAND LNOT LT LE GT GE EQ NE EQUALS TIMESEQUAL DIVEQUAL MODEQUAL PLUSEQUAL MINUSEQUAL LSHIFTEQUAL RSHIFTEQUAL ANDEQUAL XOREQUAL OREQUAL PLUSPLUS MINUSMINUS ARROW CONDOP LPAREN RPAREN LBRACKET RBRACKET LBRACE RBRACE COMMA PERIOD SEMI COLON ELLIPSIS PPHASH PPPRAGMA PPPRAGMASTRabstract_declarator_opt : empty\n| abstract_declaratorassignment_expression_opt : empty\n| assignment_expressionblock_item_list_opt : empty\n| block_item_listdeclaration_list_opt : empty\n| declaration_listdeclaration_specifiers_no_type_opt : empty\n| declaration_specifiers_no_typedesignation_opt : empty\n| designationexpression_opt : empty\n| expressionid_init_declarator_list_opt : empty\n| id_init_declarator_listidentifier_list_opt : empty\n| identifier_listinit_declarator_list_opt : empty\n| init_declarator_listinitializer_list_opt : empty\n| initializer_listparameter_type_list_opt : empty\n| parameter_type_liststruct_declarator_list_opt : empty\n| struct_declarator_listtype_qualifier_list_opt : empty\n| type_qualifier_list direct_id_declarator : ID\n direct_id_declarator : LPAREN id_declarator RPAREN\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_id_declarator : direct_id_declarator LPAREN parameter_type_list RPAREN\n | direct_id_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_declarator : TYPEID\n direct_typeid_declarator : LPAREN typeid_declarator RPAREN\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_noparen_declarator : TYPEID\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN\n id_declarator : direct_id_declarator\n id_declarator : pointer direct_id_declarator\n typeid_declarator : direct_typeid_declarator\n typeid_declarator : pointer direct_typeid_declarator\n typeid_noparen_declarator : direct_typeid_noparen_declarator\n typeid_noparen_declarator : pointer direct_typeid_noparen_declarator\n translation_unit_or_empty : translation_unit\n | empty\n translation_unit : external_declaration\n translation_unit : translation_unit external_declaration\n external_declaration : function_definition\n external_declaration : declaration\n external_declaration : pp_directive\n | pppragma_directive\n external_declaration : SEMI\n pp_directive : PPHASH\n pppragma_directive : PPPRAGMA\n | PPPRAGMA PPPRAGMASTR\n function_definition : id_declarator declaration_list_opt compound_statement\n function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement\n statement : labeled_statement\n | expression_statement\n | compound_statement\n | selection_statement\n | iteration_statement\n | jump_statement\n | pppragma_directive\n pragmacomp_or_statement : pppragma_directive statement\n | statement\n decl_body : declaration_specifiers init_declarator_list_opt\n | declaration_specifiers_no_type id_init_declarator_list_opt\n declaration : decl_body SEMI\n declaration_list : declaration\n | declaration_list declaration\n declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt\n declaration_specifiers : declaration_specifiers type_qualifier\n declaration_specifiers : declaration_specifiers storage_class_specifier\n declaration_specifiers : declaration_specifiers function_specifier\n declaration_specifiers : declaration_specifiers type_specifier_no_typeid\n declaration_specifiers : type_specifier\n declaration_specifiers : declaration_specifiers_no_type type_specifier\n storage_class_specifier : AUTO\n | REGISTER\n | STATIC\n | EXTERN\n | TYPEDEF\n function_specifier : INLINE\n type_specifier_no_typeid : VOID\n | _BOOL\n | CHAR\n | SHORT\n | INT\n | LONG\n | FLOAT\n | DOUBLE\n | _COMPLEX\n | SIGNED\n | UNSIGNED\n | __INT128\n type_specifier : typedef_name\n | enum_specifier\n | struct_or_union_specifier\n | type_specifier_no_typeid\n type_qualifier : CONST\n | RESTRICT\n | VOLATILE\n init_declarator_list : init_declarator\n | init_declarator_list COMMA init_declarator\n init_declarator : declarator\n | declarator EQUALS initializer\n id_init_declarator_list : id_init_declarator\n | id_init_declarator_list COMMA init_declarator\n id_init_declarator : id_declarator\n | id_declarator EQUALS initializer\n specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid\n specifier_qualifier_list : specifier_qualifier_list type_qualifier\n specifier_qualifier_list : type_specifier\n specifier_qualifier_list : type_qualifier_list type_specifier\n struct_or_union_specifier : struct_or_union ID\n | struct_or_union TYPEID\n struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close\n | struct_or_union brace_open brace_close\n struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close\n | struct_or_union ID brace_open brace_close\n | struct_or_union TYPEID brace_open struct_declaration_list brace_close\n | struct_or_union TYPEID brace_open brace_close\n struct_or_union : STRUCT\n | UNION\n struct_declaration_list : struct_declaration\n | struct_declaration_list struct_declaration\n struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI\n struct_declaration : SEMI\n struct_declaration : pppragma_directive\n struct_declarator_list : struct_declarator\n | struct_declarator_list COMMA struct_declarator\n struct_declarator : declarator\n struct_declarator : declarator COLON constant_expression\n | COLON constant_expression\n enum_specifier : ENUM ID\n | ENUM TYPEID\n enum_specifier : ENUM brace_open enumerator_list brace_close\n enum_specifier : ENUM ID brace_open enumerator_list brace_close\n | ENUM TYPEID brace_open enumerator_list brace_close\n enumerator_list : enumerator\n | enumerator_list COMMA\n | enumerator_list COMMA enumerator\n enumerator : ID\n | ID EQUALS constant_expression\n declarator : id_declarator\n | typeid_declarator\n pointer : TIMES type_qualifier_list_opt\n | TIMES type_qualifier_list_opt pointer\n type_qualifier_list : type_qualifier\n | type_qualifier_list type_qualifier\n parameter_type_list : parameter_list\n | parameter_list COMMA ELLIPSIS\n parameter_list : parameter_declaration\n | parameter_list COMMA parameter_declaration\n parameter_declaration : declaration_specifiers id_declarator\n | declaration_specifiers typeid_noparen_declarator\n parameter_declaration : declaration_specifiers abstract_declarator_opt\n identifier_list : identifier\n | identifier_list COMMA identifier\n initializer : assignment_expression\n initializer : brace_open initializer_list_opt brace_close\n | brace_open initializer_list COMMA brace_close\n initializer_list : designation_opt initializer\n | initializer_list COMMA designation_opt initializer\n designation : designator_list EQUALS\n designator_list : designator\n | designator_list designator\n designator : LBRACKET constant_expression RBRACKET\n | PERIOD identifier\n type_name : specifier_qualifier_list abstract_declarator_opt\n abstract_declarator : pointer\n abstract_declarator : pointer direct_abstract_declarator\n abstract_declarator : direct_abstract_declarator\n direct_abstract_declarator : LPAREN abstract_declarator RPAREN direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET\n direct_abstract_declarator : LBRACKET TIMES RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN\n direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN\n block_item : declaration\n | statement\n block_item_list : block_item\n | block_item_list block_item\n compound_statement : brace_open block_item_list_opt brace_close labeled_statement : ID COLON pragmacomp_or_statement labeled_statement : CASE constant_expression COLON pragmacomp_or_statement labeled_statement : DEFAULT COLON pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement jump_statement : GOTO ID SEMI jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI\n | RETURN SEMI\n expression_statement : expression_opt SEMI expression : assignment_expression\n | expression COMMA assignment_expression\n typedef_name : TYPEID assignment_expression : conditional_expression\n | unary_expression assignment_operator assignment_expression\n assignment_operator : EQUALS\n | XOREQUAL\n | TIMESEQUAL\n | DIVEQUAL\n | MODEQUAL\n | PLUSEQUAL\n | MINUSEQUAL\n | LSHIFTEQUAL\n | RSHIFTEQUAL\n | ANDEQUAL\n | OREQUAL\n constant_expression : conditional_expression conditional_expression : binary_expression\n | binary_expression CONDOP expression COLON conditional_expression\n binary_expression : cast_expression\n | binary_expression TIMES binary_expression\n | binary_expression DIVIDE binary_expression\n | binary_expression MOD binary_expression\n | binary_expression PLUS binary_expression\n | binary_expression MINUS binary_expression\n | binary_expression RSHIFT binary_expression\n | binary_expression LSHIFT binary_expression\n | binary_expression LT binary_expression\n | binary_expression LE binary_expression\n | binary_expression GE binary_expression\n | binary_expression GT binary_expression\n | binary_expression EQ binary_expression\n | binary_expression NE binary_expression\n | binary_expression AND binary_expression\n | binary_expression OR binary_expression\n | binary_expression XOR binary_expression\n | binary_expression LAND binary_expression\n | binary_expression LOR binary_expression\n cast_expression : unary_expression cast_expression : LPAREN type_name RPAREN cast_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression\n | MINUSMINUS unary_expression\n | unary_operator cast_expression\n unary_expression : SIZEOF unary_expression\n | SIZEOF LPAREN type_name RPAREN\n unary_operator : AND\n | TIMES\n | PLUS\n | MINUS\n | NOT\n | LNOT\n postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN\n | postfix_expression LPAREN RPAREN\n postfix_expression : postfix_expression PERIOD ID\n | postfix_expression PERIOD TYPEID\n | postfix_expression ARROW ID\n | postfix_expression ARROW TYPEID\n postfix_expression : postfix_expression PLUSPLUS\n | postfix_expression MINUSMINUS\n postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close\n | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close\n primary_expression : identifier primary_expression : constant primary_expression : unified_string_literal\n | unified_wstring_literal\n primary_expression : LPAREN expression RPAREN primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN\n offsetof_member_designator : identifier\n | offsetof_member_designator PERIOD identifier\n | offsetof_member_designator LBRACKET expression RBRACKET\n argument_expression_list : assignment_expression\n | argument_expression_list COMMA assignment_expression\n identifier : ID constant : INT_CONST_DEC\n | INT_CONST_OCT\n | INT_CONST_HEX\n | INT_CONST_BIN\n constant : FLOAT_CONST\n | HEX_FLOAT_CONST\n constant : CHAR_CONST\n | WCHAR_CONST\n unified_string_literal : STRING_LITERAL\n | unified_string_literal STRING_LITERAL\n unified_wstring_literal : WSTRING_LITERAL\n | unified_wstring_literal WSTRING_LITERAL\n brace_open : LBRACE\n brace_close : RBRACE\n empty : ' -_lr_action_items = {'VOID':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[6,6,-63,-74,-73,-60,-56,-57,-35,-31,-61,6,-36,-55,-70,-65,-54,6,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,6,-69,6,-72,-76,6,-59,-86,-261,-85,6,-113,-112,-32,-102,-101,6,6,6,-47,-48,6,-115,6,6,6,6,-92,6,6,6,6,-38,6,-49,6,6,-87,-93,-262,-103,-121,-120,6,6,6,6,6,-39,-41,-44,-40,-42,6,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,6,-175,-174,6,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LBRACKET':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,30,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,60,62,63,67,68,69,70,74,78,81,83,84,86,90,94,96,97,110,112,115,116,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,153,155,166,167,174,176,177,178,179,180,191,197,198,218,221,222,224,228,235,239,262,267,269,270,300,302,303,310,311,314,315,323,324,325,326,329,334,338,339,360,362,364,366,367,368,388,389,391,392,399,401,428,429,430,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,65,-68,-263,-71,72,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,65,-102,-101,-28,-122,-124,-27,72,72,164,-50,-53,72,-115,-263,-263,72,72,-248,-125,-123,-252,-243,-255,-259,-256,-253,-241,-242,226,-251,-228,-257,-249,-240,-254,-250,164,264,72,72,-87,-262,-23,-84,-24,-83,-103,-121,-120,-260,-258,-237,-236,-150,-152,72,-140,264,-154,-148,-248,-89,-88,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,72,72,-143,264,-141,-149,-151,-153,-118,-117,-229,-230,264,-142,-245,264,-238,-239,]),'WCHAR_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,124,124,-47,124,-28,-263,-125,-227,124,-225,124,-224,124,-223,124,124,-222,-226,-263,-223,124,124,124,-262,124,124,-223,124,124,-184,-187,-185,-181,-182,-186,-188,124,-190,-191,-183,-189,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,-12,124,124,-11,-223,-41,-44,-40,124,-42,124,124,-156,-155,-45,-157,124,-43,124,124,124,-263,-139,-175,-174,124,-172,124,124,-158,124,-171,-159,124,124,124,124,-263,124,124,-11,-170,-173,124,-162,124,-160,124,124,-161,124,124,124,-263,124,-166,-165,-163,124,124,124,-167,-164,124,-169,-168,]),'FLOAT_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,125,125,-47,125,-28,-263,-125,-227,125,-225,125,-224,125,-223,125,125,-222,-226,-263,-223,125,125,125,-262,125,125,-223,125,125,-184,-187,-185,-181,-182,-186,-188,125,-190,-191,-183,-189,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,-12,125,125,-11,-223,-41,-44,-40,125,-42,125,125,-156,-155,-45,-157,125,-43,125,125,125,-263,-139,-175,-174,125,-172,125,125,-158,125,-171,-159,125,125,125,125,-263,125,125,-11,-170,-173,125,-162,125,-160,125,125,-161,125,125,125,-263,125,-166,-165,-163,125,125,125,-167,-164,125,-169,-168,]),'MINUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,128,128,-47,128,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,128,-225,-242,-216,-195,128,-224,128,-251,-223,-228,128,128,-257,-222,-249,-240,244,-254,-250,-226,-263,-223,128,128,128,-262,128,128,-223,128,128,-184,-187,-185,-181,-182,-186,-188,128,-190,-191,-183,-189,-260,128,-220,-258,-237,-236,128,128,128,-214,-219,128,-217,-218,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,-12,128,128,-11,-223,-41,-44,-40,128,-42,128,128,-156,-155,-45,-157,128,-43,-248,128,-235,-234,-233,-232,-231,-244,128,128,244,244,244,-200,244,244,244,-199,244,244,-197,-196,244,244,244,244,244,-198,-263,-139,-175,-174,128,-172,128,128,-158,128,-171,-159,128,128,-221,-229,-230,128,128,-215,-263,128,128,-11,-170,-173,128,-162,128,-160,128,128,-161,128,128,128,-245,-263,-238,128,-166,-165,-163,-239,128,128,128,-167,-164,128,-169,-168,]),'RPAREN':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,53,54,56,58,59,60,62,63,66,67,68,69,70,74,78,81,83,84,90,94,96,106,107,108,109,110,111,112,113,114,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,158,159,160,161,165,166,167,174,176,177,178,179,180,191,197,198,199,200,201,202,218,220,221,222,224,227,228,231,232,234,235,236,237,238,239,240,269,270,275,285,302,303,310,311,314,315,318,319,320,321,322,323,324,325,326,328,329,330,332,333,334,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,366,367,368,378,388,389,390,391,392,397,398,410,412,415,416,417,419,428,430,432,435,437,438,439,442,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-263,-71,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,90,-86,-85,-51,-113,-112,-102,-101,-263,-28,-122,-124,-27,-145,-263,-147,-50,-53,-115,-263,-263,197,-15,198,-128,-263,-16,-248,-126,-132,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-21,-22,269,270,-263,-145,-263,-87,-262,-23,-84,-24,-83,-103,-121,-120,-131,-1,-2,-130,-260,-220,-258,-237,-236,329,-150,-214,-219,-217,-152,334,336,-176,-263,-218,-154,-148,368,-14,-89,-88,-105,-104,-116,-119,-133,-127,-129,-180,390,-235,-234,-233,-232,-246,-231,392,395,396,-244,-144,-263,-145,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-149,-151,-153,-13,-118,-117,-221,-229,-230,-177,-215,423,425,427,-247,428,-194,-245,-238,-263,440,-239,-263,443,446,]),'LONG':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[19,19,-63,-74,-73,-60,-56,-57,-35,-31,-61,19,-36,-55,-70,-65,-54,19,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,19,-69,19,-72,-76,19,-59,-86,-261,-85,19,-113,-112,-32,-102,-101,19,19,19,-47,-48,19,-115,19,19,19,19,-92,19,19,19,19,-38,19,-49,19,19,-87,-93,-262,-103,-121,-120,19,19,19,19,19,-39,-41,-44,-40,-42,19,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,19,-175,-174,19,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PLUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,135,135,-47,135,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,135,-225,-242,-216,-195,135,-224,135,-251,-223,-228,135,135,-257,-222,-249,-240,248,-254,-250,-226,-263,-223,135,135,135,-262,135,135,-223,135,135,-184,-187,-185,-181,-182,-186,-188,135,-190,-191,-183,-189,-260,135,-220,-258,-237,-236,135,135,135,-214,-219,135,-217,-218,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,-12,135,135,-11,-223,-41,-44,-40,135,-42,135,135,-156,-155,-45,-157,135,-43,-248,135,-235,-234,-233,-232,-231,-244,135,135,248,248,248,-200,248,248,248,-199,248,248,-197,-196,248,248,248,248,248,-198,-263,-139,-175,-174,135,-172,135,135,-158,135,-171,-159,135,135,-221,-229,-230,135,135,-215,-263,135,135,-11,-170,-173,135,-162,135,-160,135,135,-161,135,135,135,-245,-263,-238,135,-166,-165,-163,-239,135,135,135,-167,-164,135,-169,-168,]),'ELLIPSIS':([204,],[319,]),'GT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,249,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,249,-202,-200,-204,249,-203,-199,-206,249,-197,-196,-205,249,249,249,249,-198,-221,-229,-230,-215,-245,-238,-239,]),'GOTO':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,278,-262,-41,-44,-40,-42,278,-156,-155,-45,-157,278,-43,-175,-174,-172,278,-158,-171,-159,278,-170,-173,-162,278,-160,278,-161,278,278,-166,-165,-163,278,278,-167,-164,278,-169,-168,]),'ENUM':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[24,24,-63,-74,-73,-60,-56,-57,-35,-31,-61,24,-36,-55,-70,-65,-54,24,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,24,-69,24,-72,-76,24,-59,-86,-261,-85,24,-113,-112,-32,-102,-101,24,24,24,-47,-48,24,-115,24,24,24,24,-92,24,24,24,24,-38,24,-49,24,24,-87,-93,-262,-103,-121,-120,24,24,24,24,24,-39,-41,-44,-40,-42,24,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,24,-175,-174,24,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PERIOD':([55,112,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,155,176,218,221,222,224,262,267,300,323,324,325,326,329,334,360,362,364,391,392,399,401,428,429,430,437,],[-261,-248,-252,-243,-255,-259,-256,-253,-241,-242,225,-251,-228,-257,-249,-240,-254,-250,263,-262,-260,-258,-237,-236,-140,263,-248,-235,-234,-233,-232,-231,-244,-143,263,-141,-229,-230,263,-142,-245,263,-238,-239,]),'GE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,253,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,253,-202,-200,-204,253,-203,-199,-206,253,-197,-196,-205,253,253,253,253,-198,-221,-229,-230,-215,-245,-238,-239,]),'INT_CONST_DEC':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,145,145,-47,145,-28,-263,-125,-227,145,-225,145,-224,145,-223,145,145,-222,-226,-263,-223,145,145,145,-262,145,145,-223,145,145,-184,-187,-185,-181,-182,-186,-188,145,-190,-191,-183,-189,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,-12,145,145,-11,-223,-41,-44,-40,145,-42,145,145,-156,-155,-45,-157,145,-43,145,145,145,-263,-139,-175,-174,145,-172,145,145,-158,145,-171,-159,145,145,145,145,-263,145,145,-11,-170,-173,145,-162,145,-160,145,145,-161,145,145,145,-263,145,-166,-165,-163,145,145,145,-167,-164,145,-169,-168,]),'ARROW':([112,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,221,222,224,300,323,324,325,326,329,334,391,392,428,430,437,],[-248,-252,-243,-255,-259,-256,-253,-241,-242,223,-251,-228,-257,-249,-240,-254,-250,-262,-260,-258,-237,-236,-248,-235,-234,-233,-232,-231,-244,-229,-230,-245,-238,-239,]),'HEX_FLOAT_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,148,148,-47,148,-28,-263,-125,-227,148,-225,148,-224,148,-223,148,148,-222,-226,-263,-223,148,148,148,-262,148,148,-223,148,148,-184,-187,-185,-181,-182,-186,-188,148,-190,-191,-183,-189,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,-12,148,148,-11,-223,-41,-44,-40,148,-42,148,148,-156,-155,-45,-157,148,-43,148,148,148,-263,-139,-175,-174,148,-172,148,148,-158,148,-171,-159,148,148,148,148,-263,148,148,-11,-170,-173,148,-162,148,-160,148,148,-161,148,148,148,-263,148,-166,-165,-163,148,148,148,-167,-164,148,-169,-168,]),'DOUBLE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[40,40,-63,-74,-73,-60,-56,-57,-35,-31,-61,40,-36,-55,-70,-65,-54,40,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,40,-69,40,-72,-76,40,-59,-86,-261,-85,40,-113,-112,-32,-102,-101,40,40,40,-47,-48,40,-115,40,40,40,40,-92,40,40,40,40,-38,40,-49,40,40,-87,-93,-262,-103,-121,-120,40,40,40,40,40,-39,-41,-44,-40,-42,40,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,40,-175,-174,40,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'MINUSEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,207,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'INT_CONST_OCT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,149,149,-47,149,-28,-263,-125,-227,149,-225,149,-224,149,-223,149,149,-222,-226,-263,-223,149,149,149,-262,149,149,-223,149,149,-184,-187,-185,-181,-182,-186,-188,149,-190,-191,-183,-189,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,-12,149,149,-11,-223,-41,-44,-40,149,-42,149,149,-156,-155,-45,-157,149,-43,149,149,149,-263,-139,-175,-174,149,-172,149,149,-158,149,-171,-159,149,149,149,149,-263,149,149,-11,-170,-173,149,-162,149,-160,149,149,-161,149,149,149,-263,149,-166,-165,-163,149,149,149,-167,-164,149,-169,-168,]),'TIMESEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,216,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'OR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,258,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,258,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,258,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'SHORT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[2,2,-63,-74,-73,-60,-56,-57,-35,-31,-61,2,-36,-55,-70,-65,-54,2,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,2,-69,2,-72,-76,2,-59,-86,-261,-85,2,-113,-112,-32,-102,-101,2,2,2,-47,-48,2,-115,2,2,2,2,-92,2,2,2,2,-38,2,-49,2,2,-87,-93,-262,-103,-121,-120,2,2,2,2,2,-39,-41,-44,-40,-42,2,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,2,-175,-174,2,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'RETURN':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,281,-262,-41,-44,-40,-42,281,-156,-155,-45,-157,281,-43,-175,-174,-172,281,-158,-171,-159,281,-170,-173,-162,281,-160,281,-161,281,281,-166,-165,-163,281,281,-167,-164,281,-169,-168,]),'RSHIFTEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,217,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'RESTRICT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[32,32,-63,-74,-73,-60,-56,-57,-35,-31,-61,32,-36,-55,-70,-65,-54,32,-58,-178,-111,-68,32,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,32,-69,32,-72,-76,32,-59,-86,-261,-85,32,-113,-112,-32,-102,-101,32,32,32,-124,32,32,-47,-48,32,-115,32,32,32,32,-92,32,32,32,-125,32,32,32,-38,32,-49,32,32,-87,-93,-262,-103,-121,-120,32,32,32,32,32,-39,-41,-44,-40,-42,32,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,32,-175,-174,32,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'STATIC':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,65,66,69,78,80,82,87,89,90,104,115,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[9,9,-63,-74,-73,-60,-56,-57,-35,-31,-61,9,-36,-55,-70,-65,-54,9,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,9,-69,9,-72,-76,9,-59,-86,-261,-85,-113,-112,-32,-102,-101,105,9,-124,9,9,-47,-48,9,-115,195,-125,9,9,-38,9,-49,-87,-262,-103,-121,-120,9,-39,-41,-44,-40,-42,9,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,9,-175,-174,9,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'SIZEOF':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,127,127,-47,127,-28,-263,-125,-227,127,-225,127,-224,127,-223,127,127,-222,-226,-263,-223,127,127,127,-262,127,127,-223,127,127,-184,-187,-185,-181,-182,-186,-188,127,-190,-191,-183,-189,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,-12,127,127,-11,-223,-41,-44,-40,127,-42,127,127,-156,-155,-45,-157,127,-43,127,127,127,-263,-139,-175,-174,127,-172,127,127,-158,127,-171,-159,127,127,127,127,-263,127,127,-11,-170,-173,127,-162,127,-160,127,127,-161,127,127,127,-263,127,-166,-165,-163,127,127,127,-167,-164,127,-169,-168,]),'UNSIGNED':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[18,18,-63,-74,-73,-60,-56,-57,-35,-31,-61,18,-36,-55,-70,-65,-54,18,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,18,-69,18,-72,-76,18,-59,-86,-261,-85,18,-113,-112,-32,-102,-101,18,18,18,-47,-48,18,-115,18,18,18,18,-92,18,18,18,18,-38,18,-49,18,18,-87,-93,-262,-103,-121,-120,18,18,18,18,18,-39,-41,-44,-40,-42,18,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,18,-175,-174,18,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'UNION':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[20,20,-63,-74,-73,-60,-56,-57,-35,-31,-61,20,-36,-55,-70,-65,-54,20,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,20,-69,20,-72,-76,20,-59,-86,-261,-85,20,-113,-112,-32,-102,-101,20,20,20,-47,-48,20,-115,20,20,20,20,-92,20,20,20,20,-38,20,-49,20,20,-87,-93,-262,-103,-121,-120,20,20,20,20,20,-39,-41,-44,-40,-42,20,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,20,-175,-174,20,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'COLON':([2,3,5,6,13,18,19,25,26,27,29,32,33,35,37,39,40,43,45,46,54,56,59,60,62,63,90,94,96,97,112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,174,176,177,178,179,180,187,191,197,198,218,220,221,222,224,231,232,234,238,240,286,300,302,303,305,306,310,311,314,315,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,377,388,389,390,391,392,397,398,419,428,430,437,],[-63,-74,-73,-60,-61,-70,-65,-178,-111,-68,-71,-75,-114,-66,-62,-64,-67,-69,-72,-76,-86,-85,-113,-112,-102,-101,-115,-263,-263,181,-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-87,-262,-23,-84,-24,-83,309,-103,-121,-120,-260,-220,-258,-237,-236,-214,-219,-217,-176,-218,375,384,-89,-88,-192,181,-105,-104,-116,-119,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,400,-210,-198,411,-118,-117,-221,-229,-230,-177,-215,-194,-245,-238,-239,]),'$end':([0,8,11,12,15,22,31,36,38,47,61,82,169,176,272,383,],[-263,0,-35,-31,-36,-29,-34,-33,-37,-30,-32,-47,-38,-262,-39,-159,]),'WSTRING_LITERAL':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,121,123,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,123,123,-47,123,-28,-263,-125,-227,218,-259,123,-225,123,-224,123,-223,123,123,-222,-226,-263,-223,123,123,123,-262,123,123,-223,123,123,-184,-187,-185,-181,-182,-186,-188,123,-190,-191,-183,-189,-260,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,-12,123,123,-11,-223,-41,-44,-40,123,-42,123,123,-156,-155,-45,-157,123,-43,123,123,123,-263,-139,-175,-174,123,-172,123,123,-158,123,-171,-159,123,123,123,123,-263,123,123,-11,-170,-173,123,-162,123,-160,123,123,-161,123,123,123,-263,123,-166,-165,-163,123,123,123,-167,-164,123,-169,-168,]),'DIVIDE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,251,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,251,251,251,251,251,251,251,251,251,251,-197,-196,251,251,251,251,251,-198,-221,-229,-230,-215,-245,-238,-239,]),'FOR':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,283,-262,-41,-44,-40,-42,283,-156,-155,-45,-157,283,-43,-175,-174,-172,283,-158,-171,-159,283,-170,-173,-162,283,-160,283,-161,283,283,-166,-165,-163,283,283,-167,-164,283,-169,-168,]),'PLUSPLUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,121,122,123,124,125,126,127,128,129,130,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,391,392,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,137,137,-47,137,-28,-263,-248,-125,-252,-227,-243,-255,-259,-256,-253,-241,137,-225,-242,224,137,-224,137,-251,-223,-228,137,137,-257,-222,-249,-240,-254,-250,-226,-263,-223,137,137,137,-262,137,137,-223,137,137,-184,-187,-185,-181,-182,-186,-188,137,-190,-191,-183,-189,-260,137,-258,-237,-236,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,-12,137,137,-11,-223,-41,-44,-40,137,-42,137,137,-156,-155,-45,-157,137,-43,-248,137,-235,-234,-233,-232,-231,-244,137,137,-263,-139,-175,-174,137,-172,137,137,-158,137,-171,-159,137,137,-229,-230,137,137,-263,137,137,-11,-170,-173,137,-162,137,-160,137,137,-161,137,137,137,-245,-263,-238,137,-166,-165,-163,-239,137,137,137,-167,-164,137,-169,-168,]),'EQUALS':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,29,30,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,56,58,59,60,62,63,80,83,84,86,90,102,112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,168,174,176,191,197,198,218,220,221,222,224,231,232,234,240,262,267,300,302,303,310,311,314,315,323,324,325,326,329,334,360,364,388,389,390,391,392,398,401,428,430,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-71,77,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-85,-51,-113,-112,-102,-101,162,-50,-53,77,-115,192,-248,-252,209,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,162,-87,-262,-103,-121,-120,-260,-220,-258,-237,-236,-214,-219,-217,-218,-140,365,-248,-89,-88,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,-143,-141,-118,-117,-221,-229,-230,-215,-142,-245,-238,-239,]),'ELSE':([176,276,277,280,282,293,298,370,371,374,381,383,405,406,409,414,424,433,434,436,444,445,447,448,],[-262,-41,-44,-40,-42,-45,-43,-175,-174,-172,-171,-159,-170,-173,-162,-160,-161,-166,-165,441,-167,-164,-169,-168,]),'ANDEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,214,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'EQ':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,255,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,255,-202,-200,-204,-208,-203,-199,-206,255,-197,-196,-205,255,-207,255,255,-198,-221,-229,-230,-215,-245,-238,-239,]),'AND':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,144,144,-47,144,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,144,-225,-242,-216,-195,144,-224,144,-251,-223,-228,144,144,-257,-222,-249,-240,256,-254,-250,-226,-263,-223,144,144,144,-262,144,144,-223,144,144,-184,-187,-185,-181,-182,-186,-188,144,-190,-191,-183,-189,-260,144,-220,-258,-237,-236,144,144,144,-214,-219,144,-217,-218,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,-12,144,144,-11,-223,-41,-44,-40,144,-42,144,144,-156,-155,-45,-157,144,-43,-248,144,-235,-234,-233,-232,-231,-244,144,144,-201,256,-202,-200,-204,-208,-203,-199,-206,256,-197,-196,-205,256,-207,-209,256,-198,-263,-139,-175,-174,144,-172,144,144,-158,144,-171,-159,144,144,-221,-229,-230,144,144,-215,-263,144,144,-11,-170,-173,144,-162,144,-160,144,144,-161,144,144,144,-245,-263,-238,144,-166,-165,-163,-239,144,144,144,-167,-164,144,-169,-168,]),'TYPEID':([0,1,2,3,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,67,68,69,70,74,78,80,82,87,89,90,91,92,93,94,95,96,115,116,141,165,166,167,169,170,171,172,173,174,175,176,191,197,198,204,219,223,225,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[25,25,-63,-74,-73,-60,54,-56,-57,-35,-31,-61,25,-36,59,-55,-70,-65,-91,-54,25,-58,62,-178,-111,-68,-263,-71,-34,-75,-114,-90,-66,-33,-62,-37,-64,-67,25,-69,25,-72,-76,25,-59,-86,-261,-85,25,-113,-112,-32,-102,-101,25,-28,-122,-124,-27,59,25,25,-47,-48,25,-115,25,25,25,25,-92,25,-125,-123,25,25,59,25,-38,25,-49,25,25,-87,-93,-262,-103,-121,-120,25,25,323,325,25,25,25,-39,-41,-44,-40,-42,25,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,25,-175,-174,25,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LBRACE':([7,20,24,26,33,34,48,54,55,56,59,60,62,63,77,80,82,85,87,88,89,90,155,162,163,170,171,176,197,198,260,266,268,276,277,280,282,289,291,292,293,295,297,298,314,315,336,362,365,370,371,374,375,379,381,383,384,388,389,390,395,396,399,402,403,405,406,409,411,414,423,424,425,427,429,433,434,436,441,443,444,445,446,447,448,],[55,-91,55,-111,-114,-90,-263,55,-261,55,-113,-112,55,55,55,-263,-47,-7,-48,55,-8,-115,-263,55,55,55,-49,-262,-121,-120,-12,55,-11,-41,-44,-40,-42,55,-156,-155,-45,-157,55,-43,-116,-119,55,-263,-139,-175,-174,-172,55,-158,-171,-159,55,-118,-117,55,55,55,-263,55,-11,-170,-173,-162,55,-160,55,-161,55,55,-263,-166,-165,-163,55,55,-167,-164,55,-169,-168,]),'PPHASH':([0,11,12,15,22,31,36,38,61,82,169,176,272,383,],[38,-35,-31,-36,38,-34,-33,-37,-32,-47,-38,-262,-39,-159,]),'INT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[39,39,-63,-74,-73,-60,-56,-57,-35,-31,-61,39,-36,-55,-70,-65,-54,39,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,39,-69,39,-72,-76,39,-59,-86,-261,-85,39,-113,-112,-32,-102,-101,39,39,39,-47,-48,39,-115,39,39,39,39,-92,39,39,39,39,-38,39,-49,39,39,-87,-93,-262,-103,-121,-120,39,39,39,39,39,-39,-41,-44,-40,-42,39,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,39,-175,-174,39,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'SIGNED':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[43,43,-63,-74,-73,-60,-56,-57,-35,-31,-61,43,-36,-55,-70,-65,-54,43,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,43,-69,43,-72,-76,43,-59,-86,-261,-85,43,-113,-112,-32,-102,-101,43,43,43,-47,-48,43,-115,43,43,43,43,-92,43,43,43,43,-38,43,-49,43,43,-87,-93,-262,-103,-121,-120,43,43,43,43,43,-39,-41,-44,-40,-42,43,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,43,-175,-174,43,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CONTINUE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,284,-262,-41,-44,-40,-42,284,-156,-155,-45,-157,284,-43,-175,-174,-172,284,-158,-171,-159,284,-170,-173,-162,284,-160,284,-161,284,284,-166,-165,-163,284,284,-167,-164,284,-169,-168,]),'NOT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,152,152,-47,152,-28,-263,-125,-227,152,-225,152,-224,152,-223,152,152,-222,-226,-263,-223,152,152,152,-262,152,152,-223,152,152,-184,-187,-185,-181,-182,-186,-188,152,-190,-191,-183,-189,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,-12,152,152,-11,-223,-41,-44,-40,152,-42,152,152,-156,-155,-45,-157,152,-43,152,152,152,-263,-139,-175,-174,152,-172,152,152,-158,152,-171,-159,152,152,152,152,-263,152,152,-11,-170,-173,152,-162,152,-160,152,152,-161,152,152,152,-263,152,-166,-165,-163,152,152,152,-167,-164,152,-169,-168,]),'OREQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,215,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'MOD':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,259,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,259,259,259,259,259,259,259,259,259,259,-197,-196,259,259,259,259,259,-198,-221,-229,-230,-215,-245,-238,-239,]),'RSHIFT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,241,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,241,-202,-200,241,241,241,-199,241,241,-197,-196,241,241,241,241,241,-198,-221,-229,-230,-215,-245,-238,-239,]),'DEFAULT':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,286,-262,-41,-44,-40,-42,286,-156,-155,-45,-157,286,-43,-175,-174,-172,286,-158,-171,-159,286,-170,-173,-162,286,-160,286,-161,286,286,-166,-165,-163,286,286,-167,-164,286,-169,-168,]),'CHAR':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[37,37,-63,-74,-73,-60,-56,-57,-35,-31,-61,37,-36,-55,-70,-65,-54,37,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,37,-69,37,-72,-76,37,-59,-86,-261,-85,37,-113,-112,-32,-102,-101,37,37,37,-47,-48,37,-115,37,37,37,37,-92,37,37,37,37,-38,37,-49,37,37,-87,-93,-262,-103,-121,-120,37,37,37,37,37,-39,-41,-44,-40,-42,37,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,37,-175,-174,37,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'WHILE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,382,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,287,-262,-41,-44,-40,-42,287,-156,-155,-45,-157,287,-43,-175,-174,-172,287,-158,-171,413,-159,287,-170,-173,-162,287,-160,287,-161,287,287,-166,-165,-163,287,287,-167,-164,287,-169,-168,]),'DIVEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,206,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'EXTERN':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[10,10,-63,-74,-73,-60,-56,-57,-35,-31,-61,10,-36,-55,-70,-65,-54,10,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,10,-69,10,-72,-76,10,-59,-86,-261,-85,-113,-112,-32,-102,-101,10,10,10,-47,-48,10,-115,10,10,-38,10,-49,-87,-262,-103,-121,-120,10,-39,-41,-44,-40,-42,10,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,10,-175,-174,10,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CASE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,288,-262,-41,-44,-40,-42,288,-156,-155,-45,-157,288,-43,-175,-174,-172,288,-158,-171,-159,288,-170,-173,-162,288,-160,288,-161,288,288,-166,-165,-163,288,288,-167,-164,288,-169,-168,]),'LAND':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,254,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,254,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'REGISTER':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[17,17,-63,-74,-73,-60,-56,-57,-35,-31,-61,17,-36,-55,-70,-65,-54,17,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,17,-69,17,-72,-76,17,-59,-86,-261,-85,-113,-112,-32,-102,-101,17,17,17,-47,-48,17,-115,17,17,-38,17,-49,-87,-262,-103,-121,-120,17,-39,-41,-44,-40,-42,17,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,17,-175,-174,17,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'MODEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,208,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'NE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,246,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,246,-202,-200,-204,-208,-203,-199,-206,246,-197,-196,-205,246,-207,246,246,-198,-221,-229,-230,-215,-245,-238,-239,]),'SWITCH':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,290,-262,-41,-44,-40,-42,290,-156,-155,-45,-157,290,-43,-175,-174,-172,290,-158,-171,-159,290,-170,-173,-162,290,-160,290,-161,290,290,-166,-165,-163,290,290,-167,-164,290,-169,-168,]),'INT_CONST_HEX':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,138,138,-47,138,-28,-263,-125,-227,138,-225,138,-224,138,-223,138,138,-222,-226,-263,-223,138,138,138,-262,138,138,-223,138,138,-184,-187,-185,-181,-182,-186,-188,138,-190,-191,-183,-189,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,-12,138,138,-11,-223,-41,-44,-40,138,-42,138,138,-156,-155,-45,-157,138,-43,138,138,138,-263,-139,-175,-174,138,-172,138,138,-158,138,-171,-159,138,138,138,138,-263,138,138,-11,-170,-173,138,-162,138,-160,138,138,-161,138,138,138,-263,138,-166,-165,-163,138,138,138,-167,-164,138,-169,-168,]),'_COMPLEX':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[27,27,-63,-74,-73,-60,-56,-57,-35,-31,-61,27,-36,-55,-70,-65,-54,27,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,27,-69,27,-72,-76,27,-59,-86,-261,-85,27,-113,-112,-32,-102,-101,27,27,27,-47,-48,27,-115,27,27,27,27,-92,27,27,27,27,-38,27,-49,27,27,-87,-93,-262,-103,-121,-120,27,27,27,27,27,-39,-41,-44,-40,-42,27,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,27,-175,-174,27,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PLUSEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,211,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'STRUCT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[34,34,-63,-74,-73,-60,-56,-57,-35,-31,-61,34,-36,-55,-70,-65,-54,34,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,34,-69,34,-72,-76,34,-59,-86,-261,-85,34,-113,-112,-32,-102,-101,34,34,34,-47,-48,34,-115,34,34,34,34,-92,34,34,34,34,-38,34,-49,34,34,-87,-93,-262,-103,-121,-120,34,34,34,34,34,-39,-41,-44,-40,-42,34,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,34,-175,-174,34,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CONDOP':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,257,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'BREAK':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,294,-262,-41,-44,-40,-42,294,-156,-155,-45,-157,294,-43,-175,-174,-172,294,-158,-171,-159,294,-170,-173,-162,294,-160,294,-161,294,294,-166,-165,-163,294,294,-167,-164,294,-169,-168,]),'VOLATILE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[46,46,-63,-74,-73,-60,-56,-57,-35,-31,-61,46,-36,-55,-70,-65,-54,46,-58,-178,-111,-68,46,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,46,-69,46,-72,-76,46,-59,-86,-261,-85,46,-113,-112,-32,-102,-101,46,46,46,-124,46,46,-47,-48,46,-115,46,46,46,46,-92,46,46,46,-125,46,46,46,-38,46,-49,46,46,-87,-93,-262,-103,-121,-120,46,46,46,46,46,-39,-41,-44,-40,-42,46,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,46,-175,-174,46,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'INLINE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[49,49,-63,-74,-73,-60,-56,-57,-35,-31,-61,49,-36,-55,-70,-65,-54,49,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,49,-69,49,-72,-76,49,-59,-86,-261,-85,-113,-112,-32,-102,-101,49,49,49,-47,-48,49,-115,49,49,-38,49,-49,-87,-262,-103,-121,-120,49,-39,-41,-44,-40,-42,49,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,49,-175,-174,49,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'INT_CONST_BIN':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,118,118,-47,118,-28,-263,-125,-227,118,-225,118,-224,118,-223,118,118,-222,-226,-263,-223,118,118,118,-262,118,118,-223,118,118,-184,-187,-185,-181,-182,-186,-188,118,-190,-191,-183,-189,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,-12,118,118,-11,-223,-41,-44,-40,118,-42,118,118,-156,-155,-45,-157,118,-43,118,118,118,-263,-139,-175,-174,118,-172,118,118,-158,118,-171,-159,118,118,118,118,-263,118,118,-11,-170,-173,118,-162,118,-160,118,118,-161,118,118,118,-263,118,-166,-165,-163,118,118,118,-167,-164,118,-169,-168,]),'DO':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,297,-262,-41,-44,-40,-42,297,-156,-155,-45,-157,297,-43,-175,-174,-172,297,-158,-171,-159,297,-170,-173,-162,297,-160,297,-161,297,297,-166,-165,-163,297,297,-167,-164,297,-169,-168,]),'LNOT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,119,119,-47,119,-28,-263,-125,-227,119,-225,119,-224,119,-223,119,119,-222,-226,-263,-223,119,119,119,-262,119,119,-223,119,119,-184,-187,-185,-181,-182,-186,-188,119,-190,-191,-183,-189,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,-12,119,119,-11,-223,-41,-44,-40,119,-42,119,119,-156,-155,-45,-157,119,-43,119,119,119,-263,-139,-175,-174,119,-172,119,119,-158,119,-171,-159,119,119,119,119,-263,119,119,-11,-170,-173,119,-162,119,-160,119,119,-161,119,119,119,-263,119,-166,-165,-163,119,119,119,-167,-164,119,-169,-168,]),'CONST':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[3,3,-63,-74,-73,-60,-56,-57,-35,-31,-61,3,-36,-55,-70,-65,-54,3,-58,-178,-111,-68,3,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,3,-69,3,-72,-76,3,-59,-86,-261,-85,3,-113,-112,-32,-102,-101,3,3,3,-124,3,3,-47,-48,3,-115,3,3,3,3,-92,3,3,3,-125,3,3,3,-38,3,-49,3,3,-87,-93,-262,-103,-121,-120,3,3,3,3,3,-39,-41,-44,-40,-42,3,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,3,-175,-174,3,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LOR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,242,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'CHAR_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,122,122,-47,122,-28,-263,-125,-227,122,-225,122,-224,122,-223,122,122,-222,-226,-263,-223,122,122,122,-262,122,122,-223,122,122,-184,-187,-185,-181,-182,-186,-188,122,-190,-191,-183,-189,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,-12,122,122,-11,-223,-41,-44,-40,122,-42,122,122,-156,-155,-45,-157,122,-43,122,122,122,-263,-139,-175,-174,122,-172,122,122,-158,122,-171,-159,122,122,122,122,-263,122,122,-11,-170,-173,122,-162,122,-160,122,122,-161,122,122,122,-263,122,-166,-165,-163,122,122,122,-167,-164,122,-169,-168,]),'LSHIFT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,243,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,243,-202,-200,243,243,243,-199,243,243,-197,-196,243,243,243,243,243,-198,-221,-229,-230,-215,-245,-238,-239,]),'RBRACE':([55,82,93,95,100,101,102,112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,155,156,170,172,173,175,176,188,189,190,218,220,221,222,224,231,232,234,240,261,265,268,276,277,280,282,289,291,292,293,295,296,298,299,305,307,308,312,313,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,359,362,363,370,371,374,379,381,383,390,391,392,398,404,405,406,409,414,418,419,420,424,428,429,430,433,434,436,437,444,445,447,448,],[-261,-47,176,-92,-106,176,-109,-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-263,-134,-263,176,176,-93,-262,176,176,-107,-260,-220,-258,-237,-236,-214,-219,-217,-218,176,-20,-19,-41,-44,-40,-42,-6,-156,-155,-45,-157,-5,-43,176,-192,-94,-95,-108,-110,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-135,176,-137,-175,-174,-172,-158,-171,-159,-221,-229,-230,-215,-136,-170,-173,-162,-160,176,-194,-138,-161,-245,176,-238,-166,-165,-163,-239,-167,-164,-169,-168,]),'_BOOL':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[13,13,-63,-74,-73,-60,-56,-57,-35,-31,-61,13,-36,-55,-70,-65,-54,13,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,13,-69,13,-72,-76,13,-59,-86,-261,-85,13,-113,-112,-32,-102,-101,13,13,13,-47,-48,13,-115,13,13,13,13,-92,13,13,13,13,-38,13,-49,13,13,-87,-93,-262,-103,-121,-120,13,13,13,13,13,-39,-41,-44,-40,-42,13,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,13,-175,-174,13,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,245,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,245,-202,-200,-204,245,-203,-199,-206,245,-197,-196,-205,245,245,245,245,-198,-221,-229,-230,-215,-245,-238,-239,]),'SEMI':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,49,50,51,52,54,55,56,58,59,60,61,62,63,67,68,69,70,71,73,74,75,76,79,80,81,82,83,84,86,90,94,96,97,112,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,154,156,166,168,169,170,174,176,177,178,179,180,182,183,184,185,186,187,191,197,198,205,218,220,221,222,224,228,231,232,234,235,238,240,269,270,271,272,276,277,279,280,281,282,284,285,289,291,292,293,294,295,296,297,298,300,302,303,304,305,310,311,314,315,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,359,366,367,368,369,370,371,372,373,374,375,378,379,381,383,384,386,387,388,389,390,391,392,397,398,404,405,406,407,408,409,411,414,419,421,422,423,424,425,427,428,430,431,433,434,436,437,440,441,443,444,445,446,447,448,],[15,-263,-63,-74,-73,-60,-56,-57,-35,-31,-61,-263,-36,-55,-70,-65,-54,15,-58,-178,-111,-68,-263,-71,-263,-34,-75,-114,-66,-33,-62,-37,-64,-67,82,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-113,-112,-32,-102,-101,-28,-122,-124,-27,-18,-46,-145,-77,-17,-80,-81,-147,-47,-50,-53,-263,-115,-263,-263,-263,-248,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-79,-134,-145,-81,-38,-263,-87,-262,-23,-84,-24,-83,-26,307,-96,308,-25,-98,-103,-121,-120,-78,-260,-220,-258,-237,-236,-150,-214,-219,-217,-152,-176,-218,-154,-148,-82,-39,-41,-44,370,-40,371,-42,374,-14,-263,-156,-155,-45,381,-157,-13,-263,-43,-248,-89,-88,-100,-192,-105,-104,-116,-119,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-135,-149,-151,-153,405,-175,-174,406,-263,-172,-263,-13,-158,-171,-159,-263,-97,-99,-118,-117,-221,-229,-230,-177,-215,-136,-170,-173,421,-263,-162,-263,-160,-194,-263,432,-263,-161,-263,-263,-245,-238,438,-166,-165,-163,-239,444,-263,-263,-167,-164,-263,-169,-168,]),'LT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,247,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,247,-202,-200,-204,247,-203,-199,-206,247,-197,-196,-205,247,247,247,247,-198,-221,-229,-230,-215,-245,-238,-239,]),'COMMA':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,56,58,59,60,62,63,67,68,69,70,71,74,75,79,80,81,83,84,90,94,96,100,101,102,109,110,111,112,113,114,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,154,156,166,168,174,176,177,178,179,180,182,184,187,188,189,190,191,197,198,199,200,201,202,205,218,220,221,222,224,228,231,232,234,235,236,238,239,240,265,269,270,271,285,300,302,303,304,305,310,311,312,313,314,315,318,320,321,323,324,325,326,327,328,329,330,331,334,337,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,363,366,367,368,372,386,387,388,389,390,391,392,397,398,404,410,412,415,416,418,419,420,428,430,435,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-263,-71,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-85,-51,-113,-112,-102,-101,-28,-122,-124,-27,117,-145,-77,-80,-81,-147,-50,-53,-115,-263,-263,-106,190,-109,-128,-263,203,-248,204,-132,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-79,-134,-145,-81,-87,-262,-23,-84,-24,-83,306,-96,-98,190,190,-107,-103,-121,-120,-131,-1,-2,-130,-78,-260,-220,-258,-237,-236,-150,-214,-219,-217,-152,335,-176,-263,-218,362,-154,-148,-82,335,-248,-89,-88,-100,-192,-105,-104,-108,-110,-116,-119,-133,-129,-180,-235,-234,-233,-232,335,-246,-231,393,394,-244,-144,-145,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,335,-210,-198,-135,-137,-149,-151,-153,335,-97,-99,-118,-117,-221,-229,-230,-177,-215,-136,335,335,335,-247,429,-194,-138,-245,-238,335,-239,]),'OFFSETOF':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,133,133,-47,133,-28,-263,-125,-227,133,-225,133,-224,133,-223,133,133,-222,-226,-263,-223,133,133,133,-262,133,133,-223,133,133,-184,-187,-185,-181,-182,-186,-188,133,-190,-191,-183,-189,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,-12,133,133,-11,-223,-41,-44,-40,133,-42,133,133,-156,-155,-45,-157,133,-43,133,133,133,-263,-139,-175,-174,133,-172,133,133,-158,133,-171,-159,133,133,133,133,-263,133,133,-11,-170,-173,133,-162,133,-160,133,133,-161,133,133,133,-263,133,-166,-165,-163,133,133,133,-167,-164,133,-169,-168,]),'TYPEDEF':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[23,23,-63,-74,-73,-60,-56,-57,-35,-31,-61,23,-36,-55,-70,-65,-54,23,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,23,-69,23,-72,-76,23,-59,-86,-261,-85,-113,-112,-32,-102,-101,23,23,23,-47,-48,23,-115,23,23,-38,23,-49,-87,-262,-103,-121,-120,23,-39,-41,-44,-40,-42,23,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,23,-175,-174,23,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'XOR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,250,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,250,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,250,-207,-209,250,-198,-221,-229,-230,-215,-245,-238,-239,]),'AUTO':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[21,21,-63,-74,-73,-60,-56,-57,-35,-31,-61,21,-36,-55,-70,-65,-54,21,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,21,-69,21,-72,-76,21,-59,-86,-261,-85,-113,-112,-32,-102,-101,21,21,21,-47,-48,21,-115,21,21,-38,21,-49,-87,-262,-103,-121,-120,21,-39,-41,-44,-40,-42,21,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,21,-175,-174,21,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'TIMES':([0,1,2,3,4,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,27,28,29,30,31,32,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,61,62,63,65,67,68,69,70,72,77,78,82,83,84,86,94,96,97,103,104,105,110,112,115,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,167,169,170,174,176,177,178,179,180,181,191,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,272,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,302,303,306,309,310,311,323,324,325,326,329,334,335,336,338,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[28,-263,-63,-74,28,-73,-60,-56,-57,-35,-31,-61,-263,-36,-55,-70,-65,-54,28,-58,-178,-68,-263,-71,28,-34,-75,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-32,-102,-101,-263,-28,28,-124,-27,139,157,28,-47,-50,-53,28,-263,-263,28,194,-28,-263,28,-248,-125,28,-252,-227,-214,-243,-255,-259,-256,-253,-241,157,-225,-242,-216,-195,157,-224,157,-251,-223,-228,157,157,-257,-222,-249,-240,252,-254,-250,-226,-263,-223,157,274,28,-38,157,-87,-262,-23,-84,-24,-83,157,-103,157,-223,157,157,-184,-187,-185,-181,-182,-186,-188,157,-190,-191,-183,-189,-260,157,-220,-258,-237,-236,157,157,157,-214,-219,157,-217,28,-218,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,-12,157,157,-11,-39,-223,-41,-44,-40,157,-42,157,157,-156,-155,-45,-157,157,-43,-248,-89,-88,28,157,-105,-104,-235,-234,-233,-232,-231,-244,157,157,28,252,252,252,252,252,252,252,252,252,252,-197,-196,252,252,252,252,252,-198,-263,-139,-175,-174,157,-172,157,157,-158,157,-171,-159,157,157,-221,-229,-230,157,157,-215,-263,157,157,-11,-170,-173,157,-162,157,-160,157,157,-161,157,157,157,-245,-263,-238,157,-166,-165,-163,-239,157,157,157,-167,-164,157,-169,-168,]),'LPAREN':([0,1,2,3,4,5,6,9,10,11,12,13,14,15,16,17,18,19,21,22,23,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,60,61,62,63,65,67,68,69,70,72,74,77,78,81,82,83,84,86,90,94,96,97,103,104,105,110,112,115,116,117,118,119,121,122,123,124,125,126,127,128,129,130,133,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,153,155,157,162,164,166,167,169,170,174,176,177,178,179,180,181,191,192,194,195,196,197,198,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,228,230,233,235,239,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,269,270,272,274,276,277,280,281,282,283,287,288,289,290,291,292,293,295,297,298,300,301,302,303,306,309,310,311,314,315,323,324,325,326,329,334,335,336,338,339,362,365,366,367,368,370,371,373,374,375,376,379,380,381,383,384,385,388,389,391,392,393,395,399,400,402,403,405,406,408,409,411,413,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[4,-263,-63,-74,4,-73,-60,-56,-57,-35,-31,-61,-263,-36,4,-55,-70,-65,-54,4,-58,-178,66,-68,-263,-71,78,-34,-75,-114,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,66,-32,-102,-101,-263,-28,-122,-124,-27,141,78,141,78,165,-47,-50,-53,167,-115,-263,-263,167,141,-28,-263,78,-248,-125,-123,4,-252,-227,-243,-255,-259,-256,-253,-241,219,-225,-242,227,229,230,-224,233,-251,-223,-228,141,233,-257,-222,-249,-240,-254,-250,-226,165,-263,-223,141,141,167,167,-38,141,-87,-262,-23,-84,-24,-83,230,-103,230,-223,141,141,-121,-120,-184,-187,-185,-181,-182,-186,-188,141,-190,-191,-183,-189,-260,141,-258,-237,-236,141,141,-150,141,141,-152,338,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,141,230,230,-12,230,141,-11,-154,-148,-39,-223,-41,-44,-40,141,-42,373,376,230,141,380,-156,-155,-45,-157,141,-43,-248,385,-89,-88,4,230,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,141,230,338,338,-263,-139,-149,-151,-153,-175,-174,141,-172,141,141,-158,141,-171,-159,141,141,-118,-117,-229,-230,141,230,-263,230,141,-11,-170,-173,141,-162,141,426,-160,141,141,-161,141,141,141,-245,-263,-238,141,-166,-165,-163,-239,141,141,141,-167,-164,141,-169,-168,]),'MINUSMINUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,121,122,123,124,125,126,127,128,129,130,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,391,392,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,142,142,-47,142,-28,-263,-248,-125,-252,-227,-243,-255,-259,-256,-253,-241,142,-225,-242,222,142,-224,142,-251,-223,-228,142,142,-257,-222,-249,-240,-254,-250,-226,-263,-223,142,142,142,-262,142,142,-223,142,142,-184,-187,-185,-181,-182,-186,-188,142,-190,-191,-183,-189,-260,142,-258,-237,-236,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,-12,142,142,-11,-223,-41,-44,-40,142,-42,142,142,-156,-155,-45,-157,142,-43,-248,142,-235,-234,-233,-232,-231,-244,142,142,-263,-139,-175,-174,142,-172,142,142,-158,142,-171,-159,142,142,-229,-230,142,142,-263,142,142,-11,-170,-173,142,-162,142,-160,142,142,-161,142,142,142,-245,-263,-238,142,-166,-165,-163,-239,142,142,142,-167,-164,142,-169,-168,]),'ID':([0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,34,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,61,62,63,64,65,66,67,68,69,70,72,74,77,78,82,83,84,86,94,96,97,98,99,103,104,105,110,115,116,117,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,166,167,169,170,174,176,177,178,179,180,181,190,191,192,194,195,196,203,206,207,208,209,210,211,212,213,214,215,216,217,219,223,225,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,263,264,266,268,272,274,276,277,278,280,281,282,288,289,291,292,293,295,297,298,302,303,306,309,310,311,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,394,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[33,-263,-63,-74,33,-73,-60,56,-56,-57,-35,-31,-61,-263,-36,33,-55,-70,-65,-91,-54,33,-58,63,-178,-68,-263,-71,33,-34,-75,-90,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-32,-102,-101,102,-263,112,-28,-122,-124,-27,112,33,112,33,-47,-50,-53,33,-263,-263,33,102,102,112,-28,-263,33,-125,-123,33,-227,112,-225,112,-224,112,-223,112,112,-222,-226,-263,-223,112,112,33,33,-38,300,-87,-262,-23,-84,-24,-83,112,102,-103,112,-223,112,112,112,-184,-187,-185,-181,-182,-186,-188,112,-190,-191,-183,-189,112,324,326,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,-12,112,112,112,-11,-39,-223,-41,-44,369,-40,112,-42,112,300,-156,-155,-45,-157,300,-43,-89,-88,33,112,-105,-104,112,112,-263,-139,-175,-174,112,-172,300,112,-158,112,-171,-159,300,112,112,112,112,-263,112,112,-11,-170,-173,112,-162,300,-160,112,300,-161,300,112,300,-263,112,-166,-165,-163,112,300,300,-167,-164,300,-169,-168,]),'IF':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,301,-262,-41,-44,-40,-42,301,-156,-155,-45,-157,301,-43,-175,-174,-172,301,-158,-171,-159,301,-170,-173,-162,301,-160,301,-161,301,301,-166,-165,-163,301,301,-167,-164,301,-169,-168,]),'STRING_LITERAL':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,129,134,135,137,139,141,142,143,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,221,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,143,143,-47,143,-28,-263,-125,-227,143,-225,221,143,-224,143,-223,143,143,-257,-222,-226,-263,-223,143,143,143,-262,143,143,-223,143,143,-184,-187,-185,-181,-182,-186,-188,143,-190,-191,-183,-189,143,-258,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,-12,143,143,-11,-223,-41,-44,-40,143,-42,143,143,-156,-155,-45,-157,143,-43,143,143,143,-263,-139,-175,-174,143,-172,143,143,-158,143,-171,-159,143,143,143,143,-263,143,143,-11,-170,-173,143,-162,143,-160,143,143,-161,143,143,143,-263,143,-166,-165,-163,143,143,143,-167,-164,143,-169,-168,]),'FLOAT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[35,35,-63,-74,-73,-60,-56,-57,-35,-31,-61,35,-36,-55,-70,-65,-54,35,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,35,-69,35,-72,-76,35,-59,-86,-261,-85,35,-113,-112,-32,-102,-101,35,35,35,-47,-48,35,-115,35,35,35,35,-92,35,35,35,35,-38,35,-49,35,35,-87,-93,-262,-103,-121,-120,35,35,35,35,35,-39,-41,-44,-40,-42,35,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,35,-175,-174,35,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'XOREQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,210,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'LSHIFTEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,212,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'RBRACKET':([3,32,46,65,69,70,72,103,104,112,115,118,120,121,122,123,124,125,126,129,130,131,132,136,138,139,140,143,145,146,147,148,149,150,151,164,176,193,194,218,220,221,222,224,231,232,234,238,240,273,274,305,316,317,321,323,324,325,326,327,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,361,390,391,392,397,398,419,428,430,437,],[-74,-75,-76,-263,-124,-27,-263,-263,-28,-248,-125,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,228,-195,-4,-251,235,-228,-257,-249,-240,-193,-254,-250,-3,-179,-263,-262,314,315,-260,-220,-258,-237,-236,-214,-219,-217,-176,-218,366,367,-192,388,389,-180,-235,-234,-233,-232,391,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,401,-221,-229,-230,-177,-215,-194,-245,-238,-239,]),} +_lr_action_items = {'$end':([0,1,2,3,4,5,6,7,8,9,13,14,55,77,78,105,144,210,264,],[-309,0,-58,-59,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-70,-308,-71,-202,]),'SEMI':([0,2,4,5,6,7,8,9,11,12,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,62,63,64,65,66,67,69,70,72,73,74,75,76,77,78,81,82,83,84,85,86,87,88,89,90,91,92,98,99,101,102,103,104,105,106,108,110,127,131,139,140,141,142,143,144,145,146,147,148,151,152,153,154,155,156,157,158,159,160,161,162,163,166,169,172,175,176,177,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,227,228,242,243,246,249,250,251,252,253,254,255,256,257,258,259,260,261,263,264,265,266,267,269,270,272,273,282,283,284,285,286,287,288,289,325,326,327,329,330,331,333,334,349,350,351,352,371,372,375,376,377,380,381,382,384,387,391,395,396,397,398,399,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,431,438,439,442,443,456,457,458,460,462,463,464,466,467,469,470,473,475,479,480,491,492,494,495,497,499,508,509,511,514,519,520,521,523,526,527,529,],[9,9,-60,-62,-63,-64,-65,-66,-309,77,-67,-68,-52,-309,-309,-309,-116,-93,-309,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,-309,-309,-162,-89,-90,-91,-92,-81,-19,-20,-120,-122,-163,-54,-37,-83,-69,-53,-86,-9,-10,-87,-88,-94,-82,-15,-16,-124,-126,-152,-153,-307,-132,-133,146,-70,-309,-162,-55,-294,-30,146,146,146,-135,-142,-308,-309,-145,-146,-130,-13,-309,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,273,-14,-309,286,287,289,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-121,-38,-123,-177,-35,-36,-125,-127,-154,146,-137,146,-139,-134,-143,377,-128,-129,-25,-26,-147,-149,-131,-202,-201,-13,-309,-235,-257,-309,-218,-78,-80,-309,398,-214,-215,399,-217,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-155,-156,-136,-138,-144,-151,-203,-309,-205,-287,-220,-79,466,-309,-213,-216,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-178,-39,-42,-32,-33,-148,-150,-204,-309,-258,-309,-309,-309,498,-272,-273,-264,-179,-40,-41,-206,-80,-208,-209,512,-237,-309,-281,521,-288,-207,-282,-210,-309,-309,-212,-211,]),'PPHASH':([0,2,4,5,6,7,8,9,13,14,55,77,78,105,144,210,264,],[13,13,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-70,-308,-71,-202,]),'PPPRAGMA':([0,2,4,5,6,7,8,9,13,14,55,77,78,101,104,105,106,139,140,141,143,144,146,147,152,153,154,155,156,157,158,159,160,161,162,172,210,249,251,254,264,265,267,272,273,282,283,286,287,289,377,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[14,14,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-307,14,-70,14,14,14,14,-142,-308,-145,-146,14,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,14,-71,14,14,-143,-202,-201,14,14,-218,14,-80,-214,-215,-217,-144,-203,14,-205,-79,-213,-216,-204,14,14,14,-206,-80,-208,-209,14,-207,-210,14,14,-212,-211,]),'ID':([0,2,4,5,6,7,8,9,11,13,14,16,17,18,19,20,21,22,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,60,61,63,64,65,66,68,71,77,78,79,80,82,83,84,85,86,87,94,95,96,97,98,99,100,101,102,103,105,106,111,113,114,115,116,117,118,126,129,130,132,133,134,135,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,164,168,172,174,177,183,184,185,187,188,189,190,191,193,194,210,215,216,217,218,222,225,226,230,234,238,239,246,247,248,250,252,253,256,257,262,263,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,328,332,338,339,340,343,344,346,347,348,360,361,364,367,369,371,372,375,376,378,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,474,476,477,482,483,484,491,492,494,495,498,508,510,512,515,516,519,521,523,526,527,529,],[23,23,-60,-62,-63,-64,-65,-66,23,-67,-68,23,-309,-309,-309,-116,-93,23,23,-97,-309,-113,-114,-115,-221,98,102,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-140,-141,-61,23,23,-89,-90,-91,-92,23,23,-83,-69,-309,127,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,138,-307,-132,-133,-70,163,23,127,-309,127,127,-309,-28,23,23,127,-165,-167,138,138,-135,-308,23,-130,163,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,127,127,163,285,127,127,127,127,127,-266,-267,-268,-265,-269,-270,-71,-309,127,-309,-28,-266,127,127,127,23,23,-309,-154,138,127,-137,-139,-134,-128,-129,127,-131,-202,-201,163,127,163,-218,127,127,127,127,163,-80,127,-214,-215,-217,127,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,424,426,127,127,-11,127,-12,127,127,-266,127,127,-309,127,23,127,127,-155,-156,-136,-138,23,127,-203,163,-205,127,-79,127,-213,-216,-309,-182,127,-309,-28,-266,-204,127,163,-309,163,163,127,127,127,127,127,127,-11,-266,127,127,-206,-80,-208,-209,127,163,-309,127,127,127,-207,-210,163,163,-212,-211,]),'LPAREN':([0,2,4,5,6,7,8,9,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,63,64,65,66,68,71,75,76,77,78,79,81,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,105,106,110,111,113,114,116,117,118,126,127,129,130,131,132,133,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,163,164,167,168,170,171,172,173,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,212,215,216,217,218,222,225,226,227,228,234,235,238,239,240,241,246,248,250,252,253,256,257,262,263,264,265,267,271,272,273,274,277,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,349,350,351,352,358,359,360,364,367,369,371,372,375,376,378,379,381,382,384,386,387,389,390,394,395,397,398,399,422,424,425,426,427,432,434,438,439,442,443,444,445,446,449,450,452,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,479,480,482,483,484,485,486,487,488,489,490,491,492,494,495,498,504,505,508,509,510,512,514,516,517,518,519,520,521,523,526,527,529,],[24,24,-60,-62,-63,-64,-65,-66,71,-67,-68,80,24,-309,-309,-309,-116,-93,24,-29,24,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,71,24,-89,-90,-91,-92,71,71,115,-37,-83,-69,-309,80,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,-70,168,115,71,168,-309,168,-309,-28,238,-294,71,168,-30,-165,-167,-135,-308,71,-130,168,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,271,274,168,279,280,168,284,168,322,328,328,271,332,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,335,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-38,-309,168,-309,-28,-266,168,168,-35,-36,238,361,238,-309,-45,370,-154,271,-137,-139,-134,-128,-129,271,-131,-202,-201,168,168,168,-218,168,390,168,168,168,168,-80,168,-214,-215,-217,168,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,168,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,168,168,-279,-280,168,168,-304,-306,-11,168,-12,271,-266,168,168,-43,-44,-31,-34,361,370,-309,238,168,168,-155,-156,-136,-138,71,271,-203,168,-205,271,-287,390,390,465,-79,168,-213,-216,-274,-275,-276,-277,-278,-309,-182,-39,-42,-32,-33,168,-309,-28,-191,-197,-195,-266,-204,271,168,-309,168,168,168,168,271,-272,-273,168,168,-11,-40,-41,-266,168,168,-50,-51,-193,-192,-194,-196,-206,-80,-208,-209,168,-46,-49,168,-281,-309,168,-288,168,-47,-48,-207,-282,-210,168,168,-212,-211,]),'TIMES':([0,2,4,5,6,7,8,9,11,13,14,17,18,19,20,21,22,24,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,63,64,65,66,71,77,78,79,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,105,106,111,113,114,116,117,118,126,127,129,130,133,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,210,215,216,217,218,222,225,226,238,239,246,248,250,252,253,256,257,262,263,264,265,267,270,271,272,273,274,277,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,371,372,375,376,378,379,381,382,384,386,387,390,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[26,26,-60,-62,-63,-64,-65,-66,26,-67,-68,-309,-309,-309,-116,-93,26,26,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,26,26,-89,-90,-91,-92,26,-83,-69,-309,-86,-9,-10,-87,-88,-94,26,-27,-28,-166,-152,-153,-307,-132,-133,-70,188,26,188,-309,222,-309,-28,26,-294,26,188,-167,-135,-308,26,-130,188,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,188,188,188,188,-257,303,-259,188,188,188,-238,188,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-309,346,-309,-28,-266,188,188,26,368,-154,188,-137,-139,-134,-128,-129,188,-131,-202,-201,188,-257,188,188,-218,188,26,188,188,188,188,-80,188,-214,-215,-217,188,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,-279,-280,-260,188,-261,-262,-263,188,-304,-306,-11,188,-12,188,-266,188,188,-309,188,454,-155,-156,-136,-138,26,188,-203,188,-205,188,-287,26,-79,188,-213,-216,-239,-240,-241,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,-274,-275,-276,-277,-278,-309,-182,482,-309,-28,-266,-204,188,188,-309,-258,188,188,188,188,188,-272,-273,188,-264,188,-11,-266,188,188,-206,-80,-208,-209,188,188,-281,-309,188,-288,188,-207,-282,-210,188,188,-212,-211,]),'TYPEID':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,58,59,60,61,62,63,64,65,66,68,71,77,78,80,81,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,104,105,106,107,111,115,126,128,129,131,132,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,234,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,282,283,284,286,287,289,323,324,328,332,335,351,352,361,370,371,372,375,376,377,378,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[30,30,-60,-62,-63,-64,-65,-66,30,76,-67,-68,-52,-309,-309,-309,-116,-93,30,-29,-97,-309,-113,-114,-115,-221,99,103,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-140,-141,-61,30,-84,76,30,30,-89,-90,-91,-92,76,76,-83,-69,30,-53,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,30,-70,30,-85,76,30,240,30,76,-30,-165,-167,30,30,30,-135,-142,-308,76,-145,-146,-130,30,30,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,30,-71,-35,-36,30,240,30,-154,30,-137,30,-139,-134,-143,-128,-129,-131,-202,-201,30,-218,-78,-80,30,-214,-215,-217,425,427,30,30,30,-31,-34,30,30,-155,-156,-136,-138,-144,76,-203,-205,30,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'ENUM':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[31,31,-60,-62,-63,-64,-65,-66,31,-67,-68,-52,-309,-309,-309,31,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,31,-84,31,31,-83,-69,31,-53,-86,-9,-10,-87,-88,-166,-307,31,-70,31,-85,31,31,-30,-167,31,31,31,-142,-308,-145,-146,31,31,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,31,-71,-35,-36,31,31,31,31,-143,-202,-201,31,-218,-78,-80,31,-214,-215,-217,31,31,31,-31,-34,31,31,-144,-203,-205,31,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'VOID':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[33,33,-60,-62,-63,-64,-65,-66,33,33,-67,-68,-52,-309,-309,-309,-116,-93,33,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,33,-84,33,33,33,-89,-90,-91,-92,-83,-69,33,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,33,-70,33,-85,33,33,33,-30,-167,33,33,33,-135,-142,-308,33,-145,-146,-130,33,33,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,33,-71,-35,-36,33,33,-154,33,-137,33,-139,-134,-143,-128,-129,-131,-202,-201,33,-218,33,-78,-80,33,-214,-215,-217,33,33,33,-31,-34,33,33,-155,-156,-136,-138,-144,-203,-205,33,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'_BOOL':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[34,34,-60,-62,-63,-64,-65,-66,34,34,-67,-68,-52,-309,-309,-309,-116,-93,34,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,34,-84,34,34,34,-89,-90,-91,-92,-83,-69,34,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,34,-70,34,-85,34,34,34,-30,-167,34,34,34,-135,-142,-308,34,-145,-146,-130,34,34,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,34,-71,-35,-36,34,34,-154,34,-137,34,-139,-134,-143,-128,-129,-131,-202,-201,34,-218,34,-78,-80,34,-214,-215,-217,34,34,34,-31,-34,34,34,-155,-156,-136,-138,-144,-203,-205,34,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'CHAR':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[35,35,-60,-62,-63,-64,-65,-66,35,35,-67,-68,-52,-309,-309,-309,-116,-93,35,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,35,-84,35,35,35,-89,-90,-91,-92,-83,-69,35,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,35,-70,35,-85,35,35,35,-30,-167,35,35,35,-135,-142,-308,35,-145,-146,-130,35,35,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,35,-71,-35,-36,35,35,-154,35,-137,35,-139,-134,-143,-128,-129,-131,-202,-201,35,-218,35,-78,-80,35,-214,-215,-217,35,35,35,-31,-34,35,35,-155,-156,-136,-138,-144,-203,-205,35,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'SHORT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[36,36,-60,-62,-63,-64,-65,-66,36,36,-67,-68,-52,-309,-309,-309,-116,-93,36,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,36,-84,36,36,36,-89,-90,-91,-92,-83,-69,36,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,36,-70,36,-85,36,36,36,-30,-167,36,36,36,-135,-142,-308,36,-145,-146,-130,36,36,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,36,-71,-35,-36,36,36,-154,36,-137,36,-139,-134,-143,-128,-129,-131,-202,-201,36,-218,36,-78,-80,36,-214,-215,-217,36,36,36,-31,-34,36,36,-155,-156,-136,-138,-144,-203,-205,36,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'INT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[37,37,-60,-62,-63,-64,-65,-66,37,37,-67,-68,-52,-309,-309,-309,-116,-93,37,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,37,-84,37,37,37,-89,-90,-91,-92,-83,-69,37,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,37,-70,37,-85,37,37,37,-30,-167,37,37,37,-135,-142,-308,37,-145,-146,-130,37,37,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,37,-71,-35,-36,37,37,-154,37,-137,37,-139,-134,-143,-128,-129,-131,-202,-201,37,-218,37,-78,-80,37,-214,-215,-217,37,37,37,-31,-34,37,37,-155,-156,-136,-138,-144,-203,-205,37,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'LONG':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[38,38,-60,-62,-63,-64,-65,-66,38,38,-67,-68,-52,-309,-309,-309,-116,-93,38,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,38,-84,38,38,38,-89,-90,-91,-92,-83,-69,38,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,38,-70,38,-85,38,38,38,-30,-167,38,38,38,-135,-142,-308,38,-145,-146,-130,38,38,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,38,-71,-35,-36,38,38,-154,38,-137,38,-139,-134,-143,-128,-129,-131,-202,-201,38,-218,38,-78,-80,38,-214,-215,-217,38,38,38,-31,-34,38,38,-155,-156,-136,-138,-144,-203,-205,38,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'FLOAT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[39,39,-60,-62,-63,-64,-65,-66,39,39,-67,-68,-52,-309,-309,-309,-116,-93,39,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,39,-84,39,39,39,-89,-90,-91,-92,-83,-69,39,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,39,-70,39,-85,39,39,39,-30,-167,39,39,39,-135,-142,-308,39,-145,-146,-130,39,39,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,39,-71,-35,-36,39,39,-154,39,-137,39,-139,-134,-143,-128,-129,-131,-202,-201,39,-218,39,-78,-80,39,-214,-215,-217,39,39,39,-31,-34,39,39,-155,-156,-136,-138,-144,-203,-205,39,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'DOUBLE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[40,40,-60,-62,-63,-64,-65,-66,40,40,-67,-68,-52,-309,-309,-309,-116,-93,40,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,40,-84,40,40,40,-89,-90,-91,-92,-83,-69,40,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,40,-70,40,-85,40,40,40,-30,-167,40,40,40,-135,-142,-308,40,-145,-146,-130,40,40,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,40,-71,-35,-36,40,40,-154,40,-137,40,-139,-134,-143,-128,-129,-131,-202,-201,40,-218,40,-78,-80,40,-214,-215,-217,40,40,40,-31,-34,40,40,-155,-156,-136,-138,-144,-203,-205,40,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'_COMPLEX':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[41,41,-60,-62,-63,-64,-65,-66,41,41,-67,-68,-52,-309,-309,-309,-116,-93,41,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,41,-84,41,41,41,-89,-90,-91,-92,-83,-69,41,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,41,-70,41,-85,41,41,41,-30,-167,41,41,41,-135,-142,-308,41,-145,-146,-130,41,41,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,41,-71,-35,-36,41,41,-154,41,-137,41,-139,-134,-143,-128,-129,-131,-202,-201,41,-218,41,-78,-80,41,-214,-215,-217,41,41,41,-31,-34,41,41,-155,-156,-136,-138,-144,-203,-205,41,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'SIGNED':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[42,42,-60,-62,-63,-64,-65,-66,42,42,-67,-68,-52,-309,-309,-309,-116,-93,42,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,42,-84,42,42,42,-89,-90,-91,-92,-83,-69,42,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,42,-70,42,-85,42,42,42,-30,-167,42,42,42,-135,-142,-308,42,-145,-146,-130,42,42,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,42,-71,-35,-36,42,42,-154,42,-137,42,-139,-134,-143,-128,-129,-131,-202,-201,42,-218,42,-78,-80,42,-214,-215,-217,42,42,42,-31,-34,42,42,-155,-156,-136,-138,-144,-203,-205,42,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'UNSIGNED':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[43,43,-60,-62,-63,-64,-65,-66,43,43,-67,-68,-52,-309,-309,-309,-116,-93,43,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,43,-84,43,43,43,-89,-90,-91,-92,-83,-69,43,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,43,-70,43,-85,43,43,43,-30,-167,43,43,43,-135,-142,-308,43,-145,-146,-130,43,43,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,43,-71,-35,-36,43,43,-154,43,-137,43,-139,-134,-143,-128,-129,-131,-202,-201,43,-218,43,-78,-80,43,-214,-215,-217,43,43,43,-31,-34,43,43,-155,-156,-136,-138,-144,-203,-205,43,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'__INT128':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[44,44,-60,-62,-63,-64,-65,-66,44,44,-67,-68,-52,-309,-309,-309,-116,-93,44,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,44,-84,44,44,44,-89,-90,-91,-92,-83,-69,44,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,44,-70,44,-85,44,44,44,-30,-167,44,44,44,-135,-142,-308,44,-145,-146,-130,44,44,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,44,-71,-35,-36,44,44,-154,44,-137,44,-139,-134,-143,-128,-129,-131,-202,-201,44,-218,44,-78,-80,44,-214,-215,-217,44,44,44,-31,-34,44,44,-155,-156,-136,-138,-144,-203,-205,44,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'CONST':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[45,45,-60,-62,-63,-64,-65,-66,45,45,-67,-68,-52,45,45,45,-116,-93,-29,-97,45,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,45,-84,45,45,-89,-90,-91,-92,-83,-69,45,45,-53,-94,45,-166,-152,-153,-307,-132,-133,45,-70,45,-85,45,45,45,45,45,-30,-167,45,45,45,-135,-142,-308,45,-145,-146,-130,45,45,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,45,-71,45,45,-35,-36,45,45,45,-154,45,-137,45,-139,-134,-143,-128,-129,-131,-202,-201,45,-218,45,-78,-80,45,-214,-215,-217,45,45,45,-31,-34,45,45,45,-155,-156,-136,-138,-144,-203,-205,45,-79,-213,-216,-32,-33,45,45,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'RESTRICT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[46,46,-60,-62,-63,-64,-65,-66,46,46,-67,-68,-52,46,46,46,-116,-93,-29,-97,46,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,46,-84,46,46,-89,-90,-91,-92,-83,-69,46,46,-53,-94,46,-166,-152,-153,-307,-132,-133,46,-70,46,-85,46,46,46,46,46,-30,-167,46,46,46,-135,-142,-308,46,-145,-146,-130,46,46,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,46,-71,46,46,-35,-36,46,46,46,-154,46,-137,46,-139,-134,-143,-128,-129,-131,-202,-201,46,-218,46,-78,-80,46,-214,-215,-217,46,46,46,-31,-34,46,46,46,-155,-156,-136,-138,-144,-203,-205,46,-79,-213,-216,-32,-33,46,46,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'VOLATILE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[47,47,-60,-62,-63,-64,-65,-66,47,47,-67,-68,-52,47,47,47,-116,-93,-29,-97,47,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,47,-84,47,47,-89,-90,-91,-92,-83,-69,47,47,-53,-94,47,-166,-152,-153,-307,-132,-133,47,-70,47,-85,47,47,47,47,47,-30,-167,47,47,47,-135,-142,-308,47,-145,-146,-130,47,47,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,47,-71,47,47,-35,-36,47,47,47,-154,47,-137,47,-139,-134,-143,-128,-129,-131,-202,-201,47,-218,47,-78,-80,47,-214,-215,-217,47,47,47,-31,-34,47,47,47,-155,-156,-136,-138,-144,-203,-205,47,-79,-213,-216,-32,-33,47,47,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'AUTO':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[48,48,-60,-62,-63,-64,-65,-66,48,48,-67,-68,-52,48,48,48,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,48,-84,48,48,-89,-90,-91,-92,-83,-69,48,-53,-94,-152,-153,-307,-132,-133,-70,48,-85,48,48,-30,-135,-308,48,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,48,48,-154,-137,-139,-134,-202,-201,-218,-78,-80,48,-214,-215,-217,-31,-34,48,48,-155,-156,-136,-138,-203,-205,48,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'REGISTER':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[49,49,-60,-62,-63,-64,-65,-66,49,49,-67,-68,-52,49,49,49,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,49,-84,49,49,-89,-90,-91,-92,-83,-69,49,-53,-94,-152,-153,-307,-132,-133,-70,49,-85,49,49,-30,-135,-308,49,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,49,49,-154,-137,-139,-134,-202,-201,-218,-78,-80,49,-214,-215,-217,-31,-34,49,49,-155,-156,-136,-138,-203,-205,49,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'STATIC':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,97,98,99,101,102,103,105,106,107,114,115,118,126,131,133,142,144,152,153,154,155,156,157,158,159,160,161,162,210,218,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,360,361,370,371,372,375,376,381,384,390,395,398,399,442,443,446,458,491,492,494,495,519,521,527,529,],[25,25,-60,-62,-63,-64,-65,-66,25,25,-67,-68,-52,25,25,25,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,25,-84,25,25,-89,-90,-91,-92,-83,-69,117,25,-53,-94,-166,-152,-153,-307,-132,-133,-70,25,-85,217,25,226,25,-30,-167,-135,-308,25,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,348,-35,-36,25,25,-154,-137,-139,-134,-202,-201,-218,-78,-80,25,-214,-215,-217,-31,-34,445,25,25,-155,-156,-136,-138,-203,-205,25,-79,-213,-216,-32,-33,484,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'EXTERN':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[50,50,-60,-62,-63,-64,-65,-66,50,50,-67,-68,-52,50,50,50,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,50,-84,50,50,-89,-90,-91,-92,-83,-69,50,-53,-94,-152,-153,-307,-132,-133,-70,50,-85,50,50,-30,-135,-308,50,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,50,50,-154,-137,-139,-134,-202,-201,-218,-78,-80,50,-214,-215,-217,-31,-34,50,50,-155,-156,-136,-138,-203,-205,50,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'TYPEDEF':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[51,51,-60,-62,-63,-64,-65,-66,51,51,-67,-68,-52,51,51,51,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,51,-84,51,51,-89,-90,-91,-92,-83,-69,51,-53,-94,-152,-153,-307,-132,-133,-70,51,-85,51,51,-30,-135,-308,51,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,51,51,-154,-137,-139,-134,-202,-201,-218,-78,-80,51,-214,-215,-217,-31,-34,51,51,-155,-156,-136,-138,-203,-205,51,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'INLINE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[52,52,-60,-62,-63,-64,-65,-66,52,52,-67,-68,-52,52,52,52,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,52,-84,52,52,-89,-90,-91,-92,-83,-69,52,-53,-94,-152,-153,-307,-132,-133,-70,52,-85,52,52,-30,-135,-308,52,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,52,52,-154,-137,-139,-134,-202,-201,-218,-78,-80,52,-214,-215,-217,-31,-34,52,52,-155,-156,-136,-138,-203,-205,52,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'STRUCT':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[53,53,-60,-62,-63,-64,-65,-66,53,-67,-68,-52,-309,-309,-309,53,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,53,-84,53,53,-83,-69,53,-53,-86,-9,-10,-87,-88,-166,-307,53,-70,53,-85,53,53,-30,-167,53,53,53,-142,-308,-145,-146,53,53,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,53,-71,-35,-36,53,53,53,53,-143,-202,-201,53,-218,-78,-80,53,-214,-215,-217,53,53,53,-31,-34,53,53,-144,-203,-205,53,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'UNION':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[54,54,-60,-62,-63,-64,-65,-66,54,-67,-68,-52,-309,-309,-309,54,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,54,-84,54,54,-83,-69,54,-53,-86,-9,-10,-87,-88,-166,-307,54,-70,54,-85,54,54,-30,-167,54,54,54,-142,-308,-145,-146,54,54,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,54,-71,-35,-36,54,54,54,54,-143,-202,-201,54,-218,-78,-80,54,-214,-215,-217,54,54,54,-31,-34,54,54,-144,-203,-205,54,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'LBRACE':([10,14,15,23,31,32,53,54,56,57,58,59,62,77,78,81,98,99,101,102,103,106,107,109,113,130,131,144,152,153,154,155,156,157,158,159,160,161,162,172,215,227,228,264,265,267,272,273,282,283,286,287,289,338,339,340,351,352,381,382,384,386,395,398,399,432,434,442,443,458,459,460,461,463,464,472,473,476,477,491,492,494,495,508,510,519,521,523,526,527,529,],[-309,-68,-52,-29,101,101,-140,-141,101,-7,-8,-84,-309,-83,-69,-53,101,101,-307,101,101,101,-85,101,101,101,-30,-308,101,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,101,-309,-35,-36,-202,-201,101,101,-218,101,-80,-214,-215,-217,-11,101,-12,-31,-34,-203,101,-205,101,-79,-213,-216,-309,-182,-32,-33,-204,101,101,-309,101,101,101,101,101,-11,-206,-80,-208,-209,101,-309,-207,-210,101,101,-212,-211,]),'RBRACE':([14,77,78,101,104,106,127,136,137,138,139,140,141,143,144,146,147,150,151,152,153,154,155,156,157,158,159,160,161,162,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,214,215,244,245,247,249,251,254,264,265,269,270,273,282,283,286,287,289,325,326,327,329,330,331,333,334,336,337,338,373,374,377,381,384,387,395,398,399,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,431,432,433,458,462,469,470,473,475,491,492,493,494,495,499,503,509,510,514,519,520,521,527,529,],[-68,-83,-69,-307,144,-309,-294,144,-157,-160,144,144,144,-142,-308,-145,-146,144,-5,-6,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-177,-309,144,144,-158,144,144,-143,-202,-201,-235,-257,-218,-78,-80,-214,-215,-217,-279,-280,-260,-261,-262,-263,-304,-306,144,-22,-21,-159,-161,-144,-203,-205,-287,-79,-213,-216,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-178,144,-180,-204,-258,-272,-273,-264,-179,-206,-80,144,-208,-209,-237,-181,-281,144,-288,-207,-282,-210,-212,-211,]),'CASE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,164,-308,164,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,164,-202,-201,164,164,-218,164,-80,-214,-215,-217,-203,164,-205,-79,-213,-216,-204,164,164,164,-206,-80,-208,-209,164,-207,-210,164,164,-212,-211,]),'DEFAULT':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,165,-308,165,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,165,-202,-201,165,165,-218,165,-80,-214,-215,-217,-203,165,-205,-79,-213,-216,-204,165,165,165,-206,-80,-208,-209,165,-207,-210,165,165,-212,-211,]),'IF':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,167,-308,167,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,167,-202,-201,167,167,-218,167,-80,-214,-215,-217,-203,167,-205,-79,-213,-216,-204,167,167,167,-206,-80,-208,-209,167,-207,-210,167,167,-212,-211,]),'SWITCH':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,170,-308,170,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,170,-202,-201,170,170,-218,170,-80,-214,-215,-217,-203,170,-205,-79,-213,-216,-204,170,170,170,-206,-80,-208,-209,170,-207,-210,170,170,-212,-211,]),'WHILE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,281,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,171,-308,171,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,171,-202,-201,171,171,-218,394,171,-80,-214,-215,-217,-203,171,-205,-79,-213,-216,-204,171,171,171,-206,-80,-208,-209,171,-207,-210,171,171,-212,-211,]),'DO':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,172,-308,172,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,172,-202,-201,172,172,-218,172,-80,-214,-215,-217,-203,172,-205,-79,-213,-216,-204,172,172,172,-206,-80,-208,-209,172,-207,-210,172,172,-212,-211,]),'FOR':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,173,-308,173,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,173,-202,-201,173,173,-218,173,-80,-214,-215,-217,-203,173,-205,-79,-213,-216,-204,173,173,173,-206,-80,-208,-209,173,-207,-210,173,173,-212,-211,]),'GOTO':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,174,-308,174,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,174,-202,-201,174,174,-218,174,-80,-214,-215,-217,-203,174,-205,-79,-213,-216,-204,174,174,174,-206,-80,-208,-209,174,-207,-210,174,174,-212,-211,]),'BREAK':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,175,-308,175,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,175,-202,-201,175,175,-218,175,-80,-214,-215,-217,-203,175,-205,-79,-213,-216,-204,175,175,175,-206,-80,-208,-209,175,-207,-210,175,175,-212,-211,]),'CONTINUE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,176,-308,176,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,176,-202,-201,176,176,-218,176,-80,-214,-215,-217,-203,176,-205,-79,-213,-216,-204,176,176,176,-206,-80,-208,-209,176,-207,-210,176,176,-212,-211,]),'RETURN':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,177,-308,177,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,177,-202,-201,177,177,-218,177,-80,-214,-215,-217,-203,177,-205,-79,-213,-216,-204,177,177,177,-206,-80,-208,-209,177,-207,-210,177,177,-212,-211,]),'PLUSPLUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,183,183,-309,183,-309,-28,-294,183,-167,-308,183,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,183,183,183,183,325,183,183,183,183,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,183,-309,-28,-266,183,183,-309,183,183,-202,-201,183,183,183,-218,183,183,183,183,183,-80,183,-214,-215,-217,183,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,-279,-280,183,183,-304,-306,-11,183,-12,183,-266,183,183,-309,183,183,183,-203,183,-205,183,-287,-79,183,-213,-216,-274,-275,-276,-277,-278,-309,-182,183,-309,-28,-266,-204,183,183,-309,183,183,183,183,183,-272,-273,183,183,-11,-266,183,183,-206,-80,-208,-209,183,183,-281,-309,183,-288,183,-207,-282,-210,183,183,-212,-211,]),'MINUSMINUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,184,184,-309,184,-309,-28,-294,184,-167,-308,184,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,184,184,184,184,326,184,184,184,184,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,184,-309,-28,-266,184,184,-309,184,184,-202,-201,184,184,184,-218,184,184,184,184,184,-80,184,-214,-215,-217,184,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,-279,-280,184,184,-304,-306,-11,184,-12,184,-266,184,184,-309,184,184,184,-203,184,-205,184,-287,-79,184,-213,-216,-274,-275,-276,-277,-278,-309,-182,184,-309,-28,-266,-204,184,184,-309,184,184,184,184,184,-272,-273,184,184,-11,-266,184,184,-206,-80,-208,-209,184,184,-281,-309,184,-288,184,-207,-282,-210,184,184,-212,-211,]),'SIZEOF':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,187,187,-309,187,-309,-28,187,-167,-308,187,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,187,187,187,187,187,187,187,187,-266,-267,-268,-265,-269,-270,-309,187,-309,-28,-266,187,187,-309,187,187,-202,-201,187,187,187,-218,187,187,187,187,187,-80,187,-214,-215,-217,187,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,-11,187,-12,187,-266,187,187,-309,187,187,187,-203,187,-205,187,-79,187,-213,-216,-309,-182,187,-309,-28,-266,-204,187,187,-309,187,187,187,187,187,187,187,-11,-266,187,187,-206,-80,-208,-209,187,187,-309,187,187,-207,-210,187,187,-212,-211,]),'AND':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,191,191,-309,191,-309,-28,-294,191,-167,-308,191,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,191,191,191,191,-257,316,-259,191,191,191,-238,191,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,191,-309,-28,-266,191,191,-309,191,191,-202,-201,191,-257,191,191,-218,191,191,191,191,191,-80,191,-214,-215,-217,191,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,-279,-280,-260,191,-261,-262,-263,191,-304,-306,-11,191,-12,191,-266,191,191,-309,191,191,191,-203,191,-205,191,-287,-79,191,-213,-216,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,316,316,316,316,-274,-275,-276,-277,-278,-309,-182,191,-309,-28,-266,-204,191,191,-309,-258,191,191,191,191,191,-272,-273,191,-264,191,-11,-266,191,191,-206,-80,-208,-209,191,191,-281,-309,191,-288,191,-207,-282,-210,191,191,-212,-211,]),'PLUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,189,189,-309,189,-309,-28,-294,189,-167,-308,189,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,189,189,189,189,-257,306,-259,189,189,189,-238,189,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,189,-309,-28,-266,189,189,-309,189,189,-202,-201,189,-257,189,189,-218,189,189,189,189,189,-80,189,-214,-215,-217,189,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,-279,-280,-260,189,-261,-262,-263,189,-304,-306,-11,189,-12,189,-266,189,189,-309,189,189,189,-203,189,-205,189,-287,-79,189,-213,-216,-239,-240,-241,-242,-243,306,306,306,306,306,306,306,306,306,306,306,306,306,-274,-275,-276,-277,-278,-309,-182,189,-309,-28,-266,-204,189,189,-309,-258,189,189,189,189,189,-272,-273,189,-264,189,-11,-266,189,189,-206,-80,-208,-209,189,189,-281,-309,189,-288,189,-207,-282,-210,189,189,-212,-211,]),'MINUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,190,190,-309,190,-309,-28,-294,190,-167,-308,190,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,190,190,190,190,-257,307,-259,190,190,190,-238,190,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,190,-309,-28,-266,190,190,-309,190,190,-202,-201,190,-257,190,190,-218,190,190,190,190,190,-80,190,-214,-215,-217,190,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,-279,-280,-260,190,-261,-262,-263,190,-304,-306,-11,190,-12,190,-266,190,190,-309,190,190,190,-203,190,-205,190,-287,-79,190,-213,-216,-239,-240,-241,-242,-243,307,307,307,307,307,307,307,307,307,307,307,307,307,-274,-275,-276,-277,-278,-309,-182,190,-309,-28,-266,-204,190,190,-309,-258,190,190,190,190,190,-272,-273,190,-264,190,-11,-266,190,190,-206,-80,-208,-209,190,190,-281,-309,190,-288,190,-207,-282,-210,190,190,-212,-211,]),'NOT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,193,193,-309,193,-309,-28,193,-167,-308,193,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,193,193,193,193,193,193,193,193,-266,-267,-268,-265,-269,-270,-309,193,-309,-28,-266,193,193,-309,193,193,-202,-201,193,193,193,-218,193,193,193,193,193,-80,193,-214,-215,-217,193,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,-11,193,-12,193,-266,193,193,-309,193,193,193,-203,193,-205,193,-79,193,-213,-216,-309,-182,193,-309,-28,-266,-204,193,193,-309,193,193,193,193,193,193,193,-11,-266,193,193,-206,-80,-208,-209,193,193,-309,193,193,-207,-210,193,193,-212,-211,]),'LNOT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,194,194,-309,194,-309,-28,194,-167,-308,194,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,194,194,194,194,194,194,194,194,-266,-267,-268,-265,-269,-270,-309,194,-309,-28,-266,194,194,-309,194,194,-202,-201,194,194,194,-218,194,194,194,194,194,-80,194,-214,-215,-217,194,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,-11,194,-12,194,-266,194,194,-309,194,194,194,-203,194,-205,194,-79,194,-213,-216,-309,-182,194,-309,-28,-266,-204,194,194,-309,194,194,194,194,194,194,194,-11,-266,194,194,-206,-80,-208,-209,194,194,-309,194,194,-207,-210,194,194,-212,-211,]),'OFFSETOF':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,199,199,-309,199,-309,-28,199,-167,-308,199,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,199,199,199,199,199,199,199,199,-266,-267,-268,-265,-269,-270,-309,199,-309,-28,-266,199,199,-309,199,199,-202,-201,199,199,199,-218,199,199,199,199,199,-80,199,-214,-215,-217,199,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,-11,199,-12,199,-266,199,199,-309,199,199,199,-203,199,-205,199,-79,199,-213,-216,-309,-182,199,-309,-28,-266,-204,199,199,-309,199,199,199,199,199,199,199,-11,-266,199,199,-206,-80,-208,-209,199,199,-309,199,199,-207,-210,199,199,-212,-211,]),'INT_CONST_DEC':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,200,200,-309,200,-309,-28,200,-167,-308,200,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,200,200,200,200,200,200,200,200,-266,-267,-268,-265,-269,-270,-309,200,-309,-28,-266,200,200,-309,200,200,-202,-201,200,200,200,-218,200,200,200,200,200,-80,200,-214,-215,-217,200,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,-11,200,-12,200,-266,200,200,-309,200,200,200,-203,200,-205,200,-79,200,-213,-216,-309,-182,200,-309,-28,-266,-204,200,200,-309,200,200,200,200,200,200,200,-11,-266,200,200,-206,-80,-208,-209,200,200,-309,200,200,-207,-210,200,200,-212,-211,]),'INT_CONST_OCT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,201,201,-309,201,-309,-28,201,-167,-308,201,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,201,201,201,201,201,201,201,201,-266,-267,-268,-265,-269,-270,-309,201,-309,-28,-266,201,201,-309,201,201,-202,-201,201,201,201,-218,201,201,201,201,201,-80,201,-214,-215,-217,201,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,-11,201,-12,201,-266,201,201,-309,201,201,201,-203,201,-205,201,-79,201,-213,-216,-309,-182,201,-309,-28,-266,-204,201,201,-309,201,201,201,201,201,201,201,-11,-266,201,201,-206,-80,-208,-209,201,201,-309,201,201,-207,-210,201,201,-212,-211,]),'INT_CONST_HEX':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,202,202,-309,202,-309,-28,202,-167,-308,202,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,202,202,202,202,202,202,202,202,-266,-267,-268,-265,-269,-270,-309,202,-309,-28,-266,202,202,-309,202,202,-202,-201,202,202,202,-218,202,202,202,202,202,-80,202,-214,-215,-217,202,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,-11,202,-12,202,-266,202,202,-309,202,202,202,-203,202,-205,202,-79,202,-213,-216,-309,-182,202,-309,-28,-266,-204,202,202,-309,202,202,202,202,202,202,202,-11,-266,202,202,-206,-80,-208,-209,202,202,-309,202,202,-207,-210,202,202,-212,-211,]),'INT_CONST_BIN':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,203,203,-309,203,-309,-28,203,-167,-308,203,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,203,203,203,203,203,203,203,203,-266,-267,-268,-265,-269,-270,-309,203,-309,-28,-266,203,203,-309,203,203,-202,-201,203,203,203,-218,203,203,203,203,203,-80,203,-214,-215,-217,203,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,-11,203,-12,203,-266,203,203,-309,203,203,203,-203,203,-205,203,-79,203,-213,-216,-309,-182,203,-309,-28,-266,-204,203,203,-309,203,203,203,203,203,203,203,-11,-266,203,203,-206,-80,-208,-209,203,203,-309,203,203,-207,-210,203,203,-212,-211,]),'FLOAT_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,204,204,-309,204,-309,-28,204,-167,-308,204,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,204,204,204,204,204,204,204,204,-266,-267,-268,-265,-269,-270,-309,204,-309,-28,-266,204,204,-309,204,204,-202,-201,204,204,204,-218,204,204,204,204,204,-80,204,-214,-215,-217,204,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,-11,204,-12,204,-266,204,204,-309,204,204,204,-203,204,-205,204,-79,204,-213,-216,-309,-182,204,-309,-28,-266,-204,204,204,-309,204,204,204,204,204,204,204,-11,-266,204,204,-206,-80,-208,-209,204,204,-309,204,204,-207,-210,204,204,-212,-211,]),'HEX_FLOAT_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,205,205,-309,205,-309,-28,205,-167,-308,205,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,205,205,205,205,205,205,205,205,-266,-267,-268,-265,-269,-270,-309,205,-309,-28,-266,205,205,-309,205,205,-202,-201,205,205,205,-218,205,205,205,205,205,-80,205,-214,-215,-217,205,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,-11,205,-12,205,-266,205,205,-309,205,205,205,-203,205,-205,205,-79,205,-213,-216,-309,-182,205,-309,-28,-266,-204,205,205,-309,205,205,205,205,205,205,205,-11,-266,205,205,-206,-80,-208,-209,205,205,-309,205,205,-207,-210,205,205,-212,-211,]),'CHAR_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,206,206,-309,206,-309,-28,206,-167,-308,206,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,206,206,206,206,206,206,206,206,-266,-267,-268,-265,-269,-270,-309,206,-309,-28,-266,206,206,-309,206,206,-202,-201,206,206,206,-218,206,206,206,206,206,-80,206,-214,-215,-217,206,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,-11,206,-12,206,-266,206,206,-309,206,206,206,-203,206,-205,206,-79,206,-213,-216,-309,-182,206,-309,-28,-266,-204,206,206,-309,206,206,206,206,206,206,206,-11,-266,206,206,-206,-80,-208,-209,206,206,-309,206,206,-207,-210,206,206,-212,-211,]),'WCHAR_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,207,207,-309,207,-309,-28,207,-167,-308,207,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,207,207,207,207,207,207,207,207,-266,-267,-268,-265,-269,-270,-309,207,-309,-28,-266,207,207,-309,207,207,-202,-201,207,207,207,-218,207,207,207,207,207,-80,207,-214,-215,-217,207,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,-11,207,-12,207,-266,207,207,-309,207,207,207,-203,207,-205,207,-79,207,-213,-216,-309,-182,207,-309,-28,-266,-204,207,207,-309,207,207,207,207,207,207,207,-11,-266,207,207,-206,-80,-208,-209,207,207,-309,207,207,-207,-210,207,207,-212,-211,]),'STRING_LITERAL':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,197,208,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,333,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,208,208,-309,208,-309,-28,208,-167,-308,208,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,208,208,208,208,208,208,208,208,-266,-267,-268,-265,-269,-270,333,-303,-309,208,-309,-28,-266,208,208,-309,208,208,-202,-201,208,208,208,-218,208,208,208,208,208,-80,208,-214,-215,-217,208,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,-304,-11,208,-12,208,-266,208,208,-309,208,208,208,-203,208,-205,208,-79,208,-213,-216,-309,-182,208,-309,-28,-266,-204,208,208,-309,208,208,208,208,208,208,208,-11,-266,208,208,-206,-80,-208,-209,208,208,-309,208,208,-207,-210,208,208,-212,-211,]),'WSTRING_LITERAL':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,198,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,209,209,-309,209,-309,-28,209,-167,-308,209,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,209,209,209,209,209,209,209,209,-266,-267,-268,-265,-269,-270,334,-305,-309,209,-309,-28,-266,209,209,-309,209,209,-202,-201,209,209,209,-218,209,209,209,209,209,-80,209,-214,-215,-217,209,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,-306,-11,209,-12,209,-266,209,209,-309,209,209,209,-203,209,-205,209,-79,209,-213,-216,-309,-182,209,-309,-28,-266,-204,209,209,-309,209,209,209,209,209,209,209,-11,-266,209,209,-206,-80,-208,-209,209,209,-309,209,209,-207,-210,209,209,-212,-211,]),'ELSE':([14,78,144,156,157,158,159,160,161,162,264,273,282,283,286,287,289,381,384,395,398,399,458,491,492,494,495,519,521,527,529,],[-68,-69,-308,-72,-73,-74,-75,-76,-77,-78,-202,-218,-78,-80,-214,-215,-217,-203,-205,-79,-213,-216,-204,-206,508,-208,-209,-207,-210,-212,-211,]),'PPPRAGMASTR':([14,],[78,]),'EQUALS':([15,23,62,73,74,75,76,81,92,108,110,127,131,138,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,227,228,270,325,326,327,329,330,331,333,334,341,342,349,350,351,352,387,422,424,425,426,427,435,437,438,439,442,443,462,469,470,473,478,479,480,509,514,520,],[-52,-29,-162,113,-163,-54,-37,-53,130,-162,-55,-294,-30,248,-308,-294,291,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,-35,-36,-257,-279,-280,-260,-261,-262,-263,-304,-306,434,-183,-43,-44,-31,-34,-287,-274,-275,-276,-277,-278,-184,-186,-39,-42,-32,-33,-258,-272,-273,-264,-185,-40,-41,-281,-288,-282,]),'COMMA':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,62,63,64,65,66,70,72,73,74,75,76,81,87,90,91,92,94,95,96,97,98,99,102,103,108,110,121,123,124,125,126,127,131,132,133,136,137,138,142,144,148,163,169,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,211,212,213,214,227,228,231,232,233,234,235,236,237,240,241,242,243,244,245,246,247,250,252,253,256,257,259,260,261,263,269,270,276,277,288,325,326,327,329,330,331,333,334,337,349,350,351,352,356,357,358,359,371,372,373,374,375,376,380,385,387,388,389,391,392,393,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,430,431,433,438,439,442,443,449,450,452,456,457,462,469,470,473,475,479,480,485,486,487,488,489,490,493,496,499,500,503,504,505,509,514,517,518,520,525,],[-52,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-162,-89,-90,-91,-92,111,-120,-122,-163,-54,-37,-53,-94,129,-124,-126,-164,-27,-28,-166,-152,-153,-132,-133,-162,-55,229,230,-170,-175,-309,-294,-30,-165,-167,247,-157,-160,-135,-308,-130,-294,278,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-121,-38,-123,-177,-35,-36,-172,-173,-174,-188,-56,-1,-2,-45,-190,-125,-127,247,247,-154,-158,-137,-139,-134,-128,-129,378,-147,-149,-131,-235,-257,278,-309,278,-279,-280,-260,-261,-262,-263,-304,-306,432,-43,-44,-31,-34,-171,-176,-57,-189,-155,-156,-159,-161,-136,-138,-151,278,-287,-187,-188,-220,278,278,-223,278,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,278,471,-274,-292,-275,-276,-277,-278,474,-178,-180,-39,-42,-32,-33,-191,-197,-195,-148,-150,-258,-272,-273,-264,-179,-40,-41,-50,-51,-193,-192,-194,-196,510,278,-237,-293,-181,-46,-49,-281,-288,-47,-48,-282,278,]),'RPAREN':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,63,64,65,66,75,76,80,81,87,93,94,95,96,97,98,99,102,103,110,112,115,119,120,121,122,123,124,125,126,127,131,132,133,142,144,148,169,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,219,220,227,228,231,232,233,234,235,236,237,238,240,241,246,250,252,253,256,257,263,266,270,275,276,277,322,325,326,327,329,330,331,333,334,349,350,351,352,355,356,357,358,359,361,362,363,364,365,366,370,371,372,375,376,383,385,387,388,389,390,391,392,393,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,421,422,423,424,425,426,427,428,429,438,439,442,443,447,448,449,450,452,455,462,469,470,473,479,480,485,486,487,488,489,490,496,498,499,500,501,502,504,505,509,512,513,514,517,518,520,522,524,528,],[-52,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-89,-90,-91,-92,-54,-37,-309,-53,-94,131,-164,-27,-28,-166,-152,-153,-132,-133,-55,212,-309,227,228,-168,-17,-18,-170,-175,-309,-294,-30,-165,-167,-135,-308,-130,-14,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,349,350,-35,-36,-172,-173,-174,-188,-56,-1,-2,-309,-45,-190,-154,-137,-139,-134,-128,-129,-131,-13,-257,386,387,-309,422,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-169,-171,-176,-57,-189,-309,449,450,-188,-23,-24,-309,-155,-156,-136,-138,459,460,-287,-187,-188,-309,-220,463,464,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,470,-274,-292,-275,-276,-277,-278,472,473,-39,-42,-32,-33,485,486,-191,-197,-195,490,-258,-272,-273,-264,-40,-41,-50,-51,-193,-192,-194,-196,511,-309,-237,-293,514,-289,-46,-49,-281,-309,523,-288,-47,-48,-282,526,-290,-291,]),'COLON':([15,20,23,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,74,75,76,81,98,99,102,103,108,110,127,131,142,144,145,148,163,165,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,227,228,246,250,252,253,256,257,261,263,268,269,270,325,326,327,329,330,331,333,334,349,350,351,352,371,372,375,376,378,387,391,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,438,439,442,443,462,469,470,473,479,480,499,509,514,520,],[-52,-116,-29,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-163,-54,-37,-53,-152,-153,-132,-133,-162,-55,-294,-30,-135,-308,262,-130,267,272,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,-35,-36,-154,-137,-139,-134,-128,-129,379,-131,382,-235,-257,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-155,-156,-136,-138,262,-287,-220,-223,468,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-39,-42,-32,-33,-258,-272,-273,-264,-40,-41,-237,-281,-288,-282,]),'LBRACKET':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,63,64,65,66,75,76,81,87,94,95,96,97,98,99,101,102,103,110,126,127,131,132,133,142,144,148,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,215,227,228,234,235,238,240,241,246,250,252,253,256,257,263,277,325,326,333,334,341,342,349,350,351,352,358,359,364,371,372,375,376,387,389,390,422,424,425,426,427,432,435,437,438,439,442,443,449,450,452,461,469,470,478,479,480,485,486,487,488,489,490,501,502,504,505,509,510,514,517,518,520,524,528,],[79,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-89,-90,-91,-92,114,-37,79,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,114,239,-294,-30,-165,-167,-135,-308,-130,-294,321,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,343,-35,-36,239,360,239,-45,369,-154,-137,-139,-134,-128,-129,-131,239,-279,-280,-304,-306,343,-183,-43,-44,-31,-34,360,369,239,-155,-156,-136,-138,-287,239,239,-274,-275,-276,-277,-278,343,-184,-186,-39,-42,-32,-33,-191,-197,-195,343,-272,-273,-185,-40,-41,-50,-51,-193,-192,-194,-196,516,-289,-46,-49,-281,343,-288,-47,-48,-282,-290,-291,]),'RBRACKET':([45,46,47,79,95,96,97,114,116,118,127,133,144,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,216,218,221,222,223,224,239,269,270,325,326,327,329,330,331,333,334,345,346,353,354,360,367,368,369,387,391,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,422,424,425,426,427,436,440,441,444,446,451,453,454,462,469,470,473,481,482,499,506,507,509,514,520,525,],[-117,-118,-119,-309,-27,-28,-166,-309,-309,-28,-294,-167,-308,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,-28,351,352,-3,-4,-309,-235,-257,-279,-280,-260,-261,-262,-263,-304,-306,438,439,442,443,-309,-309,452,-309,-287,-220,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,469,-274,-275,-276,-277,-278,478,479,480,-309,-28,487,488,489,-258,-272,-273,-264,504,505,-237,517,518,-281,-288,-282,528,]),'PERIOD':([101,127,144,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,325,326,333,334,341,342,387,422,424,425,426,427,432,435,437,461,469,470,478,501,502,509,510,514,520,524,528,],[-307,-294,-308,-294,323,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,344,-279,-280,-304,-306,344,-183,-287,-274,-275,-276,-277,-278,344,-184,-186,344,-272,-273,-185,515,-289,-281,344,-288,-282,-290,-291,]),'ARROW':([127,144,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,325,326,333,334,387,422,424,425,426,427,469,470,509,514,520,],[-294,-308,-294,324,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-279,-280,-304,-306,-287,-274,-275,-276,-277,-278,-272,-273,-281,-288,-282,]),'XOREQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,292,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'TIMESEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,293,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'DIVEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,294,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MODEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,295,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'PLUSEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,296,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MINUSEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,297,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LSHIFTEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,298,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'RSHIFTEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,299,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'ANDEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,300,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'OREQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,301,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'CONDOP':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,302,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'DIVIDE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,304,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MOD':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,305,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'RSHIFT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,308,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,308,308,308,308,308,308,308,308,308,308,308,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LSHIFT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,309,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,309,309,309,309,309,309,309,309,309,309,309,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,310,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,310,310,310,310,310,310,310,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,311,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,311,311,311,311,311,311,311,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'GE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,312,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,312,312,312,312,312,312,312,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'GT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,313,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,313,313,313,313,313,313,313,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'EQ':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,314,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,314,314,314,314,314,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'NE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,315,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,315,315,315,315,315,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'OR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,317,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,317,317,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'XOR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,318,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,318,-254,318,318,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LAND':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,319,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,319,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LOR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,320,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'ELLIPSIS':([229,],[355,]),} -_lr_action = { } +_lr_action = {} for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): - if not _x in _lr_action: _lr_action[_x] = { } + if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items -_lr_goto_items = {'storage_class_specifier':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,]),'identifier_list_opt':([66,],[106,]),'selection_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[298,298,298,298,298,298,298,298,298,298,298,298,]),'constant':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,]),'unary_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[120,120,120,220,231,234,120,240,120,120,120,231,231,120,120,120,120,120,120,120,120,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,120,231,231,231,120,120,231,120,120,231,120,231,120,120,120,120,120,120,120,231,231,120,120,120,120,120,120,120,120,120,120,120,120,120,]),'conditional_expression':([72,77,103,141,162,164,170,181,192,195,196,213,219,226,227,230,233,257,264,266,281,288,289,297,309,335,373,375,376,380,384,385,393,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[151,151,151,151,151,151,151,305,305,151,151,151,151,151,151,151,151,151,305,151,151,305,151,151,305,151,151,151,151,151,151,151,151,419,151,151,151,151,151,151,151,151,151,151,151,151,151,]),'brace_close':([93,101,172,173,188,189,261,299,362,418,429,],[174,191,302,303,310,311,359,383,404,430,437,]),'struct_or_union_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,]),'unified_wstring_literal':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,]),'abstract_declarator_opt':([110,239,],[199,337,]),'iteration_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[277,277,277,277,277,277,277,277,277,277,277,277,]),'init_declarator_list':([30,86,],[71,71,]),'translation_unit_or_empty':([0,],[8,]),'struct_declaration_list':([57,91,92,],[93,172,173,]),'block_item_list_opt':([170,],[299,]),'enumerator':([64,98,99,190,],[100,100,100,312,]),'pp_directive':([0,22,],[11,11,]),'abstract_declarator':([30,78,86,97,110,167,239,338,],[79,161,79,185,201,161,201,161,]),'declaration_specifiers_opt':([1,14,42,44,],[50,58,83,84,]),'external_declaration':([0,22,],[12,61,]),'type_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[14,14,14,14,14,14,14,94,14,14,14,14,94,94,94,94,94,94,14,14,14,94,94,14,94,94,94,94,14,14,14,]),'designation':([155,362,399,429,],[260,260,260,260,]),'compound_statement':([88,163,170,289,297,375,384,411,423,425,427,441,443,446,],[169,272,282,282,282,282,282,282,282,282,282,282,282,282,]),'pointer':([0,4,22,30,68,78,86,97,110,117,167,239,306,338,],[16,16,16,74,116,74,166,166,74,16,166,339,16,339,]),'type_name':([141,219,229,230,233,],[237,322,331,332,333,]),'unified_string_literal':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,]),'postfix_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,]),'assignment_expression_opt':([72,103,164,],[131,193,273,]),'designation_opt':([155,362,399,429,],[266,402,266,402,]),'expression_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[276,276,276,276,276,276,276,276,276,276,276,276,]),'parameter_declaration':([66,78,165,167,204,338,],[109,109,109,109,320,109,]),'initializer_list_opt':([155,],[261,]),'cast_expression':([72,77,103,134,141,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[132,132,132,232,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,398,132,132,132,132,132,132,132,398,132,132,132,132,132,132,132,132,132,132,132,132,132,132,]),'init_declarator':([30,86,117,],[75,75,205,]),'struct_declarator_list':([97,],[182,]),'unary_operator':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,]),'brace_open':([7,24,54,56,62,63,77,88,162,163,170,266,289,297,336,375,384,390,395,396,402,411,423,425,427,441,443,446,],[57,64,91,92,98,99,155,170,155,170,170,155,170,170,399,170,170,399,399,399,155,170,170,170,170,170,170,170,]),'assignment_operator':([120,],[213,]),'struct_or_union':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,]),'identifier':([66,72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,203,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,263,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,394,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[114,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,318,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,360,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,417,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,]),'struct_declaration':([57,91,92,93,172,173,],[95,95,95,175,175,175,]),'assignment_expression':([72,77,103,141,162,164,170,195,196,213,219,226,227,230,233,257,266,281,289,297,335,373,375,376,380,384,385,393,402,408,411,421,423,425,426,427,432,438,441,443,446,],[136,156,136,238,156,136,238,316,317,321,238,238,328,238,238,238,156,238,238,238,397,238,238,238,238,238,238,416,156,238,238,238,238,238,238,238,238,238,238,238,238,]),'parameter_type_list':([66,78,165,167,338,],[108,159,159,159,159,]),'type_qualifier_list_opt':([28,65,105,],[68,103,196,]),'direct_declarator':([0,4,16,22,30,74,78,86,97,110,117,166,167,306,],[26,26,60,26,26,60,26,26,26,26,26,60,26,26,]),'type_qualifier_list':([28,65,105,],[67,104,67,]),'designator':([155,267,362,399,429,],[262,364,262,262,262,]),'argument_expression_list':([227,],[330,]),'initializer':([77,162,266,402,],[154,271,363,420,]),'specifier_qualifier_list_opt':([94,96,],[178,180,]),'constant_expression':([181,192,264,288,309,],[304,313,361,377,387,]),'expression_opt':([170,289,297,373,375,384,408,411,421,423,425,427,432,438,441,443,446,],[279,279,279,407,279,279,422,279,431,279,279,279,439,442,279,279,279,]),'primary_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,]),'declaration_specifiers':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[30,52,52,30,52,52,86,110,110,86,86,110,110,86,110,86,110,86,]),'declaration':([0,22,48,80,89,170,289,373,],[31,31,87,87,171,292,292,408,]),'struct_declarator_list_opt':([97,],[183,]),'identifier_list':([66,],[111,]),'typedef_name':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,]),'parameter_type_list_opt':([78,165,167,338,],[160,275,160,160,]),'jump_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[293,293,293,293,293,293,293,293,293,293,293,293,]),'declaration_list_opt':([48,80,],[88,163,]),'struct_declarator':([97,306,],[184,386,]),'function_definition':([0,22,],[36,36,]),'binary_expression':([72,77,103,141,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,373,375,376,380,384,385,393,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,147,357,358,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,]),'parameter_list':([66,78,165,167,338,],[113,113,113,113,113,]),'init_declarator_list_opt':([30,86,],[73,73,]),'enum_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,]),'decl_body':([0,22,48,80,89,170,289,373,],[41,41,41,41,41,41,41,41,]),'type_qualifier':([0,1,14,22,28,42,44,48,57,65,66,67,78,80,89,91,92,93,94,96,104,105,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[42,42,42,42,69,42,42,42,96,69,42,115,42,42,42,96,96,96,96,96,115,69,96,42,42,42,96,96,42,96,96,96,96,42,42,42,]),'statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[291,291,382,409,414,424,433,434,436,445,447,448,]),'enumerator_list':([64,98,99,],[101,188,189,]),'labeled_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[280,280,280,280,280,280,280,280,280,280,280,280,]),'function_specifier':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,]),'specifier_qualifier_list':([57,91,92,93,94,96,141,172,173,219,229,230,233,],[97,97,97,97,179,179,239,97,97,239,239,239,239,]),'block_item':([170,289,],[295,379,]),'block_item_list':([170,],[289,]),'empty':([0,1,14,28,30,42,44,48,65,66,72,78,80,86,94,96,97,103,105,110,155,164,165,167,170,239,289,297,338,362,373,375,384,399,408,411,421,423,425,427,429,432,438,441,443,446,],[47,51,51,70,76,51,51,85,70,107,150,158,85,76,177,177,186,150,70,200,268,150,158,158,296,200,378,378,158,403,378,378,378,403,378,378,378,378,378,378,403,378,378,378,378,378,]),'translation_unit':([0,],[22,]),'initializer_list':([155,399,],[265,418,]),'declarator':([0,4,22,30,78,86,97,110,117,167,306,],[48,53,48,80,53,168,187,202,168,53,187,]),'direct_abstract_declarator':([30,74,78,86,97,110,166,167,239,338,339,],[81,153,81,81,81,81,153,81,81,81,153,]),'designator_list':([155,362,399,429,],[267,267,267,267,]),'declaration_list':([48,80,],[89,89,]),'expression':([141,170,219,226,230,233,257,281,289,297,373,375,376,380,384,385,408,411,421,423,425,426,427,432,438,441,443,446,],[236,285,236,327,236,236,356,372,285,285,285,285,410,412,285,415,285,285,285,285,285,435,285,285,285,285,285,285,]),} +_lr_goto_items = {'translation_unit_or_empty':([0,],[1,]),'translation_unit':([0,],[2,]),'empty':([0,10,11,17,18,19,22,26,60,61,62,79,80,106,114,115,116,117,126,145,152,172,215,216,217,238,239,267,272,277,282,284,360,361,367,369,370,382,390,397,432,444,445,460,461,463,464,466,498,508,510,512,523,526,],[3,57,69,83,83,83,89,95,69,89,57,95,122,151,95,122,223,95,236,258,266,266,338,223,95,365,95,266,266,236,266,266,95,122,223,223,365,266,365,266,477,223,95,266,477,266,266,266,266,266,477,266,266,266,]),'external_declaration':([0,2,],[4,55,]),'function_definition':([0,2,],[5,5,]),'declaration':([0,2,10,58,62,106,152,284,],[6,6,59,107,59,154,154,397,]),'pp_directive':([0,2,],[7,7,]),'pppragma_directive':([0,2,104,106,139,140,141,152,172,249,251,267,272,282,382,460,463,464,508,523,526,],[8,8,147,162,147,147,147,162,282,147,147,282,282,162,282,282,282,282,282,282,282,]),'id_declarator':([0,2,11,22,24,60,61,71,111,126,129,145,238,378,],[10,10,62,92,93,108,92,93,108,231,108,108,93,108,]),'declaration_specifiers':([0,2,10,58,62,80,106,115,152,229,238,284,361,370,390,],[11,11,60,60,60,126,60,126,60,126,126,60,126,126,126,]),'decl_body':([0,2,10,58,62,106,152,284,],[12,12,12,12,12,12,12,12,]),'direct_id_declarator':([0,2,11,16,22,24,60,61,68,71,111,126,129,145,234,238,364,378,],[15,15,15,81,15,15,15,15,81,15,15,15,15,15,81,15,81,15,]),'pointer':([0,2,11,22,24,60,61,71,94,111,126,129,145,238,277,378,390,],[16,16,68,16,16,68,16,68,132,68,234,68,68,364,389,68,389,]),'type_qualifier':([0,2,10,11,17,18,19,26,58,60,62,79,80,96,104,106,114,115,117,118,126,139,140,141,145,149,152,168,217,218,229,238,239,249,251,271,277,284,328,332,335,360,361,370,390,445,446,],[17,17,17,63,17,17,17,97,17,63,17,97,17,133,97,17,97,17,97,133,63,97,97,97,257,133,17,97,97,133,17,17,97,97,97,97,257,17,97,97,97,97,17,17,17,97,133,]),'storage_class_specifier':([0,2,10,11,17,18,19,58,60,62,80,106,115,126,152,229,238,284,361,370,390,],[18,18,18,64,18,18,18,18,64,18,18,18,18,64,18,18,18,18,18,18,18,]),'function_specifier':([0,2,10,11,17,18,19,58,60,62,80,106,115,126,152,229,238,284,361,370,390,],[19,19,19,65,19,19,19,19,65,19,19,19,19,65,19,19,19,19,19,19,19,]),'type_specifier_no_typeid':([0,2,10,11,22,58,60,61,62,80,104,106,115,126,128,139,140,141,145,149,152,168,229,238,249,251,271,277,284,328,332,335,361,370,390,],[20,20,20,66,20,20,66,20,20,20,20,20,20,66,20,20,20,20,256,20,20,20,20,20,20,20,20,256,20,20,20,20,20,20,20,]),'type_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[21,21,21,87,21,87,21,21,148,21,21,87,148,148,148,263,21,148,21,21,148,148,148,21,148,148,148,21,21,21,]),'declaration_specifiers_no_type':([0,2,10,17,18,19,58,62,80,106,115,152,229,238,284,361,370,390,],[22,22,61,84,84,84,61,61,128,61,128,61,128,128,61,128,128,128,]),'typedef_name':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,]),'enum_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,]),'struct_or_union_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,]),'struct_or_union':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,]),'declaration_list_opt':([10,62,],[56,109,]),'declaration_list':([10,62,],[58,58,]),'init_declarator_list_opt':([11,60,],[67,67,]),'init_declarator_list':([11,60,],[70,70,]),'init_declarator':([11,60,111,129,],[72,72,211,242,]),'declarator':([11,60,111,129,145,378,],[73,73,73,73,261,261,]),'typeid_declarator':([11,60,71,111,129,145,378,],[74,74,112,74,74,74,74,]),'direct_typeid_declarator':([11,60,68,71,111,129,145,378,],[75,75,110,75,75,75,75,75,]),'declaration_specifiers_no_type_opt':([17,18,19,],[82,85,86,]),'id_init_declarator_list_opt':([22,61,],[88,88,]),'id_init_declarator_list':([22,61,],[90,90,]),'id_init_declarator':([22,61,],[91,91,]),'type_qualifier_list_opt':([26,79,114,117,217,239,360,445,],[94,116,216,225,347,367,444,483,]),'type_qualifier_list':([26,79,104,114,117,139,140,141,168,217,239,249,251,271,328,332,335,360,445,],[96,118,149,218,96,149,149,149,149,96,96,149,149,149,149,149,149,446,96,]),'brace_open':([31,32,56,98,99,102,103,106,109,113,130,152,172,267,272,282,339,382,386,459,460,463,464,472,473,476,508,523,526,],[100,104,106,134,135,139,140,106,106,215,215,106,106,106,106,106,215,106,461,461,106,106,106,461,461,215,106,106,106,]),'compound_statement':([56,106,109,152,172,267,272,282,382,460,463,464,508,523,526,],[105,158,210,158,158,158,158,158,158,158,158,158,158,158,158,]),'parameter_type_list':([80,115,238,361,370,390,],[119,219,366,447,366,366,]),'identifier_list_opt':([80,115,361,],[120,220,448,]),'parameter_list':([80,115,238,361,370,390,],[121,121,121,121,121,121,]),'identifier_list':([80,115,361,],[123,123,123,]),'parameter_declaration':([80,115,229,238,361,370,390,],[124,124,356,124,124,124,124,]),'identifier':([80,106,113,115,116,130,152,164,168,172,177,183,184,185,187,216,225,226,230,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,344,347,348,361,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,474,476,483,484,498,508,512,515,516,523,526,],[125,195,195,125,195,195,195,195,195,195,195,195,195,195,195,195,195,195,357,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,437,195,195,125,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,502,195,195,195,195,195,195,524,195,195,195,]),'enumerator_list':([100,134,135,],[136,244,245,]),'enumerator':([100,134,135,247,],[137,137,137,373,]),'struct_declaration_list':([104,139,140,],[141,249,251,]),'brace_close':([104,136,139,140,141,150,244,245,249,251,336,432,493,510,],[142,246,250,252,253,264,371,372,375,376,431,475,509,520,]),'struct_declaration':([104,139,140,141,249,251,],[143,143,143,254,254,254,]),'specifier_qualifier_list':([104,139,140,141,168,249,251,271,328,332,335,],[145,145,145,145,277,145,145,277,277,277,277,]),'block_item_list_opt':([106,],[150,]),'block_item_list':([106,],[152,]),'block_item':([106,152,],[153,265,]),'statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[155,155,283,283,283,395,283,492,283,283,283,283,283,]),'labeled_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[156,156,156,156,156,156,156,156,156,156,156,156,156,]),'expression_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[157,157,157,157,157,157,157,157,157,157,157,157,157,]),'selection_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[159,159,159,159,159,159,159,159,159,159,159,159,159,]),'iteration_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[160,160,160,160,160,160,160,160,160,160,160,160,160,]),'jump_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[161,161,161,161,161,161,161,161,161,161,161,161,161,]),'expression_opt':([106,152,172,267,272,282,284,382,397,460,463,464,466,498,508,512,523,526,],[166,166,166,166,166,166,396,166,467,166,166,166,497,513,166,522,166,166,]),'expression':([106,152,168,172,177,267,271,272,274,279,280,282,284,302,321,328,332,382,397,460,463,464,465,466,498,508,512,516,523,526,],[169,169,276,169,288,169,276,169,385,392,393,169,169,401,420,276,276,169,169,169,169,169,496,169,169,169,169,525,169,169,]),'assignment_expression':([106,113,116,130,152,168,172,177,216,225,226,267,271,272,274,278,279,280,282,284,290,302,321,322,328,332,339,347,348,367,369,382,397,444,460,463,464,465,466,471,476,483,484,498,508,512,516,523,526,],[178,214,224,214,178,178,178,178,224,353,354,178,178,178,178,391,178,178,178,178,400,178,178,423,178,178,214,440,441,224,224,178,178,224,178,178,178,178,178,500,214,506,507,178,178,178,178,178,178,]),'conditional_expression':([106,113,116,130,152,164,168,172,177,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,321,322,328,332,339,343,347,348,367,369,379,382,397,444,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[179,179,179,179,179,269,179,179,179,179,179,179,269,269,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,269,179,179,179,179,269,179,179,179,179,179,179,179,179,499,179,179,179,179,179,179,179,179,179,179,]),'unary_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[180,180,180,180,180,270,180,180,180,327,329,270,331,180,180,180,270,270,180,180,180,180,180,180,180,180,180,180,180,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,180,180,180,180,180,270,180,180,180,180,270,180,270,180,180,270,180,180,180,180,180,270,180,180,180,180,180,180,180,180,180,180,]),'binary_expression':([106,113,116,130,152,164,168,172,177,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,397,444,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,]),'postfix_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,]),'unary_operator':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,]),'cast_expression':([106,113,116,130,152,164,168,172,177,185,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[186,186,186,186,186,186,186,186,186,330,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,462,186,186,462,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,]),'primary_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,]),'constant':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,]),'unified_string_literal':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,]),'unified_wstring_literal':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,]),'initializer':([113,130,339,476,],[213,243,433,503,]),'assignment_expression_opt':([116,216,367,369,444,],[221,345,451,453,481,]),'typeid_noparen_declarator':([126,],[232,]),'abstract_declarator_opt':([126,277,],[233,388,]),'direct_typeid_noparen_declarator':([126,234,],[235,358,]),'abstract_declarator':([126,238,277,390,],[237,362,237,362,]),'direct_abstract_declarator':([126,234,238,277,364,389,390,],[241,359,241,241,359,359,241,]),'struct_declarator_list_opt':([145,],[255,]),'struct_declarator_list':([145,],[259,]),'struct_declarator':([145,378,],[260,456,]),'constant_expression':([164,248,262,343,379,],[268,374,380,436,457,]),'type_name':([168,271,328,332,335,],[275,383,428,429,430,]),'pragmacomp_or_statement':([172,267,272,382,460,463,464,508,523,526,],[281,381,384,458,491,494,495,519,527,529,]),'assignment_operator':([180,],[290,]),'initializer_list_opt':([215,],[336,]),'initializer_list':([215,461,],[337,493,]),'designation_opt':([215,432,461,510,],[339,476,339,476,]),'designation':([215,432,461,510,],[340,340,340,340,]),'designator_list':([215,432,461,510,],[341,341,341,341,]),'designator':([215,341,432,461,510,],[342,435,342,342,342,]),'parameter_type_list_opt':([238,370,390,],[363,455,363,]),'argument_expression_list':([322,],[421,]),'offsetof_member_designator':([474,],[501,]),} -_lr_goto = { } +_lr_goto = {} for _k, _v in _lr_goto_items.items(): - for _x,_y in zip(_v[0],_v[1]): - if not _x in _lr_goto: _lr_goto[_x] = { } + for _x, _y in zip(_v[0], _v[1]): + if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> translation_unit_or_empty","S'",1,None,None,None), - ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','../pycparser/plyparser.py',42), - ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','../pycparser/plyparser.py',43), - ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','../pycparser/plyparser.py',42), - ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','../pycparser/plyparser.py',43), - ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','../pycparser/plyparser.py',42), - ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','../pycparser/plyparser.py',43), - ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','../pycparser/plyparser.py',42), - ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','../pycparser/plyparser.py',43), - ('declaration_specifiers_opt -> empty','declaration_specifiers_opt',1,'p_declaration_specifiers_opt','../pycparser/plyparser.py',42), - ('declaration_specifiers_opt -> declaration_specifiers','declaration_specifiers_opt',1,'p_declaration_specifiers_opt','../pycparser/plyparser.py',43), - ('designation_opt -> empty','designation_opt',1,'p_designation_opt','../pycparser/plyparser.py',42), - ('designation_opt -> designation','designation_opt',1,'p_designation_opt','../pycparser/plyparser.py',43), - ('expression_opt -> empty','expression_opt',1,'p_expression_opt','../pycparser/plyparser.py',42), - ('expression_opt -> expression','expression_opt',1,'p_expression_opt','../pycparser/plyparser.py',43), - ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','../pycparser/plyparser.py',42), - ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','../pycparser/plyparser.py',43), - ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','../pycparser/plyparser.py',42), - ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','../pycparser/plyparser.py',43), - ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','../pycparser/plyparser.py',42), - ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','../pycparser/plyparser.py',43), - ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','../pycparser/plyparser.py',42), - ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','../pycparser/plyparser.py',43), - ('specifier_qualifier_list_opt -> empty','specifier_qualifier_list_opt',1,'p_specifier_qualifier_list_opt','../pycparser/plyparser.py',42), - ('specifier_qualifier_list_opt -> specifier_qualifier_list','specifier_qualifier_list_opt',1,'p_specifier_qualifier_list_opt','../pycparser/plyparser.py',43), - ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','../pycparser/plyparser.py',42), - ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','../pycparser/plyparser.py',43), - ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','../pycparser/plyparser.py',42), - ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','../pycparser/plyparser.py',43), - ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','../pycparser/c_parser.py',494), - ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','../pycparser/c_parser.py',495), - ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','../pycparser/c_parser.py',503), - ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','../pycparser/c_parser.py',510), - ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','../pycparser/c_parser.py',522), - ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','../pycparser/c_parser.py',527), - ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','../pycparser/c_parser.py',532), - ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','../pycparser/c_parser.py',537), - ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','../pycparser/c_parser.py',542), - ('function_definition -> declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','../pycparser/c_parser.py',551), - ('function_definition -> declaration_specifiers declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','../pycparser/c_parser.py',568), - ('statement -> labeled_statement','statement',1,'p_statement','../pycparser/c_parser.py',579), - ('statement -> expression_statement','statement',1,'p_statement','../pycparser/c_parser.py',580), - ('statement -> compound_statement','statement',1,'p_statement','../pycparser/c_parser.py',581), - ('statement -> selection_statement','statement',1,'p_statement','../pycparser/c_parser.py',582), - ('statement -> iteration_statement','statement',1,'p_statement','../pycparser/c_parser.py',583), - ('statement -> jump_statement','statement',1,'p_statement','../pycparser/c_parser.py',584), - ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','../pycparser/c_parser.py',598), - ('declaration -> decl_body SEMI','declaration',2,'p_declaration','../pycparser/c_parser.py',657), - ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','../pycparser/c_parser.py',666), - ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','../pycparser/c_parser.py',667), - ('declaration_specifiers -> type_qualifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_1','../pycparser/c_parser.py',672), - ('declaration_specifiers -> type_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_2','../pycparser/c_parser.py',677), - ('declaration_specifiers -> storage_class_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_3','../pycparser/c_parser.py',682), - ('declaration_specifiers -> function_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_4','../pycparser/c_parser.py',687), - ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',692), - ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',693), - ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',694), - ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',695), - ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',696), - ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','../pycparser/c_parser.py',701), - ('type_specifier -> VOID','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',706), - ('type_specifier -> _BOOL','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',707), - ('type_specifier -> CHAR','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',708), - ('type_specifier -> SHORT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',709), - ('type_specifier -> INT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',710), - ('type_specifier -> LONG','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',711), - ('type_specifier -> FLOAT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',712), - ('type_specifier -> DOUBLE','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',713), - ('type_specifier -> _COMPLEX','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',714), - ('type_specifier -> SIGNED','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',715), - ('type_specifier -> UNSIGNED','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',716), - ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',721), - ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',722), - ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',723), - ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',728), - ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',729), - ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',730), - ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list_1','../pycparser/c_parser.py',735), - ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list_1','../pycparser/c_parser.py',736), - ('init_declarator_list -> EQUALS initializer','init_declarator_list',2,'p_init_declarator_list_2','../pycparser/c_parser.py',746), - ('init_declarator_list -> abstract_declarator','init_declarator_list',1,'p_init_declarator_list_3','../pycparser/c_parser.py',754), - ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','../pycparser/c_parser.py',762), - ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','../pycparser/c_parser.py',763), - ('specifier_qualifier_list -> type_qualifier specifier_qualifier_list_opt','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','../pycparser/c_parser.py',768), - ('specifier_qualifier_list -> type_specifier specifier_qualifier_list_opt','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','../pycparser/c_parser.py',773), - ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','../pycparser/c_parser.py',781), - ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','../pycparser/c_parser.py',782), - ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','../pycparser/c_parser.py',791), - ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','../pycparser/c_parser.py',800), - ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','../pycparser/c_parser.py',801), - ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','../pycparser/c_parser.py',810), - ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','../pycparser/c_parser.py',811), - ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','../pycparser/c_parser.py',818), - ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','../pycparser/c_parser.py',819), - ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','../pycparser/c_parser.py',824), - ('struct_declaration -> specifier_qualifier_list abstract_declarator SEMI','struct_declaration',3,'p_struct_declaration_2','../pycparser/c_parser.py',862), - ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','../pycparser/c_parser.py',876), - ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','../pycparser/c_parser.py',877), - ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','../pycparser/c_parser.py',885), - ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','../pycparser/c_parser.py',890), - ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','../pycparser/c_parser.py',891), - ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','../pycparser/c_parser.py',899), - ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','../pycparser/c_parser.py',900), - ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','../pycparser/c_parser.py',905), - ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','../pycparser/c_parser.py',910), - ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','../pycparser/c_parser.py',911), - ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','../pycparser/c_parser.py',916), - ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','../pycparser/c_parser.py',917), - ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','../pycparser/c_parser.py',918), - ('enumerator -> ID','enumerator',1,'p_enumerator','../pycparser/c_parser.py',929), - ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','../pycparser/c_parser.py',930), - ('declarator -> direct_declarator','declarator',1,'p_declarator_1','../pycparser/c_parser.py',945), - ('declarator -> pointer direct_declarator','declarator',2,'p_declarator_2','../pycparser/c_parser.py',950), - ('declarator -> pointer TYPEID','declarator',2,'p_declarator_3','../pycparser/c_parser.py',959), - ('direct_declarator -> ID','direct_declarator',1,'p_direct_declarator_1','../pycparser/c_parser.py',970), - ('direct_declarator -> LPAREN declarator RPAREN','direct_declarator',3,'p_direct_declarator_2','../pycparser/c_parser.py',979), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_declarator',5,'p_direct_declarator_3','../pycparser/c_parser.py',984), - ('direct_declarator -> direct_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_declarator',6,'p_direct_declarator_4','../pycparser/c_parser.py',998), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_declarator',6,'p_direct_declarator_4','../pycparser/c_parser.py',999), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_declarator',5,'p_direct_declarator_5','../pycparser/c_parser.py',1019), - ('direct_declarator -> direct_declarator LPAREN parameter_type_list RPAREN','direct_declarator',4,'p_direct_declarator_6','../pycparser/c_parser.py',1030), - ('direct_declarator -> direct_declarator LPAREN identifier_list_opt RPAREN','direct_declarator',4,'p_direct_declarator_6','../pycparser/c_parser.py',1031), - ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','../pycparser/c_parser.py',1058), - ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','../pycparser/c_parser.py',1059), - ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','../pycparser/c_parser.py',1088), - ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','../pycparser/c_parser.py',1089), - ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','../pycparser/c_parser.py',1094), - ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','../pycparser/c_parser.py',1095), - ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','../pycparser/c_parser.py',1103), - ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','../pycparser/c_parser.py',1104), - ('parameter_declaration -> declaration_specifiers declarator','parameter_declaration',2,'p_parameter_declaration_1','../pycparser/c_parser.py',1113), - ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','../pycparser/c_parser.py',1124), - ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','../pycparser/c_parser.py',1155), - ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','../pycparser/c_parser.py',1156), - ('initializer -> assignment_expression','initializer',1,'p_initializer_1','../pycparser/c_parser.py',1165), - ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','../pycparser/c_parser.py',1170), - ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','../pycparser/c_parser.py',1171), - ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','../pycparser/c_parser.py',1179), - ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','../pycparser/c_parser.py',1180), - ('designation -> designator_list EQUALS','designation',2,'p_designation','../pycparser/c_parser.py',1191), - ('designator_list -> designator','designator_list',1,'p_designator_list','../pycparser/c_parser.py',1199), - ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','../pycparser/c_parser.py',1200), - ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','../pycparser/c_parser.py',1205), - ('designator -> PERIOD identifier','designator',2,'p_designator','../pycparser/c_parser.py',1206), - ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','../pycparser/c_parser.py',1211), - ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','../pycparser/c_parser.py',1228), - ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','../pycparser/c_parser.py',1236), - ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','../pycparser/c_parser.py',1241), - ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','../pycparser/c_parser.py',1251), - ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','../pycparser/c_parser.py',1255), - ('direct_abstract_declarator -> LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_3','../pycparser/c_parser.py',1266), - ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','../pycparser/c_parser.py',1275), - ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','../pycparser/c_parser.py',1286), - ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','../pycparser/c_parser.py',1295), - ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','../pycparser/c_parser.py',1305), - ('block_item -> declaration','block_item',1,'p_block_item','../pycparser/c_parser.py',1316), - ('block_item -> statement','block_item',1,'p_block_item','../pycparser/c_parser.py',1317), - ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','../pycparser/c_parser.py',1324), - ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','../pycparser/c_parser.py',1325), - ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','../pycparser/c_parser.py',1331), - ('labeled_statement -> ID COLON statement','labeled_statement',3,'p_labeled_statement_1','../pycparser/c_parser.py',1337), - ('labeled_statement -> CASE constant_expression COLON statement','labeled_statement',4,'p_labeled_statement_2','../pycparser/c_parser.py',1341), - ('labeled_statement -> DEFAULT COLON statement','labeled_statement',3,'p_labeled_statement_3','../pycparser/c_parser.py',1345), - ('selection_statement -> IF LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_1','../pycparser/c_parser.py',1349), - ('selection_statement -> IF LPAREN expression RPAREN statement ELSE statement','selection_statement',7,'p_selection_statement_2','../pycparser/c_parser.py',1353), - ('selection_statement -> SWITCH LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_3','../pycparser/c_parser.py',1357), - ('iteration_statement -> WHILE LPAREN expression RPAREN statement','iteration_statement',5,'p_iteration_statement_1','../pycparser/c_parser.py',1362), - ('iteration_statement -> DO statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','../pycparser/c_parser.py',1366), - ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement','iteration_statement',9,'p_iteration_statement_3','../pycparser/c_parser.py',1370), - ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN statement','iteration_statement',8,'p_iteration_statement_4','../pycparser/c_parser.py',1374), - ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','../pycparser/c_parser.py',1379), - ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','../pycparser/c_parser.py',1383), - ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','../pycparser/c_parser.py',1387), - ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','../pycparser/c_parser.py',1391), - ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','../pycparser/c_parser.py',1392), - ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','../pycparser/c_parser.py',1397), - ('expression -> assignment_expression','expression',1,'p_expression','../pycparser/c_parser.py',1404), - ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','../pycparser/c_parser.py',1405), - ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','../pycparser/c_parser.py',1417), - ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','../pycparser/c_parser.py',1421), - ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','../pycparser/c_parser.py',1422), - ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1435), - ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1436), - ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1437), - ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1438), - ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1439), - ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1440), - ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1441), - ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1442), - ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1443), - ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1444), - ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1445), - ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','../pycparser/c_parser.py',1450), - ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','../pycparser/c_parser.py',1454), - ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','../pycparser/c_parser.py',1455), - ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','../pycparser/c_parser.py',1463), - ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1464), - ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1465), - ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1466), - ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1467), - ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1468), - ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1469), - ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1470), - ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1471), - ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1472), - ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1473), - ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1474), - ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1475), - ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1476), - ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1477), - ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1478), - ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1479), - ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1480), - ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1481), - ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','../pycparser/c_parser.py',1489), - ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','../pycparser/c_parser.py',1493), - ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','../pycparser/c_parser.py',1497), - ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1501), - ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1502), - ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1503), - ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','../pycparser/c_parser.py',1508), - ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','../pycparser/c_parser.py',1509), - ('unary_operator -> AND','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1517), - ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1518), - ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1519), - ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1520), - ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1521), - ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1522), - ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','../pycparser/c_parser.py',1527), - ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','../pycparser/c_parser.py',1531), - ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','../pycparser/c_parser.py',1535), - ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','../pycparser/c_parser.py',1536), - ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1541), - ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1542), - ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1543), - ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1544), - ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','../pycparser/c_parser.py',1550), - ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','../pycparser/c_parser.py',1551), - ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','../pycparser/c_parser.py',1556), - ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','../pycparser/c_parser.py',1557), - ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','../pycparser/c_parser.py',1562), - ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','../pycparser/c_parser.py',1566), - ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','../pycparser/c_parser.py',1570), - ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','../pycparser/c_parser.py',1571), - ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','../pycparser/c_parser.py',1576), - ('primary_expression -> OFFSETOF LPAREN type_name COMMA identifier RPAREN','primary_expression',6,'p_primary_expression_5','../pycparser/c_parser.py',1580), - ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','../pycparser/c_parser.py',1588), - ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','../pycparser/c_parser.py',1589), - ('identifier -> ID','identifier',1,'p_identifier','../pycparser/c_parser.py',1598), - ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','../pycparser/c_parser.py',1602), - ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','../pycparser/c_parser.py',1603), - ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','../pycparser/c_parser.py',1604), - ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','../pycparser/c_parser.py',1605), - ('constant -> FLOAT_CONST','constant',1,'p_constant_2','../pycparser/c_parser.py',1611), - ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','../pycparser/c_parser.py',1612), - ('constant -> CHAR_CONST','constant',1,'p_constant_3','../pycparser/c_parser.py',1618), - ('constant -> WCHAR_CONST','constant',1,'p_constant_3','../pycparser/c_parser.py',1619), - ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','../pycparser/c_parser.py',1630), - ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','../pycparser/c_parser.py',1631), - ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','../pycparser/c_parser.py',1641), - ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','../pycparser/c_parser.py',1642), - ('brace_open -> LBRACE','brace_open',1,'p_brace_open','../pycparser/c_parser.py',1652), - ('brace_close -> RBRACE','brace_close',1,'p_brace_close','../pycparser/c_parser.py',1657), - ('empty -> ','empty',0,'p_empty','../pycparser/c_parser.py',1662), + ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',43), + ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',44), + ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',43), + ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',44), + ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',43), + ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',44), + ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',43), + ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',44), + ('declaration_specifiers_no_type_opt -> empty','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',43), + ('declaration_specifiers_no_type_opt -> declaration_specifiers_no_type','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',44), + ('designation_opt -> empty','designation_opt',1,'p_designation_opt','plyparser.py',43), + ('designation_opt -> designation','designation_opt',1,'p_designation_opt','plyparser.py',44), + ('expression_opt -> empty','expression_opt',1,'p_expression_opt','plyparser.py',43), + ('expression_opt -> expression','expression_opt',1,'p_expression_opt','plyparser.py',44), + ('id_init_declarator_list_opt -> empty','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',43), + ('id_init_declarator_list_opt -> id_init_declarator_list','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',44), + ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',43), + ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',44), + ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',43), + ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',44), + ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',43), + ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',44), + ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',43), + ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',44), + ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',43), + ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',44), + ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',43), + ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',44), + ('direct_id_declarator -> ID','direct_id_declarator',1,'p_direct_id_declarator_1','plyparser.py',126), + ('direct_id_declarator -> LPAREN id_declarator RPAREN','direct_id_declarator',3,'p_direct_id_declarator_2','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_3','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',127), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_5','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN parameter_type_list RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN identifier_list_opt RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',127), + ('direct_typeid_declarator -> TYPEID','direct_typeid_declarator',1,'p_direct_typeid_declarator_1','plyparser.py',126), + ('direct_typeid_declarator -> LPAREN typeid_declarator RPAREN','direct_typeid_declarator',3,'p_direct_typeid_declarator_2','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_3','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',127), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_5','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN parameter_type_list RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',127), + ('direct_typeid_noparen_declarator -> TYPEID','direct_typeid_noparen_declarator',1,'p_direct_typeid_noparen_declarator_1','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_3','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',127), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_5','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',127), + ('id_declarator -> direct_id_declarator','id_declarator',1,'p_id_declarator_1','plyparser.py',126), + ('id_declarator -> pointer direct_id_declarator','id_declarator',2,'p_id_declarator_2','plyparser.py',126), + ('typeid_declarator -> direct_typeid_declarator','typeid_declarator',1,'p_typeid_declarator_1','plyparser.py',126), + ('typeid_declarator -> pointer direct_typeid_declarator','typeid_declarator',2,'p_typeid_declarator_2','plyparser.py',126), + ('typeid_noparen_declarator -> direct_typeid_noparen_declarator','typeid_noparen_declarator',1,'p_typeid_noparen_declarator_1','plyparser.py',126), + ('typeid_noparen_declarator -> pointer direct_typeid_noparen_declarator','typeid_noparen_declarator',2,'p_typeid_noparen_declarator_2','plyparser.py',126), + ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',514), + ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',515), + ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','c_parser.py',523), + ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','c_parser.py',530), + ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','c_parser.py',541), + ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','c_parser.py',546), + ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',551), + ('external_declaration -> pppragma_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',552), + ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','c_parser.py',557), + ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','c_parser.py',562), + ('pppragma_directive -> PPPRAGMA','pppragma_directive',1,'p_pppragma_directive','c_parser.py',568), + ('pppragma_directive -> PPPRAGMA PPPRAGMASTR','pppragma_directive',2,'p_pppragma_directive','c_parser.py',569), + ('function_definition -> id_declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','c_parser.py',580), + ('function_definition -> declaration_specifiers id_declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','c_parser.py',597), + ('statement -> labeled_statement','statement',1,'p_statement','c_parser.py',608), + ('statement -> expression_statement','statement',1,'p_statement','c_parser.py',609), + ('statement -> compound_statement','statement',1,'p_statement','c_parser.py',610), + ('statement -> selection_statement','statement',1,'p_statement','c_parser.py',611), + ('statement -> iteration_statement','statement',1,'p_statement','c_parser.py',612), + ('statement -> jump_statement','statement',1,'p_statement','c_parser.py',613), + ('statement -> pppragma_directive','statement',1,'p_statement','c_parser.py',614), + ('pragmacomp_or_statement -> pppragma_directive statement','pragmacomp_or_statement',2,'p_pragmacomp_or_statement','c_parser.py',661), + ('pragmacomp_or_statement -> statement','pragmacomp_or_statement',1,'p_pragmacomp_or_statement','c_parser.py',662), + ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',681), + ('decl_body -> declaration_specifiers_no_type id_init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',682), + ('declaration -> decl_body SEMI','declaration',2,'p_declaration','c_parser.py',741), + ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','c_parser.py',750), + ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','c_parser.py',751), + ('declaration_specifiers_no_type -> type_qualifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_1','c_parser.py',761), + ('declaration_specifiers_no_type -> storage_class_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_2','c_parser.py',766), + ('declaration_specifiers_no_type -> function_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_3','c_parser.py',771), + ('declaration_specifiers -> declaration_specifiers type_qualifier','declaration_specifiers',2,'p_declaration_specifiers_1','c_parser.py',777), + ('declaration_specifiers -> declaration_specifiers storage_class_specifier','declaration_specifiers',2,'p_declaration_specifiers_2','c_parser.py',782), + ('declaration_specifiers -> declaration_specifiers function_specifier','declaration_specifiers',2,'p_declaration_specifiers_3','c_parser.py',787), + ('declaration_specifiers -> declaration_specifiers type_specifier_no_typeid','declaration_specifiers',2,'p_declaration_specifiers_4','c_parser.py',792), + ('declaration_specifiers -> type_specifier','declaration_specifiers',1,'p_declaration_specifiers_5','c_parser.py',797), + ('declaration_specifiers -> declaration_specifiers_no_type type_specifier','declaration_specifiers',2,'p_declaration_specifiers_6','c_parser.py',802), + ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',808), + ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',809), + ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',810), + ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',811), + ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',812), + ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','c_parser.py',817), + ('type_specifier_no_typeid -> VOID','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',822), + ('type_specifier_no_typeid -> _BOOL','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',823), + ('type_specifier_no_typeid -> CHAR','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',824), + ('type_specifier_no_typeid -> SHORT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',825), + ('type_specifier_no_typeid -> INT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',826), + ('type_specifier_no_typeid -> LONG','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',827), + ('type_specifier_no_typeid -> FLOAT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',828), + ('type_specifier_no_typeid -> DOUBLE','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',829), + ('type_specifier_no_typeid -> _COMPLEX','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',830), + ('type_specifier_no_typeid -> SIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',831), + ('type_specifier_no_typeid -> UNSIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',832), + ('type_specifier_no_typeid -> __INT128','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',833), + ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier','c_parser.py',838), + ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier','c_parser.py',839), + ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier','c_parser.py',840), + ('type_specifier -> type_specifier_no_typeid','type_specifier',1,'p_type_specifier','c_parser.py',841), + ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','c_parser.py',846), + ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','c_parser.py',847), + ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','c_parser.py',848), + ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list','c_parser.py',853), + ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list','c_parser.py',854), + ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','c_parser.py',862), + ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','c_parser.py',863), + ('id_init_declarator_list -> id_init_declarator','id_init_declarator_list',1,'p_id_init_declarator_list','c_parser.py',868), + ('id_init_declarator_list -> id_init_declarator_list COMMA init_declarator','id_init_declarator_list',3,'p_id_init_declarator_list','c_parser.py',869), + ('id_init_declarator -> id_declarator','id_init_declarator',1,'p_id_init_declarator','c_parser.py',874), + ('id_init_declarator -> id_declarator EQUALS initializer','id_init_declarator',3,'p_id_init_declarator','c_parser.py',875), + ('specifier_qualifier_list -> specifier_qualifier_list type_specifier_no_typeid','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','c_parser.py',882), + ('specifier_qualifier_list -> specifier_qualifier_list type_qualifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','c_parser.py',887), + ('specifier_qualifier_list -> type_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_3','c_parser.py',892), + ('specifier_qualifier_list -> type_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_4','c_parser.py',897), + ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',906), + ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',907), + ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','c_parser.py',917), + ('struct_or_union_specifier -> struct_or_union brace_open brace_close','struct_or_union_specifier',3,'p_struct_or_union_specifier_2','c_parser.py',918), + ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',935), + ('struct_or_union_specifier -> struct_or_union ID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',936), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',937), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',938), + ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','c_parser.py',954), + ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','c_parser.py',955), + ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','c_parser.py',962), + ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','c_parser.py',963), + ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','c_parser.py',971), + ('struct_declaration -> SEMI','struct_declaration',1,'p_struct_declaration_2','c_parser.py',1009), + ('struct_declaration -> pppragma_directive','struct_declaration',1,'p_struct_declaration_3','c_parser.py',1014), + ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','c_parser.py',1019), + ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','c_parser.py',1020), + ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','c_parser.py',1028), + ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','c_parser.py',1033), + ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','c_parser.py',1034), + ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1042), + ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1043), + ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','c_parser.py',1048), + ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1053), + ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1054), + ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','c_parser.py',1059), + ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','c_parser.py',1060), + ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','c_parser.py',1061), + ('enumerator -> ID','enumerator',1,'p_enumerator','c_parser.py',1072), + ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','c_parser.py',1073), + ('declarator -> id_declarator','declarator',1,'p_declarator','c_parser.py',1088), + ('declarator -> typeid_declarator','declarator',1,'p_declarator','c_parser.py',1089), + ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','c_parser.py',1200), + ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','c_parser.py',1201), + ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','c_parser.py',1230), + ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','c_parser.py',1231), + ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','c_parser.py',1236), + ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','c_parser.py',1237), + ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','c_parser.py',1245), + ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','c_parser.py',1246), + ('parameter_declaration -> declaration_specifiers id_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1265), + ('parameter_declaration -> declaration_specifiers typeid_noparen_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1266), + ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','c_parser.py',1277), + ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','c_parser.py',1308), + ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','c_parser.py',1309), + ('initializer -> assignment_expression','initializer',1,'p_initializer_1','c_parser.py',1318), + ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','c_parser.py',1323), + ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','c_parser.py',1324), + ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','c_parser.py',1332), + ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','c_parser.py',1333), + ('designation -> designator_list EQUALS','designation',2,'p_designation','c_parser.py',1344), + ('designator_list -> designator','designator_list',1,'p_designator_list','c_parser.py',1352), + ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','c_parser.py',1353), + ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','c_parser.py',1358), + ('designator -> PERIOD identifier','designator',2,'p_designator','c_parser.py',1359), + ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','c_parser.py',1364), + ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','c_parser.py',1375), + ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','c_parser.py',1383), + ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','c_parser.py',1388), + ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','c_parser.py',1398), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','c_parser.py',1402), + ('direct_abstract_declarator -> LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_3','c_parser.py',1413), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','c_parser.py',1423), + ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','c_parser.py',1434), + ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','c_parser.py',1443), + ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','c_parser.py',1453), + ('block_item -> declaration','block_item',1,'p_block_item','c_parser.py',1464), + ('block_item -> statement','block_item',1,'p_block_item','c_parser.py',1465), + ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','c_parser.py',1472), + ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','c_parser.py',1473), + ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','c_parser.py',1479), + ('labeled_statement -> ID COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_1','c_parser.py',1485), + ('labeled_statement -> CASE constant_expression COLON pragmacomp_or_statement','labeled_statement',4,'p_labeled_statement_2','c_parser.py',1489), + ('labeled_statement -> DEFAULT COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_3','c_parser.py',1493), + ('selection_statement -> IF LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_1','c_parser.py',1497), + ('selection_statement -> IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement','selection_statement',7,'p_selection_statement_2','c_parser.py',1501), + ('selection_statement -> SWITCH LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_3','c_parser.py',1505), + ('iteration_statement -> WHILE LPAREN expression RPAREN pragmacomp_or_statement','iteration_statement',5,'p_iteration_statement_1','c_parser.py',1510), + ('iteration_statement -> DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','c_parser.py',1514), + ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',9,'p_iteration_statement_3','c_parser.py',1518), + ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',8,'p_iteration_statement_4','c_parser.py',1522), + ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','c_parser.py',1527), + ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','c_parser.py',1531), + ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','c_parser.py',1535), + ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','c_parser.py',1539), + ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','c_parser.py',1540), + ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','c_parser.py',1545), + ('expression -> assignment_expression','expression',1,'p_expression','c_parser.py',1552), + ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','c_parser.py',1553), + ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','c_parser.py',1565), + ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','c_parser.py',1569), + ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','c_parser.py',1570), + ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','c_parser.py',1583), + ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1584), + ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1585), + ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1586), + ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1587), + ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1588), + ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1589), + ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1590), + ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1591), + ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1592), + ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1593), + ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','c_parser.py',1598), + ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','c_parser.py',1602), + ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','c_parser.py',1603), + ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','c_parser.py',1611), + ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1612), + ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1613), + ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1614), + ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1615), + ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1616), + ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1617), + ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1618), + ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1619), + ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1620), + ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1621), + ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1622), + ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1623), + ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1624), + ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1625), + ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1626), + ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1627), + ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1628), + ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1629), + ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','c_parser.py',1637), + ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','c_parser.py',1641), + ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','c_parser.py',1645), + ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1649), + ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1650), + ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1651), + ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','c_parser.py',1656), + ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1657), + ('unary_operator -> AND','unary_operator',1,'p_unary_operator','c_parser.py',1665), + ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','c_parser.py',1666), + ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','c_parser.py',1667), + ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','c_parser.py',1668), + ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','c_parser.py',1669), + ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','c_parser.py',1670), + ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','c_parser.py',1675), + ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','c_parser.py',1679), + ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','c_parser.py',1683), + ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','c_parser.py',1684), + ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1689), + ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1690), + ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1691), + ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1692), + ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1698), + ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1699), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','c_parser.py',1704), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','c_parser.py',1705), + ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','c_parser.py',1710), + ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','c_parser.py',1714), + ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1718), + ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1719), + ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','c_parser.py',1724), + ('primary_expression -> OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN','primary_expression',6,'p_primary_expression_5','c_parser.py',1728), + ('offsetof_member_designator -> identifier','offsetof_member_designator',1,'p_offsetof_member_designator','c_parser.py',1736), + ('offsetof_member_designator -> offsetof_member_designator PERIOD identifier','offsetof_member_designator',3,'p_offsetof_member_designator','c_parser.py',1737), + ('offsetof_member_designator -> offsetof_member_designator LBRACKET expression RBRACKET','offsetof_member_designator',4,'p_offsetof_member_designator','c_parser.py',1738), + ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','c_parser.py',1751), + ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','c_parser.py',1752), + ('identifier -> ID','identifier',1,'p_identifier','c_parser.py',1761), + ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','c_parser.py',1765), + ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','c_parser.py',1766), + ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','c_parser.py',1767), + ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','c_parser.py',1768), + ('constant -> FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1787), + ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1788), + ('constant -> CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1804), + ('constant -> WCHAR_CONST','constant',1,'p_constant_3','c_parser.py',1805), + ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','c_parser.py',1816), + ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','c_parser.py',1817), + ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1827), + ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1828), + ('brace_open -> LBRACE','brace_open',1,'p_brace_open','c_parser.py',1838), + ('brace_close -> RBRACE','brace_close',1,'p_brace_close','c_parser.py',1844), + ('empty -> ','empty',0,'p_empty','c_parser.py',1850), ] From pypy.commits at gmail.com Sat Sep 21 20:11:49 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 21 Sep 2019 17:11:49 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: back out b2dd9b388196 and reinstate abe60bf6dc7b Message-ID: <5d86bc45.1c69fb81.c2adb.9e66@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97587:e0c3eceb2db4 Date: 2019-09-22 00:45 +0300 http://bitbucket.org/pypy/pypy/changeset/e0c3eceb2db4/ Log: back out b2dd9b388196 and reinstate abe60bf6dc7b diff --git a/pypy/interpreter/pyparser/test/apptest_parsestring.py b/pypy/interpreter/pyparser/test/apptest_parsestring.py --- a/pypy/interpreter/pyparser/test/apptest_parsestring.py +++ b/pypy/interpreter/pyparser/test/apptest_parsestring.py @@ -8,3 +8,11 @@ eval("b'''\n\\z'''") assert not w assert excinfo.value.filename == '' + +def test_str_invalid_escape(): + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('error', category=DeprecationWarning) + with raises(SyntaxError) as excinfo: + eval("'''\n\\z'''") + assert not w + assert excinfo.value.filename == '' diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -130,6 +130,15 @@ final=True, errorhandler=state.decode_error_handler, ud_handler=unicodedata_handler) + if first_escape_error_char is not None: + msg = "invalid escape sequence '%s'" + try: + space.warn(space.newtext(msg % first_escape_error_char), space.w_DeprecationWarning) + except OperationError as e: + if e.match(space, space.w_DeprecationWarning): + raise oefmt(space.w_SyntaxError, msg, first_escape_error_char) + else: + raise return s, ulen, blen def decode_raw_unicode_escape(space, string): From pypy.commits at gmail.com Sat Sep 21 20:11:46 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 21 Sep 2019 17:11:46 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default into py3.6 Message-ID: <5d86bc42.1c69fb81.ec56c.906a@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97586:9d896e4b91a8 Date: 2019-09-22 00:38 +0300 http://bitbucket.org/pypy/pypy/changeset/9d896e4b91a8/ Log: merge default into py3.6 diff --git a/lib_pypy/cffi/_pycparser/README b/lib_pypy/cffi/_pycparser/README --- a/lib_pypy/cffi/_pycparser/README +++ b/lib_pypy/cffi/_pycparser/README @@ -10,3 +10,8 @@ ^^^^^^^^^^^^^^^ yacctab='cffi._pycparser.yacctab', ^^^^^^^^^^^^^^^ + +Also, when updating the version of this in-place, you must regenerate the +lextab.py and yacctab.py files. They will be regenerated on import if they +are not found, so they should be removed, then regenrated, then the new +versions committed. diff --git a/lib_pypy/cffi/_pycparser/_c_ast.cfg b/lib_pypy/cffi/_pycparser/_c_ast.cfg --- a/lib_pypy/cffi/_pycparser/_c_ast.cfg +++ b/lib_pypy/cffi/_pycparser/_c_ast.cfg @@ -9,7 +9,7 @@ # ** - a sequence of child nodes # - an attribute # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- @@ -187,3 +187,5 @@ Union: [name, decls**] While: [cond*, stmt*] + +Pragma: [string] diff --git a/lib_pypy/cffi/_pycparser/lextab.py b/lib_pypy/cffi/_pycparser/lextab.py --- a/lib_pypy/cffi/_pycparser/lextab.py +++ b/lib_pypy/cffi/_pycparser/lextab.py @@ -1,9 +1,10 @@ -# pycparser.lextab.py. This file automatically created by PLY (version 3.4). Don't edit! -_tabversion = '3.4' -_lextokens = {'VOID': 1, 'LBRACKET': 1, 'WCHAR_CONST': 1, 'FLOAT_CONST': 1, 'MINUS': 1, 'RPAREN': 1, 'LONG': 1, 'PLUS': 1, 'ELLIPSIS': 1, 'GT': 1, 'GOTO': 1, 'ENUM': 1, 'PERIOD': 1, 'GE': 1, 'INT_CONST_DEC': 1, 'ARROW': 1, 'HEX_FLOAT_CONST': 1, 'DOUBLE': 1, 'MINUSEQUAL': 1, 'INT_CONST_OCT': 1, 'TIMESEQUAL': 1, 'OR': 1, 'SHORT': 1, 'RETURN': 1, 'RSHIFTEQUAL': 1, 'RESTRICT': 1, 'STATIC': 1, 'SIZEOF': 1, 'UNSIGNED': 1, 'UNION': 1, 'COLON': 1, 'WSTRING_LITERAL': 1, 'DIVIDE': 1, 'FOR': 1, 'PLUSPLUS': 1, 'EQUALS': 1, 'ELSE': 1, 'INLINE': 1, 'EQ': 1, 'AND': 1, 'TYPEID': 1, 'LBRACE': 1, 'PPHASH': 1, 'INT': 1, 'SIGNED': 1, 'CONTINUE': 1, 'NOT': 1, 'OREQUAL': 1, 'MOD': 1, 'RSHIFT': 1, 'DEFAULT': 1, 'CHAR': 1, 'WHILE': 1, 'DIVEQUAL': 1, 'EXTERN': 1, 'CASE': 1, 'LAND': 1, 'REGISTER': 1, 'MODEQUAL': 1, 'NE': 1, 'SWITCH': 1, 'INT_CONST_HEX': 1, '_COMPLEX': 1, 'PLUSEQUAL': 1, 'STRUCT': 1, 'CONDOP': 1, 'BREAK': 1, 'VOLATILE': 1, 'ANDEQUAL': 1, 'INT_CONST_BIN': 1, 'DO': 1, 'LNOT': 1, 'CONST': 1, 'LOR': 1, 'CHAR_CONST': 1, 'LSHIFT': 1, 'RBRACE': 1, '_BOOL': 1, 'LE': 1, 'SEMI': 1, 'LT': 1, 'COMMA': 1, 'OFFSETOF': 1, 'TYPEDEF': 1, 'XOR': 1, 'AUTO': 1, 'TIMES': 1, 'LPAREN': 1, 'MINUSMINUS': 1, 'ID': 1, 'IF': 1, 'STRING_LITERAL': 1, 'FLOAT': 1, 'XOREQUAL': 1, 'LSHIFTEQUAL': 1, 'RBRACKET': 1} -_lexreflags = 0 +# lextab.py. This file automatically created by PLY (version 3.10). Don't edit! +_tabversion = '3.10' +_lextokens = set(('_BOOL', '_COMPLEX', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN', 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', 'REGISTER', 'OFFSETOF', 'RESTRICT', 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', 'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID', 'VOLATILE', 'WHILE', '__INT128', 'ID', 'TYPEID', 'INT_CONST_DEC', 'INT_CONST_OCT', 'INT_CONST_HEX', 'INT_CONST_BIN', 'FLOAT_CONST', 'HEX_FLOAT_CONST', 'CHAR_CONST', 'WCHAR_CONST', 'STRING_LITERAL', 'WSTRING_LITERAL', 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MOD', 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', 'LOR', 'LAND', 'LNOT', 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', 'PLUSEQUAL', 'MINUSEQUAL', 'LSHIFTEQUAL', 'RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', 'OREQUAL', 'PLUSPLUS', 'MINUSMINUS', 'ARROW', 'CONDOP', 'LPAREN', 'RPAREN', 'LBRACKET', 'RBRACKET', 'LBRACE', 'RBRACE', 'COMMA', 'PERIOD', 'SEMI', 'COLON', 'ELLIPSIS', 'PPHASH', 'PPPRAGMA', 'PPPRAGMASTR')) +_lexreflags = 64 _lexliterals = '' -_lexstateinfo = {'ppline': 'exclusive', 'pppragma': 'exclusive', 'INITIAL': 'inclusive'} -_lexstatere = {'ppline': [('(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, None, None, None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR'), None, None, None, None, None, None, ('t_pppragma_ID', 'ID')])], 'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P\\.\\.\\.)|(?P\\+\\+)|(?P\\|\\|)|(?P\\^=)|(?P\\|=)|(?P<<=)|(?P>>=)|(?P\\+=)|(?P\\*=)|(?P\\+)|(?P%=)|(?P/=)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, None, None, None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, None, None, None, None, (None, 'ELLIPSIS'), (None, 'PLUSPLUS'), (None, 'LOR'), (None, 'XOREQUAL'), (None, 'OREQUAL'), (None, 'LSHIFTEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'PLUSEQUAL'), (None, 'TIMESEQUAL'), (None, 'PLUS'), (None, 'MODEQUAL'), (None, 'DIVEQUAL')]), ('(?P\\])|(?P\\?)|(?P\\^)|(?P<<)|(?P<=)|(?P\\()|(?P->)|(?P==)|(?P!=)|(?P--)|(?P\\|)|(?P\\*)|(?P\\[)|(?P>=)|(?P\\))|(?P&&)|(?P>>)|(?P-=)|(?P\\.)|(?P&=)|(?P=)|(?P<)|(?P,)|(?P/)|(?P&)|(?P%)|(?P;)|(?P-)|(?P>)|(?P:)|(?P~)|(?P!)', [None, (None, 'RBRACKET'), (None, 'CONDOP'), (None, 'XOR'), (None, 'LSHIFT'), (None, 'LE'), (None, 'LPAREN'), (None, 'ARROW'), (None, 'EQ'), (None, 'NE'), (None, 'MINUSMINUS'), (None, 'OR'), (None, 'TIMES'), (None, 'LBRACKET'), (None, 'GE'), (None, 'RPAREN'), (None, 'LAND'), (None, 'RSHIFT'), (None, 'MINUSEQUAL'), (None, 'PERIOD'), (None, 'ANDEQUAL'), (None, 'EQUALS'), (None, 'LT'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'AND'), (None, 'MOD'), (None, 'SEMI'), (None, 'MINUS'), (None, 'GT'), (None, 'COLON'), (None, 'NOT'), (None, 'LNOT')])]} -_lexstateignore = {'ppline': ' \t', 'pppragma': ' \t<>.-{}();=+-*/$%@&^~!?:,0123456789', 'INITIAL': ' \t'} -_lexstateerrorf = {'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error', 'INITIAL': 't_error'} +_lexstateinfo = {'INITIAL': 'inclusive', 'ppline': 'exclusive', 'pppragma': 'exclusive'} +_lexstatere = {'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-9])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-9])([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P\\.\\.\\.)|(?P\\|\\|)|(?P\\+\\+)|(?P<<=)|(?P\\|=)|(?P\\+=)|(?P>>=)|(?P\\*=)|(?P\\^=)|(?P&=)|(?P->)|(?P\\?)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, (None, 'ELLIPSIS'), (None, 'LOR'), (None, 'PLUSPLUS'), (None, 'LSHIFTEQUAL'), (None, 'OREQUAL'), (None, 'PLUSEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'TIMESEQUAL'), (None, 'XOREQUAL'), (None, 'ANDEQUAL'), (None, 'ARROW'), (None, 'CONDOP')]), ('(?P/=)|(?P==)|(?P>=)|(?P&&)|(?P\\[)|(?P<=)|(?P\\()|(?P<<)|(?P-=)|(?P--)|(?P%=)|(?P!=)|(?P\\|)|(?P\\.)|(?P\\+)|(?P\\])|(?P\\))|(?P>>)|(?P\\*)|(?P\\^)|(?P&)|(?P:)|(?P,)|(?P/)|(?P=)|(?P>)|(?P!)|(?P<)|(?P-)|(?P%)|(?P~)|(?P;)', [None, (None, 'DIVEQUAL'), (None, 'EQ'), (None, 'GE'), (None, 'LAND'), (None, 'LBRACKET'), (None, 'LE'), (None, 'LPAREN'), (None, 'LSHIFT'), (None, 'MINUSEQUAL'), (None, 'MINUSMINUS'), (None, 'MODEQUAL'), (None, 'NE'), (None, 'OR'), (None, 'PERIOD'), (None, 'PLUS'), (None, 'RBRACKET'), (None, 'RPAREN'), (None, 'RSHIFT'), (None, 'TIMES'), (None, 'XOR'), (None, 'AND'), (None, 'COLON'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'EQUALS'), (None, 'GT'), (None, 'LNOT'), (None, 'LT'), (None, 'MINUS'), (None, 'MOD'), (None, 'NOT'), (None, 'SEMI')])], 'ppline': [('(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P.+)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR')])]} +_lexstateignore = {'INITIAL': ' \t', 'ppline': ' \t', 'pppragma': ' \t'} +_lexstateerrorf = {'INITIAL': 't_error', 'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error'} +_lexstateeoff = {} diff --git a/lib_pypy/cffi/_pycparser/yacctab.py b/lib_pypy/cffi/_pycparser/yacctab.py --- a/lib_pypy/cffi/_pycparser/yacctab.py +++ b/lib_pypy/cffi/_pycparser/yacctab.py @@ -1,292 +1,338 @@ # yacctab.py # This file is automatically generated. Do not edit. -_tabversion = '3.2' +_tabversion = '3.10' _lr_method = 'LALR' -_lr_signature = '\x11\x82\x05\xfb:\x10\xfeo5\xb4\x11N\xe7S\xb4b' +_lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMOD_BOOL _COMPLEX AUTO BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM EXTERN FLOAT FOR GOTO IF INLINE INT LONG REGISTER OFFSETOF RESTRICT RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH TYPEDEF UNION UNSIGNED VOID VOLATILE WHILE __INT128 ID TYPEID INT_CONST_DEC INT_CONST_OCT INT_CONST_HEX INT_CONST_BIN FLOAT_CONST HEX_FLOAT_CONST CHAR_CONST WCHAR_CONST STRING_LITERAL WSTRING_LITERAL PLUS MINUS TIMES DIVIDE MOD OR AND NOT XOR LSHIFT RSHIFT LOR LAND LNOT LT LE GT GE EQ NE EQUALS TIMESEQUAL DIVEQUAL MODEQUAL PLUSEQUAL MINUSEQUAL LSHIFTEQUAL RSHIFTEQUAL ANDEQUAL XOREQUAL OREQUAL PLUSPLUS MINUSMINUS ARROW CONDOP LPAREN RPAREN LBRACKET RBRACKET LBRACE RBRACE COMMA PERIOD SEMI COLON ELLIPSIS PPHASH PPPRAGMA PPPRAGMASTRabstract_declarator_opt : empty\n| abstract_declaratorassignment_expression_opt : empty\n| assignment_expressionblock_item_list_opt : empty\n| block_item_listdeclaration_list_opt : empty\n| declaration_listdeclaration_specifiers_no_type_opt : empty\n| declaration_specifiers_no_typedesignation_opt : empty\n| designationexpression_opt : empty\n| expressionid_init_declarator_list_opt : empty\n| id_init_declarator_listidentifier_list_opt : empty\n| identifier_listinit_declarator_list_opt : empty\n| init_declarator_listinitializer_list_opt : empty\n| initializer_listparameter_type_list_opt : empty\n| parameter_type_liststruct_declarator_list_opt : empty\n| struct_declarator_listtype_qualifier_list_opt : empty\n| type_qualifier_list direct_id_declarator : ID\n direct_id_declarator : LPAREN id_declarator RPAREN\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_id_declarator : direct_id_declarator LPAREN parameter_type_list RPAREN\n | direct_id_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_declarator : TYPEID\n direct_typeid_declarator : LPAREN typeid_declarator RPAREN\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_noparen_declarator : TYPEID\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN\n id_declarator : direct_id_declarator\n id_declarator : pointer direct_id_declarator\n typeid_declarator : direct_typeid_declarator\n typeid_declarator : pointer direct_typeid_declarator\n typeid_noparen_declarator : direct_typeid_noparen_declarator\n typeid_noparen_declarator : pointer direct_typeid_noparen_declarator\n translation_unit_or_empty : translation_unit\n | empty\n translation_unit : external_declaration\n translation_unit : translation_unit external_declaration\n external_declaration : function_definition\n external_declaration : declaration\n external_declaration : pp_directive\n | pppragma_directive\n external_declaration : SEMI\n pp_directive : PPHASH\n pppragma_directive : PPPRAGMA\n | PPPRAGMA PPPRAGMASTR\n function_definition : id_declarator declaration_list_opt compound_statement\n function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement\n statement : labeled_statement\n | expression_statement\n | compound_statement\n | selection_statement\n | iteration_statement\n | jump_statement\n | pppragma_directive\n pragmacomp_or_statement : pppragma_directive statement\n | statement\n decl_body : declaration_specifiers init_declarator_list_opt\n | declaration_specifiers_no_type id_init_declarator_list_opt\n declaration : decl_body SEMI\n declaration_list : declaration\n | declaration_list declaration\n declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt\n declaration_specifiers : declaration_specifiers type_qualifier\n declaration_specifiers : declaration_specifiers storage_class_specifier\n declaration_specifiers : declaration_specifiers function_specifier\n declaration_specifiers : declaration_specifiers type_specifier_no_typeid\n declaration_specifiers : type_specifier\n declaration_specifiers : declaration_specifiers_no_type type_specifier\n storage_class_specifier : AUTO\n | REGISTER\n | STATIC\n | EXTERN\n | TYPEDEF\n function_specifier : INLINE\n type_specifier_no_typeid : VOID\n | _BOOL\n | CHAR\n | SHORT\n | INT\n | LONG\n | FLOAT\n | DOUBLE\n | _COMPLEX\n | SIGNED\n | UNSIGNED\n | __INT128\n type_specifier : typedef_name\n | enum_specifier\n | struct_or_union_specifier\n | type_specifier_no_typeid\n type_qualifier : CONST\n | RESTRICT\n | VOLATILE\n init_declarator_list : init_declarator\n | init_declarator_list COMMA init_declarator\n init_declarator : declarator\n | declarator EQUALS initializer\n id_init_declarator_list : id_init_declarator\n | id_init_declarator_list COMMA init_declarator\n id_init_declarator : id_declarator\n | id_declarator EQUALS initializer\n specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid\n specifier_qualifier_list : specifier_qualifier_list type_qualifier\n specifier_qualifier_list : type_specifier\n specifier_qualifier_list : type_qualifier_list type_specifier\n struct_or_union_specifier : struct_or_union ID\n | struct_or_union TYPEID\n struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close\n | struct_or_union brace_open brace_close\n struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close\n | struct_or_union ID brace_open brace_close\n | struct_or_union TYPEID brace_open struct_declaration_list brace_close\n | struct_or_union TYPEID brace_open brace_close\n struct_or_union : STRUCT\n | UNION\n struct_declaration_list : struct_declaration\n | struct_declaration_list struct_declaration\n struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI\n struct_declaration : SEMI\n struct_declaration : pppragma_directive\n struct_declarator_list : struct_declarator\n | struct_declarator_list COMMA struct_declarator\n struct_declarator : declarator\n struct_declarator : declarator COLON constant_expression\n | COLON constant_expression\n enum_specifier : ENUM ID\n | ENUM TYPEID\n enum_specifier : ENUM brace_open enumerator_list brace_close\n enum_specifier : ENUM ID brace_open enumerator_list brace_close\n | ENUM TYPEID brace_open enumerator_list brace_close\n enumerator_list : enumerator\n | enumerator_list COMMA\n | enumerator_list COMMA enumerator\n enumerator : ID\n | ID EQUALS constant_expression\n declarator : id_declarator\n | typeid_declarator\n pointer : TIMES type_qualifier_list_opt\n | TIMES type_qualifier_list_opt pointer\n type_qualifier_list : type_qualifier\n | type_qualifier_list type_qualifier\n parameter_type_list : parameter_list\n | parameter_list COMMA ELLIPSIS\n parameter_list : parameter_declaration\n | parameter_list COMMA parameter_declaration\n parameter_declaration : declaration_specifiers id_declarator\n | declaration_specifiers typeid_noparen_declarator\n parameter_declaration : declaration_specifiers abstract_declarator_opt\n identifier_list : identifier\n | identifier_list COMMA identifier\n initializer : assignment_expression\n initializer : brace_open initializer_list_opt brace_close\n | brace_open initializer_list COMMA brace_close\n initializer_list : designation_opt initializer\n | initializer_list COMMA designation_opt initializer\n designation : designator_list EQUALS\n designator_list : designator\n | designator_list designator\n designator : LBRACKET constant_expression RBRACKET\n | PERIOD identifier\n type_name : specifier_qualifier_list abstract_declarator_opt\n abstract_declarator : pointer\n abstract_declarator : pointer direct_abstract_declarator\n abstract_declarator : direct_abstract_declarator\n direct_abstract_declarator : LPAREN abstract_declarator RPAREN direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET\n direct_abstract_declarator : LBRACKET TIMES RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN\n direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN\n block_item : declaration\n | statement\n block_item_list : block_item\n | block_item_list block_item\n compound_statement : brace_open block_item_list_opt brace_close labeled_statement : ID COLON pragmacomp_or_statement labeled_statement : CASE constant_expression COLON pragmacomp_or_statement labeled_statement : DEFAULT COLON pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement jump_statement : GOTO ID SEMI jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI\n | RETURN SEMI\n expression_statement : expression_opt SEMI expression : assignment_expression\n | expression COMMA assignment_expression\n typedef_name : TYPEID assignment_expression : conditional_expression\n | unary_expression assignment_operator assignment_expression\n assignment_operator : EQUALS\n | XOREQUAL\n | TIMESEQUAL\n | DIVEQUAL\n | MODEQUAL\n | PLUSEQUAL\n | MINUSEQUAL\n | LSHIFTEQUAL\n | RSHIFTEQUAL\n | ANDEQUAL\n | OREQUAL\n constant_expression : conditional_expression conditional_expression : binary_expression\n | binary_expression CONDOP expression COLON conditional_expression\n binary_expression : cast_expression\n | binary_expression TIMES binary_expression\n | binary_expression DIVIDE binary_expression\n | binary_expression MOD binary_expression\n | binary_expression PLUS binary_expression\n | binary_expression MINUS binary_expression\n | binary_expression RSHIFT binary_expression\n | binary_expression LSHIFT binary_expression\n | binary_expression LT binary_expression\n | binary_expression LE binary_expression\n | binary_expression GE binary_expression\n | binary_expression GT binary_expression\n | binary_expression EQ binary_expression\n | binary_expression NE binary_expression\n | binary_expression AND binary_expression\n | binary_expression OR binary_expression\n | binary_expression XOR binary_expression\n | binary_expression LAND binary_expression\n | binary_expression LOR binary_expression\n cast_expression : unary_expression cast_expression : LPAREN type_name RPAREN cast_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression\n | MINUSMINUS unary_expression\n | unary_operator cast_expression\n unary_expression : SIZEOF unary_expression\n | SIZEOF LPAREN type_name RPAREN\n unary_operator : AND\n | TIMES\n | PLUS\n | MINUS\n | NOT\n | LNOT\n postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN\n | postfix_expression LPAREN RPAREN\n postfix_expression : postfix_expression PERIOD ID\n | postfix_expression PERIOD TYPEID\n | postfix_expression ARROW ID\n | postfix_expression ARROW TYPEID\n postfix_expression : postfix_expression PLUSPLUS\n | postfix_expression MINUSMINUS\n postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close\n | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close\n primary_expression : identifier primary_expression : constant primary_expression : unified_string_literal\n | unified_wstring_literal\n primary_expression : LPAREN expression RPAREN primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN\n offsetof_member_designator : identifier\n | offsetof_member_designator PERIOD identifier\n | offsetof_member_designator LBRACKET expression RBRACKET\n argument_expression_list : assignment_expression\n | argument_expression_list COMMA assignment_expression\n identifier : ID constant : INT_CONST_DEC\n | INT_CONST_OCT\n | INT_CONST_HEX\n | INT_CONST_BIN\n constant : FLOAT_CONST\n | HEX_FLOAT_CONST\n constant : CHAR_CONST\n | WCHAR_CONST\n unified_string_literal : STRING_LITERAL\n | unified_string_literal STRING_LITERAL\n unified_wstring_literal : WSTRING_LITERAL\n | unified_wstring_literal WSTRING_LITERAL\n brace_open : LBRACE\n brace_close : RBRACE\n empty : ' -_lr_action_items = {'VOID':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[6,6,-63,-74,-73,-60,-56,-57,-35,-31,-61,6,-36,-55,-70,-65,-54,6,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,6,-69,6,-72,-76,6,-59,-86,-261,-85,6,-113,-112,-32,-102,-101,6,6,6,-47,-48,6,-115,6,6,6,6,-92,6,6,6,6,-38,6,-49,6,6,-87,-93,-262,-103,-121,-120,6,6,6,6,6,-39,-41,-44,-40,-42,6,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,6,-175,-174,6,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LBRACKET':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,30,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,60,62,63,67,68,69,70,74,78,81,83,84,86,90,94,96,97,110,112,115,116,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,153,155,166,167,174,176,177,178,179,180,191,197,198,218,221,222,224,228,235,239,262,267,269,270,300,302,303,310,311,314,315,323,324,325,326,329,334,338,339,360,362,364,366,367,368,388,389,391,392,399,401,428,429,430,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,65,-68,-263,-71,72,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,65,-102,-101,-28,-122,-124,-27,72,72,164,-50,-53,72,-115,-263,-263,72,72,-248,-125,-123,-252,-243,-255,-259,-256,-253,-241,-242,226,-251,-228,-257,-249,-240,-254,-250,164,264,72,72,-87,-262,-23,-84,-24,-83,-103,-121,-120,-260,-258,-237,-236,-150,-152,72,-140,264,-154,-148,-248,-89,-88,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,72,72,-143,264,-141,-149,-151,-153,-118,-117,-229,-230,264,-142,-245,264,-238,-239,]),'WCHAR_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,124,124,-47,124,-28,-263,-125,-227,124,-225,124,-224,124,-223,124,124,-222,-226,-263,-223,124,124,124,-262,124,124,-223,124,124,-184,-187,-185,-181,-182,-186,-188,124,-190,-191,-183,-189,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,-12,124,124,-11,-223,-41,-44,-40,124,-42,124,124,-156,-155,-45,-157,124,-43,124,124,124,-263,-139,-175,-174,124,-172,124,124,-158,124,-171,-159,124,124,124,124,-263,124,124,-11,-170,-173,124,-162,124,-160,124,124,-161,124,124,124,-263,124,-166,-165,-163,124,124,124,-167,-164,124,-169,-168,]),'FLOAT_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,125,125,-47,125,-28,-263,-125,-227,125,-225,125,-224,125,-223,125,125,-222,-226,-263,-223,125,125,125,-262,125,125,-223,125,125,-184,-187,-185,-181,-182,-186,-188,125,-190,-191,-183,-189,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,-12,125,125,-11,-223,-41,-44,-40,125,-42,125,125,-156,-155,-45,-157,125,-43,125,125,125,-263,-139,-175,-174,125,-172,125,125,-158,125,-171,-159,125,125,125,125,-263,125,125,-11,-170,-173,125,-162,125,-160,125,125,-161,125,125,125,-263,125,-166,-165,-163,125,125,125,-167,-164,125,-169,-168,]),'MINUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,128,128,-47,128,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,128,-225,-242,-216,-195,128,-224,128,-251,-223,-228,128,128,-257,-222,-249,-240,244,-254,-250,-226,-263,-223,128,128,128,-262,128,128,-223,128,128,-184,-187,-185,-181,-182,-186,-188,128,-190,-191,-183,-189,-260,128,-220,-258,-237,-236,128,128,128,-214,-219,128,-217,-218,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,-12,128,128,-11,-223,-41,-44,-40,128,-42,128,128,-156,-155,-45,-157,128,-43,-248,128,-235,-234,-233,-232,-231,-244,128,128,244,244,244,-200,244,244,244,-199,244,244,-197,-196,244,244,244,244,244,-198,-263,-139,-175,-174,128,-172,128,128,-158,128,-171,-159,128,128,-221,-229,-230,128,128,-215,-263,128,128,-11,-170,-173,128,-162,128,-160,128,128,-161,128,128,128,-245,-263,-238,128,-166,-165,-163,-239,128,128,128,-167,-164,128,-169,-168,]),'RPAREN':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,53,54,56,58,59,60,62,63,66,67,68,69,70,74,78,81,83,84,90,94,96,106,107,108,109,110,111,112,113,114,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,158,159,160,161,165,166,167,174,176,177,178,179,180,191,197,198,199,200,201,202,218,220,221,222,224,227,228,231,232,234,235,236,237,238,239,240,269,270,275,285,302,303,310,311,314,315,318,319,320,321,322,323,324,325,326,328,329,330,332,333,334,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,366,367,368,378,388,389,390,391,392,397,398,410,412,415,416,417,419,428,430,432,435,437,438,439,442,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-263,-71,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,90,-86,-85,-51,-113,-112,-102,-101,-263,-28,-122,-124,-27,-145,-263,-147,-50,-53,-115,-263,-263,197,-15,198,-128,-263,-16,-248,-126,-132,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-21,-22,269,270,-263,-145,-263,-87,-262,-23,-84,-24,-83,-103,-121,-120,-131,-1,-2,-130,-260,-220,-258,-237,-236,329,-150,-214,-219,-217,-152,334,336,-176,-263,-218,-154,-148,368,-14,-89,-88,-105,-104,-116,-119,-133,-127,-129,-180,390,-235,-234,-233,-232,-246,-231,392,395,396,-244,-144,-263,-145,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-149,-151,-153,-13,-118,-117,-221,-229,-230,-177,-215,423,425,427,-247,428,-194,-245,-238,-263,440,-239,-263,443,446,]),'LONG':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[19,19,-63,-74,-73,-60,-56,-57,-35,-31,-61,19,-36,-55,-70,-65,-54,19,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,19,-69,19,-72,-76,19,-59,-86,-261,-85,19,-113,-112,-32,-102,-101,19,19,19,-47,-48,19,-115,19,19,19,19,-92,19,19,19,19,-38,19,-49,19,19,-87,-93,-262,-103,-121,-120,19,19,19,19,19,-39,-41,-44,-40,-42,19,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,19,-175,-174,19,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PLUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,135,135,-47,135,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,135,-225,-242,-216,-195,135,-224,135,-251,-223,-228,135,135,-257,-222,-249,-240,248,-254,-250,-226,-263,-223,135,135,135,-262,135,135,-223,135,135,-184,-187,-185,-181,-182,-186,-188,135,-190,-191,-183,-189,-260,135,-220,-258,-237,-236,135,135,135,-214,-219,135,-217,-218,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,-12,135,135,-11,-223,-41,-44,-40,135,-42,135,135,-156,-155,-45,-157,135,-43,-248,135,-235,-234,-233,-232,-231,-244,135,135,248,248,248,-200,248,248,248,-199,248,248,-197,-196,248,248,248,248,248,-198,-263,-139,-175,-174,135,-172,135,135,-158,135,-171,-159,135,135,-221,-229,-230,135,135,-215,-263,135,135,-11,-170,-173,135,-162,135,-160,135,135,-161,135,135,135,-245,-263,-238,135,-166,-165,-163,-239,135,135,135,-167,-164,135,-169,-168,]),'ELLIPSIS':([204,],[319,]),'GT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,249,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,249,-202,-200,-204,249,-203,-199,-206,249,-197,-196,-205,249,249,249,249,-198,-221,-229,-230,-215,-245,-238,-239,]),'GOTO':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,278,-262,-41,-44,-40,-42,278,-156,-155,-45,-157,278,-43,-175,-174,-172,278,-158,-171,-159,278,-170,-173,-162,278,-160,278,-161,278,278,-166,-165,-163,278,278,-167,-164,278,-169,-168,]),'ENUM':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[24,24,-63,-74,-73,-60,-56,-57,-35,-31,-61,24,-36,-55,-70,-65,-54,24,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,24,-69,24,-72,-76,24,-59,-86,-261,-85,24,-113,-112,-32,-102,-101,24,24,24,-47,-48,24,-115,24,24,24,24,-92,24,24,24,24,-38,24,-49,24,24,-87,-93,-262,-103,-121,-120,24,24,24,24,24,-39,-41,-44,-40,-42,24,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,24,-175,-174,24,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PERIOD':([55,112,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,155,176,218,221,222,224,262,267,300,323,324,325,326,329,334,360,362,364,391,392,399,401,428,429,430,437,],[-261,-248,-252,-243,-255,-259,-256,-253,-241,-242,225,-251,-228,-257,-249,-240,-254,-250,263,-262,-260,-258,-237,-236,-140,263,-248,-235,-234,-233,-232,-231,-244,-143,263,-141,-229,-230,263,-142,-245,263,-238,-239,]),'GE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,253,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,253,-202,-200,-204,253,-203,-199,-206,253,-197,-196,-205,253,253,253,253,-198,-221,-229,-230,-215,-245,-238,-239,]),'INT_CONST_DEC':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,145,145,-47,145,-28,-263,-125,-227,145,-225,145,-224,145,-223,145,145,-222,-226,-263,-223,145,145,145,-262,145,145,-223,145,145,-184,-187,-185,-181,-182,-186,-188,145,-190,-191,-183,-189,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,-12,145,145,-11,-223,-41,-44,-40,145,-42,145,145,-156,-155,-45,-157,145,-43,145,145,145,-263,-139,-175,-174,145,-172,145,145,-158,145,-171,-159,145,145,145,145,-263,145,145,-11,-170,-173,145,-162,145,-160,145,145,-161,145,145,145,-263,145,-166,-165,-163,145,145,145,-167,-164,145,-169,-168,]),'ARROW':([112,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,221,222,224,300,323,324,325,326,329,334,391,392,428,430,437,],[-248,-252,-243,-255,-259,-256,-253,-241,-242,223,-251,-228,-257,-249,-240,-254,-250,-262,-260,-258,-237,-236,-248,-235,-234,-233,-232,-231,-244,-229,-230,-245,-238,-239,]),'HEX_FLOAT_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,148,148,-47,148,-28,-263,-125,-227,148,-225,148,-224,148,-223,148,148,-222,-226,-263,-223,148,148,148,-262,148,148,-223,148,148,-184,-187,-185,-181,-182,-186,-188,148,-190,-191,-183,-189,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,-12,148,148,-11,-223,-41,-44,-40,148,-42,148,148,-156,-155,-45,-157,148,-43,148,148,148,-263,-139,-175,-174,148,-172,148,148,-158,148,-171,-159,148,148,148,148,-263,148,148,-11,-170,-173,148,-162,148,-160,148,148,-161,148,148,148,-263,148,-166,-165,-163,148,148,148,-167,-164,148,-169,-168,]),'DOUBLE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[40,40,-63,-74,-73,-60,-56,-57,-35,-31,-61,40,-36,-55,-70,-65,-54,40,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,40,-69,40,-72,-76,40,-59,-86,-261,-85,40,-113,-112,-32,-102,-101,40,40,40,-47,-48,40,-115,40,40,40,40,-92,40,40,40,40,-38,40,-49,40,40,-87,-93,-262,-103,-121,-120,40,40,40,40,40,-39,-41,-44,-40,-42,40,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,40,-175,-174,40,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'MINUSEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,207,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'INT_CONST_OCT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,149,149,-47,149,-28,-263,-125,-227,149,-225,149,-224,149,-223,149,149,-222,-226,-263,-223,149,149,149,-262,149,149,-223,149,149,-184,-187,-185,-181,-182,-186,-188,149,-190,-191,-183,-189,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,-12,149,149,-11,-223,-41,-44,-40,149,-42,149,149,-156,-155,-45,-157,149,-43,149,149,149,-263,-139,-175,-174,149,-172,149,149,-158,149,-171,-159,149,149,149,149,-263,149,149,-11,-170,-173,149,-162,149,-160,149,149,-161,149,149,149,-263,149,-166,-165,-163,149,149,149,-167,-164,149,-169,-168,]),'TIMESEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,216,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'OR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,258,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,258,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,258,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'SHORT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[2,2,-63,-74,-73,-60,-56,-57,-35,-31,-61,2,-36,-55,-70,-65,-54,2,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,2,-69,2,-72,-76,2,-59,-86,-261,-85,2,-113,-112,-32,-102,-101,2,2,2,-47,-48,2,-115,2,2,2,2,-92,2,2,2,2,-38,2,-49,2,2,-87,-93,-262,-103,-121,-120,2,2,2,2,2,-39,-41,-44,-40,-42,2,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,2,-175,-174,2,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'RETURN':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,281,-262,-41,-44,-40,-42,281,-156,-155,-45,-157,281,-43,-175,-174,-172,281,-158,-171,-159,281,-170,-173,-162,281,-160,281,-161,281,281,-166,-165,-163,281,281,-167,-164,281,-169,-168,]),'RSHIFTEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,217,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'RESTRICT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[32,32,-63,-74,-73,-60,-56,-57,-35,-31,-61,32,-36,-55,-70,-65,-54,32,-58,-178,-111,-68,32,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,32,-69,32,-72,-76,32,-59,-86,-261,-85,32,-113,-112,-32,-102,-101,32,32,32,-124,32,32,-47,-48,32,-115,32,32,32,32,-92,32,32,32,-125,32,32,32,-38,32,-49,32,32,-87,-93,-262,-103,-121,-120,32,32,32,32,32,-39,-41,-44,-40,-42,32,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,32,-175,-174,32,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'STATIC':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,65,66,69,78,80,82,87,89,90,104,115,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[9,9,-63,-74,-73,-60,-56,-57,-35,-31,-61,9,-36,-55,-70,-65,-54,9,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,9,-69,9,-72,-76,9,-59,-86,-261,-85,-113,-112,-32,-102,-101,105,9,-124,9,9,-47,-48,9,-115,195,-125,9,9,-38,9,-49,-87,-262,-103,-121,-120,9,-39,-41,-44,-40,-42,9,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,9,-175,-174,9,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'SIZEOF':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,127,127,-47,127,-28,-263,-125,-227,127,-225,127,-224,127,-223,127,127,-222,-226,-263,-223,127,127,127,-262,127,127,-223,127,127,-184,-187,-185,-181,-182,-186,-188,127,-190,-191,-183,-189,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,-12,127,127,-11,-223,-41,-44,-40,127,-42,127,127,-156,-155,-45,-157,127,-43,127,127,127,-263,-139,-175,-174,127,-172,127,127,-158,127,-171,-159,127,127,127,127,-263,127,127,-11,-170,-173,127,-162,127,-160,127,127,-161,127,127,127,-263,127,-166,-165,-163,127,127,127,-167,-164,127,-169,-168,]),'UNSIGNED':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[18,18,-63,-74,-73,-60,-56,-57,-35,-31,-61,18,-36,-55,-70,-65,-54,18,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,18,-69,18,-72,-76,18,-59,-86,-261,-85,18,-113,-112,-32,-102,-101,18,18,18,-47,-48,18,-115,18,18,18,18,-92,18,18,18,18,-38,18,-49,18,18,-87,-93,-262,-103,-121,-120,18,18,18,18,18,-39,-41,-44,-40,-42,18,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,18,-175,-174,18,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'UNION':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[20,20,-63,-74,-73,-60,-56,-57,-35,-31,-61,20,-36,-55,-70,-65,-54,20,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,20,-69,20,-72,-76,20,-59,-86,-261,-85,20,-113,-112,-32,-102,-101,20,20,20,-47,-48,20,-115,20,20,20,20,-92,20,20,20,20,-38,20,-49,20,20,-87,-93,-262,-103,-121,-120,20,20,20,20,20,-39,-41,-44,-40,-42,20,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,20,-175,-174,20,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'COLON':([2,3,5,6,13,18,19,25,26,27,29,32,33,35,37,39,40,43,45,46,54,56,59,60,62,63,90,94,96,97,112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,174,176,177,178,179,180,187,191,197,198,218,220,221,222,224,231,232,234,238,240,286,300,302,303,305,306,310,311,314,315,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,377,388,389,390,391,392,397,398,419,428,430,437,],[-63,-74,-73,-60,-61,-70,-65,-178,-111,-68,-71,-75,-114,-66,-62,-64,-67,-69,-72,-76,-86,-85,-113,-112,-102,-101,-115,-263,-263,181,-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-87,-262,-23,-84,-24,-83,309,-103,-121,-120,-260,-220,-258,-237,-236,-214,-219,-217,-176,-218,375,384,-89,-88,-192,181,-105,-104,-116,-119,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,400,-210,-198,411,-118,-117,-221,-229,-230,-177,-215,-194,-245,-238,-239,]),'$end':([0,8,11,12,15,22,31,36,38,47,61,82,169,176,272,383,],[-263,0,-35,-31,-36,-29,-34,-33,-37,-30,-32,-47,-38,-262,-39,-159,]),'WSTRING_LITERAL':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,121,123,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,123,123,-47,123,-28,-263,-125,-227,218,-259,123,-225,123,-224,123,-223,123,123,-222,-226,-263,-223,123,123,123,-262,123,123,-223,123,123,-184,-187,-185,-181,-182,-186,-188,123,-190,-191,-183,-189,-260,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,-12,123,123,-11,-223,-41,-44,-40,123,-42,123,123,-156,-155,-45,-157,123,-43,123,123,123,-263,-139,-175,-174,123,-172,123,123,-158,123,-171,-159,123,123,123,123,-263,123,123,-11,-170,-173,123,-162,123,-160,123,123,-161,123,123,123,-263,123,-166,-165,-163,123,123,123,-167,-164,123,-169,-168,]),'DIVIDE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,251,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,251,251,251,251,251,251,251,251,251,251,-197,-196,251,251,251,251,251,-198,-221,-229,-230,-215,-245,-238,-239,]),'FOR':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,283,-262,-41,-44,-40,-42,283,-156,-155,-45,-157,283,-43,-175,-174,-172,283,-158,-171,-159,283,-170,-173,-162,283,-160,283,-161,283,283,-166,-165,-163,283,283,-167,-164,283,-169,-168,]),'PLUSPLUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,121,122,123,124,125,126,127,128,129,130,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,391,392,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,137,137,-47,137,-28,-263,-248,-125,-252,-227,-243,-255,-259,-256,-253,-241,137,-225,-242,224,137,-224,137,-251,-223,-228,137,137,-257,-222,-249,-240,-254,-250,-226,-263,-223,137,137,137,-262,137,137,-223,137,137,-184,-187,-185,-181,-182,-186,-188,137,-190,-191,-183,-189,-260,137,-258,-237,-236,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,-12,137,137,-11,-223,-41,-44,-40,137,-42,137,137,-156,-155,-45,-157,137,-43,-248,137,-235,-234,-233,-232,-231,-244,137,137,-263,-139,-175,-174,137,-172,137,137,-158,137,-171,-159,137,137,-229,-230,137,137,-263,137,137,-11,-170,-173,137,-162,137,-160,137,137,-161,137,137,137,-245,-263,-238,137,-166,-165,-163,-239,137,137,137,-167,-164,137,-169,-168,]),'EQUALS':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,29,30,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,56,58,59,60,62,63,80,83,84,86,90,102,112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,168,174,176,191,197,198,218,220,221,222,224,231,232,234,240,262,267,300,302,303,310,311,314,315,323,324,325,326,329,334,360,364,388,389,390,391,392,398,401,428,430,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-71,77,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-85,-51,-113,-112,-102,-101,162,-50,-53,77,-115,192,-248,-252,209,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,162,-87,-262,-103,-121,-120,-260,-220,-258,-237,-236,-214,-219,-217,-218,-140,365,-248,-89,-88,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,-143,-141,-118,-117,-221,-229,-230,-215,-142,-245,-238,-239,]),'ELSE':([176,276,277,280,282,293,298,370,371,374,381,383,405,406,409,414,424,433,434,436,444,445,447,448,],[-262,-41,-44,-40,-42,-45,-43,-175,-174,-172,-171,-159,-170,-173,-162,-160,-161,-166,-165,441,-167,-164,-169,-168,]),'ANDEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,214,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'EQ':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,255,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,255,-202,-200,-204,-208,-203,-199,-206,255,-197,-196,-205,255,-207,255,255,-198,-221,-229,-230,-215,-245,-238,-239,]),'AND':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,144,144,-47,144,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,144,-225,-242,-216,-195,144,-224,144,-251,-223,-228,144,144,-257,-222,-249,-240,256,-254,-250,-226,-263,-223,144,144,144,-262,144,144,-223,144,144,-184,-187,-185,-181,-182,-186,-188,144,-190,-191,-183,-189,-260,144,-220,-258,-237,-236,144,144,144,-214,-219,144,-217,-218,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,-12,144,144,-11,-223,-41,-44,-40,144,-42,144,144,-156,-155,-45,-157,144,-43,-248,144,-235,-234,-233,-232,-231,-244,144,144,-201,256,-202,-200,-204,-208,-203,-199,-206,256,-197,-196,-205,256,-207,-209,256,-198,-263,-139,-175,-174,144,-172,144,144,-158,144,-171,-159,144,144,-221,-229,-230,144,144,-215,-263,144,144,-11,-170,-173,144,-162,144,-160,144,144,-161,144,144,144,-245,-263,-238,144,-166,-165,-163,-239,144,144,144,-167,-164,144,-169,-168,]),'TYPEID':([0,1,2,3,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,67,68,69,70,74,78,80,82,87,89,90,91,92,93,94,95,96,115,116,141,165,166,167,169,170,171,172,173,174,175,176,191,197,198,204,219,223,225,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[25,25,-63,-74,-73,-60,54,-56,-57,-35,-31,-61,25,-36,59,-55,-70,-65,-91,-54,25,-58,62,-178,-111,-68,-263,-71,-34,-75,-114,-90,-66,-33,-62,-37,-64,-67,25,-69,25,-72,-76,25,-59,-86,-261,-85,25,-113,-112,-32,-102,-101,25,-28,-122,-124,-27,59,25,25,-47,-48,25,-115,25,25,25,25,-92,25,-125,-123,25,25,59,25,-38,25,-49,25,25,-87,-93,-262,-103,-121,-120,25,25,323,325,25,25,25,-39,-41,-44,-40,-42,25,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,25,-175,-174,25,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LBRACE':([7,20,24,26,33,34,48,54,55,56,59,60,62,63,77,80,82,85,87,88,89,90,155,162,163,170,171,176,197,198,260,266,268,276,277,280,282,289,291,292,293,295,297,298,314,315,336,362,365,370,371,374,375,379,381,383,384,388,389,390,395,396,399,402,403,405,406,409,411,414,423,424,425,427,429,433,434,436,441,443,444,445,446,447,448,],[55,-91,55,-111,-114,-90,-263,55,-261,55,-113,-112,55,55,55,-263,-47,-7,-48,55,-8,-115,-263,55,55,55,-49,-262,-121,-120,-12,55,-11,-41,-44,-40,-42,55,-156,-155,-45,-157,55,-43,-116,-119,55,-263,-139,-175,-174,-172,55,-158,-171,-159,55,-118,-117,55,55,55,-263,55,-11,-170,-173,-162,55,-160,55,-161,55,55,-263,-166,-165,-163,55,55,-167,-164,55,-169,-168,]),'PPHASH':([0,11,12,15,22,31,36,38,61,82,169,176,272,383,],[38,-35,-31,-36,38,-34,-33,-37,-32,-47,-38,-262,-39,-159,]),'INT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[39,39,-63,-74,-73,-60,-56,-57,-35,-31,-61,39,-36,-55,-70,-65,-54,39,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,39,-69,39,-72,-76,39,-59,-86,-261,-85,39,-113,-112,-32,-102,-101,39,39,39,-47,-48,39,-115,39,39,39,39,-92,39,39,39,39,-38,39,-49,39,39,-87,-93,-262,-103,-121,-120,39,39,39,39,39,-39,-41,-44,-40,-42,39,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,39,-175,-174,39,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'SIGNED':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[43,43,-63,-74,-73,-60,-56,-57,-35,-31,-61,43,-36,-55,-70,-65,-54,43,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,43,-69,43,-72,-76,43,-59,-86,-261,-85,43,-113,-112,-32,-102,-101,43,43,43,-47,-48,43,-115,43,43,43,43,-92,43,43,43,43,-38,43,-49,43,43,-87,-93,-262,-103,-121,-120,43,43,43,43,43,-39,-41,-44,-40,-42,43,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,43,-175,-174,43,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CONTINUE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,284,-262,-41,-44,-40,-42,284,-156,-155,-45,-157,284,-43,-175,-174,-172,284,-158,-171,-159,284,-170,-173,-162,284,-160,284,-161,284,284,-166,-165,-163,284,284,-167,-164,284,-169,-168,]),'NOT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,152,152,-47,152,-28,-263,-125,-227,152,-225,152,-224,152,-223,152,152,-222,-226,-263,-223,152,152,152,-262,152,152,-223,152,152,-184,-187,-185,-181,-182,-186,-188,152,-190,-191,-183,-189,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,-12,152,152,-11,-223,-41,-44,-40,152,-42,152,152,-156,-155,-45,-157,152,-43,152,152,152,-263,-139,-175,-174,152,-172,152,152,-158,152,-171,-159,152,152,152,152,-263,152,152,-11,-170,-173,152,-162,152,-160,152,152,-161,152,152,152,-263,152,-166,-165,-163,152,152,152,-167,-164,152,-169,-168,]),'OREQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,215,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'MOD':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,259,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,259,259,259,259,259,259,259,259,259,259,-197,-196,259,259,259,259,259,-198,-221,-229,-230,-215,-245,-238,-239,]),'RSHIFT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,241,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,241,-202,-200,241,241,241,-199,241,241,-197,-196,241,241,241,241,241,-198,-221,-229,-230,-215,-245,-238,-239,]),'DEFAULT':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,286,-262,-41,-44,-40,-42,286,-156,-155,-45,-157,286,-43,-175,-174,-172,286,-158,-171,-159,286,-170,-173,-162,286,-160,286,-161,286,286,-166,-165,-163,286,286,-167,-164,286,-169,-168,]),'CHAR':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[37,37,-63,-74,-73,-60,-56,-57,-35,-31,-61,37,-36,-55,-70,-65,-54,37,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,37,-69,37,-72,-76,37,-59,-86,-261,-85,37,-113,-112,-32,-102,-101,37,37,37,-47,-48,37,-115,37,37,37,37,-92,37,37,37,37,-38,37,-49,37,37,-87,-93,-262,-103,-121,-120,37,37,37,37,37,-39,-41,-44,-40,-42,37,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,37,-175,-174,37,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'WHILE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,382,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,287,-262,-41,-44,-40,-42,287,-156,-155,-45,-157,287,-43,-175,-174,-172,287,-158,-171,413,-159,287,-170,-173,-162,287,-160,287,-161,287,287,-166,-165,-163,287,287,-167,-164,287,-169,-168,]),'DIVEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,206,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'EXTERN':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[10,10,-63,-74,-73,-60,-56,-57,-35,-31,-61,10,-36,-55,-70,-65,-54,10,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,10,-69,10,-72,-76,10,-59,-86,-261,-85,-113,-112,-32,-102,-101,10,10,10,-47,-48,10,-115,10,10,-38,10,-49,-87,-262,-103,-121,-120,10,-39,-41,-44,-40,-42,10,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,10,-175,-174,10,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CASE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,288,-262,-41,-44,-40,-42,288,-156,-155,-45,-157,288,-43,-175,-174,-172,288,-158,-171,-159,288,-170,-173,-162,288,-160,288,-161,288,288,-166,-165,-163,288,288,-167,-164,288,-169,-168,]),'LAND':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,254,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,254,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'REGISTER':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[17,17,-63,-74,-73,-60,-56,-57,-35,-31,-61,17,-36,-55,-70,-65,-54,17,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,17,-69,17,-72,-76,17,-59,-86,-261,-85,-113,-112,-32,-102,-101,17,17,17,-47,-48,17,-115,17,17,-38,17,-49,-87,-262,-103,-121,-120,17,-39,-41,-44,-40,-42,17,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,17,-175,-174,17,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'MODEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,208,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'NE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,246,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,246,-202,-200,-204,-208,-203,-199,-206,246,-197,-196,-205,246,-207,246,246,-198,-221,-229,-230,-215,-245,-238,-239,]),'SWITCH':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,290,-262,-41,-44,-40,-42,290,-156,-155,-45,-157,290,-43,-175,-174,-172,290,-158,-171,-159,290,-170,-173,-162,290,-160,290,-161,290,290,-166,-165,-163,290,290,-167,-164,290,-169,-168,]),'INT_CONST_HEX':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,138,138,-47,138,-28,-263,-125,-227,138,-225,138,-224,138,-223,138,138,-222,-226,-263,-223,138,138,138,-262,138,138,-223,138,138,-184,-187,-185,-181,-182,-186,-188,138,-190,-191,-183,-189,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,-12,138,138,-11,-223,-41,-44,-40,138,-42,138,138,-156,-155,-45,-157,138,-43,138,138,138,-263,-139,-175,-174,138,-172,138,138,-158,138,-171,-159,138,138,138,138,-263,138,138,-11,-170,-173,138,-162,138,-160,138,138,-161,138,138,138,-263,138,-166,-165,-163,138,138,138,-167,-164,138,-169,-168,]),'_COMPLEX':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[27,27,-63,-74,-73,-60,-56,-57,-35,-31,-61,27,-36,-55,-70,-65,-54,27,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,27,-69,27,-72,-76,27,-59,-86,-261,-85,27,-113,-112,-32,-102,-101,27,27,27,-47,-48,27,-115,27,27,27,27,-92,27,27,27,27,-38,27,-49,27,27,-87,-93,-262,-103,-121,-120,27,27,27,27,27,-39,-41,-44,-40,-42,27,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,27,-175,-174,27,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PLUSEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,211,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'STRUCT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[34,34,-63,-74,-73,-60,-56,-57,-35,-31,-61,34,-36,-55,-70,-65,-54,34,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,34,-69,34,-72,-76,34,-59,-86,-261,-85,34,-113,-112,-32,-102,-101,34,34,34,-47,-48,34,-115,34,34,34,34,-92,34,34,34,34,-38,34,-49,34,34,-87,-93,-262,-103,-121,-120,34,34,34,34,34,-39,-41,-44,-40,-42,34,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,34,-175,-174,34,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CONDOP':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,257,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'BREAK':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,294,-262,-41,-44,-40,-42,294,-156,-155,-45,-157,294,-43,-175,-174,-172,294,-158,-171,-159,294,-170,-173,-162,294,-160,294,-161,294,294,-166,-165,-163,294,294,-167,-164,294,-169,-168,]),'VOLATILE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[46,46,-63,-74,-73,-60,-56,-57,-35,-31,-61,46,-36,-55,-70,-65,-54,46,-58,-178,-111,-68,46,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,46,-69,46,-72,-76,46,-59,-86,-261,-85,46,-113,-112,-32,-102,-101,46,46,46,-124,46,46,-47,-48,46,-115,46,46,46,46,-92,46,46,46,-125,46,46,46,-38,46,-49,46,46,-87,-93,-262,-103,-121,-120,46,46,46,46,46,-39,-41,-44,-40,-42,46,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,46,-175,-174,46,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'INLINE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[49,49,-63,-74,-73,-60,-56,-57,-35,-31,-61,49,-36,-55,-70,-65,-54,49,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,49,-69,49,-72,-76,49,-59,-86,-261,-85,-113,-112,-32,-102,-101,49,49,49,-47,-48,49,-115,49,49,-38,49,-49,-87,-262,-103,-121,-120,49,-39,-41,-44,-40,-42,49,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,49,-175,-174,49,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'INT_CONST_BIN':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,118,118,-47,118,-28,-263,-125,-227,118,-225,118,-224,118,-223,118,118,-222,-226,-263,-223,118,118,118,-262,118,118,-223,118,118,-184,-187,-185,-181,-182,-186,-188,118,-190,-191,-183,-189,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,-12,118,118,-11,-223,-41,-44,-40,118,-42,118,118,-156,-155,-45,-157,118,-43,118,118,118,-263,-139,-175,-174,118,-172,118,118,-158,118,-171,-159,118,118,118,118,-263,118,118,-11,-170,-173,118,-162,118,-160,118,118,-161,118,118,118,-263,118,-166,-165,-163,118,118,118,-167,-164,118,-169,-168,]),'DO':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,297,-262,-41,-44,-40,-42,297,-156,-155,-45,-157,297,-43,-175,-174,-172,297,-158,-171,-159,297,-170,-173,-162,297,-160,297,-161,297,297,-166,-165,-163,297,297,-167,-164,297,-169,-168,]),'LNOT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,119,119,-47,119,-28,-263,-125,-227,119,-225,119,-224,119,-223,119,119,-222,-226,-263,-223,119,119,119,-262,119,119,-223,119,119,-184,-187,-185,-181,-182,-186,-188,119,-190,-191,-183,-189,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,-12,119,119,-11,-223,-41,-44,-40,119,-42,119,119,-156,-155,-45,-157,119,-43,119,119,119,-263,-139,-175,-174,119,-172,119,119,-158,119,-171,-159,119,119,119,119,-263,119,119,-11,-170,-173,119,-162,119,-160,119,119,-161,119,119,119,-263,119,-166,-165,-163,119,119,119,-167,-164,119,-169,-168,]),'CONST':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[3,3,-63,-74,-73,-60,-56,-57,-35,-31,-61,3,-36,-55,-70,-65,-54,3,-58,-178,-111,-68,3,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,3,-69,3,-72,-76,3,-59,-86,-261,-85,3,-113,-112,-32,-102,-101,3,3,3,-124,3,3,-47,-48,3,-115,3,3,3,3,-92,3,3,3,-125,3,3,3,-38,3,-49,3,3,-87,-93,-262,-103,-121,-120,3,3,3,3,3,-39,-41,-44,-40,-42,3,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,3,-175,-174,3,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LOR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,242,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'CHAR_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,122,122,-47,122,-28,-263,-125,-227,122,-225,122,-224,122,-223,122,122,-222,-226,-263,-223,122,122,122,-262,122,122,-223,122,122,-184,-187,-185,-181,-182,-186,-188,122,-190,-191,-183,-189,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,-12,122,122,-11,-223,-41,-44,-40,122,-42,122,122,-156,-155,-45,-157,122,-43,122,122,122,-263,-139,-175,-174,122,-172,122,122,-158,122,-171,-159,122,122,122,122,-263,122,122,-11,-170,-173,122,-162,122,-160,122,122,-161,122,122,122,-263,122,-166,-165,-163,122,122,122,-167,-164,122,-169,-168,]),'LSHIFT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,243,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,243,-202,-200,243,243,243,-199,243,243,-197,-196,243,243,243,243,243,-198,-221,-229,-230,-215,-245,-238,-239,]),'RBRACE':([55,82,93,95,100,101,102,112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,155,156,170,172,173,175,176,188,189,190,218,220,221,222,224,231,232,234,240,261,265,268,276,277,280,282,289,291,292,293,295,296,298,299,305,307,308,312,313,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,359,362,363,370,371,374,379,381,383,390,391,392,398,404,405,406,409,414,418,419,420,424,428,429,430,433,434,436,437,444,445,447,448,],[-261,-47,176,-92,-106,176,-109,-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-263,-134,-263,176,176,-93,-262,176,176,-107,-260,-220,-258,-237,-236,-214,-219,-217,-218,176,-20,-19,-41,-44,-40,-42,-6,-156,-155,-45,-157,-5,-43,176,-192,-94,-95,-108,-110,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-135,176,-137,-175,-174,-172,-158,-171,-159,-221,-229,-230,-215,-136,-170,-173,-162,-160,176,-194,-138,-161,-245,176,-238,-166,-165,-163,-239,-167,-164,-169,-168,]),'_BOOL':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[13,13,-63,-74,-73,-60,-56,-57,-35,-31,-61,13,-36,-55,-70,-65,-54,13,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,13,-69,13,-72,-76,13,-59,-86,-261,-85,13,-113,-112,-32,-102,-101,13,13,13,-47,-48,13,-115,13,13,13,13,-92,13,13,13,13,-38,13,-49,13,13,-87,-93,-262,-103,-121,-120,13,13,13,13,13,-39,-41,-44,-40,-42,13,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,13,-175,-174,13,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,245,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,245,-202,-200,-204,245,-203,-199,-206,245,-197,-196,-205,245,245,245,245,-198,-221,-229,-230,-215,-245,-238,-239,]),'SEMI':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,49,50,51,52,54,55,56,58,59,60,61,62,63,67,68,69,70,71,73,74,75,76,79,80,81,82,83,84,86,90,94,96,97,112,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,154,156,166,168,169,170,174,176,177,178,179,180,182,183,184,185,186,187,191,197,198,205,218,220,221,222,224,228,231,232,234,235,238,240,269,270,271,272,276,277,279,280,281,282,284,285,289,291,292,293,294,295,296,297,298,300,302,303,304,305,310,311,314,315,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,359,366,367,368,369,370,371,372,373,374,375,378,379,381,383,384,386,387,388,389,390,391,392,397,398,404,405,406,407,408,409,411,414,419,421,422,423,424,425,427,428,430,431,433,434,436,437,440,441,443,444,445,446,447,448,],[15,-263,-63,-74,-73,-60,-56,-57,-35,-31,-61,-263,-36,-55,-70,-65,-54,15,-58,-178,-111,-68,-263,-71,-263,-34,-75,-114,-66,-33,-62,-37,-64,-67,82,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-113,-112,-32,-102,-101,-28,-122,-124,-27,-18,-46,-145,-77,-17,-80,-81,-147,-47,-50,-53,-263,-115,-263,-263,-263,-248,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-79,-134,-145,-81,-38,-263,-87,-262,-23,-84,-24,-83,-26,307,-96,308,-25,-98,-103,-121,-120,-78,-260,-220,-258,-237,-236,-150,-214,-219,-217,-152,-176,-218,-154,-148,-82,-39,-41,-44,370,-40,371,-42,374,-14,-263,-156,-155,-45,381,-157,-13,-263,-43,-248,-89,-88,-100,-192,-105,-104,-116,-119,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-135,-149,-151,-153,405,-175,-174,406,-263,-172,-263,-13,-158,-171,-159,-263,-97,-99,-118,-117,-221,-229,-230,-177,-215,-136,-170,-173,421,-263,-162,-263,-160,-194,-263,432,-263,-161,-263,-263,-245,-238,438,-166,-165,-163,-239,444,-263,-263,-167,-164,-263,-169,-168,]),'LT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,247,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,247,-202,-200,-204,247,-203,-199,-206,247,-197,-196,-205,247,247,247,247,-198,-221,-229,-230,-215,-245,-238,-239,]),'COMMA':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,56,58,59,60,62,63,67,68,69,70,71,74,75,79,80,81,83,84,90,94,96,100,101,102,109,110,111,112,113,114,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,154,156,166,168,174,176,177,178,179,180,182,184,187,188,189,190,191,197,198,199,200,201,202,205,218,220,221,222,224,228,231,232,234,235,236,238,239,240,265,269,270,271,285,300,302,303,304,305,310,311,312,313,314,315,318,320,321,323,324,325,326,327,328,329,330,331,334,337,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,363,366,367,368,372,386,387,388,389,390,391,392,397,398,404,410,412,415,416,418,419,420,428,430,435,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-263,-71,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-85,-51,-113,-112,-102,-101,-28,-122,-124,-27,117,-145,-77,-80,-81,-147,-50,-53,-115,-263,-263,-106,190,-109,-128,-263,203,-248,204,-132,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-79,-134,-145,-81,-87,-262,-23,-84,-24,-83,306,-96,-98,190,190,-107,-103,-121,-120,-131,-1,-2,-130,-78,-260,-220,-258,-237,-236,-150,-214,-219,-217,-152,335,-176,-263,-218,362,-154,-148,-82,335,-248,-89,-88,-100,-192,-105,-104,-108,-110,-116,-119,-133,-129,-180,-235,-234,-233,-232,335,-246,-231,393,394,-244,-144,-145,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,335,-210,-198,-135,-137,-149,-151,-153,335,-97,-99,-118,-117,-221,-229,-230,-177,-215,-136,335,335,335,-247,429,-194,-138,-245,-238,335,-239,]),'OFFSETOF':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,133,133,-47,133,-28,-263,-125,-227,133,-225,133,-224,133,-223,133,133,-222,-226,-263,-223,133,133,133,-262,133,133,-223,133,133,-184,-187,-185,-181,-182,-186,-188,133,-190,-191,-183,-189,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,-12,133,133,-11,-223,-41,-44,-40,133,-42,133,133,-156,-155,-45,-157,133,-43,133,133,133,-263,-139,-175,-174,133,-172,133,133,-158,133,-171,-159,133,133,133,133,-263,133,133,-11,-170,-173,133,-162,133,-160,133,133,-161,133,133,133,-263,133,-166,-165,-163,133,133,133,-167,-164,133,-169,-168,]),'TYPEDEF':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[23,23,-63,-74,-73,-60,-56,-57,-35,-31,-61,23,-36,-55,-70,-65,-54,23,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,23,-69,23,-72,-76,23,-59,-86,-261,-85,-113,-112,-32,-102,-101,23,23,23,-47,-48,23,-115,23,23,-38,23,-49,-87,-262,-103,-121,-120,23,-39,-41,-44,-40,-42,23,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,23,-175,-174,23,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'XOR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,250,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,250,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,250,-207,-209,250,-198,-221,-229,-230,-215,-245,-238,-239,]),'AUTO':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[21,21,-63,-74,-73,-60,-56,-57,-35,-31,-61,21,-36,-55,-70,-65,-54,21,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,21,-69,21,-72,-76,21,-59,-86,-261,-85,-113,-112,-32,-102,-101,21,21,21,-47,-48,21,-115,21,21,-38,21,-49,-87,-262,-103,-121,-120,21,-39,-41,-44,-40,-42,21,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,21,-175,-174,21,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'TIMES':([0,1,2,3,4,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,27,28,29,30,31,32,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,61,62,63,65,67,68,69,70,72,77,78,82,83,84,86,94,96,97,103,104,105,110,112,115,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,167,169,170,174,176,177,178,179,180,181,191,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,272,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,302,303,306,309,310,311,323,324,325,326,329,334,335,336,338,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[28,-263,-63,-74,28,-73,-60,-56,-57,-35,-31,-61,-263,-36,-55,-70,-65,-54,28,-58,-178,-68,-263,-71,28,-34,-75,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-32,-102,-101,-263,-28,28,-124,-27,139,157,28,-47,-50,-53,28,-263,-263,28,194,-28,-263,28,-248,-125,28,-252,-227,-214,-243,-255,-259,-256,-253,-241,157,-225,-242,-216,-195,157,-224,157,-251,-223,-228,157,157,-257,-222,-249,-240,252,-254,-250,-226,-263,-223,157,274,28,-38,157,-87,-262,-23,-84,-24,-83,157,-103,157,-223,157,157,-184,-187,-185,-181,-182,-186,-188,157,-190,-191,-183,-189,-260,157,-220,-258,-237,-236,157,157,157,-214,-219,157,-217,28,-218,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,-12,157,157,-11,-39,-223,-41,-44,-40,157,-42,157,157,-156,-155,-45,-157,157,-43,-248,-89,-88,28,157,-105,-104,-235,-234,-233,-232,-231,-244,157,157,28,252,252,252,252,252,252,252,252,252,252,-197,-196,252,252,252,252,252,-198,-263,-139,-175,-174,157,-172,157,157,-158,157,-171,-159,157,157,-221,-229,-230,157,157,-215,-263,157,157,-11,-170,-173,157,-162,157,-160,157,157,-161,157,157,157,-245,-263,-238,157,-166,-165,-163,-239,157,157,157,-167,-164,157,-169,-168,]),'LPAREN':([0,1,2,3,4,5,6,9,10,11,12,13,14,15,16,17,18,19,21,22,23,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,60,61,62,63,65,67,68,69,70,72,74,77,78,81,82,83,84,86,90,94,96,97,103,104,105,110,112,115,116,117,118,119,121,122,123,124,125,126,127,128,129,130,133,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,153,155,157,162,164,166,167,169,170,174,176,177,178,179,180,181,191,192,194,195,196,197,198,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,228,230,233,235,239,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,269,270,272,274,276,277,280,281,282,283,287,288,289,290,291,292,293,295,297,298,300,301,302,303,306,309,310,311,314,315,323,324,325,326,329,334,335,336,338,339,362,365,366,367,368,370,371,373,374,375,376,379,380,381,383,384,385,388,389,391,392,393,395,399,400,402,403,405,406,408,409,411,413,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[4,-263,-63,-74,4,-73,-60,-56,-57,-35,-31,-61,-263,-36,4,-55,-70,-65,-54,4,-58,-178,66,-68,-263,-71,78,-34,-75,-114,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,66,-32,-102,-101,-263,-28,-122,-124,-27,141,78,141,78,165,-47,-50,-53,167,-115,-263,-263,167,141,-28,-263,78,-248,-125,-123,4,-252,-227,-243,-255,-259,-256,-253,-241,219,-225,-242,227,229,230,-224,233,-251,-223,-228,141,233,-257,-222,-249,-240,-254,-250,-226,165,-263,-223,141,141,167,167,-38,141,-87,-262,-23,-84,-24,-83,230,-103,230,-223,141,141,-121,-120,-184,-187,-185,-181,-182,-186,-188,141,-190,-191,-183,-189,-260,141,-258,-237,-236,141,141,-150,141,141,-152,338,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,141,230,230,-12,230,141,-11,-154,-148,-39,-223,-41,-44,-40,141,-42,373,376,230,141,380,-156,-155,-45,-157,141,-43,-248,385,-89,-88,4,230,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,141,230,338,338,-263,-139,-149,-151,-153,-175,-174,141,-172,141,141,-158,141,-171,-159,141,141,-118,-117,-229,-230,141,230,-263,230,141,-11,-170,-173,141,-162,141,426,-160,141,141,-161,141,141,141,-245,-263,-238,141,-166,-165,-163,-239,141,141,141,-167,-164,141,-169,-168,]),'MINUSMINUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,121,122,123,124,125,126,127,128,129,130,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,391,392,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,142,142,-47,142,-28,-263,-248,-125,-252,-227,-243,-255,-259,-256,-253,-241,142,-225,-242,222,142,-224,142,-251,-223,-228,142,142,-257,-222,-249,-240,-254,-250,-226,-263,-223,142,142,142,-262,142,142,-223,142,142,-184,-187,-185,-181,-182,-186,-188,142,-190,-191,-183,-189,-260,142,-258,-237,-236,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,-12,142,142,-11,-223,-41,-44,-40,142,-42,142,142,-156,-155,-45,-157,142,-43,-248,142,-235,-234,-233,-232,-231,-244,142,142,-263,-139,-175,-174,142,-172,142,142,-158,142,-171,-159,142,142,-229,-230,142,142,-263,142,142,-11,-170,-173,142,-162,142,-160,142,142,-161,142,142,142,-245,-263,-238,142,-166,-165,-163,-239,142,142,142,-167,-164,142,-169,-168,]),'ID':([0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,34,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,61,62,63,64,65,66,67,68,69,70,72,74,77,78,82,83,84,86,94,96,97,98,99,103,104,105,110,115,116,117,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,166,167,169,170,174,176,177,178,179,180,181,190,191,192,194,195,196,203,206,207,208,209,210,211,212,213,214,215,216,217,219,223,225,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,263,264,266,268,272,274,276,277,278,280,281,282,288,289,291,292,293,295,297,298,302,303,306,309,310,311,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,394,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[33,-263,-63,-74,33,-73,-60,56,-56,-57,-35,-31,-61,-263,-36,33,-55,-70,-65,-91,-54,33,-58,63,-178,-68,-263,-71,33,-34,-75,-90,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-32,-102,-101,102,-263,112,-28,-122,-124,-27,112,33,112,33,-47,-50,-53,33,-263,-263,33,102,102,112,-28,-263,33,-125,-123,33,-227,112,-225,112,-224,112,-223,112,112,-222,-226,-263,-223,112,112,33,33,-38,300,-87,-262,-23,-84,-24,-83,112,102,-103,112,-223,112,112,112,-184,-187,-185,-181,-182,-186,-188,112,-190,-191,-183,-189,112,324,326,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,-12,112,112,112,-11,-39,-223,-41,-44,369,-40,112,-42,112,300,-156,-155,-45,-157,300,-43,-89,-88,33,112,-105,-104,112,112,-263,-139,-175,-174,112,-172,300,112,-158,112,-171,-159,300,112,112,112,112,-263,112,112,-11,-170,-173,112,-162,300,-160,112,300,-161,300,112,300,-263,112,-166,-165,-163,112,300,300,-167,-164,300,-169,-168,]),'IF':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,301,-262,-41,-44,-40,-42,301,-156,-155,-45,-157,301,-43,-175,-174,-172,301,-158,-171,-159,301,-170,-173,-162,301,-160,301,-161,301,301,-166,-165,-163,301,301,-167,-164,301,-169,-168,]),'STRING_LITERAL':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,129,134,135,137,139,141,142,143,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,221,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,143,143,-47,143,-28,-263,-125,-227,143,-225,221,143,-224,143,-223,143,143,-257,-222,-226,-263,-223,143,143,143,-262,143,143,-223,143,143,-184,-187,-185,-181,-182,-186,-188,143,-190,-191,-183,-189,143,-258,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,-12,143,143,-11,-223,-41,-44,-40,143,-42,143,143,-156,-155,-45,-157,143,-43,143,143,143,-263,-139,-175,-174,143,-172,143,143,-158,143,-171,-159,143,143,143,143,-263,143,143,-11,-170,-173,143,-162,143,-160,143,143,-161,143,143,143,-263,143,-166,-165,-163,143,143,143,-167,-164,143,-169,-168,]),'FLOAT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[35,35,-63,-74,-73,-60,-56,-57,-35,-31,-61,35,-36,-55,-70,-65,-54,35,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,35,-69,35,-72,-76,35,-59,-86,-261,-85,35,-113,-112,-32,-102,-101,35,35,35,-47,-48,35,-115,35,35,35,35,-92,35,35,35,35,-38,35,-49,35,35,-87,-93,-262,-103,-121,-120,35,35,35,35,35,-39,-41,-44,-40,-42,35,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,35,-175,-174,35,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'XOREQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,210,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'LSHIFTEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,212,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'RBRACKET':([3,32,46,65,69,70,72,103,104,112,115,118,120,121,122,123,124,125,126,129,130,131,132,136,138,139,140,143,145,146,147,148,149,150,151,164,176,193,194,218,220,221,222,224,231,232,234,238,240,273,274,305,316,317,321,323,324,325,326,327,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,361,390,391,392,397,398,419,428,430,437,],[-74,-75,-76,-263,-124,-27,-263,-263,-28,-248,-125,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,228,-195,-4,-251,235,-228,-257,-249,-240,-193,-254,-250,-3,-179,-263,-262,314,315,-260,-220,-258,-237,-236,-214,-219,-217,-176,-218,366,367,-192,388,389,-180,-235,-234,-233,-232,391,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,401,-221,-229,-230,-177,-215,-194,-245,-238,-239,]),} +_lr_action_items = {'$end':([0,1,2,3,4,5,6,7,8,9,13,14,55,77,78,105,144,210,264,],[-309,0,-58,-59,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-70,-308,-71,-202,]),'SEMI':([0,2,4,5,6,7,8,9,11,12,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,62,63,64,65,66,67,69,70,72,73,74,75,76,77,78,81,82,83,84,85,86,87,88,89,90,91,92,98,99,101,102,103,104,105,106,108,110,127,131,139,140,141,142,143,144,145,146,147,148,151,152,153,154,155,156,157,158,159,160,161,162,163,166,169,172,175,176,177,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,227,228,242,243,246,249,250,251,252,253,254,255,256,257,258,259,260,261,263,264,265,266,267,269,270,272,273,282,283,284,285,286,287,288,289,325,326,327,329,330,331,333,334,349,350,351,352,371,372,375,376,377,380,381,382,384,387,391,395,396,397,398,399,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,431,438,439,442,443,456,457,458,460,462,463,464,466,467,469,470,473,475,479,480,491,492,494,495,497,499,508,509,511,514,519,520,521,523,526,527,529,],[9,9,-60,-62,-63,-64,-65,-66,-309,77,-67,-68,-52,-309,-309,-309,-116,-93,-309,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,-309,-309,-162,-89,-90,-91,-92,-81,-19,-20,-120,-122,-163,-54,-37,-83,-69,-53,-86,-9,-10,-87,-88,-94,-82,-15,-16,-124,-126,-152,-153,-307,-132,-133,146,-70,-309,-162,-55,-294,-30,146,146,146,-135,-142,-308,-309,-145,-146,-130,-13,-309,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,273,-14,-309,286,287,289,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-121,-38,-123,-177,-35,-36,-125,-127,-154,146,-137,146,-139,-134,-143,377,-128,-129,-25,-26,-147,-149,-131,-202,-201,-13,-309,-235,-257,-309,-218,-78,-80,-309,398,-214,-215,399,-217,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-155,-156,-136,-138,-144,-151,-203,-309,-205,-287,-220,-79,466,-309,-213,-216,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-178,-39,-42,-32,-33,-148,-150,-204,-309,-258,-309,-309,-309,498,-272,-273,-264,-179,-40,-41,-206,-80,-208,-209,512,-237,-309,-281,521,-288,-207,-282,-210,-309,-309,-212,-211,]),'PPHASH':([0,2,4,5,6,7,8,9,13,14,55,77,78,105,144,210,264,],[13,13,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-70,-308,-71,-202,]),'PPPRAGMA':([0,2,4,5,6,7,8,9,13,14,55,77,78,101,104,105,106,139,140,141,143,144,146,147,152,153,154,155,156,157,158,159,160,161,162,172,210,249,251,254,264,265,267,272,273,282,283,286,287,289,377,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[14,14,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-307,14,-70,14,14,14,14,-142,-308,-145,-146,14,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,14,-71,14,14,-143,-202,-201,14,14,-218,14,-80,-214,-215,-217,-144,-203,14,-205,-79,-213,-216,-204,14,14,14,-206,-80,-208,-209,14,-207,-210,14,14,-212,-211,]),'ID':([0,2,4,5,6,7,8,9,11,13,14,16,17,18,19,20,21,22,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,60,61,63,64,65,66,68,71,77,78,79,80,82,83,84,85,86,87,94,95,96,97,98,99,100,101,102,103,105,106,111,113,114,115,116,117,118,126,129,130,132,133,134,135,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,164,168,172,174,177,183,184,185,187,188,189,190,191,193,194,210,215,216,217,218,222,225,226,230,234,238,239,246,247,248,250,252,253,256,257,262,263,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,328,332,338,339,340,343,344,346,347,348,360,361,364,367,369,371,372,375,376,378,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,474,476,477,482,483,484,491,492,494,495,498,508,510,512,515,516,519,521,523,526,527,529,],[23,23,-60,-62,-63,-64,-65,-66,23,-67,-68,23,-309,-309,-309,-116,-93,23,23,-97,-309,-113,-114,-115,-221,98,102,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-140,-141,-61,23,23,-89,-90,-91,-92,23,23,-83,-69,-309,127,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,138,-307,-132,-133,-70,163,23,127,-309,127,127,-309,-28,23,23,127,-165,-167,138,138,-135,-308,23,-130,163,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,127,127,163,285,127,127,127,127,127,-266,-267,-268,-265,-269,-270,-71,-309,127,-309,-28,-266,127,127,127,23,23,-309,-154,138,127,-137,-139,-134,-128,-129,127,-131,-202,-201,163,127,163,-218,127,127,127,127,163,-80,127,-214,-215,-217,127,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,424,426,127,127,-11,127,-12,127,127,-266,127,127,-309,127,23,127,127,-155,-156,-136,-138,23,127,-203,163,-205,127,-79,127,-213,-216,-309,-182,127,-309,-28,-266,-204,127,163,-309,163,163,127,127,127,127,127,127,-11,-266,127,127,-206,-80,-208,-209,127,163,-309,127,127,127,-207,-210,163,163,-212,-211,]),'LPAREN':([0,2,4,5,6,7,8,9,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,63,64,65,66,68,71,75,76,77,78,79,81,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,105,106,110,111,113,114,116,117,118,126,127,129,130,131,132,133,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,163,164,167,168,170,171,172,173,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,212,215,216,217,218,222,225,226,227,228,234,235,238,239,240,241,246,248,250,252,253,256,257,262,263,264,265,267,271,272,273,274,277,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,349,350,351,352,358,359,360,364,367,369,371,372,375,376,378,379,381,382,384,386,387,389,390,394,395,397,398,399,422,424,425,426,427,432,434,438,439,442,443,444,445,446,449,450,452,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,479,480,482,483,484,485,486,487,488,489,490,491,492,494,495,498,504,505,508,509,510,512,514,516,517,518,519,520,521,523,526,527,529,],[24,24,-60,-62,-63,-64,-65,-66,71,-67,-68,80,24,-309,-309,-309,-116,-93,24,-29,24,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,71,24,-89,-90,-91,-92,71,71,115,-37,-83,-69,-309,80,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,-70,168,115,71,168,-309,168,-309,-28,238,-294,71,168,-30,-165,-167,-135,-308,71,-130,168,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,271,274,168,279,280,168,284,168,322,328,328,271,332,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,335,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-38,-309,168,-309,-28,-266,168,168,-35,-36,238,361,238,-309,-45,370,-154,271,-137,-139,-134,-128,-129,271,-131,-202,-201,168,168,168,-218,168,390,168,168,168,168,-80,168,-214,-215,-217,168,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,168,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,168,168,-279,-280,168,168,-304,-306,-11,168,-12,271,-266,168,168,-43,-44,-31,-34,361,370,-309,238,168,168,-155,-156,-136,-138,71,271,-203,168,-205,271,-287,390,390,465,-79,168,-213,-216,-274,-275,-276,-277,-278,-309,-182,-39,-42,-32,-33,168,-309,-28,-191,-197,-195,-266,-204,271,168,-309,168,168,168,168,271,-272,-273,168,168,-11,-40,-41,-266,168,168,-50,-51,-193,-192,-194,-196,-206,-80,-208,-209,168,-46,-49,168,-281,-309,168,-288,168,-47,-48,-207,-282,-210,168,168,-212,-211,]),'TIMES':([0,2,4,5,6,7,8,9,11,13,14,17,18,19,20,21,22,24,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,63,64,65,66,71,77,78,79,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,105,106,111,113,114,116,117,118,126,127,129,130,133,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,210,215,216,217,218,222,225,226,238,239,246,248,250,252,253,256,257,262,263,264,265,267,270,271,272,273,274,277,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,371,372,375,376,378,379,381,382,384,386,387,390,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[26,26,-60,-62,-63,-64,-65,-66,26,-67,-68,-309,-309,-309,-116,-93,26,26,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,26,26,-89,-90,-91,-92,26,-83,-69,-309,-86,-9,-10,-87,-88,-94,26,-27,-28,-166,-152,-153,-307,-132,-133,-70,188,26,188,-309,222,-309,-28,26,-294,26,188,-167,-135,-308,26,-130,188,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,188,188,188,188,-257,303,-259,188,188,188,-238,188,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-309,346,-309,-28,-266,188,188,26,368,-154,188,-137,-139,-134,-128,-129,188,-131,-202,-201,188,-257,188,188,-218,188,26,188,188,188,188,-80,188,-214,-215,-217,188,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,-279,-280,-260,188,-261,-262,-263,188,-304,-306,-11,188,-12,188,-266,188,188,-309,188,454,-155,-156,-136,-138,26,188,-203,188,-205,188,-287,26,-79,188,-213,-216,-239,-240,-241,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,-274,-275,-276,-277,-278,-309,-182,482,-309,-28,-266,-204,188,188,-309,-258,188,188,188,188,188,-272,-273,188,-264,188,-11,-266,188,188,-206,-80,-208,-209,188,188,-281,-309,188,-288,188,-207,-282,-210,188,188,-212,-211,]),'TYPEID':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,58,59,60,61,62,63,64,65,66,68,71,77,78,80,81,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,104,105,106,107,111,115,126,128,129,131,132,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,234,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,282,283,284,286,287,289,323,324,328,332,335,351,352,361,370,371,372,375,376,377,378,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[30,30,-60,-62,-63,-64,-65,-66,30,76,-67,-68,-52,-309,-309,-309,-116,-93,30,-29,-97,-309,-113,-114,-115,-221,99,103,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-140,-141,-61,30,-84,76,30,30,-89,-90,-91,-92,76,76,-83,-69,30,-53,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,30,-70,30,-85,76,30,240,30,76,-30,-165,-167,30,30,30,-135,-142,-308,76,-145,-146,-130,30,30,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,30,-71,-35,-36,30,240,30,-154,30,-137,30,-139,-134,-143,-128,-129,-131,-202,-201,30,-218,-78,-80,30,-214,-215,-217,425,427,30,30,30,-31,-34,30,30,-155,-156,-136,-138,-144,76,-203,-205,30,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'ENUM':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[31,31,-60,-62,-63,-64,-65,-66,31,-67,-68,-52,-309,-309,-309,31,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,31,-84,31,31,-83,-69,31,-53,-86,-9,-10,-87,-88,-166,-307,31,-70,31,-85,31,31,-30,-167,31,31,31,-142,-308,-145,-146,31,31,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,31,-71,-35,-36,31,31,31,31,-143,-202,-201,31,-218,-78,-80,31,-214,-215,-217,31,31,31,-31,-34,31,31,-144,-203,-205,31,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'VOID':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[33,33,-60,-62,-63,-64,-65,-66,33,33,-67,-68,-52,-309,-309,-309,-116,-93,33,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,33,-84,33,33,33,-89,-90,-91,-92,-83,-69,33,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,33,-70,33,-85,33,33,33,-30,-167,33,33,33,-135,-142,-308,33,-145,-146,-130,33,33,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,33,-71,-35,-36,33,33,-154,33,-137,33,-139,-134,-143,-128,-129,-131,-202,-201,33,-218,33,-78,-80,33,-214,-215,-217,33,33,33,-31,-34,33,33,-155,-156,-136,-138,-144,-203,-205,33,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'_BOOL':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[34,34,-60,-62,-63,-64,-65,-66,34,34,-67,-68,-52,-309,-309,-309,-116,-93,34,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,34,-84,34,34,34,-89,-90,-91,-92,-83,-69,34,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,34,-70,34,-85,34,34,34,-30,-167,34,34,34,-135,-142,-308,34,-145,-146,-130,34,34,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,34,-71,-35,-36,34,34,-154,34,-137,34,-139,-134,-143,-128,-129,-131,-202,-201,34,-218,34,-78,-80,34,-214,-215,-217,34,34,34,-31,-34,34,34,-155,-156,-136,-138,-144,-203,-205,34,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'CHAR':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[35,35,-60,-62,-63,-64,-65,-66,35,35,-67,-68,-52,-309,-309,-309,-116,-93,35,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,35,-84,35,35,35,-89,-90,-91,-92,-83,-69,35,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,35,-70,35,-85,35,35,35,-30,-167,35,35,35,-135,-142,-308,35,-145,-146,-130,35,35,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,35,-71,-35,-36,35,35,-154,35,-137,35,-139,-134,-143,-128,-129,-131,-202,-201,35,-218,35,-78,-80,35,-214,-215,-217,35,35,35,-31,-34,35,35,-155,-156,-136,-138,-144,-203,-205,35,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'SHORT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[36,36,-60,-62,-63,-64,-65,-66,36,36,-67,-68,-52,-309,-309,-309,-116,-93,36,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,36,-84,36,36,36,-89,-90,-91,-92,-83,-69,36,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,36,-70,36,-85,36,36,36,-30,-167,36,36,36,-135,-142,-308,36,-145,-146,-130,36,36,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,36,-71,-35,-36,36,36,-154,36,-137,36,-139,-134,-143,-128,-129,-131,-202,-201,36,-218,36,-78,-80,36,-214,-215,-217,36,36,36,-31,-34,36,36,-155,-156,-136,-138,-144,-203,-205,36,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'INT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[37,37,-60,-62,-63,-64,-65,-66,37,37,-67,-68,-52,-309,-309,-309,-116,-93,37,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,37,-84,37,37,37,-89,-90,-91,-92,-83,-69,37,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,37,-70,37,-85,37,37,37,-30,-167,37,37,37,-135,-142,-308,37,-145,-146,-130,37,37,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,37,-71,-35,-36,37,37,-154,37,-137,37,-139,-134,-143,-128,-129,-131,-202,-201,37,-218,37,-78,-80,37,-214,-215,-217,37,37,37,-31,-34,37,37,-155,-156,-136,-138,-144,-203,-205,37,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'LONG':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[38,38,-60,-62,-63,-64,-65,-66,38,38,-67,-68,-52,-309,-309,-309,-116,-93,38,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,38,-84,38,38,38,-89,-90,-91,-92,-83,-69,38,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,38,-70,38,-85,38,38,38,-30,-167,38,38,38,-135,-142,-308,38,-145,-146,-130,38,38,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,38,-71,-35,-36,38,38,-154,38,-137,38,-139,-134,-143,-128,-129,-131,-202,-201,38,-218,38,-78,-80,38,-214,-215,-217,38,38,38,-31,-34,38,38,-155,-156,-136,-138,-144,-203,-205,38,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'FLOAT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[39,39,-60,-62,-63,-64,-65,-66,39,39,-67,-68,-52,-309,-309,-309,-116,-93,39,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,39,-84,39,39,39,-89,-90,-91,-92,-83,-69,39,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,39,-70,39,-85,39,39,39,-30,-167,39,39,39,-135,-142,-308,39,-145,-146,-130,39,39,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,39,-71,-35,-36,39,39,-154,39,-137,39,-139,-134,-143,-128,-129,-131,-202,-201,39,-218,39,-78,-80,39,-214,-215,-217,39,39,39,-31,-34,39,39,-155,-156,-136,-138,-144,-203,-205,39,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'DOUBLE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[40,40,-60,-62,-63,-64,-65,-66,40,40,-67,-68,-52,-309,-309,-309,-116,-93,40,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,40,-84,40,40,40,-89,-90,-91,-92,-83,-69,40,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,40,-70,40,-85,40,40,40,-30,-167,40,40,40,-135,-142,-308,40,-145,-146,-130,40,40,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,40,-71,-35,-36,40,40,-154,40,-137,40,-139,-134,-143,-128,-129,-131,-202,-201,40,-218,40,-78,-80,40,-214,-215,-217,40,40,40,-31,-34,40,40,-155,-156,-136,-138,-144,-203,-205,40,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'_COMPLEX':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[41,41,-60,-62,-63,-64,-65,-66,41,41,-67,-68,-52,-309,-309,-309,-116,-93,41,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,41,-84,41,41,41,-89,-90,-91,-92,-83,-69,41,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,41,-70,41,-85,41,41,41,-30,-167,41,41,41,-135,-142,-308,41,-145,-146,-130,41,41,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,41,-71,-35,-36,41,41,-154,41,-137,41,-139,-134,-143,-128,-129,-131,-202,-201,41,-218,41,-78,-80,41,-214,-215,-217,41,41,41,-31,-34,41,41,-155,-156,-136,-138,-144,-203,-205,41,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'SIGNED':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[42,42,-60,-62,-63,-64,-65,-66,42,42,-67,-68,-52,-309,-309,-309,-116,-93,42,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,42,-84,42,42,42,-89,-90,-91,-92,-83,-69,42,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,42,-70,42,-85,42,42,42,-30,-167,42,42,42,-135,-142,-308,42,-145,-146,-130,42,42,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,42,-71,-35,-36,42,42,-154,42,-137,42,-139,-134,-143,-128,-129,-131,-202,-201,42,-218,42,-78,-80,42,-214,-215,-217,42,42,42,-31,-34,42,42,-155,-156,-136,-138,-144,-203,-205,42,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'UNSIGNED':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[43,43,-60,-62,-63,-64,-65,-66,43,43,-67,-68,-52,-309,-309,-309,-116,-93,43,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,43,-84,43,43,43,-89,-90,-91,-92,-83,-69,43,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,43,-70,43,-85,43,43,43,-30,-167,43,43,43,-135,-142,-308,43,-145,-146,-130,43,43,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,43,-71,-35,-36,43,43,-154,43,-137,43,-139,-134,-143,-128,-129,-131,-202,-201,43,-218,43,-78,-80,43,-214,-215,-217,43,43,43,-31,-34,43,43,-155,-156,-136,-138,-144,-203,-205,43,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'__INT128':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[44,44,-60,-62,-63,-64,-65,-66,44,44,-67,-68,-52,-309,-309,-309,-116,-93,44,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,44,-84,44,44,44,-89,-90,-91,-92,-83,-69,44,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,44,-70,44,-85,44,44,44,-30,-167,44,44,44,-135,-142,-308,44,-145,-146,-130,44,44,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,44,-71,-35,-36,44,44,-154,44,-137,44,-139,-134,-143,-128,-129,-131,-202,-201,44,-218,44,-78,-80,44,-214,-215,-217,44,44,44,-31,-34,44,44,-155,-156,-136,-138,-144,-203,-205,44,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'CONST':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[45,45,-60,-62,-63,-64,-65,-66,45,45,-67,-68,-52,45,45,45,-116,-93,-29,-97,45,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,45,-84,45,45,-89,-90,-91,-92,-83,-69,45,45,-53,-94,45,-166,-152,-153,-307,-132,-133,45,-70,45,-85,45,45,45,45,45,-30,-167,45,45,45,-135,-142,-308,45,-145,-146,-130,45,45,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,45,-71,45,45,-35,-36,45,45,45,-154,45,-137,45,-139,-134,-143,-128,-129,-131,-202,-201,45,-218,45,-78,-80,45,-214,-215,-217,45,45,45,-31,-34,45,45,45,-155,-156,-136,-138,-144,-203,-205,45,-79,-213,-216,-32,-33,45,45,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'RESTRICT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[46,46,-60,-62,-63,-64,-65,-66,46,46,-67,-68,-52,46,46,46,-116,-93,-29,-97,46,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,46,-84,46,46,-89,-90,-91,-92,-83,-69,46,46,-53,-94,46,-166,-152,-153,-307,-132,-133,46,-70,46,-85,46,46,46,46,46,-30,-167,46,46,46,-135,-142,-308,46,-145,-146,-130,46,46,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,46,-71,46,46,-35,-36,46,46,46,-154,46,-137,46,-139,-134,-143,-128,-129,-131,-202,-201,46,-218,46,-78,-80,46,-214,-215,-217,46,46,46,-31,-34,46,46,46,-155,-156,-136,-138,-144,-203,-205,46,-79,-213,-216,-32,-33,46,46,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'VOLATILE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[47,47,-60,-62,-63,-64,-65,-66,47,47,-67,-68,-52,47,47,47,-116,-93,-29,-97,47,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,47,-84,47,47,-89,-90,-91,-92,-83,-69,47,47,-53,-94,47,-166,-152,-153,-307,-132,-133,47,-70,47,-85,47,47,47,47,47,-30,-167,47,47,47,-135,-142,-308,47,-145,-146,-130,47,47,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,47,-71,47,47,-35,-36,47,47,47,-154,47,-137,47,-139,-134,-143,-128,-129,-131,-202,-201,47,-218,47,-78,-80,47,-214,-215,-217,47,47,47,-31,-34,47,47,47,-155,-156,-136,-138,-144,-203,-205,47,-79,-213,-216,-32,-33,47,47,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'AUTO':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[48,48,-60,-62,-63,-64,-65,-66,48,48,-67,-68,-52,48,48,48,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,48,-84,48,48,-89,-90,-91,-92,-83,-69,48,-53,-94,-152,-153,-307,-132,-133,-70,48,-85,48,48,-30,-135,-308,48,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,48,48,-154,-137,-139,-134,-202,-201,-218,-78,-80,48,-214,-215,-217,-31,-34,48,48,-155,-156,-136,-138,-203,-205,48,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'REGISTER':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[49,49,-60,-62,-63,-64,-65,-66,49,49,-67,-68,-52,49,49,49,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,49,-84,49,49,-89,-90,-91,-92,-83,-69,49,-53,-94,-152,-153,-307,-132,-133,-70,49,-85,49,49,-30,-135,-308,49,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,49,49,-154,-137,-139,-134,-202,-201,-218,-78,-80,49,-214,-215,-217,-31,-34,49,49,-155,-156,-136,-138,-203,-205,49,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'STATIC':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,97,98,99,101,102,103,105,106,107,114,115,118,126,131,133,142,144,152,153,154,155,156,157,158,159,160,161,162,210,218,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,360,361,370,371,372,375,376,381,384,390,395,398,399,442,443,446,458,491,492,494,495,519,521,527,529,],[25,25,-60,-62,-63,-64,-65,-66,25,25,-67,-68,-52,25,25,25,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,25,-84,25,25,-89,-90,-91,-92,-83,-69,117,25,-53,-94,-166,-152,-153,-307,-132,-133,-70,25,-85,217,25,226,25,-30,-167,-135,-308,25,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,348,-35,-36,25,25,-154,-137,-139,-134,-202,-201,-218,-78,-80,25,-214,-215,-217,-31,-34,445,25,25,-155,-156,-136,-138,-203,-205,25,-79,-213,-216,-32,-33,484,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'EXTERN':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[50,50,-60,-62,-63,-64,-65,-66,50,50,-67,-68,-52,50,50,50,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,50,-84,50,50,-89,-90,-91,-92,-83,-69,50,-53,-94,-152,-153,-307,-132,-133,-70,50,-85,50,50,-30,-135,-308,50,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,50,50,-154,-137,-139,-134,-202,-201,-218,-78,-80,50,-214,-215,-217,-31,-34,50,50,-155,-156,-136,-138,-203,-205,50,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'TYPEDEF':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[51,51,-60,-62,-63,-64,-65,-66,51,51,-67,-68,-52,51,51,51,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,51,-84,51,51,-89,-90,-91,-92,-83,-69,51,-53,-94,-152,-153,-307,-132,-133,-70,51,-85,51,51,-30,-135,-308,51,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,51,51,-154,-137,-139,-134,-202,-201,-218,-78,-80,51,-214,-215,-217,-31,-34,51,51,-155,-156,-136,-138,-203,-205,51,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'INLINE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[52,52,-60,-62,-63,-64,-65,-66,52,52,-67,-68,-52,52,52,52,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,52,-84,52,52,-89,-90,-91,-92,-83,-69,52,-53,-94,-152,-153,-307,-132,-133,-70,52,-85,52,52,-30,-135,-308,52,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,52,52,-154,-137,-139,-134,-202,-201,-218,-78,-80,52,-214,-215,-217,-31,-34,52,52,-155,-156,-136,-138,-203,-205,52,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'STRUCT':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[53,53,-60,-62,-63,-64,-65,-66,53,-67,-68,-52,-309,-309,-309,53,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,53,-84,53,53,-83,-69,53,-53,-86,-9,-10,-87,-88,-166,-307,53,-70,53,-85,53,53,-30,-167,53,53,53,-142,-308,-145,-146,53,53,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,53,-71,-35,-36,53,53,53,53,-143,-202,-201,53,-218,-78,-80,53,-214,-215,-217,53,53,53,-31,-34,53,53,-144,-203,-205,53,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'UNION':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[54,54,-60,-62,-63,-64,-65,-66,54,-67,-68,-52,-309,-309,-309,54,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,54,-84,54,54,-83,-69,54,-53,-86,-9,-10,-87,-88,-166,-307,54,-70,54,-85,54,54,-30,-167,54,54,54,-142,-308,-145,-146,54,54,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,54,-71,-35,-36,54,54,54,54,-143,-202,-201,54,-218,-78,-80,54,-214,-215,-217,54,54,54,-31,-34,54,54,-144,-203,-205,54,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'LBRACE':([10,14,15,23,31,32,53,54,56,57,58,59,62,77,78,81,98,99,101,102,103,106,107,109,113,130,131,144,152,153,154,155,156,157,158,159,160,161,162,172,215,227,228,264,265,267,272,273,282,283,286,287,289,338,339,340,351,352,381,382,384,386,395,398,399,432,434,442,443,458,459,460,461,463,464,472,473,476,477,491,492,494,495,508,510,519,521,523,526,527,529,],[-309,-68,-52,-29,101,101,-140,-141,101,-7,-8,-84,-309,-83,-69,-53,101,101,-307,101,101,101,-85,101,101,101,-30,-308,101,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,101,-309,-35,-36,-202,-201,101,101,-218,101,-80,-214,-215,-217,-11,101,-12,-31,-34,-203,101,-205,101,-79,-213,-216,-309,-182,-32,-33,-204,101,101,-309,101,101,101,101,101,-11,-206,-80,-208,-209,101,-309,-207,-210,101,101,-212,-211,]),'RBRACE':([14,77,78,101,104,106,127,136,137,138,139,140,141,143,144,146,147,150,151,152,153,154,155,156,157,158,159,160,161,162,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,214,215,244,245,247,249,251,254,264,265,269,270,273,282,283,286,287,289,325,326,327,329,330,331,333,334,336,337,338,373,374,377,381,384,387,395,398,399,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,431,432,433,458,462,469,470,473,475,491,492,493,494,495,499,503,509,510,514,519,520,521,527,529,],[-68,-83,-69,-307,144,-309,-294,144,-157,-160,144,144,144,-142,-308,-145,-146,144,-5,-6,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-177,-309,144,144,-158,144,144,-143,-202,-201,-235,-257,-218,-78,-80,-214,-215,-217,-279,-280,-260,-261,-262,-263,-304,-306,144,-22,-21,-159,-161,-144,-203,-205,-287,-79,-213,-216,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-178,144,-180,-204,-258,-272,-273,-264,-179,-206,-80,144,-208,-209,-237,-181,-281,144,-288,-207,-282,-210,-212,-211,]),'CASE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,164,-308,164,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,164,-202,-201,164,164,-218,164,-80,-214,-215,-217,-203,164,-205,-79,-213,-216,-204,164,164,164,-206,-80,-208,-209,164,-207,-210,164,164,-212,-211,]),'DEFAULT':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,165,-308,165,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,165,-202,-201,165,165,-218,165,-80,-214,-215,-217,-203,165,-205,-79,-213,-216,-204,165,165,165,-206,-80,-208,-209,165,-207,-210,165,165,-212,-211,]),'IF':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,167,-308,167,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,167,-202,-201,167,167,-218,167,-80,-214,-215,-217,-203,167,-205,-79,-213,-216,-204,167,167,167,-206,-80,-208,-209,167,-207,-210,167,167,-212,-211,]),'SWITCH':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,170,-308,170,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,170,-202,-201,170,170,-218,170,-80,-214,-215,-217,-203,170,-205,-79,-213,-216,-204,170,170,170,-206,-80,-208,-209,170,-207,-210,170,170,-212,-211,]),'WHILE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,281,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,171,-308,171,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,171,-202,-201,171,171,-218,394,171,-80,-214,-215,-217,-203,171,-205,-79,-213,-216,-204,171,171,171,-206,-80,-208,-209,171,-207,-210,171,171,-212,-211,]),'DO':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,172,-308,172,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,172,-202,-201,172,172,-218,172,-80,-214,-215,-217,-203,172,-205,-79,-213,-216,-204,172,172,172,-206,-80,-208,-209,172,-207,-210,172,172,-212,-211,]),'FOR':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,173,-308,173,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,173,-202,-201,173,173,-218,173,-80,-214,-215,-217,-203,173,-205,-79,-213,-216,-204,173,173,173,-206,-80,-208,-209,173,-207,-210,173,173,-212,-211,]),'GOTO':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,174,-308,174,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,174,-202,-201,174,174,-218,174,-80,-214,-215,-217,-203,174,-205,-79,-213,-216,-204,174,174,174,-206,-80,-208,-209,174,-207,-210,174,174,-212,-211,]),'BREAK':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,175,-308,175,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,175,-202,-201,175,175,-218,175,-80,-214,-215,-217,-203,175,-205,-79,-213,-216,-204,175,175,175,-206,-80,-208,-209,175,-207,-210,175,175,-212,-211,]),'CONTINUE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,176,-308,176,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,176,-202,-201,176,176,-218,176,-80,-214,-215,-217,-203,176,-205,-79,-213,-216,-204,176,176,176,-206,-80,-208,-209,176,-207,-210,176,176,-212,-211,]),'RETURN':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,177,-308,177,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,177,-202,-201,177,177,-218,177,-80,-214,-215,-217,-203,177,-205,-79,-213,-216,-204,177,177,177,-206,-80,-208,-209,177,-207,-210,177,177,-212,-211,]),'PLUSPLUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,183,183,-309,183,-309,-28,-294,183,-167,-308,183,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,183,183,183,183,325,183,183,183,183,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,183,-309,-28,-266,183,183,-309,183,183,-202,-201,183,183,183,-218,183,183,183,183,183,-80,183,-214,-215,-217,183,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,-279,-280,183,183,-304,-306,-11,183,-12,183,-266,183,183,-309,183,183,183,-203,183,-205,183,-287,-79,183,-213,-216,-274,-275,-276,-277,-278,-309,-182,183,-309,-28,-266,-204,183,183,-309,183,183,183,183,183,-272,-273,183,183,-11,-266,183,183,-206,-80,-208,-209,183,183,-281,-309,183,-288,183,-207,-282,-210,183,183,-212,-211,]),'MINUSMINUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,184,184,-309,184,-309,-28,-294,184,-167,-308,184,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,184,184,184,184,326,184,184,184,184,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,184,-309,-28,-266,184,184,-309,184,184,-202,-201,184,184,184,-218,184,184,184,184,184,-80,184,-214,-215,-217,184,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,-279,-280,184,184,-304,-306,-11,184,-12,184,-266,184,184,-309,184,184,184,-203,184,-205,184,-287,-79,184,-213,-216,-274,-275,-276,-277,-278,-309,-182,184,-309,-28,-266,-204,184,184,-309,184,184,184,184,184,-272,-273,184,184,-11,-266,184,184,-206,-80,-208,-209,184,184,-281,-309,184,-288,184,-207,-282,-210,184,184,-212,-211,]),'SIZEOF':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,187,187,-309,187,-309,-28,187,-167,-308,187,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,187,187,187,187,187,187,187,187,-266,-267,-268,-265,-269,-270,-309,187,-309,-28,-266,187,187,-309,187,187,-202,-201,187,187,187,-218,187,187,187,187,187,-80,187,-214,-215,-217,187,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,-11,187,-12,187,-266,187,187,-309,187,187,187,-203,187,-205,187,-79,187,-213,-216,-309,-182,187,-309,-28,-266,-204,187,187,-309,187,187,187,187,187,187,187,-11,-266,187,187,-206,-80,-208,-209,187,187,-309,187,187,-207,-210,187,187,-212,-211,]),'AND':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,191,191,-309,191,-309,-28,-294,191,-167,-308,191,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,191,191,191,191,-257,316,-259,191,191,191,-238,191,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,191,-309,-28,-266,191,191,-309,191,191,-202,-201,191,-257,191,191,-218,191,191,191,191,191,-80,191,-214,-215,-217,191,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,-279,-280,-260,191,-261,-262,-263,191,-304,-306,-11,191,-12,191,-266,191,191,-309,191,191,191,-203,191,-205,191,-287,-79,191,-213,-216,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,316,316,316,316,-274,-275,-276,-277,-278,-309,-182,191,-309,-28,-266,-204,191,191,-309,-258,191,191,191,191,191,-272,-273,191,-264,191,-11,-266,191,191,-206,-80,-208,-209,191,191,-281,-309,191,-288,191,-207,-282,-210,191,191,-212,-211,]),'PLUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,189,189,-309,189,-309,-28,-294,189,-167,-308,189,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,189,189,189,189,-257,306,-259,189,189,189,-238,189,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,189,-309,-28,-266,189,189,-309,189,189,-202,-201,189,-257,189,189,-218,189,189,189,189,189,-80,189,-214,-215,-217,189,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,-279,-280,-260,189,-261,-262,-263,189,-304,-306,-11,189,-12,189,-266,189,189,-309,189,189,189,-203,189,-205,189,-287,-79,189,-213,-216,-239,-240,-241,-242,-243,306,306,306,306,306,306,306,306,306,306,306,306,306,-274,-275,-276,-277,-278,-309,-182,189,-309,-28,-266,-204,189,189,-309,-258,189,189,189,189,189,-272,-273,189,-264,189,-11,-266,189,189,-206,-80,-208,-209,189,189,-281,-309,189,-288,189,-207,-282,-210,189,189,-212,-211,]),'MINUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,190,190,-309,190,-309,-28,-294,190,-167,-308,190,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,190,190,190,190,-257,307,-259,190,190,190,-238,190,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,190,-309,-28,-266,190,190,-309,190,190,-202,-201,190,-257,190,190,-218,190,190,190,190,190,-80,190,-214,-215,-217,190,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,-279,-280,-260,190,-261,-262,-263,190,-304,-306,-11,190,-12,190,-266,190,190,-309,190,190,190,-203,190,-205,190,-287,-79,190,-213,-216,-239,-240,-241,-242,-243,307,307,307,307,307,307,307,307,307,307,307,307,307,-274,-275,-276,-277,-278,-309,-182,190,-309,-28,-266,-204,190,190,-309,-258,190,190,190,190,190,-272,-273,190,-264,190,-11,-266,190,190,-206,-80,-208,-209,190,190,-281,-309,190,-288,190,-207,-282,-210,190,190,-212,-211,]),'NOT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,193,193,-309,193,-309,-28,193,-167,-308,193,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,193,193,193,193,193,193,193,193,-266,-267,-268,-265,-269,-270,-309,193,-309,-28,-266,193,193,-309,193,193,-202,-201,193,193,193,-218,193,193,193,193,193,-80,193,-214,-215,-217,193,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,-11,193,-12,193,-266,193,193,-309,193,193,193,-203,193,-205,193,-79,193,-213,-216,-309,-182,193,-309,-28,-266,-204,193,193,-309,193,193,193,193,193,193,193,-11,-266,193,193,-206,-80,-208,-209,193,193,-309,193,193,-207,-210,193,193,-212,-211,]),'LNOT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,194,194,-309,194,-309,-28,194,-167,-308,194,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,194,194,194,194,194,194,194,194,-266,-267,-268,-265,-269,-270,-309,194,-309,-28,-266,194,194,-309,194,194,-202,-201,194,194,194,-218,194,194,194,194,194,-80,194,-214,-215,-217,194,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,-11,194,-12,194,-266,194,194,-309,194,194,194,-203,194,-205,194,-79,194,-213,-216,-309,-182,194,-309,-28,-266,-204,194,194,-309,194,194,194,194,194,194,194,-11,-266,194,194,-206,-80,-208,-209,194,194,-309,194,194,-207,-210,194,194,-212,-211,]),'OFFSETOF':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,199,199,-309,199,-309,-28,199,-167,-308,199,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,199,199,199,199,199,199,199,199,-266,-267,-268,-265,-269,-270,-309,199,-309,-28,-266,199,199,-309,199,199,-202,-201,199,199,199,-218,199,199,199,199,199,-80,199,-214,-215,-217,199,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,-11,199,-12,199,-266,199,199,-309,199,199,199,-203,199,-205,199,-79,199,-213,-216,-309,-182,199,-309,-28,-266,-204,199,199,-309,199,199,199,199,199,199,199,-11,-266,199,199,-206,-80,-208,-209,199,199,-309,199,199,-207,-210,199,199,-212,-211,]),'INT_CONST_DEC':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,200,200,-309,200,-309,-28,200,-167,-308,200,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,200,200,200,200,200,200,200,200,-266,-267,-268,-265,-269,-270,-309,200,-309,-28,-266,200,200,-309,200,200,-202,-201,200,200,200,-218,200,200,200,200,200,-80,200,-214,-215,-217,200,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,-11,200,-12,200,-266,200,200,-309,200,200,200,-203,200,-205,200,-79,200,-213,-216,-309,-182,200,-309,-28,-266,-204,200,200,-309,200,200,200,200,200,200,200,-11,-266,200,200,-206,-80,-208,-209,200,200,-309,200,200,-207,-210,200,200,-212,-211,]),'INT_CONST_OCT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,201,201,-309,201,-309,-28,201,-167,-308,201,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,201,201,201,201,201,201,201,201,-266,-267,-268,-265,-269,-270,-309,201,-309,-28,-266,201,201,-309,201,201,-202,-201,201,201,201,-218,201,201,201,201,201,-80,201,-214,-215,-217,201,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,-11,201,-12,201,-266,201,201,-309,201,201,201,-203,201,-205,201,-79,201,-213,-216,-309,-182,201,-309,-28,-266,-204,201,201,-309,201,201,201,201,201,201,201,-11,-266,201,201,-206,-80,-208,-209,201,201,-309,201,201,-207,-210,201,201,-212,-211,]),'INT_CONST_HEX':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,202,202,-309,202,-309,-28,202,-167,-308,202,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,202,202,202,202,202,202,202,202,-266,-267,-268,-265,-269,-270,-309,202,-309,-28,-266,202,202,-309,202,202,-202,-201,202,202,202,-218,202,202,202,202,202,-80,202,-214,-215,-217,202,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,-11,202,-12,202,-266,202,202,-309,202,202,202,-203,202,-205,202,-79,202,-213,-216,-309,-182,202,-309,-28,-266,-204,202,202,-309,202,202,202,202,202,202,202,-11,-266,202,202,-206,-80,-208,-209,202,202,-309,202,202,-207,-210,202,202,-212,-211,]),'INT_CONST_BIN':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,203,203,-309,203,-309,-28,203,-167,-308,203,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,203,203,203,203,203,203,203,203,-266,-267,-268,-265,-269,-270,-309,203,-309,-28,-266,203,203,-309,203,203,-202,-201,203,203,203,-218,203,203,203,203,203,-80,203,-214,-215,-217,203,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,-11,203,-12,203,-266,203,203,-309,203,203,203,-203,203,-205,203,-79,203,-213,-216,-309,-182,203,-309,-28,-266,-204,203,203,-309,203,203,203,203,203,203,203,-11,-266,203,203,-206,-80,-208,-209,203,203,-309,203,203,-207,-210,203,203,-212,-211,]),'FLOAT_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,204,204,-309,204,-309,-28,204,-167,-308,204,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,204,204,204,204,204,204,204,204,-266,-267,-268,-265,-269,-270,-309,204,-309,-28,-266,204,204,-309,204,204,-202,-201,204,204,204,-218,204,204,204,204,204,-80,204,-214,-215,-217,204,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,-11,204,-12,204,-266,204,204,-309,204,204,204,-203,204,-205,204,-79,204,-213,-216,-309,-182,204,-309,-28,-266,-204,204,204,-309,204,204,204,204,204,204,204,-11,-266,204,204,-206,-80,-208,-209,204,204,-309,204,204,-207,-210,204,204,-212,-211,]),'HEX_FLOAT_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,205,205,-309,205,-309,-28,205,-167,-308,205,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,205,205,205,205,205,205,205,205,-266,-267,-268,-265,-269,-270,-309,205,-309,-28,-266,205,205,-309,205,205,-202,-201,205,205,205,-218,205,205,205,205,205,-80,205,-214,-215,-217,205,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,-11,205,-12,205,-266,205,205,-309,205,205,205,-203,205,-205,205,-79,205,-213,-216,-309,-182,205,-309,-28,-266,-204,205,205,-309,205,205,205,205,205,205,205,-11,-266,205,205,-206,-80,-208,-209,205,205,-309,205,205,-207,-210,205,205,-212,-211,]),'CHAR_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,206,206,-309,206,-309,-28,206,-167,-308,206,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,206,206,206,206,206,206,206,206,-266,-267,-268,-265,-269,-270,-309,206,-309,-28,-266,206,206,-309,206,206,-202,-201,206,206,206,-218,206,206,206,206,206,-80,206,-214,-215,-217,206,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,-11,206,-12,206,-266,206,206,-309,206,206,206,-203,206,-205,206,-79,206,-213,-216,-309,-182,206,-309,-28,-266,-204,206,206,-309,206,206,206,206,206,206,206,-11,-266,206,206,-206,-80,-208,-209,206,206,-309,206,206,-207,-210,206,206,-212,-211,]),'WCHAR_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,207,207,-309,207,-309,-28,207,-167,-308,207,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,207,207,207,207,207,207,207,207,-266,-267,-268,-265,-269,-270,-309,207,-309,-28,-266,207,207,-309,207,207,-202,-201,207,207,207,-218,207,207,207,207,207,-80,207,-214,-215,-217,207,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,-11,207,-12,207,-266,207,207,-309,207,207,207,-203,207,-205,207,-79,207,-213,-216,-309,-182,207,-309,-28,-266,-204,207,207,-309,207,207,207,207,207,207,207,-11,-266,207,207,-206,-80,-208,-209,207,207,-309,207,207,-207,-210,207,207,-212,-211,]),'STRING_LITERAL':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,197,208,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,333,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,208,208,-309,208,-309,-28,208,-167,-308,208,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,208,208,208,208,208,208,208,208,-266,-267,-268,-265,-269,-270,333,-303,-309,208,-309,-28,-266,208,208,-309,208,208,-202,-201,208,208,208,-218,208,208,208,208,208,-80,208,-214,-215,-217,208,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,-304,-11,208,-12,208,-266,208,208,-309,208,208,208,-203,208,-205,208,-79,208,-213,-216,-309,-182,208,-309,-28,-266,-204,208,208,-309,208,208,208,208,208,208,208,-11,-266,208,208,-206,-80,-208,-209,208,208,-309,208,208,-207,-210,208,208,-212,-211,]),'WSTRING_LITERAL':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,198,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,209,209,-309,209,-309,-28,209,-167,-308,209,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,209,209,209,209,209,209,209,209,-266,-267,-268,-265,-269,-270,334,-305,-309,209,-309,-28,-266,209,209,-309,209,209,-202,-201,209,209,209,-218,209,209,209,209,209,-80,209,-214,-215,-217,209,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,-306,-11,209,-12,209,-266,209,209,-309,209,209,209,-203,209,-205,209,-79,209,-213,-216,-309,-182,209,-309,-28,-266,-204,209,209,-309,209,209,209,209,209,209,209,-11,-266,209,209,-206,-80,-208,-209,209,209,-309,209,209,-207,-210,209,209,-212,-211,]),'ELSE':([14,78,144,156,157,158,159,160,161,162,264,273,282,283,286,287,289,381,384,395,398,399,458,491,492,494,495,519,521,527,529,],[-68,-69,-308,-72,-73,-74,-75,-76,-77,-78,-202,-218,-78,-80,-214,-215,-217,-203,-205,-79,-213,-216,-204,-206,508,-208,-209,-207,-210,-212,-211,]),'PPPRAGMASTR':([14,],[78,]),'EQUALS':([15,23,62,73,74,75,76,81,92,108,110,127,131,138,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,227,228,270,325,326,327,329,330,331,333,334,341,342,349,350,351,352,387,422,424,425,426,427,435,437,438,439,442,443,462,469,470,473,478,479,480,509,514,520,],[-52,-29,-162,113,-163,-54,-37,-53,130,-162,-55,-294,-30,248,-308,-294,291,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,-35,-36,-257,-279,-280,-260,-261,-262,-263,-304,-306,434,-183,-43,-44,-31,-34,-287,-274,-275,-276,-277,-278,-184,-186,-39,-42,-32,-33,-258,-272,-273,-264,-185,-40,-41,-281,-288,-282,]),'COMMA':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,62,63,64,65,66,70,72,73,74,75,76,81,87,90,91,92,94,95,96,97,98,99,102,103,108,110,121,123,124,125,126,127,131,132,133,136,137,138,142,144,148,163,169,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,211,212,213,214,227,228,231,232,233,234,235,236,237,240,241,242,243,244,245,246,247,250,252,253,256,257,259,260,261,263,269,270,276,277,288,325,326,327,329,330,331,333,334,337,349,350,351,352,356,357,358,359,371,372,373,374,375,376,380,385,387,388,389,391,392,393,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,430,431,433,438,439,442,443,449,450,452,456,457,462,469,470,473,475,479,480,485,486,487,488,489,490,493,496,499,500,503,504,505,509,514,517,518,520,525,],[-52,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-162,-89,-90,-91,-92,111,-120,-122,-163,-54,-37,-53,-94,129,-124,-126,-164,-27,-28,-166,-152,-153,-132,-133,-162,-55,229,230,-170,-175,-309,-294,-30,-165,-167,247,-157,-160,-135,-308,-130,-294,278,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-121,-38,-123,-177,-35,-36,-172,-173,-174,-188,-56,-1,-2,-45,-190,-125,-127,247,247,-154,-158,-137,-139,-134,-128,-129,378,-147,-149,-131,-235,-257,278,-309,278,-279,-280,-260,-261,-262,-263,-304,-306,432,-43,-44,-31,-34,-171,-176,-57,-189,-155,-156,-159,-161,-136,-138,-151,278,-287,-187,-188,-220,278,278,-223,278,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,278,471,-274,-292,-275,-276,-277,-278,474,-178,-180,-39,-42,-32,-33,-191,-197,-195,-148,-150,-258,-272,-273,-264,-179,-40,-41,-50,-51,-193,-192,-194,-196,510,278,-237,-293,-181,-46,-49,-281,-288,-47,-48,-282,278,]),'RPAREN':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,63,64,65,66,75,76,80,81,87,93,94,95,96,97,98,99,102,103,110,112,115,119,120,121,122,123,124,125,126,127,131,132,133,142,144,148,169,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,219,220,227,228,231,232,233,234,235,236,237,238,240,241,246,250,252,253,256,257,263,266,270,275,276,277,322,325,326,327,329,330,331,333,334,349,350,351,352,355,356,357,358,359,361,362,363,364,365,366,370,371,372,375,376,383,385,387,388,389,390,391,392,393,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,421,422,423,424,425,426,427,428,429,438,439,442,443,447,448,449,450,452,455,462,469,470,473,479,480,485,486,487,488,489,490,496,498,499,500,501,502,504,505,509,512,513,514,517,518,520,522,524,528,],[-52,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-89,-90,-91,-92,-54,-37,-309,-53,-94,131,-164,-27,-28,-166,-152,-153,-132,-133,-55,212,-309,227,228,-168,-17,-18,-170,-175,-309,-294,-30,-165,-167,-135,-308,-130,-14,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,349,350,-35,-36,-172,-173,-174,-188,-56,-1,-2,-309,-45,-190,-154,-137,-139,-134,-128,-129,-131,-13,-257,386,387,-309,422,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-169,-171,-176,-57,-189,-309,449,450,-188,-23,-24,-309,-155,-156,-136,-138,459,460,-287,-187,-188,-309,-220,463,464,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,470,-274,-292,-275,-276,-277,-278,472,473,-39,-42,-32,-33,485,486,-191,-197,-195,490,-258,-272,-273,-264,-40,-41,-50,-51,-193,-192,-194,-196,511,-309,-237,-293,514,-289,-46,-49,-281,-309,523,-288,-47,-48,-282,526,-290,-291,]),'COLON':([15,20,23,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,74,75,76,81,98,99,102,103,108,110,127,131,142,144,145,148,163,165,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,227,228,246,250,252,253,256,257,261,263,268,269,270,325,326,327,329,330,331,333,334,349,350,351,352,371,372,375,376,378,387,391,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,438,439,442,443,462,469,470,473,479,480,499,509,514,520,],[-52,-116,-29,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-163,-54,-37,-53,-152,-153,-132,-133,-162,-55,-294,-30,-135,-308,262,-130,267,272,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,-35,-36,-154,-137,-139,-134,-128,-129,379,-131,382,-235,-257,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-155,-156,-136,-138,262,-287,-220,-223,468,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-39,-42,-32,-33,-258,-272,-273,-264,-40,-41,-237,-281,-288,-282,]),'LBRACKET':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,63,64,65,66,75,76,81,87,94,95,96,97,98,99,101,102,103,110,126,127,131,132,133,142,144,148,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,215,227,228,234,235,238,240,241,246,250,252,253,256,257,263,277,325,326,333,334,341,342,349,350,351,352,358,359,364,371,372,375,376,387,389,390,422,424,425,426,427,432,435,437,438,439,442,443,449,450,452,461,469,470,478,479,480,485,486,487,488,489,490,501,502,504,505,509,510,514,517,518,520,524,528,],[79,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-89,-90,-91,-92,114,-37,79,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,114,239,-294,-30,-165,-167,-135,-308,-130,-294,321,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,343,-35,-36,239,360,239,-45,369,-154,-137,-139,-134,-128,-129,-131,239,-279,-280,-304,-306,343,-183,-43,-44,-31,-34,360,369,239,-155,-156,-136,-138,-287,239,239,-274,-275,-276,-277,-278,343,-184,-186,-39,-42,-32,-33,-191,-197,-195,343,-272,-273,-185,-40,-41,-50,-51,-193,-192,-194,-196,516,-289,-46,-49,-281,343,-288,-47,-48,-282,-290,-291,]),'RBRACKET':([45,46,47,79,95,96,97,114,116,118,127,133,144,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,216,218,221,222,223,224,239,269,270,325,326,327,329,330,331,333,334,345,346,353,354,360,367,368,369,387,391,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,422,424,425,426,427,436,440,441,444,446,451,453,454,462,469,470,473,481,482,499,506,507,509,514,520,525,],[-117,-118,-119,-309,-27,-28,-166,-309,-309,-28,-294,-167,-308,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,-28,351,352,-3,-4,-309,-235,-257,-279,-280,-260,-261,-262,-263,-304,-306,438,439,442,443,-309,-309,452,-309,-287,-220,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,469,-274,-275,-276,-277,-278,478,479,480,-309,-28,487,488,489,-258,-272,-273,-264,504,505,-237,517,518,-281,-288,-282,528,]),'PERIOD':([101,127,144,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,325,326,333,334,341,342,387,422,424,425,426,427,432,435,437,461,469,470,478,501,502,509,510,514,520,524,528,],[-307,-294,-308,-294,323,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,344,-279,-280,-304,-306,344,-183,-287,-274,-275,-276,-277,-278,344,-184,-186,344,-272,-273,-185,515,-289,-281,344,-288,-282,-290,-291,]),'ARROW':([127,144,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,325,326,333,334,387,422,424,425,426,427,469,470,509,514,520,],[-294,-308,-294,324,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-279,-280,-304,-306,-287,-274,-275,-276,-277,-278,-272,-273,-281,-288,-282,]),'XOREQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,292,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'TIMESEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,293,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'DIVEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,294,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MODEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,295,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'PLUSEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,296,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MINUSEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,297,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LSHIFTEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,298,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'RSHIFTEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,299,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'ANDEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,300,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'OREQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,301,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'CONDOP':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,302,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'DIVIDE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,304,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MOD':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,305,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'RSHIFT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,308,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,308,308,308,308,308,308,308,308,308,308,308,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LSHIFT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,309,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,309,309,309,309,309,309,309,309,309,309,309,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,310,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,310,310,310,310,310,310,310,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,311,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,311,311,311,311,311,311,311,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'GE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,312,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,312,312,312,312,312,312,312,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'GT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,313,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,313,313,313,313,313,313,313,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'EQ':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,314,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,314,314,314,314,314,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'NE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,315,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,315,315,315,315,315,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'OR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,317,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,317,317,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'XOR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,318,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,318,-254,318,318,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LAND':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,319,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,319,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LOR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,320,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'ELLIPSIS':([229,],[355,]),} -_lr_action = { } +_lr_action = {} for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): - if not _x in _lr_action: _lr_action[_x] = { } + if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items -_lr_goto_items = {'storage_class_specifier':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,]),'identifier_list_opt':([66,],[106,]),'selection_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[298,298,298,298,298,298,298,298,298,298,298,298,]),'constant':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,]),'unary_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[120,120,120,220,231,234,120,240,120,120,120,231,231,120,120,120,120,120,120,120,120,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,120,231,231,231,120,120,231,120,120,231,120,231,120,120,120,120,120,120,120,231,231,120,120,120,120,120,120,120,120,120,120,120,120,120,]),'conditional_expression':([72,77,103,141,162,164,170,181,192,195,196,213,219,226,227,230,233,257,264,266,281,288,289,297,309,335,373,375,376,380,384,385,393,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[151,151,151,151,151,151,151,305,305,151,151,151,151,151,151,151,151,151,305,151,151,305,151,151,305,151,151,151,151,151,151,151,151,419,151,151,151,151,151,151,151,151,151,151,151,151,151,]),'brace_close':([93,101,172,173,188,189,261,299,362,418,429,],[174,191,302,303,310,311,359,383,404,430,437,]),'struct_or_union_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,]),'unified_wstring_literal':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,]),'abstract_declarator_opt':([110,239,],[199,337,]),'iteration_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[277,277,277,277,277,277,277,277,277,277,277,277,]),'init_declarator_list':([30,86,],[71,71,]),'translation_unit_or_empty':([0,],[8,]),'struct_declaration_list':([57,91,92,],[93,172,173,]),'block_item_list_opt':([170,],[299,]),'enumerator':([64,98,99,190,],[100,100,100,312,]),'pp_directive':([0,22,],[11,11,]),'abstract_declarator':([30,78,86,97,110,167,239,338,],[79,161,79,185,201,161,201,161,]),'declaration_specifiers_opt':([1,14,42,44,],[50,58,83,84,]),'external_declaration':([0,22,],[12,61,]),'type_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[14,14,14,14,14,14,14,94,14,14,14,14,94,94,94,94,94,94,14,14,14,94,94,14,94,94,94,94,14,14,14,]),'designation':([155,362,399,429,],[260,260,260,260,]),'compound_statement':([88,163,170,289,297,375,384,411,423,425,427,441,443,446,],[169,272,282,282,282,282,282,282,282,282,282,282,282,282,]),'pointer':([0,4,22,30,68,78,86,97,110,117,167,239,306,338,],[16,16,16,74,116,74,166,166,74,16,166,339,16,339,]),'type_name':([141,219,229,230,233,],[237,322,331,332,333,]),'unified_string_literal':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,]),'postfix_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,]),'assignment_expression_opt':([72,103,164,],[131,193,273,]),'designation_opt':([155,362,399,429,],[266,402,266,402,]),'expression_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[276,276,276,276,276,276,276,276,276,276,276,276,]),'parameter_declaration':([66,78,165,167,204,338,],[109,109,109,109,320,109,]),'initializer_list_opt':([155,],[261,]),'cast_expression':([72,77,103,134,141,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[132,132,132,232,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,398,132,132,132,132,132,132,132,398,132,132,132,132,132,132,132,132,132,132,132,132,132,132,]),'init_declarator':([30,86,117,],[75,75,205,]),'struct_declarator_list':([97,],[182,]),'unary_operator':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,]),'brace_open':([7,24,54,56,62,63,77,88,162,163,170,266,289,297,336,375,384,390,395,396,402,411,423,425,427,441,443,446,],[57,64,91,92,98,99,155,170,155,170,170,155,170,170,399,170,170,399,399,399,155,170,170,170,170,170,170,170,]),'assignment_operator':([120,],[213,]),'struct_or_union':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,]),'identifier':([66,72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,203,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,263,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,394,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[114,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,318,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,360,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,417,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,]),'struct_declaration':([57,91,92,93,172,173,],[95,95,95,175,175,175,]),'assignment_expression':([72,77,103,141,162,164,170,195,196,213,219,226,227,230,233,257,266,281,289,297,335,373,375,376,380,384,385,393,402,408,411,421,423,425,426,427,432,438,441,443,446,],[136,156,136,238,156,136,238,316,317,321,238,238,328,238,238,238,156,238,238,238,397,238,238,238,238,238,238,416,156,238,238,238,238,238,238,238,238,238,238,238,238,]),'parameter_type_list':([66,78,165,167,338,],[108,159,159,159,159,]),'type_qualifier_list_opt':([28,65,105,],[68,103,196,]),'direct_declarator':([0,4,16,22,30,74,78,86,97,110,117,166,167,306,],[26,26,60,26,26,60,26,26,26,26,26,60,26,26,]),'type_qualifier_list':([28,65,105,],[67,104,67,]),'designator':([155,267,362,399,429,],[262,364,262,262,262,]),'argument_expression_list':([227,],[330,]),'initializer':([77,162,266,402,],[154,271,363,420,]),'specifier_qualifier_list_opt':([94,96,],[178,180,]),'constant_expression':([181,192,264,288,309,],[304,313,361,377,387,]),'expression_opt':([170,289,297,373,375,384,408,411,421,423,425,427,432,438,441,443,446,],[279,279,279,407,279,279,422,279,431,279,279,279,439,442,279,279,279,]),'primary_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,]),'declaration_specifiers':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[30,52,52,30,52,52,86,110,110,86,86,110,110,86,110,86,110,86,]),'declaration':([0,22,48,80,89,170,289,373,],[31,31,87,87,171,292,292,408,]),'struct_declarator_list_opt':([97,],[183,]),'identifier_list':([66,],[111,]),'typedef_name':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,]),'parameter_type_list_opt':([78,165,167,338,],[160,275,160,160,]),'jump_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[293,293,293,293,293,293,293,293,293,293,293,293,]),'declaration_list_opt':([48,80,],[88,163,]),'struct_declarator':([97,306,],[184,386,]),'function_definition':([0,22,],[36,36,]),'binary_expression':([72,77,103,141,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,373,375,376,380,384,385,393,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,147,357,358,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,]),'parameter_list':([66,78,165,167,338,],[113,113,113,113,113,]),'init_declarator_list_opt':([30,86,],[73,73,]),'enum_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,]),'decl_body':([0,22,48,80,89,170,289,373,],[41,41,41,41,41,41,41,41,]),'type_qualifier':([0,1,14,22,28,42,44,48,57,65,66,67,78,80,89,91,92,93,94,96,104,105,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[42,42,42,42,69,42,42,42,96,69,42,115,42,42,42,96,96,96,96,96,115,69,96,42,42,42,96,96,42,96,96,96,96,42,42,42,]),'statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[291,291,382,409,414,424,433,434,436,445,447,448,]),'enumerator_list':([64,98,99,],[101,188,189,]),'labeled_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[280,280,280,280,280,280,280,280,280,280,280,280,]),'function_specifier':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,]),'specifier_qualifier_list':([57,91,92,93,94,96,141,172,173,219,229,230,233,],[97,97,97,97,179,179,239,97,97,239,239,239,239,]),'block_item':([170,289,],[295,379,]),'block_item_list':([170,],[289,]),'empty':([0,1,14,28,30,42,44,48,65,66,72,78,80,86,94,96,97,103,105,110,155,164,165,167,170,239,289,297,338,362,373,375,384,399,408,411,421,423,425,427,429,432,438,441,443,446,],[47,51,51,70,76,51,51,85,70,107,150,158,85,76,177,177,186,150,70,200,268,150,158,158,296,200,378,378,158,403,378,378,378,403,378,378,378,378,378,378,403,378,378,378,378,378,]),'translation_unit':([0,],[22,]),'initializer_list':([155,399,],[265,418,]),'declarator':([0,4,22,30,78,86,97,110,117,167,306,],[48,53,48,80,53,168,187,202,168,53,187,]),'direct_abstract_declarator':([30,74,78,86,97,110,166,167,239,338,339,],[81,153,81,81,81,81,153,81,81,81,153,]),'designator_list':([155,362,399,429,],[267,267,267,267,]),'declaration_list':([48,80,],[89,89,]),'expression':([141,170,219,226,230,233,257,281,289,297,373,375,376,380,384,385,408,411,421,423,425,426,427,432,438,441,443,446,],[236,285,236,327,236,236,356,372,285,285,285,285,410,412,285,415,285,285,285,285,285,435,285,285,285,285,285,285,]),} +_lr_goto_items = {'translation_unit_or_empty':([0,],[1,]),'translation_unit':([0,],[2,]),'empty':([0,10,11,17,18,19,22,26,60,61,62,79,80,106,114,115,116,117,126,145,152,172,215,216,217,238,239,267,272,277,282,284,360,361,367,369,370,382,390,397,432,444,445,460,461,463,464,466,498,508,510,512,523,526,],[3,57,69,83,83,83,89,95,69,89,57,95,122,151,95,122,223,95,236,258,266,266,338,223,95,365,95,266,266,236,266,266,95,122,223,223,365,266,365,266,477,223,95,266,477,266,266,266,266,266,477,266,266,266,]),'external_declaration':([0,2,],[4,55,]),'function_definition':([0,2,],[5,5,]),'declaration':([0,2,10,58,62,106,152,284,],[6,6,59,107,59,154,154,397,]),'pp_directive':([0,2,],[7,7,]),'pppragma_directive':([0,2,104,106,139,140,141,152,172,249,251,267,272,282,382,460,463,464,508,523,526,],[8,8,147,162,147,147,147,162,282,147,147,282,282,162,282,282,282,282,282,282,282,]),'id_declarator':([0,2,11,22,24,60,61,71,111,126,129,145,238,378,],[10,10,62,92,93,108,92,93,108,231,108,108,93,108,]),'declaration_specifiers':([0,2,10,58,62,80,106,115,152,229,238,284,361,370,390,],[11,11,60,60,60,126,60,126,60,126,126,60,126,126,126,]),'decl_body':([0,2,10,58,62,106,152,284,],[12,12,12,12,12,12,12,12,]),'direct_id_declarator':([0,2,11,16,22,24,60,61,68,71,111,126,129,145,234,238,364,378,],[15,15,15,81,15,15,15,15,81,15,15,15,15,15,81,15,81,15,]),'pointer':([0,2,11,22,24,60,61,71,94,111,126,129,145,238,277,378,390,],[16,16,68,16,16,68,16,68,132,68,234,68,68,364,389,68,389,]),'type_qualifier':([0,2,10,11,17,18,19,26,58,60,62,79,80,96,104,106,114,115,117,118,126,139,140,141,145,149,152,168,217,218,229,238,239,249,251,271,277,284,328,332,335,360,361,370,390,445,446,],[17,17,17,63,17,17,17,97,17,63,17,97,17,133,97,17,97,17,97,133,63,97,97,97,257,133,17,97,97,133,17,17,97,97,97,97,257,17,97,97,97,97,17,17,17,97,133,]),'storage_class_specifier':([0,2,10,11,17,18,19,58,60,62,80,106,115,126,152,229,238,284,361,370,390,],[18,18,18,64,18,18,18,18,64,18,18,18,18,64,18,18,18,18,18,18,18,]),'function_specifier':([0,2,10,11,17,18,19,58,60,62,80,106,115,126,152,229,238,284,361,370,390,],[19,19,19,65,19,19,19,19,65,19,19,19,19,65,19,19,19,19,19,19,19,]),'type_specifier_no_typeid':([0,2,10,11,22,58,60,61,62,80,104,106,115,126,128,139,140,141,145,149,152,168,229,238,249,251,271,277,284,328,332,335,361,370,390,],[20,20,20,66,20,20,66,20,20,20,20,20,20,66,20,20,20,20,256,20,20,20,20,20,20,20,20,256,20,20,20,20,20,20,20,]),'type_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[21,21,21,87,21,87,21,21,148,21,21,87,148,148,148,263,21,148,21,21,148,148,148,21,148,148,148,21,21,21,]),'declaration_specifiers_no_type':([0,2,10,17,18,19,58,62,80,106,115,152,229,238,284,361,370,390,],[22,22,61,84,84,84,61,61,128,61,128,61,128,128,61,128,128,128,]),'typedef_name':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,]),'enum_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,]),'struct_or_union_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,]),'struct_or_union':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,]),'declaration_list_opt':([10,62,],[56,109,]),'declaration_list':([10,62,],[58,58,]),'init_declarator_list_opt':([11,60,],[67,67,]),'init_declarator_list':([11,60,],[70,70,]),'init_declarator':([11,60,111,129,],[72,72,211,242,]),'declarator':([11,60,111,129,145,378,],[73,73,73,73,261,261,]),'typeid_declarator':([11,60,71,111,129,145,378,],[74,74,112,74,74,74,74,]),'direct_typeid_declarator':([11,60,68,71,111,129,145,378,],[75,75,110,75,75,75,75,75,]),'declaration_specifiers_no_type_opt':([17,18,19,],[82,85,86,]),'id_init_declarator_list_opt':([22,61,],[88,88,]),'id_init_declarator_list':([22,61,],[90,90,]),'id_init_declarator':([22,61,],[91,91,]),'type_qualifier_list_opt':([26,79,114,117,217,239,360,445,],[94,116,216,225,347,367,444,483,]),'type_qualifier_list':([26,79,104,114,117,139,140,141,168,217,239,249,251,271,328,332,335,360,445,],[96,118,149,218,96,149,149,149,149,96,96,149,149,149,149,149,149,446,96,]),'brace_open':([31,32,56,98,99,102,103,106,109,113,130,152,172,267,272,282,339,382,386,459,460,463,464,472,473,476,508,523,526,],[100,104,106,134,135,139,140,106,106,215,215,106,106,106,106,106,215,106,461,461,106,106,106,461,461,215,106,106,106,]),'compound_statement':([56,106,109,152,172,267,272,282,382,460,463,464,508,523,526,],[105,158,210,158,158,158,158,158,158,158,158,158,158,158,158,]),'parameter_type_list':([80,115,238,361,370,390,],[119,219,366,447,366,366,]),'identifier_list_opt':([80,115,361,],[120,220,448,]),'parameter_list':([80,115,238,361,370,390,],[121,121,121,121,121,121,]),'identifier_list':([80,115,361,],[123,123,123,]),'parameter_declaration':([80,115,229,238,361,370,390,],[124,124,356,124,124,124,124,]),'identifier':([80,106,113,115,116,130,152,164,168,172,177,183,184,185,187,216,225,226,230,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,344,347,348,361,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,474,476,483,484,498,508,512,515,516,523,526,],[125,195,195,125,195,195,195,195,195,195,195,195,195,195,195,195,195,195,357,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,437,195,195,125,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,502,195,195,195,195,195,195,524,195,195,195,]),'enumerator_list':([100,134,135,],[136,244,245,]),'enumerator':([100,134,135,247,],[137,137,137,373,]),'struct_declaration_list':([104,139,140,],[141,249,251,]),'brace_close':([104,136,139,140,141,150,244,245,249,251,336,432,493,510,],[142,246,250,252,253,264,371,372,375,376,431,475,509,520,]),'struct_declaration':([104,139,140,141,249,251,],[143,143,143,254,254,254,]),'specifier_qualifier_list':([104,139,140,141,168,249,251,271,328,332,335,],[145,145,145,145,277,145,145,277,277,277,277,]),'block_item_list_opt':([106,],[150,]),'block_item_list':([106,],[152,]),'block_item':([106,152,],[153,265,]),'statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[155,155,283,283,283,395,283,492,283,283,283,283,283,]),'labeled_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[156,156,156,156,156,156,156,156,156,156,156,156,156,]),'expression_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[157,157,157,157,157,157,157,157,157,157,157,157,157,]),'selection_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[159,159,159,159,159,159,159,159,159,159,159,159,159,]),'iteration_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[160,160,160,160,160,160,160,160,160,160,160,160,160,]),'jump_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[161,161,161,161,161,161,161,161,161,161,161,161,161,]),'expression_opt':([106,152,172,267,272,282,284,382,397,460,463,464,466,498,508,512,523,526,],[166,166,166,166,166,166,396,166,467,166,166,166,497,513,166,522,166,166,]),'expression':([106,152,168,172,177,267,271,272,274,279,280,282,284,302,321,328,332,382,397,460,463,464,465,466,498,508,512,516,523,526,],[169,169,276,169,288,169,276,169,385,392,393,169,169,401,420,276,276,169,169,169,169,169,496,169,169,169,169,525,169,169,]),'assignment_expression':([106,113,116,130,152,168,172,177,216,225,226,267,271,272,274,278,279,280,282,284,290,302,321,322,328,332,339,347,348,367,369,382,397,444,460,463,464,465,466,471,476,483,484,498,508,512,516,523,526,],[178,214,224,214,178,178,178,178,224,353,354,178,178,178,178,391,178,178,178,178,400,178,178,423,178,178,214,440,441,224,224,178,178,224,178,178,178,178,178,500,214,506,507,178,178,178,178,178,178,]),'conditional_expression':([106,113,116,130,152,164,168,172,177,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,321,322,328,332,339,343,347,348,367,369,379,382,397,444,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[179,179,179,179,179,269,179,179,179,179,179,179,269,269,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,269,179,179,179,179,269,179,179,179,179,179,179,179,179,499,179,179,179,179,179,179,179,179,179,179,]),'unary_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[180,180,180,180,180,270,180,180,180,327,329,270,331,180,180,180,270,270,180,180,180,180,180,180,180,180,180,180,180,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,180,180,180,180,180,270,180,180,180,180,270,180,270,180,180,270,180,180,180,180,180,270,180,180,180,180,180,180,180,180,180,180,]),'binary_expression':([106,113,116,130,152,164,168,172,177,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,397,444,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,]),'postfix_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,]),'unary_operator':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,]),'cast_expression':([106,113,116,130,152,164,168,172,177,185,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[186,186,186,186,186,186,186,186,186,330,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,462,186,186,462,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,]),'primary_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,]),'constant':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,]),'unified_string_literal':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,]),'unified_wstring_literal':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,]),'initializer':([113,130,339,476,],[213,243,433,503,]),'assignment_expression_opt':([116,216,367,369,444,],[221,345,451,453,481,]),'typeid_noparen_declarator':([126,],[232,]),'abstract_declarator_opt':([126,277,],[233,388,]),'direct_typeid_noparen_declarator':([126,234,],[235,358,]),'abstract_declarator':([126,238,277,390,],[237,362,237,362,]),'direct_abstract_declarator':([126,234,238,277,364,389,390,],[241,359,241,241,359,359,241,]),'struct_declarator_list_opt':([145,],[255,]),'struct_declarator_list':([145,],[259,]),'struct_declarator':([145,378,],[260,456,]),'constant_expression':([164,248,262,343,379,],[268,374,380,436,457,]),'type_name':([168,271,328,332,335,],[275,383,428,429,430,]),'pragmacomp_or_statement':([172,267,272,382,460,463,464,508,523,526,],[281,381,384,458,491,494,495,519,527,529,]),'assignment_operator':([180,],[290,]),'initializer_list_opt':([215,],[336,]),'initializer_list':([215,461,],[337,493,]),'designation_opt':([215,432,461,510,],[339,476,339,476,]),'designation':([215,432,461,510,],[340,340,340,340,]),'designator_list':([215,432,461,510,],[341,341,341,341,]),'designator':([215,341,432,461,510,],[342,435,342,342,342,]),'parameter_type_list_opt':([238,370,390,],[363,455,363,]),'argument_expression_list':([322,],[421,]),'offsetof_member_designator':([474,],[501,]),} -_lr_goto = { } +_lr_goto = {} for _k, _v in _lr_goto_items.items(): - for _x,_y in zip(_v[0],_v[1]): - if not _x in _lr_goto: _lr_goto[_x] = { } + for _x, _y in zip(_v[0], _v[1]): + if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> translation_unit_or_empty","S'",1,None,None,None), - ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','../pycparser/plyparser.py',42), - ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','../pycparser/plyparser.py',43), - ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','../pycparser/plyparser.py',42), - ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','../pycparser/plyparser.py',43), - ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','../pycparser/plyparser.py',42), - ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','../pycparser/plyparser.py',43), - ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','../pycparser/plyparser.py',42), - ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','../pycparser/plyparser.py',43), - ('declaration_specifiers_opt -> empty','declaration_specifiers_opt',1,'p_declaration_specifiers_opt','../pycparser/plyparser.py',42), - ('declaration_specifiers_opt -> declaration_specifiers','declaration_specifiers_opt',1,'p_declaration_specifiers_opt','../pycparser/plyparser.py',43), - ('designation_opt -> empty','designation_opt',1,'p_designation_opt','../pycparser/plyparser.py',42), - ('designation_opt -> designation','designation_opt',1,'p_designation_opt','../pycparser/plyparser.py',43), - ('expression_opt -> empty','expression_opt',1,'p_expression_opt','../pycparser/plyparser.py',42), - ('expression_opt -> expression','expression_opt',1,'p_expression_opt','../pycparser/plyparser.py',43), - ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','../pycparser/plyparser.py',42), - ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','../pycparser/plyparser.py',43), - ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','../pycparser/plyparser.py',42), - ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','../pycparser/plyparser.py',43), - ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','../pycparser/plyparser.py',42), - ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','../pycparser/plyparser.py',43), - ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','../pycparser/plyparser.py',42), - ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','../pycparser/plyparser.py',43), - ('specifier_qualifier_list_opt -> empty','specifier_qualifier_list_opt',1,'p_specifier_qualifier_list_opt','../pycparser/plyparser.py',42), - ('specifier_qualifier_list_opt -> specifier_qualifier_list','specifier_qualifier_list_opt',1,'p_specifier_qualifier_list_opt','../pycparser/plyparser.py',43), - ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','../pycparser/plyparser.py',42), - ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','../pycparser/plyparser.py',43), - ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','../pycparser/plyparser.py',42), - ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','../pycparser/plyparser.py',43), - ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','../pycparser/c_parser.py',494), - ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','../pycparser/c_parser.py',495), - ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','../pycparser/c_parser.py',503), - ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','../pycparser/c_parser.py',510), - ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','../pycparser/c_parser.py',522), - ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','../pycparser/c_parser.py',527), - ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','../pycparser/c_parser.py',532), - ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','../pycparser/c_parser.py',537), - ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','../pycparser/c_parser.py',542), - ('function_definition -> declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','../pycparser/c_parser.py',551), - ('function_definition -> declaration_specifiers declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','../pycparser/c_parser.py',568), - ('statement -> labeled_statement','statement',1,'p_statement','../pycparser/c_parser.py',579), - ('statement -> expression_statement','statement',1,'p_statement','../pycparser/c_parser.py',580), - ('statement -> compound_statement','statement',1,'p_statement','../pycparser/c_parser.py',581), - ('statement -> selection_statement','statement',1,'p_statement','../pycparser/c_parser.py',582), - ('statement -> iteration_statement','statement',1,'p_statement','../pycparser/c_parser.py',583), - ('statement -> jump_statement','statement',1,'p_statement','../pycparser/c_parser.py',584), - ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','../pycparser/c_parser.py',598), - ('declaration -> decl_body SEMI','declaration',2,'p_declaration','../pycparser/c_parser.py',657), - ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','../pycparser/c_parser.py',666), - ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','../pycparser/c_parser.py',667), - ('declaration_specifiers -> type_qualifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_1','../pycparser/c_parser.py',672), - ('declaration_specifiers -> type_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_2','../pycparser/c_parser.py',677), - ('declaration_specifiers -> storage_class_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_3','../pycparser/c_parser.py',682), - ('declaration_specifiers -> function_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_4','../pycparser/c_parser.py',687), - ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',692), - ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',693), - ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',694), - ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',695), - ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',696), - ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','../pycparser/c_parser.py',701), - ('type_specifier -> VOID','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',706), - ('type_specifier -> _BOOL','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',707), - ('type_specifier -> CHAR','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',708), - ('type_specifier -> SHORT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',709), - ('type_specifier -> INT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',710), - ('type_specifier -> LONG','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',711), - ('type_specifier -> FLOAT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',712), - ('type_specifier -> DOUBLE','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',713), - ('type_specifier -> _COMPLEX','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',714), - ('type_specifier -> SIGNED','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',715), - ('type_specifier -> UNSIGNED','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',716), - ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',721), - ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',722), - ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',723), - ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',728), - ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',729), - ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',730), - ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list_1','../pycparser/c_parser.py',735), - ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list_1','../pycparser/c_parser.py',736), - ('init_declarator_list -> EQUALS initializer','init_declarator_list',2,'p_init_declarator_list_2','../pycparser/c_parser.py',746), - ('init_declarator_list -> abstract_declarator','init_declarator_list',1,'p_init_declarator_list_3','../pycparser/c_parser.py',754), - ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','../pycparser/c_parser.py',762), - ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','../pycparser/c_parser.py',763), - ('specifier_qualifier_list -> type_qualifier specifier_qualifier_list_opt','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','../pycparser/c_parser.py',768), - ('specifier_qualifier_list -> type_specifier specifier_qualifier_list_opt','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','../pycparser/c_parser.py',773), - ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','../pycparser/c_parser.py',781), - ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','../pycparser/c_parser.py',782), - ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','../pycparser/c_parser.py',791), - ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','../pycparser/c_parser.py',800), - ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','../pycparser/c_parser.py',801), - ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','../pycparser/c_parser.py',810), - ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','../pycparser/c_parser.py',811), - ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','../pycparser/c_parser.py',818), - ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','../pycparser/c_parser.py',819), - ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','../pycparser/c_parser.py',824), - ('struct_declaration -> specifier_qualifier_list abstract_declarator SEMI','struct_declaration',3,'p_struct_declaration_2','../pycparser/c_parser.py',862), - ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','../pycparser/c_parser.py',876), - ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','../pycparser/c_parser.py',877), - ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','../pycparser/c_parser.py',885), - ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','../pycparser/c_parser.py',890), - ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','../pycparser/c_parser.py',891), - ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','../pycparser/c_parser.py',899), - ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','../pycparser/c_parser.py',900), - ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','../pycparser/c_parser.py',905), - ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','../pycparser/c_parser.py',910), - ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','../pycparser/c_parser.py',911), - ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','../pycparser/c_parser.py',916), - ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','../pycparser/c_parser.py',917), - ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','../pycparser/c_parser.py',918), - ('enumerator -> ID','enumerator',1,'p_enumerator','../pycparser/c_parser.py',929), - ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','../pycparser/c_parser.py',930), - ('declarator -> direct_declarator','declarator',1,'p_declarator_1','../pycparser/c_parser.py',945), - ('declarator -> pointer direct_declarator','declarator',2,'p_declarator_2','../pycparser/c_parser.py',950), - ('declarator -> pointer TYPEID','declarator',2,'p_declarator_3','../pycparser/c_parser.py',959), - ('direct_declarator -> ID','direct_declarator',1,'p_direct_declarator_1','../pycparser/c_parser.py',970), - ('direct_declarator -> LPAREN declarator RPAREN','direct_declarator',3,'p_direct_declarator_2','../pycparser/c_parser.py',979), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_declarator',5,'p_direct_declarator_3','../pycparser/c_parser.py',984), - ('direct_declarator -> direct_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_declarator',6,'p_direct_declarator_4','../pycparser/c_parser.py',998), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_declarator',6,'p_direct_declarator_4','../pycparser/c_parser.py',999), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_declarator',5,'p_direct_declarator_5','../pycparser/c_parser.py',1019), - ('direct_declarator -> direct_declarator LPAREN parameter_type_list RPAREN','direct_declarator',4,'p_direct_declarator_6','../pycparser/c_parser.py',1030), - ('direct_declarator -> direct_declarator LPAREN identifier_list_opt RPAREN','direct_declarator',4,'p_direct_declarator_6','../pycparser/c_parser.py',1031), - ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','../pycparser/c_parser.py',1058), - ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','../pycparser/c_parser.py',1059), - ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','../pycparser/c_parser.py',1088), - ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','../pycparser/c_parser.py',1089), - ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','../pycparser/c_parser.py',1094), - ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','../pycparser/c_parser.py',1095), - ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','../pycparser/c_parser.py',1103), - ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','../pycparser/c_parser.py',1104), - ('parameter_declaration -> declaration_specifiers declarator','parameter_declaration',2,'p_parameter_declaration_1','../pycparser/c_parser.py',1113), - ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','../pycparser/c_parser.py',1124), - ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','../pycparser/c_parser.py',1155), - ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','../pycparser/c_parser.py',1156), - ('initializer -> assignment_expression','initializer',1,'p_initializer_1','../pycparser/c_parser.py',1165), - ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','../pycparser/c_parser.py',1170), - ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','../pycparser/c_parser.py',1171), - ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','../pycparser/c_parser.py',1179), - ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','../pycparser/c_parser.py',1180), - ('designation -> designator_list EQUALS','designation',2,'p_designation','../pycparser/c_parser.py',1191), - ('designator_list -> designator','designator_list',1,'p_designator_list','../pycparser/c_parser.py',1199), - ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','../pycparser/c_parser.py',1200), - ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','../pycparser/c_parser.py',1205), - ('designator -> PERIOD identifier','designator',2,'p_designator','../pycparser/c_parser.py',1206), - ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','../pycparser/c_parser.py',1211), - ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','../pycparser/c_parser.py',1228), - ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','../pycparser/c_parser.py',1236), - ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','../pycparser/c_parser.py',1241), - ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','../pycparser/c_parser.py',1251), - ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','../pycparser/c_parser.py',1255), - ('direct_abstract_declarator -> LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_3','../pycparser/c_parser.py',1266), - ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','../pycparser/c_parser.py',1275), - ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','../pycparser/c_parser.py',1286), - ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','../pycparser/c_parser.py',1295), - ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','../pycparser/c_parser.py',1305), - ('block_item -> declaration','block_item',1,'p_block_item','../pycparser/c_parser.py',1316), - ('block_item -> statement','block_item',1,'p_block_item','../pycparser/c_parser.py',1317), - ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','../pycparser/c_parser.py',1324), - ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','../pycparser/c_parser.py',1325), - ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','../pycparser/c_parser.py',1331), - ('labeled_statement -> ID COLON statement','labeled_statement',3,'p_labeled_statement_1','../pycparser/c_parser.py',1337), - ('labeled_statement -> CASE constant_expression COLON statement','labeled_statement',4,'p_labeled_statement_2','../pycparser/c_parser.py',1341), - ('labeled_statement -> DEFAULT COLON statement','labeled_statement',3,'p_labeled_statement_3','../pycparser/c_parser.py',1345), - ('selection_statement -> IF LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_1','../pycparser/c_parser.py',1349), - ('selection_statement -> IF LPAREN expression RPAREN statement ELSE statement','selection_statement',7,'p_selection_statement_2','../pycparser/c_parser.py',1353), - ('selection_statement -> SWITCH LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_3','../pycparser/c_parser.py',1357), - ('iteration_statement -> WHILE LPAREN expression RPAREN statement','iteration_statement',5,'p_iteration_statement_1','../pycparser/c_parser.py',1362), - ('iteration_statement -> DO statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','../pycparser/c_parser.py',1366), - ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement','iteration_statement',9,'p_iteration_statement_3','../pycparser/c_parser.py',1370), - ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN statement','iteration_statement',8,'p_iteration_statement_4','../pycparser/c_parser.py',1374), - ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','../pycparser/c_parser.py',1379), - ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','../pycparser/c_parser.py',1383), - ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','../pycparser/c_parser.py',1387), - ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','../pycparser/c_parser.py',1391), - ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','../pycparser/c_parser.py',1392), - ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','../pycparser/c_parser.py',1397), - ('expression -> assignment_expression','expression',1,'p_expression','../pycparser/c_parser.py',1404), - ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','../pycparser/c_parser.py',1405), - ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','../pycparser/c_parser.py',1417), - ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','../pycparser/c_parser.py',1421), - ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','../pycparser/c_parser.py',1422), - ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1435), - ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1436), - ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1437), - ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1438), - ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1439), - ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1440), - ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1441), - ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1442), - ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1443), - ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1444), - ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1445), - ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','../pycparser/c_parser.py',1450), - ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','../pycparser/c_parser.py',1454), - ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','../pycparser/c_parser.py',1455), - ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','../pycparser/c_parser.py',1463), - ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1464), - ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1465), - ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1466), - ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1467), - ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1468), - ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1469), - ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1470), - ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1471), - ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1472), - ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1473), - ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1474), - ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1475), - ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1476), - ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1477), - ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1478), - ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1479), - ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1480), - ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1481), - ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','../pycparser/c_parser.py',1489), - ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','../pycparser/c_parser.py',1493), - ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','../pycparser/c_parser.py',1497), - ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1501), - ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1502), - ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1503), - ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','../pycparser/c_parser.py',1508), - ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','../pycparser/c_parser.py',1509), - ('unary_operator -> AND','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1517), - ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1518), - ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1519), - ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1520), - ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1521), - ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1522), - ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','../pycparser/c_parser.py',1527), - ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','../pycparser/c_parser.py',1531), - ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','../pycparser/c_parser.py',1535), - ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','../pycparser/c_parser.py',1536), - ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1541), - ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1542), - ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1543), - ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1544), - ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','../pycparser/c_parser.py',1550), - ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','../pycparser/c_parser.py',1551), - ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','../pycparser/c_parser.py',1556), - ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','../pycparser/c_parser.py',1557), - ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','../pycparser/c_parser.py',1562), - ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','../pycparser/c_parser.py',1566), - ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','../pycparser/c_parser.py',1570), - ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','../pycparser/c_parser.py',1571), - ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','../pycparser/c_parser.py',1576), - ('primary_expression -> OFFSETOF LPAREN type_name COMMA identifier RPAREN','primary_expression',6,'p_primary_expression_5','../pycparser/c_parser.py',1580), - ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','../pycparser/c_parser.py',1588), - ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','../pycparser/c_parser.py',1589), - ('identifier -> ID','identifier',1,'p_identifier','../pycparser/c_parser.py',1598), - ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','../pycparser/c_parser.py',1602), - ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','../pycparser/c_parser.py',1603), - ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','../pycparser/c_parser.py',1604), - ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','../pycparser/c_parser.py',1605), - ('constant -> FLOAT_CONST','constant',1,'p_constant_2','../pycparser/c_parser.py',1611), - ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','../pycparser/c_parser.py',1612), - ('constant -> CHAR_CONST','constant',1,'p_constant_3','../pycparser/c_parser.py',1618), - ('constant -> WCHAR_CONST','constant',1,'p_constant_3','../pycparser/c_parser.py',1619), - ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','../pycparser/c_parser.py',1630), - ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','../pycparser/c_parser.py',1631), - ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','../pycparser/c_parser.py',1641), - ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','../pycparser/c_parser.py',1642), - ('brace_open -> LBRACE','brace_open',1,'p_brace_open','../pycparser/c_parser.py',1652), - ('brace_close -> RBRACE','brace_close',1,'p_brace_close','../pycparser/c_parser.py',1657), - ('empty -> ','empty',0,'p_empty','../pycparser/c_parser.py',1662), + ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',43), + ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',44), + ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',43), + ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',44), + ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',43), + ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',44), + ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',43), + ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',44), + ('declaration_specifiers_no_type_opt -> empty','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',43), + ('declaration_specifiers_no_type_opt -> declaration_specifiers_no_type','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',44), + ('designation_opt -> empty','designation_opt',1,'p_designation_opt','plyparser.py',43), + ('designation_opt -> designation','designation_opt',1,'p_designation_opt','plyparser.py',44), + ('expression_opt -> empty','expression_opt',1,'p_expression_opt','plyparser.py',43), + ('expression_opt -> expression','expression_opt',1,'p_expression_opt','plyparser.py',44), + ('id_init_declarator_list_opt -> empty','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',43), + ('id_init_declarator_list_opt -> id_init_declarator_list','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',44), + ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',43), + ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',44), + ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',43), + ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',44), + ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',43), + ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',44), + ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',43), + ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',44), + ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',43), + ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',44), + ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',43), + ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',44), + ('direct_id_declarator -> ID','direct_id_declarator',1,'p_direct_id_declarator_1','plyparser.py',126), + ('direct_id_declarator -> LPAREN id_declarator RPAREN','direct_id_declarator',3,'p_direct_id_declarator_2','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_3','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',127), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_5','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN parameter_type_list RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN identifier_list_opt RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',127), + ('direct_typeid_declarator -> TYPEID','direct_typeid_declarator',1,'p_direct_typeid_declarator_1','plyparser.py',126), + ('direct_typeid_declarator -> LPAREN typeid_declarator RPAREN','direct_typeid_declarator',3,'p_direct_typeid_declarator_2','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_3','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',127), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_5','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN parameter_type_list RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',127), + ('direct_typeid_noparen_declarator -> TYPEID','direct_typeid_noparen_declarator',1,'p_direct_typeid_noparen_declarator_1','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_3','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',127), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_5','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',127), + ('id_declarator -> direct_id_declarator','id_declarator',1,'p_id_declarator_1','plyparser.py',126), + ('id_declarator -> pointer direct_id_declarator','id_declarator',2,'p_id_declarator_2','plyparser.py',126), + ('typeid_declarator -> direct_typeid_declarator','typeid_declarator',1,'p_typeid_declarator_1','plyparser.py',126), + ('typeid_declarator -> pointer direct_typeid_declarator','typeid_declarator',2,'p_typeid_declarator_2','plyparser.py',126), + ('typeid_noparen_declarator -> direct_typeid_noparen_declarator','typeid_noparen_declarator',1,'p_typeid_noparen_declarator_1','plyparser.py',126), + ('typeid_noparen_declarator -> pointer direct_typeid_noparen_declarator','typeid_noparen_declarator',2,'p_typeid_noparen_declarator_2','plyparser.py',126), + ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',514), + ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',515), + ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','c_parser.py',523), + ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','c_parser.py',530), + ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','c_parser.py',541), + ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','c_parser.py',546), + ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',551), + ('external_declaration -> pppragma_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',552), + ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','c_parser.py',557), + ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','c_parser.py',562), + ('pppragma_directive -> PPPRAGMA','pppragma_directive',1,'p_pppragma_directive','c_parser.py',568), + ('pppragma_directive -> PPPRAGMA PPPRAGMASTR','pppragma_directive',2,'p_pppragma_directive','c_parser.py',569), + ('function_definition -> id_declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','c_parser.py',580), + ('function_definition -> declaration_specifiers id_declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','c_parser.py',597), + ('statement -> labeled_statement','statement',1,'p_statement','c_parser.py',608), + ('statement -> expression_statement','statement',1,'p_statement','c_parser.py',609), + ('statement -> compound_statement','statement',1,'p_statement','c_parser.py',610), + ('statement -> selection_statement','statement',1,'p_statement','c_parser.py',611), + ('statement -> iteration_statement','statement',1,'p_statement','c_parser.py',612), + ('statement -> jump_statement','statement',1,'p_statement','c_parser.py',613), + ('statement -> pppragma_directive','statement',1,'p_statement','c_parser.py',614), + ('pragmacomp_or_statement -> pppragma_directive statement','pragmacomp_or_statement',2,'p_pragmacomp_or_statement','c_parser.py',661), + ('pragmacomp_or_statement -> statement','pragmacomp_or_statement',1,'p_pragmacomp_or_statement','c_parser.py',662), + ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',681), + ('decl_body -> declaration_specifiers_no_type id_init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',682), + ('declaration -> decl_body SEMI','declaration',2,'p_declaration','c_parser.py',741), + ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','c_parser.py',750), + ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','c_parser.py',751), + ('declaration_specifiers_no_type -> type_qualifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_1','c_parser.py',761), + ('declaration_specifiers_no_type -> storage_class_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_2','c_parser.py',766), + ('declaration_specifiers_no_type -> function_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_3','c_parser.py',771), + ('declaration_specifiers -> declaration_specifiers type_qualifier','declaration_specifiers',2,'p_declaration_specifiers_1','c_parser.py',777), + ('declaration_specifiers -> declaration_specifiers storage_class_specifier','declaration_specifiers',2,'p_declaration_specifiers_2','c_parser.py',782), + ('declaration_specifiers -> declaration_specifiers function_specifier','declaration_specifiers',2,'p_declaration_specifiers_3','c_parser.py',787), + ('declaration_specifiers -> declaration_specifiers type_specifier_no_typeid','declaration_specifiers',2,'p_declaration_specifiers_4','c_parser.py',792), + ('declaration_specifiers -> type_specifier','declaration_specifiers',1,'p_declaration_specifiers_5','c_parser.py',797), + ('declaration_specifiers -> declaration_specifiers_no_type type_specifier','declaration_specifiers',2,'p_declaration_specifiers_6','c_parser.py',802), + ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',808), + ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',809), + ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',810), + ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',811), + ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',812), + ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','c_parser.py',817), + ('type_specifier_no_typeid -> VOID','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',822), + ('type_specifier_no_typeid -> _BOOL','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',823), + ('type_specifier_no_typeid -> CHAR','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',824), + ('type_specifier_no_typeid -> SHORT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',825), + ('type_specifier_no_typeid -> INT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',826), + ('type_specifier_no_typeid -> LONG','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',827), + ('type_specifier_no_typeid -> FLOAT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',828), + ('type_specifier_no_typeid -> DOUBLE','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',829), + ('type_specifier_no_typeid -> _COMPLEX','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',830), + ('type_specifier_no_typeid -> SIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',831), + ('type_specifier_no_typeid -> UNSIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',832), + ('type_specifier_no_typeid -> __INT128','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',833), + ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier','c_parser.py',838), + ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier','c_parser.py',839), + ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier','c_parser.py',840), + ('type_specifier -> type_specifier_no_typeid','type_specifier',1,'p_type_specifier','c_parser.py',841), + ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','c_parser.py',846), + ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','c_parser.py',847), + ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','c_parser.py',848), + ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list','c_parser.py',853), + ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list','c_parser.py',854), + ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','c_parser.py',862), + ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','c_parser.py',863), + ('id_init_declarator_list -> id_init_declarator','id_init_declarator_list',1,'p_id_init_declarator_list','c_parser.py',868), + ('id_init_declarator_list -> id_init_declarator_list COMMA init_declarator','id_init_declarator_list',3,'p_id_init_declarator_list','c_parser.py',869), + ('id_init_declarator -> id_declarator','id_init_declarator',1,'p_id_init_declarator','c_parser.py',874), + ('id_init_declarator -> id_declarator EQUALS initializer','id_init_declarator',3,'p_id_init_declarator','c_parser.py',875), + ('specifier_qualifier_list -> specifier_qualifier_list type_specifier_no_typeid','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','c_parser.py',882), + ('specifier_qualifier_list -> specifier_qualifier_list type_qualifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','c_parser.py',887), + ('specifier_qualifier_list -> type_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_3','c_parser.py',892), + ('specifier_qualifier_list -> type_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_4','c_parser.py',897), + ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',906), + ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',907), + ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','c_parser.py',917), + ('struct_or_union_specifier -> struct_or_union brace_open brace_close','struct_or_union_specifier',3,'p_struct_or_union_specifier_2','c_parser.py',918), + ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',935), + ('struct_or_union_specifier -> struct_or_union ID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',936), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',937), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',938), + ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','c_parser.py',954), + ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','c_parser.py',955), + ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','c_parser.py',962), + ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','c_parser.py',963), + ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','c_parser.py',971), + ('struct_declaration -> SEMI','struct_declaration',1,'p_struct_declaration_2','c_parser.py',1009), + ('struct_declaration -> pppragma_directive','struct_declaration',1,'p_struct_declaration_3','c_parser.py',1014), + ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','c_parser.py',1019), + ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','c_parser.py',1020), + ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','c_parser.py',1028), + ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','c_parser.py',1033), + ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','c_parser.py',1034), + ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1042), + ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1043), + ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','c_parser.py',1048), + ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1053), + ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1054), + ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','c_parser.py',1059), + ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','c_parser.py',1060), + ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','c_parser.py',1061), + ('enumerator -> ID','enumerator',1,'p_enumerator','c_parser.py',1072), + ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','c_parser.py',1073), + ('declarator -> id_declarator','declarator',1,'p_declarator','c_parser.py',1088), + ('declarator -> typeid_declarator','declarator',1,'p_declarator','c_parser.py',1089), + ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','c_parser.py',1200), + ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','c_parser.py',1201), + ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','c_parser.py',1230), + ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','c_parser.py',1231), + ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','c_parser.py',1236), + ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','c_parser.py',1237), + ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','c_parser.py',1245), + ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','c_parser.py',1246), + ('parameter_declaration -> declaration_specifiers id_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1265), + ('parameter_declaration -> declaration_specifiers typeid_noparen_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1266), + ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','c_parser.py',1277), + ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','c_parser.py',1308), + ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','c_parser.py',1309), + ('initializer -> assignment_expression','initializer',1,'p_initializer_1','c_parser.py',1318), + ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','c_parser.py',1323), + ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','c_parser.py',1324), + ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','c_parser.py',1332), + ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','c_parser.py',1333), + ('designation -> designator_list EQUALS','designation',2,'p_designation','c_parser.py',1344), + ('designator_list -> designator','designator_list',1,'p_designator_list','c_parser.py',1352), + ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','c_parser.py',1353), + ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','c_parser.py',1358), + ('designator -> PERIOD identifier','designator',2,'p_designator','c_parser.py',1359), + ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','c_parser.py',1364), + ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','c_parser.py',1375), + ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','c_parser.py',1383), + ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','c_parser.py',1388), + ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','c_parser.py',1398), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','c_parser.py',1402), + ('direct_abstract_declarator -> LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_3','c_parser.py',1413), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','c_parser.py',1423), + ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','c_parser.py',1434), + ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','c_parser.py',1443), + ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','c_parser.py',1453), + ('block_item -> declaration','block_item',1,'p_block_item','c_parser.py',1464), + ('block_item -> statement','block_item',1,'p_block_item','c_parser.py',1465), + ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','c_parser.py',1472), + ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','c_parser.py',1473), + ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','c_parser.py',1479), + ('labeled_statement -> ID COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_1','c_parser.py',1485), + ('labeled_statement -> CASE constant_expression COLON pragmacomp_or_statement','labeled_statement',4,'p_labeled_statement_2','c_parser.py',1489), + ('labeled_statement -> DEFAULT COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_3','c_parser.py',1493), + ('selection_statement -> IF LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_1','c_parser.py',1497), + ('selection_statement -> IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement','selection_statement',7,'p_selection_statement_2','c_parser.py',1501), + ('selection_statement -> SWITCH LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_3','c_parser.py',1505), + ('iteration_statement -> WHILE LPAREN expression RPAREN pragmacomp_or_statement','iteration_statement',5,'p_iteration_statement_1','c_parser.py',1510), + ('iteration_statement -> DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','c_parser.py',1514), + ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',9,'p_iteration_statement_3','c_parser.py',1518), + ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',8,'p_iteration_statement_4','c_parser.py',1522), + ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','c_parser.py',1527), + ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','c_parser.py',1531), + ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','c_parser.py',1535), + ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','c_parser.py',1539), + ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','c_parser.py',1540), + ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','c_parser.py',1545), + ('expression -> assignment_expression','expression',1,'p_expression','c_parser.py',1552), + ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','c_parser.py',1553), + ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','c_parser.py',1565), + ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','c_parser.py',1569), + ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','c_parser.py',1570), + ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','c_parser.py',1583), + ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1584), + ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1585), + ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1586), + ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1587), + ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1588), + ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1589), + ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1590), + ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1591), + ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1592), + ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1593), + ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','c_parser.py',1598), + ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','c_parser.py',1602), + ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','c_parser.py',1603), + ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','c_parser.py',1611), + ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1612), + ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1613), + ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1614), + ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1615), + ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1616), + ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1617), + ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1618), + ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1619), + ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1620), + ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1621), + ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1622), + ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1623), + ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1624), + ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1625), + ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1626), + ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1627), + ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1628), + ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1629), + ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','c_parser.py',1637), + ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','c_parser.py',1641), + ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','c_parser.py',1645), + ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1649), + ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1650), + ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1651), + ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','c_parser.py',1656), + ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1657), + ('unary_operator -> AND','unary_operator',1,'p_unary_operator','c_parser.py',1665), + ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','c_parser.py',1666), + ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','c_parser.py',1667), + ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','c_parser.py',1668), + ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','c_parser.py',1669), + ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','c_parser.py',1670), + ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','c_parser.py',1675), + ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','c_parser.py',1679), + ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','c_parser.py',1683), + ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','c_parser.py',1684), + ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1689), + ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1690), + ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1691), + ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1692), + ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1698), + ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1699), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','c_parser.py',1704), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','c_parser.py',1705), + ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','c_parser.py',1710), + ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','c_parser.py',1714), + ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1718), + ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1719), + ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','c_parser.py',1724), + ('primary_expression -> OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN','primary_expression',6,'p_primary_expression_5','c_parser.py',1728), + ('offsetof_member_designator -> identifier','offsetof_member_designator',1,'p_offsetof_member_designator','c_parser.py',1736), + ('offsetof_member_designator -> offsetof_member_designator PERIOD identifier','offsetof_member_designator',3,'p_offsetof_member_designator','c_parser.py',1737), + ('offsetof_member_designator -> offsetof_member_designator LBRACKET expression RBRACKET','offsetof_member_designator',4,'p_offsetof_member_designator','c_parser.py',1738), + ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','c_parser.py',1751), + ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','c_parser.py',1752), + ('identifier -> ID','identifier',1,'p_identifier','c_parser.py',1761), + ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','c_parser.py',1765), + ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','c_parser.py',1766), + ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','c_parser.py',1767), + ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','c_parser.py',1768), + ('constant -> FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1787), + ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1788), + ('constant -> CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1804), + ('constant -> WCHAR_CONST','constant',1,'p_constant_3','c_parser.py',1805), + ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','c_parser.py',1816), + ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','c_parser.py',1817), + ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1827), + ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1828), + ('brace_open -> LBRACE','brace_open',1,'p_brace_open','c_parser.py',1838), + ('brace_close -> RBRACE','brace_close',1,'p_brace_close','c_parser.py',1844), + ('empty -> ','empty',0,'p_empty','c_parser.py',1850), ] From pypy.commits at gmail.com Sun Sep 22 03:28:13 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 22 Sep 2019 00:28:13 -0700 (PDT) Subject: [pypy-commit] pypy default: update release note to latest HEAD Message-ID: <5d87228d.1c69fb81.a8579.2db3@mx.google.com> Author: Matti Picus Branch: Changeset: r97588:5fa60afb5e51 Date: 2019-09-22 10:26 +0300 http://bitbucket.org/pypy/pypy/changeset/5fa60afb5e51/ Log: update release note to latest HEAD diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst --- a/pypy/doc/release-v7.2.0.rst +++ b/pypy/doc/release-v7.2.0.rst @@ -126,7 +126,7 @@ * Package windows DLLs needed by cffi modules next to the cffi c-extensions (`issue 2988`_) * Cleanup and refactor JIT code to remove ``rpython.jit.metainterp.typesystem`` -* Fix memoryviews of ctype structures with padding, (cpython issue 32780_) +* Fix memoryviews of ctype structures with padding, (CPython issue 32780_) Changes to Python 3.6 released in v7.1.1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,6 +185,23 @@ * Correctly wrap the I/O errors we can get when importing modules * Fix bad output from JSON with ``'skipkeys=True'`` (`issue 3052`_) * Fix compatibility with latest virtualenv HEAD +* Avoid ``RuntimeError`` in ``repr()`` of recursive ``dictviews`` (CPython + issue 18533_) +* Fix for printing after ``gc.get_objects()`` (`issue 2979`) +* Optimize many fast-paths through utf-8 code when we know it is ascii or no + surroagates are present +* Check for a rare case of someone shrinking a buffer from another thread + while using it in a ``read()`` variant. One of the issues discovered when + reviewing the code for the sandbox. +* Prevent segfault when slicing ``array.array`` with a large step size +* Support building ``ncurses`` on Suse Linux +* Update statically-linked ``_ssl`` OpenSSL to 1.1.0c on ``darwin`` +* Optimize ``W_TextIOWrapper._readline`` and ``ByteBuffer.getslice`` +* Fix possible race condition in threading ``Lock.release()`` (`issue 3072`_) +* Make ``CDLL(None)`` on win32 raise ``TypeError`` +* Change ``sys.getfilesystemcodeerors()`` to ``'strict'`` on win32 +* Update vendored version of ``pycparser`` to version 2.19 +* Implement a much faster json decoder (3x speedup for large json files, 2x less memory) C-API (cpyext) and c-extensions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -211,7 +228,7 @@ 3003`_) * Fix parsing for converting strings with underscore into ints * Add ``memoryview.obj`` which stores a reference, (`issue 3016`_) -* Fix datetime.fromtimestamp for win32 (cpython issue 29097_) +* Fix datetime.fromtimestamp for win32 (CPython issue 29097_) * Improve multiprocessing support on win32 * Support negative offsets in ``lnotab`` (`issue 2943`_) * Fix leak of file descriptor with `_io.FileIO('dir/')` @@ -232,19 +249,60 @@ * Fix case where ``int()`` would go into infinite recursion * Don't ignore fold parameter in ``(date,)time.replace()`` * Fix logic bug for ``memoryview.cast`` (when ``view.format`` is not ``'B'``) +* Implement retry-on-EINTR in fcntl module (CPython issue 35189_) +* Fix handling of 1st argument to ``hashlib.blake2{b,s}()`` (CPython issue + 33729_) +* Prevent overflow in ``_hashlib`` ``digest()`` (CPython issue 34922_) +* ``IOBase.readlines()`` relies on the iterator protocol instead of calling + ``readline()`` directly +* Don't inherit ``IS_ABSTRACT`` flag in classes +* Reset raw_pos after unwinding the raw stream (CPython issue 32228_) +* Add existing options ``-b`` and ``-d`` to ``pypy3 --help`` text +* Clean up ``_codecs`` error handling code +* Add support for using stdlib as a zipfile +* Check return type of ``__prepare__()`` (CPython issue 31588_) +* Fix logic in ``_curses.get_wch`` (`issue 3064`_) +* Match CPython exit code when failing to flush stdout/stderr at exit +* Improve SyntaxError message output +* Add ``range.__bool__`` +* Add cursor validity check to ``_sqlite.Cursor.close`` +* Improve message when mistakenly using ``print something`` in Python3 +* Handle generator exit in ``athrow()`` (CPython issue 33786_) +* Support unmarshalling ``TYPE_INT64`` and turn ``OverflowErrors`` from + ``marshal.loads`` into ``ValueErrors`` +* Update ``_posixsubprocess.c`` to match CPython (CPython issue 32270_) +* Remove unused ``_posixsubprocess.cloexec_pipe()`` +* Add missing constants to ``stat`` and ``kill _stat`` (`issue 3073`_) +* Fix argument handling in ``select.poll().poll()`` +* Raise ``SyntaxError`` instead of ``DeprecationWarning`` when treating invalid + escapes in bytes as errors (CPython issue 28691_) Python 3.6 c-API ~~~~~~~~~~~~~~~~ * Add ``PyStructSequence_InitType2``, ``Py_RETURN_NOTIMPLEMENTED``, - ``PyGILState_Check``, ``PyUnicode_AsUCS4``, ``PyUnicode_AsUCS4Copy`` + ``PyGILState_Check``, ``PyUnicode_AsUCS4``, ``PyUnicode_AsUCS4Copy``, + ``PyErr_SetFromWindowsErr``, * Sync the various ``Py**Flag`` constants with CPython +* Allow ``PyTypeObject`` with ``tp_doc==""`` (`issue 3055`_) +* Update ``pymacro.h`` to match CPython 3.6.9 +* Support more datetime C functions and definitions .. _`Lehmer's algorithm`: https://en.wikipedia.org/wiki/Lehmer's_GCD_algorithm .. _29097: https://bugs.python.org/issue29097 .. _32780: https://bugs.python.org/issue32780 .. _35409 : https://bugs.python.org/issue35409 .. _27169 : https://bugs.python.org/issue27169 +.. _18533 : https://bugs.python.org/issue18533 +.. _35189 : https://bugs.python.org/issue35189 +.. _33279 : https://bugs.python.org/issue33279 +.. _34922 : https://bugs.python.org/issue34922 +.. _32228 : https://bugs.python.org/issue32228 +.. _31588 : https://bugs.python.org/issue31588 +.. _33786 : https://bugs.python.org/issue33786 +.. _32270 : https://bugs.python.org/issue32270 +.. _28691 : https://bugs.python.org/issue28691 + .. _opencv2: https://github.com/skvark/opencv-python/ .. _`issue 2617`: https://bitbucket.com/pypy/pypy/issues/2617 .. _`issue 2722`: https://bitbucket.com/pypy/pypy/issues/2722 @@ -273,3 +331,8 @@ .. _`issue 3049`: https://bitbucket.com/pypy/pypy/issues/3049 .. _`issue 3050`: https://bitbucket.com/pypy/pypy/issues/3050 .. _`issue 3052`: https://bitbucket.com/pypy/pypy/issues/3052 +.. _`issue 3055`: https://bitbucket.com/pypy/pypy/issues/3055 +.. _`issue 2979`: https://bitbucket.com/pypy/pypy/issues/2979 +.. _`issue 3064`: https://bitbucket.com/pypy/pypy/issues/3064 +.. _`issue 3072`: https://bitbucket.com/pypy/pypy/issues/3072 +.. _`issue 3073`: https://bitbucket.com/pypy/pypy/issues/3073 From pypy.commits at gmail.com Sun Sep 22 03:29:36 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 22 Sep 2019 00:29:36 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy2.7-v7.x: merge default into release (without json-default-maps for now) Message-ID: <5d8722e0.1c69fb81.641ff.d95f@mx.google.com> Author: Matti Picus Branch: release-pypy2.7-v7.x Changeset: r97589:ab23a6930447 Date: 2019-09-22 10:28 +0300 http://bitbucket.org/pypy/pypy/changeset/ab23a6930447/ Log: merge default into release (without json-default-maps for now) diff too long, truncating to 2000 out of 9961 lines diff --git a/LICENSE b/LICENSE --- a/LICENSE +++ b/LICENSE @@ -40,11 +40,11 @@ Armin Rigo Maciej Fijalkowski Carl Friedrich Bolz-Tereick + Matti Picus Antonio Cuni Amaury Forgeot d'Arc - Matti Picus + Ronan Lamy Samuele Pedroni - Ronan Lamy Alex Gaynor Philip Jenvey Richard Plangger @@ -94,6 +94,7 @@ Jason Creighton Mark Young Alex Martelli + Andrew Lawrence Spenser Bauman Michal Bendowski Jan de Mooij @@ -106,11 +107,11 @@ Stefan Schwarzer Tomek Meka Valentino Volonghi + Stefan Beyer Patrick Maupin Devin Jeanpierre Bob Ippolito Bruno Gola - Andrew Lawrence David Malcolm Squeaky Edd Barrett @@ -124,7 +125,6 @@ Wenzhu Man Konstantin Lopuhin John Witulski - Stefan Beyer Jeremy Thurgood Greg Price Ivan Sichmann Freitas @@ -138,6 +138,7 @@ Pavel Vinogradov William Leslie Paweł Piotr Przeradowski + Stian Andreassen marky1991 Ilya Osadchiy Tobias Oberstein @@ -146,14 +147,13 @@ Taavi Burns Adrian Kuhn tav - Stian Andreassen Georg Brandl Joannah Nanjekye + Julian Berman Bert Freudenberg Wanja Saatkamp Mike Blume Gerald Klix - Julian Berman Oscar Nierstrasz Rami Chowdhury Stefan H. Muller @@ -204,6 +204,7 @@ Andrews Medina Aaron Iles Toby Watson + Lin Cheng Daniel Patrick Stuart Williams Antoine Pitrou @@ -245,6 +246,7 @@ Valentina Mukhamedzhanova Stefano Parmesan touilleMan + Anthony Sottile Marc Abramowitz Arjun Naik Aaron Gallagher @@ -254,7 +256,6 @@ Omer Katz Jacek Generowicz Tomasz Dziopa - Lin Cheng Sylvain Thenault Jakub Stasiak Andrew Dalke @@ -285,7 +286,6 @@ Lene Wagner Tomo Cocoa Miro Hrončok - Anthony Sottile David Lievens Neil Blakey-Milner Henrik Vendelbo @@ -294,11 +294,14 @@ Christoph Gerum Miguel de Val Borro Artur Lisiecki + joserubiovidales at gmail.com afteryu Toni Mattis + Vincent Michel Laurens Van Houtven Bobby Impollonia Roberto De Ioris + Yannick Jadoul Jeong YunWon Christopher Armstrong Aaron Tubbs @@ -312,6 +315,7 @@ Fabio Niephaus Akira Li Gustavo Niemeyer + joachim-ballmann at bitbucket.org Nate Bragg Lucas Stadler roberto at goyle @@ -331,8 +335,12 @@ Ben Darnell Juan Francisco Cantero Hurtado Godefroid Chappelle + Paul Ganssle + Michal Kuffa Stephan Busemann + Bystroushaak Dan Colish + Ram Rachum timo Volodymyr Vladymyrov Daniel Neuhäuser @@ -342,18 +350,22 @@ Chris Lambacher John Aldis coolbutuseless at gmail.com + Yasen Kiprov Mike Bayer Rodrigo Araújo Daniil Yarancev Min RK OlivierBlanvillain + dakarpov at gmail.com Jonas Pfannschmidt Zearin Johan Forsberg Andrey Churin Dan Crosta reubano at gmail.com + Ryan Hileman Stanisław Halik + DeVerne Jones Julien Phalip Roman Podoliaka Steve Papanik @@ -369,17 +381,20 @@ Jim Hunziker shoma hosaka Buck Golemon + whitequark Iraklis D. JohnDoe yrttyr Michael Chermside Anna Ravencroft remarkablerocket + Ivan Petre Vijiac Berker Peksag Christian Muirhead soareschen Matthew Miller + Jesdi Konrad Delong Dinu Gherman pizi @@ -398,13 +413,16 @@ Markus Unterwaditzer Kristoffer Kleine Graham Markall + paugier Dan Loewenherz werat Filip Salomonsson Niclas Olofsson + Zsolt Cserna Chris Pressey Tobias Diaz Paul Graydon + mkuffa Nikolaos-Digenis Karagiannis Kurt Griffiths Ben Mather diff --git a/extra_tests/cffi_tests/test_egg_version.py b/extra_tests/cffi_tests/test_version.py rename from extra_tests/cffi_tests/test_egg_version.py rename to extra_tests/cffi_tests/test_version.py --- a/extra_tests/cffi_tests/test_egg_version.py +++ b/extra_tests/cffi_tests/test_version.py @@ -1,6 +1,7 @@ from email.parser import Parser import py +import urllib2 import cffi import pypy @@ -10,3 +11,12 @@ def test_egg_version(): info = Parser().parsestr(egg_info.read()) assert info['version'] == cffi.__version__ + +def test_pycparser_version(): + url = 'https://raw.githubusercontent.com/eliben/pycparser/master/pycparser/__init__.py' + source = urllib2.urlopen(url).read() + dest = py.path.local(__file__).join('..', '..', '..', 'lib_pypy', 'cffi', + '_pycparser', '__init__.py').read() + # if this fails, the vendored pycparser is not the latest version + assert source.strip() == dest.strip() + diff --git a/lib_pypy/cffi/_pycparser/__init__.py b/lib_pypy/cffi/_pycparser/__init__.py --- a/lib_pypy/cffi/_pycparser/__init__.py +++ b/lib_pypy/cffi/_pycparser/__init__.py @@ -4,12 +4,14 @@ # This package file exports some convenience functions for # interacting with pycparser # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- __all__ = ['c_lexer', 'c_parser', 'c_ast'] -__version__ = '2.14' +__version__ = '2.19' +import io +from subprocess import check_output from .c_parser import CParser @@ -27,7 +29,6 @@ When successful, returns the preprocessed file's contents. Errors from cpp will be printed out. """ - from subprocess import Popen, PIPE path_list = [cpp_path] if isinstance(cpp_args, list): path_list += cpp_args @@ -38,11 +39,7 @@ try: # Note the use of universal_newlines to treat all newlines # as \n for Python's purpose - # - pipe = Popen( path_list, - stdout=PIPE, - universal_newlines=True) - text = pipe.communicate()[0] + text = check_output(path_list, universal_newlines=True) except OSError as e: raise RuntimeError("Unable to invoke 'cpp'. " + 'Make sure its path was passed correctly\n' + @@ -85,7 +82,7 @@ if use_cpp: text = preprocess_file(filename, cpp_path, cpp_args) else: - with open(filename, 'rU') as f: + with io.open(filename) as f: text = f.read() if parser is None: diff --git a/lib_pypy/cffi/_pycparser/_ast_gen.py b/lib_pypy/cffi/_pycparser/_ast_gen.py --- a/lib_pypy/cffi/_pycparser/_ast_gen.py +++ b/lib_pypy/cffi/_pycparser/_ast_gen.py @@ -7,7 +7,7 @@ # The design of this module was inspired by astgen.py from the # Python 2.5 code-base. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- import pprint @@ -63,6 +63,7 @@ contents: a list of contents - attributes and child nodes See comment at the top of the configuration file for details. """ + def __init__(self, name, contents): self.name = name self.all_entries = [] @@ -84,6 +85,8 @@ def generate_source(self): src = self._gen_init() src += '\n' + self._gen_children() + src += '\n' + self._gen_iter() + src += '\n' + self._gen_attr_names() return src @@ -131,6 +134,33 @@ return src + def _gen_iter(self): + src = ' def __iter__(self):\n' + + if self.all_entries: + for child in self.child: + src += ( + ' if self.%(child)s is not None:\n' + + ' yield self.%(child)s\n') % (dict(child=child)) + + for seq_child in self.seq_child: + src += ( + ' for child in (self.%(child)s or []):\n' + ' yield child\n') % (dict(child=seq_child)) + + if not (self.child or self.seq_child): + # Empty generator + src += ( + ' return\n' + + ' yield\n') + else: + # Empty generator + src += ( + ' return\n' + + ' yield\n') + + return src + def _gen_attr_names(self): src = " attr_names = (" + ''.join("%r, " % nm for nm in self.attr) + ')' return src @@ -150,7 +180,7 @@ # # AST Node classes. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- @@ -159,11 +189,38 @@ _PROLOGUE_CODE = r''' import sys +def _repr(obj): + """ + Get the representation of an object, with dedicated pprint-like format for lists. + """ + if isinstance(obj, list): + return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' + else: + return repr(obj) class Node(object): __slots__ = () """ Abstract base class for AST nodes. """ + def __repr__(self): + """ Generates a python representation of the current node + """ + result = self.__class__.__name__ + '(' + + indent = '' + separator = '' + for name in self.__slots__[:-2]: + result += separator + result += indent + result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) + + separator = ',' + indent = '\n ' + (' ' * len(self.__class__.__name__)) + + result += indent + ')' + + return result + def children(self): """ A sequence of all children that are Nodes """ @@ -253,26 +310,29 @@ * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) """ + + _method_cache = None + def visit(self, node): """ Visit a node. """ - method = 'visit_' + node.__class__.__name__ - visitor = getattr(self, method, self.generic_visit) + + if self._method_cache is None: + self._method_cache = {} + + visitor = self._method_cache.get(node.__class__.__name__, None) + if visitor is None: + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + self._method_cache[node.__class__.__name__] = visitor + return visitor(node) def generic_visit(self, node): """ Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. """ - for c_name, c in node.children(): + for c in node: self.visit(c) - ''' - - -if __name__ == "__main__": - import sys - ast_gen = ASTCodeGenerator('_c_ast.cfg') - ast_gen.generate(open('c_ast.py', 'w')) - diff --git a/lib_pypy/cffi/_pycparser/_build_tables.py b/lib_pypy/cffi/_pycparser/_build_tables.py --- a/lib_pypy/cffi/_pycparser/_build_tables.py +++ b/lib_pypy/cffi/_pycparser/_build_tables.py @@ -6,17 +6,21 @@ # Also generates AST code from the configuration file. # Should be called from the pycparser directory. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- +# Insert '.' and '..' as first entries to the search path for modules. +# Restricted environments like embeddable python do not include the +# current working directory on startup. +import sys +sys.path[0:0] = ['.', '..'] + # Generate c_ast.py from _ast_gen import ASTCodeGenerator ast_gen = ASTCodeGenerator('_c_ast.cfg') ast_gen.generate(open('c_ast.py', 'w')) -import sys -sys.path[0:0] = ['.', '..'] from pycparser import c_parser # Generates the tables diff --git a/lib_pypy/cffi/_pycparser/ast_transforms.py b/lib_pypy/cffi/_pycparser/ast_transforms.py --- a/lib_pypy/cffi/_pycparser/ast_transforms.py +++ b/lib_pypy/cffi/_pycparser/ast_transforms.py @@ -3,7 +3,7 @@ # # Some utilities used by the parser to create a friendlier AST. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ @@ -43,7 +43,7 @@ Default: break - The goal of this transform it to fix this mess, turning it into the + The goal of this transform is to fix this mess, turning it into the following: Switch @@ -74,7 +74,8 @@ # Goes over the children of the Compound below the Switch, adding them # either directly below new_compound or below the last Case as appropriate - for child in switch_node.stmt.block_items: + # (for `switch(cond) {}`, block_items would have been None) + for child in (switch_node.stmt.block_items or []): if isinstance(child, (c_ast.Case, c_ast.Default)): # If it's a Case/Default: # 1. Add it to the Compound and mark as "last case" diff --git a/lib_pypy/cffi/_pycparser/c_ast.py b/lib_pypy/cffi/_pycparser/c_ast.py --- a/lib_pypy/cffi/_pycparser/c_ast.py +++ b/lib_pypy/cffi/_pycparser/c_ast.py @@ -11,18 +11,45 @@ # # AST Node classes. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- import sys +def _repr(obj): + """ + Get the representation of an object, with dedicated pprint-like format for lists. + """ + if isinstance(obj, list): + return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' + else: + return repr(obj) class Node(object): __slots__ = () """ Abstract base class for AST nodes. """ + def __repr__(self): + """ Generates a python representation of the current node + """ + result = self.__class__.__name__ + '(' + + indent = '' + separator = '' + for name in self.__slots__[:-2]: + result += separator + result += indent + result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) + + separator = ',' + indent = '\n ' + (' ' * len(self.__class__.__name__)) + + result += indent + ')' + + return result + def children(self): """ A sequence of all children that are Nodes """ @@ -112,21 +139,31 @@ * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) """ + + _method_cache = None + def visit(self, node): """ Visit a node. """ - method = 'visit_' + node.__class__.__name__ - visitor = getattr(self, method, self.generic_visit) + + if self._method_cache is None: + self._method_cache = {} + + visitor = self._method_cache.get(node.__class__.__name__, None) + if visitor is None: + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + self._method_cache[node.__class__.__name__] = visitor + return visitor(node) def generic_visit(self, node): """ Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. """ - for c_name, c in node.children(): + for c in node: self.visit(c) - class ArrayDecl(Node): __slots__ = ('type', 'dim', 'dim_quals', 'coord', '__weakref__') def __init__(self, type, dim, dim_quals, coord=None): @@ -141,6 +178,12 @@ if self.dim is not None: nodelist.append(("dim", self.dim)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + if self.dim is not None: + yield self.dim + attr_names = ('dim_quals', ) class ArrayRef(Node): @@ -156,6 +199,12 @@ if self.subscript is not None: nodelist.append(("subscript", self.subscript)) return tuple(nodelist) + def __iter__(self): + if self.name is not None: + yield self.name + if self.subscript is not None: + yield self.subscript + attr_names = () class Assignment(Node): @@ -172,6 +221,12 @@ if self.rvalue is not None: nodelist.append(("rvalue", self.rvalue)) return tuple(nodelist) + def __iter__(self): + if self.lvalue is not None: + yield self.lvalue + if self.rvalue is not None: + yield self.rvalue + attr_names = ('op', ) class BinaryOp(Node): @@ -188,6 +243,12 @@ if self.right is not None: nodelist.append(("right", self.right)) return tuple(nodelist) + def __iter__(self): + if self.left is not None: + yield self.left + if self.right is not None: + yield self.right + attr_names = ('op', ) class Break(Node): @@ -198,6 +259,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class Case(Node): @@ -214,6 +279,12 @@ nodelist.append(("stmts[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + for child in (self.stmts or []): + yield child + attr_names = () class Cast(Node): @@ -229,6 +300,12 @@ if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) + def __iter__(self): + if self.to_type is not None: + yield self.to_type + if self.expr is not None: + yield self.expr + attr_names = () class Compound(Node): @@ -243,6 +320,10 @@ nodelist.append(("block_items[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.block_items or []): + yield child + attr_names = () class CompoundLiteral(Node): @@ -258,6 +339,12 @@ if self.init is not None: nodelist.append(("init", self.init)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + if self.init is not None: + yield self.init + attr_names = () class Constant(Node): @@ -271,6 +358,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('type', 'value', ) class Continue(Node): @@ -281,6 +372,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class Decl(Node): @@ -302,6 +397,14 @@ if self.bitsize is not None: nodelist.append(("bitsize", self.bitsize)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + if self.init is not None: + yield self.init + if self.bitsize is not None: + yield self.bitsize + attr_names = ('name', 'quals', 'storage', 'funcspec', ) class DeclList(Node): @@ -316,6 +419,10 @@ nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.decls or []): + yield child + attr_names = () class Default(Node): @@ -330,6 +437,10 @@ nodelist.append(("stmts[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.stmts or []): + yield child + attr_names = () class DoWhile(Node): @@ -345,6 +456,12 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + attr_names = () class EllipsisParam(Node): @@ -355,6 +472,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class EmptyStatement(Node): @@ -365,6 +486,10 @@ def children(self): return () + def __iter__(self): + return + yield + attr_names = () class Enum(Node): @@ -379,6 +504,10 @@ if self.values is not None: nodelist.append(("values", self.values)) return tuple(nodelist) + def __iter__(self): + if self.values is not None: + yield self.values + attr_names = ('name', ) class Enumerator(Node): @@ -393,6 +522,10 @@ if self.value is not None: nodelist.append(("value", self.value)) return tuple(nodelist) + def __iter__(self): + if self.value is not None: + yield self.value + attr_names = ('name', ) class EnumeratorList(Node): @@ -407,6 +540,10 @@ nodelist.append(("enumerators[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.enumerators or []): + yield child + attr_names = () class ExprList(Node): @@ -421,6 +558,10 @@ nodelist.append(("exprs[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.exprs or []): + yield child + attr_names = () class FileAST(Node): @@ -435,6 +576,10 @@ nodelist.append(("ext[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.ext or []): + yield child + attr_names = () class For(Node): @@ -454,6 +599,16 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.init is not None: + yield self.init + if self.cond is not None: + yield self.cond + if self.next is not None: + yield self.next + if self.stmt is not None: + yield self.stmt + attr_names = () class FuncCall(Node): @@ -469,6 +624,12 @@ if self.args is not None: nodelist.append(("args", self.args)) return tuple(nodelist) + def __iter__(self): + if self.name is not None: + yield self.name + if self.args is not None: + yield self.args + attr_names = () class FuncDecl(Node): @@ -484,6 +645,12 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.args is not None: + yield self.args + if self.type is not None: + yield self.type + attr_names = () class FuncDef(Node): @@ -502,6 +669,14 @@ nodelist.append(("param_decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + if self.decl is not None: + yield self.decl + if self.body is not None: + yield self.body + for child in (self.param_decls or []): + yield child + attr_names = () class Goto(Node): @@ -514,6 +689,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('name', ) class ID(Node): @@ -526,6 +705,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('name', ) class IdentifierType(Node): @@ -538,6 +721,10 @@ nodelist = [] return tuple(nodelist) + def __iter__(self): + return + yield + attr_names = ('names', ) class If(Node): @@ -555,6 +742,14 @@ if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.iftrue is not None: + yield self.iftrue + if self.iffalse is not None: + yield self.iffalse + attr_names = () class InitList(Node): @@ -569,6 +764,10 @@ nodelist.append(("exprs[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.exprs or []): + yield child + attr_names = () class Label(Node): @@ -583,6 +782,10 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.stmt is not None: + yield self.stmt + attr_names = ('name', ) class NamedInitializer(Node): @@ -599,6 +802,12 @@ nodelist.append(("name[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + for child in (self.name or []): + yield child + attr_names = () class ParamList(Node): @@ -613,6 +822,10 @@ nodelist.append(("params[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.params or []): + yield child + attr_names = () class PtrDecl(Node): @@ -627,6 +840,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('quals', ) class Return(Node): @@ -640,6 +857,10 @@ if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + attr_names = () class Struct(Node): @@ -655,6 +876,10 @@ nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.decls or []): + yield child + attr_names = ('name', ) class StructRef(Node): @@ -671,6 +896,12 @@ if self.field is not None: nodelist.append(("field", self.field)) return tuple(nodelist) + def __iter__(self): + if self.name is not None: + yield self.name + if self.field is not None: + yield self.field + attr_names = ('type', ) class Switch(Node): @@ -686,6 +917,12 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + attr_names = () class TernaryOp(Node): @@ -703,6 +940,14 @@ if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.iftrue is not None: + yield self.iftrue + if self.iffalse is not None: + yield self.iffalse + attr_names = () class TypeDecl(Node): @@ -718,6 +963,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('declname', 'quals', ) class Typedef(Node): @@ -734,6 +983,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('name', 'quals', 'storage', ) class Typename(Node): @@ -749,6 +1002,10 @@ if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) + def __iter__(self): + if self.type is not None: + yield self.type + attr_names = ('name', 'quals', ) class UnaryOp(Node): @@ -763,6 +1020,10 @@ if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) + def __iter__(self): + if self.expr is not None: + yield self.expr + attr_names = ('op', ) class Union(Node): @@ -778,6 +1039,10 @@ nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) + def __iter__(self): + for child in (self.decls or []): + yield child + attr_names = ('name', ) class While(Node): @@ -793,5 +1058,27 @@ if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + attr_names = () +class Pragma(Node): + __slots__ = ('string', 'coord', '__weakref__') + def __init__(self, string, coord=None): + self.string = string + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('string', ) + diff --git a/lib_pypy/cffi/_pycparser/c_generator.py b/lib_pypy/cffi/_pycparser/c_generator.py --- a/lib_pypy/cffi/_pycparser/c_generator.py +++ b/lib_pypy/cffi/_pycparser/c_generator.py @@ -3,7 +3,7 @@ # # C code generator from pycparser AST nodes. # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ from . import c_ast @@ -40,6 +40,12 @@ def visit_ID(self, n): return n.name + def visit_Pragma(self, n): + ret = '#pragma' + if n.string: + ret += ' ' + n.string + return ret + def visit_ArrayRef(self, n): arrref = self._parenthesize_unless_simple(n.name) return arrref + '[' + self.visit(n.subscript) + ']' @@ -113,7 +119,7 @@ return s def visit_Cast(self, n): - s = '(' + self._generate_type(n.to_type) + ')' + s = '(' + self._generate_type(n.to_type, emit_declname=False) + ')' return s + ' ' + self._parenthesize_unless_simple(n.expr) def visit_ExprList(self, n): @@ -129,18 +135,20 @@ return ', '.join(visited_subexprs) def visit_Enum(self, n): - s = 'enum' - if n.name: s += ' ' + n.name - if n.values: - s += ' {' - for i, enumerator in enumerate(n.values.enumerators): - s += enumerator.name - if enumerator.value: - s += ' = ' + self.visit(enumerator.value) - if i != len(n.values.enumerators) - 1: - s += ', ' - s += '}' - return s + return self._generate_struct_union_enum(n, name='enum') + + def visit_Enumerator(self, n): + if not n.value: + return '{indent}{name},\n'.format( + indent=self._make_indent(), + name=n.name, + ) + else: + return '{indent}{name} = {value},\n'.format( + indent=self._make_indent(), + name=n.name, + value=self.visit(n.value), + ) def visit_FuncDef(self, n): decl = self.visit(n.decl) @@ -157,6 +165,8 @@ for ext in n.ext: if isinstance(ext, c_ast.FuncDef): s += self.visit(ext) + elif isinstance(ext, c_ast.Pragma): + s += self.visit(ext) + '\n' else: s += self.visit(ext) + ';\n' return s @@ -170,6 +180,10 @@ s += self._make_indent() + '}\n' return s + def visit_CompoundLiteral(self, n): + return '(' + self.visit(n.type) + '){' + self.visit(n.init) + '}' + + def visit_EmptyStatement(self, n): return ';' @@ -188,9 +202,9 @@ return 'continue;' def visit_TernaryOp(self, n): - s = self._visit_expr(n.cond) + ' ? ' - s += self._visit_expr(n.iftrue) + ' : ' - s += self._visit_expr(n.iffalse) + s = '(' + self._visit_expr(n.cond) + ') ? ' + s += '(' + self._visit_expr(n.iftrue) + ') : ' + s += '(' + self._visit_expr(n.iffalse) + ')' return s def visit_If(self, n): @@ -256,43 +270,67 @@ return '...' def visit_Struct(self, n): - return self._generate_struct_union(n, 'struct') + return self._generate_struct_union_enum(n, 'struct') def visit_Typename(self, n): return self._generate_type(n.type) def visit_Union(self, n): - return self._generate_struct_union(n, 'union') + return self._generate_struct_union_enum(n, 'union') def visit_NamedInitializer(self, n): s = '' for name in n.name: if isinstance(name, c_ast.ID): s += '.' + name.name - elif isinstance(name, c_ast.Constant): - s += '[' + name.value + ']' - s += ' = ' + self.visit(n.expr) + else: + s += '[' + self.visit(name) + ']' + s += ' = ' + self._visit_expr(n.expr) return s def visit_FuncDecl(self, n): return self._generate_type(n) - def _generate_struct_union(self, n, name): - """ Generates code for structs and unions. name should be either - 'struct' or union. + def visit_ArrayDecl(self, n): + return self._generate_type(n, emit_declname=False) + + def visit_TypeDecl(self, n): + return self._generate_type(n, emit_declname=False) + + def visit_PtrDecl(self, n): + return self._generate_type(n, emit_declname=False) + + def _generate_struct_union_enum(self, n, name): + """ Generates code for structs, unions, and enums. name should be + 'struct', 'union', or 'enum'. """ + if name in ('struct', 'union'): + members = n.decls + body_function = self._generate_struct_union_body + else: + assert name == 'enum' + members = None if n.values is None else n.values.enumerators + body_function = self._generate_enum_body s = name + ' ' + (n.name or '') - if n.decls: + if members is not None: + # None means no members + # Empty sequence means an empty list of members s += '\n' s += self._make_indent() self.indent_level += 2 s += '{\n' - for decl in n.decls: - s += self._generate_stmt(decl) + s += body_function(members) self.indent_level -= 2 s += self._make_indent() + '}' return s + def _generate_struct_union_body(self, members): + return ''.join(self._generate_stmt(decl) for decl in members) + + def _generate_enum_body(self, members): + # `[:-2] + '\n'` removes the final `,` from the enumerator list + return ''.join(self.visit(value) for value in members)[:-2] + '\n' + def _generate_stmt(self, n, add_indent=False): """ Generation from a statement node. This method exists as a wrapper for individual visit_* methods to handle different treatment of @@ -330,7 +368,7 @@ s += self._generate_type(n.type) return s - def _generate_type(self, n, modifiers=[]): + def _generate_type(self, n, modifiers=[], emit_declname = True): """ Recursive generation from a type node. n is the type node. modifiers collects the PtrDecl, ArrayDecl and FuncDecl modifiers encountered on the way down to a TypeDecl, to allow proper @@ -344,23 +382,29 @@ if n.quals: s += ' '.join(n.quals) + ' ' s += self.visit(n.type) - nstr = n.declname if n.declname else '' + nstr = n.declname if n.declname and emit_declname else '' # Resolve modifiers. # Wrap in parens to distinguish pointer to array and pointer to # function syntax. # for i, modifier in enumerate(modifiers): if isinstance(modifier, c_ast.ArrayDecl): - if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): - nstr = '(' + nstr + ')' - nstr += '[' + self.visit(modifier.dim) + ']' + if (i != 0 and + isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '[' + if modifier.dim_quals: + nstr += ' '.join(modifier.dim_quals) + ' ' + nstr += self.visit(modifier.dim) + ']' elif isinstance(modifier, c_ast.FuncDecl): - if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): - nstr = '(' + nstr + ')' + if (i != 0 and + isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' nstr += '(' + self.visit(modifier.args) + ')' elif isinstance(modifier, c_ast.PtrDecl): if modifier.quals: - nstr = '* %s %s' % (' '.join(modifier.quals), nstr) + nstr = '* %s%s' % (' '.join(modifier.quals), + ' ' + nstr if nstr else '') else: nstr = '*' + nstr if nstr: s += ' ' + nstr @@ -368,11 +412,12 @@ elif typ == c_ast.Decl: return self._generate_decl(n.type) elif typ == c_ast.Typename: - return self._generate_type(n.type) + return self._generate_type(n.type, emit_declname = emit_declname) elif typ == c_ast.IdentifierType: return ' '.join(n.names) + ' ' elif typ in (c_ast.ArrayDecl, c_ast.PtrDecl, c_ast.FuncDecl): - return self._generate_type(n.type, modifiers + [n]) + return self._generate_type(n.type, modifiers + [n], + emit_declname = emit_declname) else: return self.visit(n) @@ -395,5 +440,5 @@ """ Returns True for nodes that are "simple" - i.e. nodes that always have higher precedence than operators. """ - return isinstance(n,( c_ast.Constant, c_ast.ID, c_ast.ArrayRef, - c_ast.StructRef, c_ast.FuncCall)) + return isinstance(n, (c_ast.Constant, c_ast.ID, c_ast.ArrayRef, + c_ast.StructRef, c_ast.FuncCall)) diff --git a/lib_pypy/cffi/_pycparser/c_lexer.py b/lib_pypy/cffi/_pycparser/c_lexer.py --- a/lib_pypy/cffi/_pycparser/c_lexer.py +++ b/lib_pypy/cffi/_pycparser/c_lexer.py @@ -3,7 +3,7 @@ # # CLexer class: lexer for the C language # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ import re @@ -19,7 +19,7 @@ tokens. The public attribute filename can be set to an initial - filaneme, but the lexer will update it upon #line + filename, but the lexer will update it upon #line directives. """ def __init__(self, error_func, on_lbrace_func, on_rbrace_func, @@ -52,8 +52,8 @@ # Allow either "# line" or "# " to support GCC's # cpp output # - self.line_pattern = re.compile('([ \t]*line\W)|([ \t]*\d+)') - self.pragma_pattern = re.compile('[ \t]*pragma\W') + self.line_pattern = re.compile(r'([ \t]*line\W)|([ \t]*\d+)') + self.pragma_pattern = re.compile(r'[ \t]*pragma\W') def build(self, **kwargs): """ Builds the lexer from the specification. Must be @@ -102,11 +102,11 @@ keywords = ( '_BOOL', '_COMPLEX', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN', - 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', + 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', 'REGISTER', 'OFFSETOF', 'RESTRICT', 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', 'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID', - 'VOLATILE', 'WHILE', + 'VOLATILE', 'WHILE', '__INT128', ) keyword_map = {} @@ -171,7 +171,9 @@ 'ELLIPSIS', # pre-processor - 'PPHASH', # '#' + 'PPHASH', # '#' + 'PPPRAGMA', # 'pragma' + 'PPPRAGMASTR', ) ## @@ -203,12 +205,37 @@ # parse all correct code, even if it means to sometimes parse incorrect # code. # - simple_escape = r"""([a-zA-Z._~!=&\^\-\\?'"])""" - decimal_escape = r"""(\d+)""" - hex_escape = r"""(x[0-9a-fA-F]+)""" - bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])""" + # The original regexes were taken verbatim from the C syntax definition, + # and were later modified to avoid worst-case exponential running time. + # + # simple_escape = r"""([a-zA-Z._~!=&\^\-\\?'"])""" + # decimal_escape = r"""(\d+)""" + # hex_escape = r"""(x[0-9a-fA-F]+)""" + # bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])""" + # + # The following modifications were made to avoid the ambiguity that allowed backtracking: + # (https://github.com/eliben/pycparser/issues/61) + # + # - \x was removed from simple_escape, unless it was not followed by a hex digit, to avoid ambiguity with hex_escape. + # - hex_escape allows one or more hex characters, but requires that the next character(if any) is not hex + # - decimal_escape allows one or more decimal characters, but requires that the next character(if any) is not a decimal + # - bad_escape does not allow any decimals (8-9), to avoid conflicting with the permissive decimal_escape. + # + # Without this change, python's `re` module would recursively try parsing each ambiguous escape sequence in multiple ways. + # e.g. `\123` could be parsed as `\1`+`23`, `\12`+`3`, and `\123`. + + simple_escape = r"""([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))""" + decimal_escape = r"""(\d+)(?!\d)""" + hex_escape = r"""(x[0-9a-fA-F]+)(?![0-9a-fA-F])""" + bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-9])""" escape_sequence = r"""(\\("""+simple_escape+'|'+decimal_escape+'|'+hex_escape+'))' + + # This complicated regex with lookahead might be slow for strings, so because all of the valid escapes (including \x) allowed + # 0 or more non-escaped characters after the first character, simple_escape+decimal_escape+hex_escape got simplified to + + escape_sequence_start_in_string = r"""(\\[0-9a-zA-Z._~!=&\^\-\\?'"])""" + cconst_char = r"""([^'\\\n]|"""+escape_sequence+')' char_const = "'"+cconst_char+"'" wchar_const = 'L'+char_const @@ -216,7 +243,7 @@ bad_char_const = r"""('"""+cconst_char+"""[^'\n]+')|('')|('"""+bad_escape+r"""[^'\n]*')""" # string literals (K&R2: A.2.6) - string_char = r"""([^"\\\n]|"""+escape_sequence+')' + string_char = r"""([^"\\\n]|"""+escape_sequence_start_in_string+')' string_literal = '"'+string_char+'*"' wstring_literal = 'L'+string_literal bad_string_literal = '"'+string_char+'*'+bad_escape+string_char+'*"' @@ -274,7 +301,6 @@ def t_ppline_NEWLINE(self, t): r'\n' - if self.pp_line is None: self._error('line number missing in #line', t) else: @@ -304,15 +330,14 @@ def t_pppragma_PPPRAGMA(self, t): r'pragma' - pass + return t - t_pppragma_ignore = ' \t<>.-{}();=+-*/$%@&^~!?:,0123456789' + t_pppragma_ignore = ' \t' - @TOKEN(string_literal) - def t_pppragma_STR(self, t): pass - - @TOKEN(identifier) - def t_pppragma_ID(self, t): pass + def t_pppragma_STR(self, t): + '.+' + t.type = 'PPPRAGMASTR' + return t def t_pppragma_error(self, t): self._error('invalid #pragma directive', t) @@ -482,4 +507,3 @@ def t_error(self, t): msg = 'Illegal character %s' % repr(t.value[0]) self._error(msg, t) - diff --git a/lib_pypy/cffi/_pycparser/c_parser.py b/lib_pypy/cffi/_pycparser/c_parser.py --- a/lib_pypy/cffi/_pycparser/c_parser.py +++ b/lib_pypy/cffi/_pycparser/c_parser.py @@ -3,7 +3,7 @@ # # CParser class: Parser and AST builder for the C language # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ import re @@ -12,14 +12,16 @@ from . import c_ast from .c_lexer import CLexer -from .plyparser import PLYParser, Coord, ParseError +from .plyparser import PLYParser, Coord, ParseError, parameterized, template from .ast_transforms import fix_switch_cases + at template class CParser(PLYParser): def __init__( self, lex_optimize=True, + lexer=CLexer, lextab='cffi._pycparser.lextab', yacc_optimize=True, yacctab='cffi._pycparser.yacctab', @@ -42,6 +44,10 @@ to save the re-generation of the lexer table on each run. + lexer: + Set this parameter to define the lexer to use if + you're not using the default CLexer. + lextab: Points to the lex table that's used for optimized mode. Only if you're modifying the lexer and want @@ -70,7 +76,7 @@ Set this parameter to control the location of generated lextab and yacctab files. """ - self.clex = CLexer( + self.clex = lexer( error_func=self._lex_error_func, on_lbrace_func=self._lex_on_lbrace_func, on_rbrace_func=self._lex_on_rbrace_func, @@ -86,14 +92,14 @@ 'abstract_declarator', 'assignment_expression', 'declaration_list', - 'declaration_specifiers', + 'declaration_specifiers_no_type', 'designation', 'expression', 'identifier_list', 'init_declarator_list', + 'id_init_declarator_list', 'initializer_list', 'parameter_type_list', - 'specifier_qualifier_list', 'block_item_list', 'type_qualifier_list', 'struct_declarator_list' @@ -342,7 +348,7 @@ coord=typename[0].coord) return decl - def _add_declaration_specifier(self, declspec, newspec, kind): + def _add_declaration_specifier(self, declspec, newspec, kind, append=False): """ Declaration specifiers are represented by a dictionary with the entries: * qual: a list of type qualifiers @@ -352,11 +358,18 @@ This method is given a declaration specifier, and a new specifier of a given kind. + If `append` is True, the new specifier is added to the end of + the specifiers list, otherwise it's added at the beginning. Returns the declaration specifier, with the new specifier incorporated. """ spec = declspec or dict(qual=[], storage=[], type=[], function=[]) - spec[kind].insert(0, newspec) + + if append: + spec[kind].append(newspec) + else: + spec[kind].insert(0, newspec) + return spec def _build_declarations(self, spec, decls, typedef_namespace=False): @@ -516,8 +529,7 @@ def p_translation_unit_2(self, p): """ translation_unit : translation_unit external_declaration """ - if p[2] is not None: - p[1].extend(p[2]) + p[1].extend(p[2]) p[0] = p[1] # Declarations always come as lists (because they can be @@ -537,32 +549,42 @@ def p_external_declaration_3(self, p): """ external_declaration : pp_directive + | pppragma_directive """ - p[0] = p[1] + p[0] = [p[1]] def p_external_declaration_4(self, p): """ external_declaration : SEMI """ - p[0] = None + p[0] = [] def p_pp_directive(self, p): """ pp_directive : PPHASH """ self._parse_error('Directives not supported yet', - self._coord(p.lineno(1))) + self._token_coord(p, 1)) + + def p_pppragma_directive(self, p): + """ pppragma_directive : PPPRAGMA + | PPPRAGMA PPPRAGMASTR + """ + if len(p) == 3: + p[0] = c_ast.Pragma(p[2], self._token_coord(p, 2)) + else: + p[0] = c_ast.Pragma("", self._token_coord(p, 1)) # In function definitions, the declarator can be followed by # a declaration list, for old "K&R style" function definitios. # def p_function_definition_1(self, p): - """ function_definition : declarator declaration_list_opt compound_statement + """ function_definition : id_declarator declaration_list_opt compound_statement """ # no declaration specifiers - 'int' becomes the default type spec = dict( qual=[], storage=[], type=[c_ast.IdentifierType(['int'], - coord=self._coord(p.lineno(1)))], + coord=self._token_coord(p, 1))], function=[]) p[0] = self._build_function_definition( @@ -572,7 +594,7 @@ body=p[3]) def p_function_definition_2(self, p): - """ function_definition : declaration_specifiers declarator declaration_list_opt compound_statement + """ function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement """ spec = p[1] @@ -589,9 +611,63 @@ | selection_statement | iteration_statement | jump_statement + | pppragma_directive """ p[0] = p[1] + # A pragma is generally considered a decorator rather than an actual statement. + # Still, for the purposes of analyzing an abstract syntax tree of C code, + # pragma's should not be ignored and were previously treated as a statement. + # This presents a problem for constructs that take a statement such as labeled_statements, + # selection_statements, and iteration_statements, causing a misleading structure + # in the AST. For example, consider the following C code. + # + # for (int i = 0; i < 3; i++) + # #pragma omp critical + # sum += 1; + # + # This code will compile and execute "sum += 1;" as the body of the for loop. + # Previous implementations of PyCParser would render the AST for this + # block of code as follows: + # + # For: + # DeclList: + # Decl: i, [], [], [] + # TypeDecl: i, [] + # IdentifierType: ['int'] + # Constant: int, 0 + # BinaryOp: < + # ID: i + # Constant: int, 3 + # UnaryOp: p++ + # ID: i + # Pragma: omp critical + # Assignment: += + # ID: sum + # Constant: int, 1 + # + # This AST misleadingly takes the Pragma as the body of the loop and the + # assignment then becomes a sibling of the loop. + # + # To solve edge cases like these, the pragmacomp_or_statement rule groups + # a pragma and its following statement (which would otherwise be orphaned) + # using a compound block, effectively turning the above code into: + # + # for (int i = 0; i < 3; i++) { + # #pragma omp critical + # sum += 1; + # } + def p_pragmacomp_or_statement(self, p): + """ pragmacomp_or_statement : pppragma_directive statement + | statement + """ + if isinstance(p[1], c_ast.Pragma) and len(p) == 3: + p[0] = c_ast.Compound( + block_items=[p[1], p[2]], + coord=self._token_coord(p, 1)) + else: + p[0] = p[1] + # In C, declarations can come several in a line: # int x, *px, romulo = 5; # @@ -603,6 +679,7 @@ # def p_decl_body(self, p): """ decl_body : declaration_specifiers init_declarator_list_opt + | declaration_specifiers_no_type id_init_declarator_list_opt """ spec = p[1] @@ -675,26 +752,58 @@ """ p[0] = p[1] if len(p) == 2 else p[1] + p[2] - def p_declaration_specifiers_1(self, p): - """ declaration_specifiers : type_qualifier declaration_specifiers_opt + # To know when declaration-specifiers end and declarators begin, + # we require declaration-specifiers to have at least one + # type-specifier, and disallow typedef-names after we've seen any + # type-specifier. These are both required by the spec. + # + def p_declaration_specifiers_no_type_1(self, p): + """ declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'qual') - def p_declaration_specifiers_2(self, p): - """ declaration_specifiers : type_specifier declaration_specifiers_opt - """ - p[0] = self._add_declaration_specifier(p[2], p[1], 'type') - - def p_declaration_specifiers_3(self, p): - """ declaration_specifiers : storage_class_specifier declaration_specifiers_opt + def p_declaration_specifiers_no_type_2(self, p): + """ declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'storage') - def p_declaration_specifiers_4(self, p): - """ declaration_specifiers : function_specifier declaration_specifiers_opt + def p_declaration_specifiers_no_type_3(self, p): + """ declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'function') + + def p_declaration_specifiers_1(self, p): + """ declaration_specifiers : declaration_specifiers type_qualifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_declaration_specifiers_2(self, p): + """ declaration_specifiers : declaration_specifiers storage_class_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'storage', append=True) + + def p_declaration_specifiers_3(self, p): + """ declaration_specifiers : declaration_specifiers function_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'function', append=True) + + def p_declaration_specifiers_4(self, p): + """ declaration_specifiers : declaration_specifiers type_specifier_no_typeid + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_declaration_specifiers_5(self, p): + """ declaration_specifiers : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_declaration_specifiers_6(self, p): + """ declaration_specifiers : declaration_specifiers_no_type type_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_storage_class_specifier(self, p): """ storage_class_specifier : AUTO | REGISTER @@ -709,25 +818,27 @@ """ p[0] = p[1] - def p_type_specifier_1(self, p): - """ type_specifier : VOID - | _BOOL - | CHAR - | SHORT - | INT - | LONG - | FLOAT - | DOUBLE - | _COMPLEX - | SIGNED - | UNSIGNED + def p_type_specifier_no_typeid(self, p): + """ type_specifier_no_typeid : VOID + | _BOOL + | CHAR + | SHORT + | INT + | LONG + | FLOAT + | DOUBLE + | _COMPLEX + | SIGNED + | UNSIGNED + | __INT128 """ - p[0] = c_ast.IdentifierType([p[1]], coord=self._coord(p.lineno(1))) + p[0] = c_ast.IdentifierType([p[1]], coord=self._token_coord(p, 1)) - def p_type_specifier_2(self, p): + def p_type_specifier(self, p): """ type_specifier : typedef_name | enum_specifier | struct_or_union_specifier + | type_specifier_no_typeid """ p[0] = p[1] @@ -738,30 +849,12 @@ """ p[0] = p[1] - def p_init_declarator_list_1(self, p): + def p_init_declarator_list(self, p): """ init_declarator_list : init_declarator | init_declarator_list COMMA init_declarator """ p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] - # If the code is declaring a variable that was declared a typedef in an - # outer scope, yacc will think the name is part of declaration_specifiers, - # not init_declarator, and will then get confused by EQUALS. Pass None - # up in place of declarator, and handle this at a higher level. - # - def p_init_declarator_list_2(self, p): - """ init_declarator_list : EQUALS initializer - """ - p[0] = [dict(decl=None, init=p[2])] - - # Similarly, if the code contains duplicate typedefs of, for example, - # array types, the array portion will appear as an abstract declarator. - # - def p_init_declarator_list_3(self, p): - """ init_declarator_list : abstract_declarator - """ - p[0] = [dict(decl=p[1], init=None)] - # Returns a {decl= : init=} dictionary # If there's no initializer, uses None # @@ -771,15 +864,40 @@ """ p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + def p_id_init_declarator_list(self, p): + """ id_init_declarator_list : id_init_declarator + | id_init_declarator_list COMMA init_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + def p_id_init_declarator(self, p): + """ id_init_declarator : id_declarator + | id_declarator EQUALS initializer + """ + p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + + # Require at least one type specifier in a specifier-qualifier-list + # def p_specifier_qualifier_list_1(self, p): - """ specifier_qualifier_list : type_qualifier specifier_qualifier_list_opt + """ specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid """ - p[0] = self._add_declaration_specifier(p[2], p[1], 'qual') + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) def p_specifier_qualifier_list_2(self, p): - """ specifier_qualifier_list : type_specifier specifier_qualifier_list_opt + """ specifier_qualifier_list : specifier_qualifier_list type_qualifier """ - p[0] = self._add_declaration_specifier(p[2], p[1], 'type') + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_specifier_qualifier_list_3(self, p): + """ specifier_qualifier_list : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_specifier_qualifier_list_4(self, p): + """ specifier_qualifier_list : type_qualifier_list type_specifier + """ + spec = dict(qual=p[1], storage=[], type=[], function=[]) + p[0] = self._add_declaration_specifier(spec, p[2], 'type', append=True) # TYPEID is allowed here (and in other struct/enum related tag names), because # struct/enum tags reside in their own namespace and can be named the same as types @@ -789,29 +907,48 @@ | struct_or_union TYPEID """ klass = self._select_struct_union_class(p[1]) + # None means no list of members p[0] = klass( name=p[2], decls=None, - coord=self._coord(p.lineno(2))) + coord=self._token_coord(p, 2)) def p_struct_or_union_specifier_2(self, p): """ struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close + | struct_or_union brace_open brace_close """ klass = self._select_struct_union_class(p[1]) - p[0] = klass( - name=None, - decls=p[3], - coord=self._coord(p.lineno(2))) + if len(p) == 4: + # Empty sequence means an empty list of members + p[0] = klass( + name=None, + decls=[], + coord=self._token_coord(p, 2)) + else: + p[0] = klass( + name=None, + decls=p[3], + coord=self._token_coord(p, 2)) + def p_struct_or_union_specifier_3(self, p): """ struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close + | struct_or_union ID brace_open brace_close | struct_or_union TYPEID brace_open struct_declaration_list brace_close + | struct_or_union TYPEID brace_open brace_close """ klass = self._select_struct_union_class(p[1]) - p[0] = klass( - name=p[2], From pypy.commits at gmail.com Sun Sep 22 07:44:15 2019 From: pypy.commits at gmail.com (rlamy) Date: Sun, 22 Sep 2019 04:44:15 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Handle locale in time.strftime(). Fixes #3079 Message-ID: <5d875e8f.1c69fb81.f4100.ae9e@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97590:7392d01b93d0 Date: 2019-09-22 12:42 +0100 http://bitbucket.org/pypy/pypy/changeset/7392d01b93d0/ Log: Handle locale in time.strftime(). Fixes #3079 diff --git a/lib-python/3/test/test_time.py b/lib-python/3/test/test_time.py --- a/lib-python/3/test/test_time.py +++ b/lib-python/3/test/test_time.py @@ -530,6 +530,8 @@ self.skipTest('could not set locale.LC_ALL to fr_FR') # This should not cause an exception time.strftime("%B", (2009,2,1,0,0,0,0,0,0)) + # PyPy addition: + time.strftime("%B", (2009,8,1,0,0,0,0,0,0)).lower() class _TestAsctimeYear: diff --git a/pypy/module/time/interp_time.py b/pypy/module/time/interp_time.py --- a/pypy/module/time/interp_time.py +++ b/pypy/module/time/interp_time.py @@ -6,6 +6,8 @@ from pypy.interpreter.timeutils import ( SECS_TO_NS, MS_TO_NS, US_TO_NS, monotonic as _monotonic, timestamp_w) from pypy.interpreter.unicodehelper import decode_utf8sp +from pypy.module._codecs.locale import ( + str_decode_locale_surrogateescape, unicode_encode_locale_surrogateescape) from rpython.rtyper.lltypesystem import lltype from rpython.rlib.rarithmetic import ( intmask, r_ulonglong, r_longfloat, widen, ovfcheck, ovfcheck_float_to_int) @@ -338,8 +340,8 @@ "void pypy__tzset();"], separate_module_sources = [""" long pypy_get_timezone() { - long timezone; - _get_timezone(&timezone); + long timezone; + _get_timezone(&timezone); return timezone; }; int pypy_get_daylight() { @@ -359,7 +361,7 @@ c_get_timezone = external('pypy_get_timezone', [], rffi.LONG, win_eci) c_get_daylight = external('pypy_get_daylight', [], rffi.INT, win_eci) c_get_tzname = external('pypy_get_tzname', - [rffi.SIZE_T, rffi.INT, rffi.CCHARP], + [rffi.SIZE_T, rffi.INT, rffi.CCHARP], rffi.INT, win_eci, calling_conv='c') c_strftime = external('strftime', [rffi.CCHARP, rffi.SIZE_T, rffi.CCHARP, TM_P], @@ -869,6 +871,7 @@ raise oefmt(space.w_ValueError, "invalid format string") i += 1 + format = unicode_encode_locale_surrogateescape(format.decode('utf8')) i = 1024 while True: outbuf = lltype.malloc(rffi.CCHARP.TO, i, flavor='raw') @@ -881,7 +884,8 @@ # e.g. an empty format, or %Z when the timezone # is unknown. result = rffi.charp2strn(outbuf, intmask(buflen)) - return space.newtext(result) + decoded, size = str_decode_locale_surrogateescape(result) + return space.newutf8(decoded, size) finally: lltype.free(outbuf, flavor='raw') i += i From pypy.commits at gmail.com Mon Sep 23 06:18:02 2019 From: pypy.commits at gmail.com (stevie_92) Date: Mon, 23 Sep 2019 03:18:02 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Fixed bugs in rrc incmark Message-ID: <5d889bda.1c69fb81.bd808.04d3@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97591:f23e180d2dfc Date: 2019-09-23 12:17 +0200 http://bitbucket.org/pypy/pypy/changeset/f23e180d2dfc/ Log: Fixed bugs in rrc incmark Added test case and implemented missing check for new linked proxies diff --git a/rpython/memory/gc/rrc/incmark.py b/rpython/memory/gc/rrc/incmark.py --- a/rpython/memory/gc/rrc/incmark.py +++ b/rpython/memory/gc/rrc/incmark.py @@ -72,24 +72,35 @@ # set their cyclic refcount to > 0 to mark them as live consistent = True self.snapshot_consistent = True - # simply iterate the snapshot for objects in p_list, as linked objects might not be freed, except by the gc + + # sync p_list_old (except gc-objects) + # simply iterate the snapshot for objects in p_list, as linked objects + # might not be freed, except by the gc free_p_list = self.gc.AddressStack() for i in range(0, self.total_objs): snapobj = self.snapshot_objs[i] if snapobj.pypy_link == 0: - break + break # only look for objects in p_list pyobj = llmemory.cast_adr_to_ptr(snapobj.pyobj, self.PYOBJ_HDR_PTR) pygchdr = self.pyobj_as_gc(pyobj) - if (pygchdr <> lltype.nullptr(self.PYOBJ_GC_HDR) and + if (pygchdr != lltype.nullptr(self.PYOBJ_GC_HDR) and pygchdr.c_gc_refs != self.RAWREFCOUNT_REFS_UNTRACKED): - break + break # only look for non-gc if snapobj.refcnt == 0: + # check consistency consistent = pyobj.c_ob_refcnt == snapobj.refcnt_original if not consistent: break # move to separate list + self.p_list_old.remove(snapobj.pyobj) free_p_list.append(snapobj.pyobj) + # look if there is a (newly) linked non-gc proxy, where the non-rc obj + # is unmarked + self.p_list_old_consistent = True + self.p_list_old.foreach(self._check_consistency_p_list_old, None) + consistent &= self.p_list_old_consistent + # sync gc objects pygchdr = self.pyobj_list.c_gc_next while pygchdr <> self.pyobj_list and consistent: @@ -116,9 +127,14 @@ self._gc_list_add(self.pyobj_old_list, pygchdr) else: # new object, keep alive + pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT pyobj = self.gc_as_pyobj(pygchdr) - pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT - # TODO: also keep reachable objects alive (in case rc proxy -> non-rc -> non-rc proxy -> rc obj!!!) + if pyobj.c_ob_pypy_link != 0: + addr = llmemory.cast_int_to_adr(pyobj.c_ob_pypy_link) + if not (self.gc.header(addr).tid & + (self.GCFLAG_VISITED | self.GCFLAG_NO_HEAP_PTRS)): + consistent = False + break pygchdr = next_old self._debug_check_consistency(print_label="end-check-consistency") @@ -172,11 +188,19 @@ "refcnt original", snapobj.refcnt_original, "link", snapobj.pypy_link) + def _check_consistency_p_list_old(self, pyobject, foo): + pyobj = llmemory.cast_adr_to_ptr(pyobject, self.PYOBJ_HDR_PTR) + pygchdr = self.pyobj_as_gc(pyobj) + if (pygchdr == lltype.nullptr(self.PYOBJ_GC_HDR) and + pyobj.c_ob_pypy_link != 0): + addr = llmemory.cast_int_to_adr(pyobj.c_ob_pypy_link) + if not (self.gc.header(addr).tid & + (self.GCFLAG_VISITED | self.GCFLAG_NO_HEAP_PTRS)): + self.p_list_old_consistent = False + def _free_p_list(self, pyobject, foo): from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT - # unlink - self.p_list_old.remove(pyobject) pyobj = llmemory.cast_adr_to_ptr(pyobject, self.PYOBJ_HDR_PTR) refcnt = pyobj.c_ob_refcnt if refcnt >= REFCNT_FROM_PYPY_LIGHT: diff --git a/rpython/memory/gc/test/dot/keep_cpython_inc_3.dot b/rpython/memory/gc/test/dot/keep_cpython_inc_3b.dot copy from rpython/memory/gc/test/dot/keep_cpython_inc_3.dot copy to rpython/memory/gc/test/dot/keep_cpython_inc_3b.dot --- a/rpython/memory/gc/test/dot/keep_cpython_inc_3.dot +++ b/rpython/memory/gc/test/dot/keep_cpython_inc_3b.dot @@ -5,7 +5,7 @@ "d" [type=B, alive=y]; "e" [type=C, alive=y]; "f" [type=C, alive=y, ext_refcnt=1, added=after_snap]; - "g" [type=B, alive=y, added=linked_after_snap]; + "g" [type=B, alive=y, added=linked_after_snap, gc=n]; "a" -> "b" [removed=after_snap]; "b" -> "c"; "c" -> "d"; diff --git a/rpython/memory/gc/test/test_rawrefcount.py b/rpython/memory/gc/test/test_rawrefcount.py --- a/rpython/memory/gc/test/test_rawrefcount.py +++ b/rpython/memory/gc/test/test_rawrefcount.py @@ -850,13 +850,15 @@ i += 1 for obj in add_linked_pyobj_after_snap: r, raddr, check_alive = self._rawrefcount_pyobj( - tracked=obj.info.tracked, tuple=obj.info.tuple) + tracked=obj.info.tracked, tuple=obj.info.tuple, + is_gc=obj.info.gc) r.c_ob_refcnt += obj.info.ext_refcnt obj.r = r obj.raddr = raddr - def double_check(): - obj.check_alive() - check_alive() + old_alive = obj.check_alive + def double_check(ext_refcnt): + old_alive() + check_alive(ext_refcnt) obj.check_alive = double_check self.gc.rawrefcount_create_link_pypy(obj.pref, raddr) From pypy.commits at gmail.com Mon Sep 23 08:12:45 2019 From: pypy.commits at gmail.com (rlamy) Date: Mon, 23 Sep 2019 05:12:45 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: add locale test Message-ID: <5d88b6bd.1c69fb81.d3568.3fd1@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97592:c5ca148709ff Date: 2019-09-23 13:11 +0100 http://bitbucket.org/pypy/pypy/changeset/c5ca148709ff/ Log: add locale test diff --git a/pypy/module/_codecs/test/test_locale.py b/pypy/module/_codecs/test/test_locale.py --- a/pypy/module/_codecs/test/test_locale.py +++ b/pypy/module/_codecs/test/test_locale.py @@ -60,6 +60,12 @@ assert (locale_decoder(val) == utf8_decoder(val, 'strict', True, None)[:2]) + def test_decode_locale_latin1(self): + self.setlocale("fr_FR") + uni = u"août" + string = uni.encode('latin1') + assert str_decode_locale_surrogateescape(string) == (uni.encode('utf8'), len(uni)) + def test_decode_locale_errorhandler(self): self.setlocale("en_US.UTF-8") locale_decoder = str_decode_locale_surrogateescape From pypy.commits at gmail.com Mon Sep 23 08:57:43 2019 From: pypy.commits at gmail.com (stevie_92) Date: Mon, 23 Sep 2019 05:57:43 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Fixed bug in rrc gc tests Message-ID: <5d88c147.1c69fb81.3082c.85d2@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97593:8b37cae53ec8 Date: 2019-09-23 14:56 +0200 http://bitbucket.org/pypy/pypy/changeset/8b37cae53ec8/ Log: Fixed bug in rrc gc tests diff --git a/rpython/memory/gc/test/test_rawrefcount.py b/rpython/memory/gc/test/test_rawrefcount.py --- a/rpython/memory/gc/test/test_rawrefcount.py +++ b/rpython/memory/gc/test/test_rawrefcount.py @@ -5,6 +5,7 @@ from rpython.memory.gc.rrc.mark import RawRefCountMarkGC from rpython.memory.gc.rrc.incmark import RawRefCountIncMarkGC from rpython.memory.gc.test.test_direct import BaseDirectGCTest +from rpython.rlib import rgc from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY, REFCNT_FROM_PYPY_LIGHT PYOBJ_HDR = RawRefCountBaseGC.PYOBJ_HDR @@ -645,7 +646,8 @@ dest.info.ext_refcnt += 1 if removed == "after_snap": remove_after_snap.append(('C', source, dest)) - elif source.info.type == "P" or dest.info.type == "P": + elif (source.info.type == "P" or dest.info.type == "P" or + (source.info.type == "B" and dest.info.type == "B")): if (source.p is None or llmemory.cast_ptr_to_adr(source.p.next) == llmemory.NULL): if added == "after_snap": @@ -664,6 +666,14 @@ else: assert False # only 2 refs supported from pypy obj in tests + if (len(add_after_snap) > 0 or len(add_border_after_snap) > 0 or + len(add_linked_pyobj_after_snap) > 0 or + len(add_pyobj_after_snap) > 0 or + len(add_pypy_after_snap) > 0 or + len(remove_after_snap) > 0): + if self.RRCGCClass != RawRefCountIncMarkGC: + py.test.skip('Incremental test on non-incremental gc.') + # add finalizers for name in nodes: n = nodes[name] @@ -810,87 +820,83 @@ # do a collection to find cyclic isolates and clean them, if there are # no finalizers - if True: - from rpython.rlib import rgc - state = -1 - after_snap = False - while state <> 0: - states = self.gc.collect_step() - state = rgc.new_state(states) - if (self.gc.rrc_gc.state == RawRefCountBaseGC.STATE_MARKING and - not after_snap): - for obj in add_pyobj_after_snap: - r, raddr, check_alive = self._rawrefcount_pyobj( - tracked=obj.info.tracked, tuple=obj.info.tuple) - r.c_ob_refcnt += obj.info.ext_refcnt - obj.r = r - obj.raddr = raddr - obj.check_alive = check_alive - for obj in add_pypy_after_snap: - p, pref, check_alive = \ - self._rawrefcount_pypyobj(42 + i, rooted=obj.info - .rooted, create_old=True) - obj.p = p - obj.pref = pref - obj.check_alive = check_alive - i += 1 - for obj in add_border_after_snap: - p, pref, r, raddr, check_alive = \ - self._rawrefcount_pair(42 + i, rooted=obj.info - .rooted, create_old=True, - tracked=obj.info.tracked, - tuple=obj.info.tuple, - is_gc=obj.info.gc) - r.c_ob_refcnt += obj.info.ext_refcnt - obj.r = r - obj.raddr = raddr - obj.p = p - obj.pref = pref - obj.check_alive = check_alive - i += 1 - for obj in add_linked_pyobj_after_snap: - r, raddr, check_alive = self._rawrefcount_pyobj( - tracked=obj.info.tracked, tuple=obj.info.tuple, - is_gc=obj.info.gc) - r.c_ob_refcnt += obj.info.ext_refcnt - obj.r = r - obj.raddr = raddr - old_alive = obj.check_alive - def double_check(ext_refcnt): - old_alive() - check_alive(ext_refcnt) - obj.check_alive = double_check - self.gc.rawrefcount_create_link_pypy(obj.pref, raddr) + state = -1 + after_snap = False + while state <> 0: + states = self.gc.collect_step() + state = rgc.new_state(states) + if (self.gc.rrc_gc.state == RawRefCountBaseGC.STATE_MARKING and + not after_snap): + for obj in add_pyobj_after_snap: + r, raddr, check_alive = self._rawrefcount_pyobj( + tracked=obj.info.tracked, tuple=obj.info.tuple) + r.c_ob_refcnt += obj.info.ext_refcnt + obj.r = r + obj.raddr = raddr + obj.check_alive = check_alive + for obj in add_pypy_after_snap: + p, pref, check_alive = \ + self._rawrefcount_pypyobj(42 + i, rooted=obj.info + .rooted, create_old=True) + obj.p = p + obj.pref = pref + obj.check_alive = check_alive + i += 1 + for obj in add_border_after_snap: + p, pref, r, raddr, check_alive = \ + self._rawrefcount_pair(42 + i, rooted=obj.info + .rooted, create_old=True, + tracked=obj.info.tracked, + tuple=obj.info.tuple, + is_gc=obj.info.gc) + r.c_ob_refcnt += obj.info.ext_refcnt + obj.r = r + obj.raddr = raddr + obj.p = p + obj.pref = pref + obj.check_alive = check_alive + i += 1 + for obj in add_linked_pyobj_after_snap: + r, raddr, check_alive = self._rawrefcount_pyobj( + tracked=obj.info.tracked, tuple=obj.info.tuple, + is_gc=obj.info.gc) + r.c_ob_refcnt += obj.info.ext_refcnt + obj.r = r + obj.raddr = raddr + old_alive = obj.check_alive + def double_check(ext_refcnt): + old_alive() + check_alive(ext_refcnt) + obj.check_alive = double_check + self.gc.rawrefcount_create_link_pypy(obj.pref, raddr) - for add in add_after_snap: - if add[0] == "C": - (type, source, dest) = add - self._rawrefcount_addref(source.r, dest.r) - if source.info.alive: - dest.info.ext_refcnt += 1 - elif add[0] == "P": - (type, prop, source, dest) = add - if prop == "next": - source.p.next = dest.p - elif prop == "prev": - source.p.prev = dest.p - else: - assert False, "not yet supported" + for add in add_after_snap: + if add[0] == "C": + (type, source, dest) = add + self._rawrefcount_addref(source.r, dest.r) + if source.info.alive: + dest.info.ext_refcnt += 1 + elif add[0] == "P": + (type, prop, source, dest) = add + if prop == "next": + source.p.next = dest.p + elif prop == "prev": + source.p.prev = dest.p else: assert False, "not yet supported" - for remove in remove_after_snap: - if remove[0] == "P": - if remove[1] == "next": - remove[2].p.next = remove[2].p - elif prop == "prev": - remove[2].p.prev = remove[2].p - else: - assert False, "not yet supported" + else: + assert False, "not yet supported" + for remove in remove_after_snap: + if remove[0] == "P": + if remove[1] == "next": + remove[2].p.next = remove[2].p + elif prop == "prev": + remove[2].p.prev = remove[2].p else: assert False, "not yet supported" - after_snap = True - else: - self.gc.collect() + else: + assert False, "not yet supported" + after_snap = True self.gc.rrc_gc.invoke_callback() if self.trigger <> []: From pypy.commits at gmail.com Mon Sep 23 17:40:02 2019 From: pypy.commits at gmail.com (stevie_92) Date: Mon, 23 Sep 2019 14:40:02 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Cleaned up and moved code Message-ID: <5d893bb2.1c69fb81.b45a.88a8@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97594:aad1bca0736f Date: 2019-09-23 14:58 +0200 http://bitbucket.org/pypy/pypy/changeset/aad1bca0736f/ Log: Cleaned up and moved code diff --git a/rpython/memory/gc/rrc/base.py b/rpython/memory/gc/rrc/base.py --- a/rpython/memory/gc/rrc/base.py +++ b/rpython/memory/gc/rrc/base.py @@ -719,11 +719,6 @@ gchdr.c_gc_refs >> self.RAWREFCOUNT_REFS_SHIFT, "refcnt", pyobj.c_ob_refcnt, "link", intobj) - #if intobj: TODO fix - # obj = llmemory.cast_int_to_adr(intobj) - # marked = self.header(obj).tid & \ - # (GCFLAG_VISITED | GCFLAG_NO_HEAP_PTRS) - # debug_print(" linked obj", obj, ": marked", marked) ll_assert(gchdr.c_gc_next != lltype.nullptr(self.PYOBJ_GC_HDR), "gc_next is null") diff --git a/rpython/memory/gc/rrc/incmark.py b/rpython/memory/gc/rrc/incmark.py --- a/rpython/memory/gc/rrc/incmark.py +++ b/rpython/memory/gc/rrc/incmark.py @@ -43,6 +43,8 @@ self._debug_print_snap(print_label="roots-marked") self._debug_check_consistency(print_label="roots-marked") + + self._gc_list_init(self.pyobj_old_list) self.state = self.STATE_MARKING return False @@ -224,7 +226,6 @@ # refcount > 0 def _mark_rawrefcount(self): - self._gc_list_init(self.pyobj_old_list) # TODO: move??? # as long as new objects with cyclic a refcount > 0 or alive border # objects are found, increment the refcount of all referenced objects # of those newly found objects From pypy.commits at gmail.com Mon Sep 23 17:40:04 2019 From: pypy.commits at gmail.com (stevie_92) Date: Mon, 23 Sep 2019 14:40:04 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Fixed handling of modern finalizers in rrc gc Message-ID: <5d893bb4.1c69fb81.14ec9.ffd6@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97595:7818db583143 Date: 2019-09-23 23:39 +0200 http://bitbucket.org/pypy/pypy/changeset/7818db583143/ Log: Fixed handling of modern finalizers in rrc gc Fixed test cases diff --git a/rpython/memory/gc/rrc/base.py b/rpython/memory/gc/rrc/base.py --- a/rpython/memory/gc/rrc/base.py +++ b/rpython/memory/gc/rrc/base.py @@ -109,6 +109,8 @@ self.tuple_list = self._pygchdr(tuple_list) self.pyobj_old_list = self._gc_list_new() self.pyobj_isolate_list = self._gc_list_new() + self.pyobj_isolate_old_list = self._gc_list_new() + self.pyobj_isolate_dead_list = self._gc_list_new() self.pyobj_dead_list = self._gc_list_new() self.pyobj_garbage_list = self._gc_list_new() self.garbage_to_trace = self.gc.AddressStack() @@ -177,7 +179,7 @@ def next_cyclic_isolate(self): if not self._gc_list_is_empty(self.pyobj_isolate_list): gchdr = self._gc_list_pop(self.pyobj_isolate_list) - self._gc_list_add(self.pyobj_old_list, gchdr) + self._gc_list_add(self.pyobj_isolate_old_list, gchdr) return llmemory.cast_ptr_to_adr(self.gc_as_pyobj(gchdr)) return llmemory.NULL @@ -546,37 +548,9 @@ self.gc.trace(obj, self._collect_ref_rec, None) return True - def _check_finalizer(self): - # Check, if the cyclic isolate from the last collection cycle - # is reachable from outside, after the finalizers have been - # executed (and if all finalizers have been executed). Return - # True if some objects are reachable and thus have been resurrected. - - # check if the list has been fully processed since the last cycle - # (for safety) - found_alive = not self._gc_list_is_empty(self.pyobj_isolate_list) - - # check if all finalizers have actually been called (for safety) - if not found_alive: - found_alive = self._find_finalizer() - - # check if there are any objects with a reference count > 0 - if not found_alive: - gchdr = self.pyobj_old_list.c_gc_next - while gchdr <> self.pyobj_old_list: - if True: # TODO: check refcount or marked (see _collect_roots) - found_alive = True - break - gchdr = gchdr.c_gc_next - - if found_alive: - self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) + def _find_finalizer(self): + if not self._gc_list_is_empty(self.pyobj_isolate_list): return True - else: - self._gc_list_merge(self.pyobj_old_list, self.pyobj_dead_list) - return False - - def _find_finalizer(self): gchdr = self.pyobj_old_list.c_gc_next while gchdr <> self.pyobj_old_list: if self.finalizer_type(gchdr) == self.RAWREFCOUNT_FINALIZER_MODERN: @@ -699,6 +673,8 @@ "pyobj_dead_list") self._debug_check_list(self.pyobj_isolate_list, should_print, "pyobj_isolate_list") + self._debug_check_list(self.pyobj_isolate_old_list, should_print, + "pyobj_isolate_old_list") # pyobj_garbage_list is not a real list, it just marks the # first and the last object in pyobj_list, which are garbage diff --git a/rpython/memory/gc/rrc/incmark.py b/rpython/memory/gc/rrc/incmark.py --- a/rpython/memory/gc/rrc/incmark.py +++ b/rpython/memory/gc/rrc/incmark.py @@ -6,35 +6,21 @@ class RawRefCountIncMarkGC(RawRefCountBaseGC): def major_collection_trace_step(self): - if not self.cycle_enabled or self.state == self.STATE_GARBAGE: + if (not self.cycle_enabled or self.state == self.STATE_GARBAGE or + not self._gc_list_is_empty(self.pyobj_isolate_list)): self._debug_check_consistency(print_label="begin-mark") self.p_list_old.foreach(self._major_trace, (False, False)) self._debug_check_consistency(print_label="end-mark") return True if self.state == self.STATE_DEFAULT: - # Merge all objects whose finalizer have been executed to the - # pyobj_list (to reprocess them again in the snapshot). Finalizers - # can only be executed once, so termination will eventually happen. - # Objects which have not been resurrected should be freed during - # this cycle. - if not self._gc_list_is_empty(self.pyobj_old_list): - self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) - # TODO: use separate list and process it after pyobj_list has been - # fully processed (just before modern finalizers) if references - # to separate list are encountered during take_snapshot - # move them to pyobj_list and include them in the snapshot. - # For the remaining list (before modern finalizers), check - # if there are external references from marked non-rc objects - # (rc objects were already detected during take_snapshot) - - # Untrack all tuples with only non-gc rrc objects and + # untrack all tuples with only non-gc rrc objects and # promote all other tuples to the pyobj_list self._untrack_tuples() # TODO: execute incrementally? (before snapshot!, own phase) - # Now take a snapshot - self._take_snapshot(self.pyobj_list) + # now take a snapshot + self._take_snapshot() self._debug_print_snap(print_label="after-snapshot") # collect all rawrefcounted roots @@ -65,97 +51,8 @@ # we are finished with marking, now finish things up ll_assert(self.state == self.STATE_GARBAGE_MARKING, "invalid state") - # sync snapshot with pyob_list: - # * check the consistency of "dead" objects and keep all of them - # alive, in case an inconsistency is found (the graph changed - # between two pauses, so some of those objects might be alive) - # * move all dead objects still in pyob_list to pyobj_old_list - # * for all other objects (in snapshot and new), - # set their cyclic refcount to > 0 to mark them as live - consistent = True - self.snapshot_consistent = True - - # sync p_list_old (except gc-objects) - # simply iterate the snapshot for objects in p_list, as linked objects - # might not be freed, except by the gc - free_p_list = self.gc.AddressStack() - for i in range(0, self.total_objs): - snapobj = self.snapshot_objs[i] - if snapobj.pypy_link == 0: - break # only look for objects in p_list - pyobj = llmemory.cast_adr_to_ptr(snapobj.pyobj, self.PYOBJ_HDR_PTR) - pygchdr = self.pyobj_as_gc(pyobj) - if (pygchdr != lltype.nullptr(self.PYOBJ_GC_HDR) and - pygchdr.c_gc_refs != self.RAWREFCOUNT_REFS_UNTRACKED): - break # only look for non-gc - if snapobj.refcnt == 0: - # check consistency - consistent = pyobj.c_ob_refcnt == snapobj.refcnt_original - if not consistent: - break - # move to separate list - self.p_list_old.remove(snapobj.pyobj) - free_p_list.append(snapobj.pyobj) - - # look if there is a (newly) linked non-gc proxy, where the non-rc obj - # is unmarked - self.p_list_old_consistent = True - self.p_list_old.foreach(self._check_consistency_p_list_old, None) - consistent &= self.p_list_old_consistent - - # sync gc objects - pygchdr = self.pyobj_list.c_gc_next - while pygchdr <> self.pyobj_list and consistent: - next_old = pygchdr.c_gc_next - if pygchdr.c_gc_refs > 0: # object is in snapshot - snapobj = self.snapshot_objs[pygchdr.c_gc_refs - 1] - pygchdr.c_gc_refs = snapobj.refcnt - if snapobj.refcnt == 0: # object considered dead - # check consistency (dead subgraphs can never change): - pyobj = self.gc_as_pyobj(pygchdr) - # refcount equal - consistent = snapobj.refcnt_original == pyobj.c_ob_refcnt - if not consistent: - break - # outgoing (internal) references equal - self.snapshot_curr = snapobj - self.snapshot_curr_index = 0 - self._check_snapshot_traverse(pyobj) - consistent = self.snapshot_consistent - if not consistent: - break - # consistent -> prepare object for collection - self._gc_list_remove(pygchdr) - self._gc_list_add(self.pyobj_old_list, pygchdr) - else: - # new object, keep alive - pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT - pyobj = self.gc_as_pyobj(pygchdr) - if pyobj.c_ob_pypy_link != 0: - addr = llmemory.cast_int_to_adr(pyobj.c_ob_pypy_link) - if not (self.gc.header(addr).tid & - (self.GCFLAG_VISITED | self.GCFLAG_NO_HEAP_PTRS)): - consistent = False - break - pygchdr = next_old - - self._debug_check_consistency(print_label="end-check-consistency") - - if not consistent: # keep all objects alive - while free_p_list.non_empty(): - self.p_list_old.append(free_p_list.pop()) - while pygchdr <> self.pyobj_list: # continue previous loop - pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT - pygchdr = pygchdr.c_gc_next - pygchdr = self.pyobj_old_list.c_gc_next - while pygchdr <> self.pyobj_old_list: # resurrect "dead" objects - pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT - pygchdr = pygchdr.c_gc_next - if not self._gc_list_is_empty(self.pyobj_old_list): - self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) - else: - free_p_list.foreach(self._free_p_list, None) - + # sync snapshot + self._sync_snapshot() self._debug_check_consistency(print_label="before-snap-discard") # now the snapshot is not needed any more, discard it @@ -181,6 +78,147 @@ self._debug_check_consistency(print_label="end-mark") return True + def _sync_snapshot(self): + # sync snapshot with pyob_list: + # * check the consistency of "dead" objects and keep all of them + # alive, in case an inconsistency is found (the graph changed + # between two pauses, so some of those objects might be alive) + # * move all dead objects still in pyob_list to pyobj_old_list + # * for all other objects (in snapshot and new), + # set their cyclic refcount to > 0 to mark them as live + consistent = True + self.snapshot_consistent = True + + # sync p_list_old (except gc-objects) + # simply iterate the snapshot for objects in p_list, as linked objects + # might not be freed, except by the gc + free_p_list = self.gc.AddressStack() + for i in range(0, self.total_objs): + snapobj = self.snapshot_objs[i] + if snapobj.pypy_link == 0: + break # only look for objects in p_list + pyobj = llmemory.cast_adr_to_ptr(snapobj.pyobj, self.PYOBJ_HDR_PTR) + pygchdr = self.pyobj_as_gc(pyobj) + if (pygchdr != lltype.nullptr(self.PYOBJ_GC_HDR) and + pygchdr.c_gc_refs != self.RAWREFCOUNT_REFS_UNTRACKED): + break # only look for non-gc + if snapobj.refcnt == 0: + # check consistency + consistent = pyobj.c_ob_refcnt == snapobj.refcnt_original + if not consistent: + break + # move to separate list + self.p_list_old.remove(snapobj.pyobj) + free_p_list.append(snapobj.pyobj) + + # look if there is a (newly) linked non-gc proxy, where the non-rc obj + # is unmarked + self.p_list_old_consistent = True + self.p_list_old.foreach(self._check_consistency_p_list_old, None) + consistent &= self.p_list_old_consistent + + # sync gc objects + pygchdr = self.pyobj_list.c_gc_next + while pygchdr <> self.pyobj_list and consistent: + next_old = pygchdr.c_gc_next + if pygchdr.c_gc_refs > 0: # object is in snapshot + consistent = self._check_consistency_gc(pygchdr, + self.pyobj_old_list) + if not consistent: + break + else: + # new object, keep alive + pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT + pyobj = self.gc_as_pyobj(pygchdr) + if pyobj.c_ob_pypy_link != 0: + addr = llmemory.cast_int_to_adr(pyobj.c_ob_pypy_link) + if not (self.gc.header(addr).tid & + (self.GCFLAG_VISITED | self.GCFLAG_NO_HEAP_PTRS)): + consistent = False + break + pygchdr = next_old + pygchdr_continue_gc = pygchdr + + # sync isolate objs + isolate_consistent = True + pygchdr = self.pyobj_isolate_old_list.c_gc_next + while pygchdr <> self.pyobj_isolate_old_list and isolate_consistent: + next_old = pygchdr.c_gc_next + isolate_consistent = \ + self._check_consistency_gc(pygchdr, + self.pyobj_isolate_dead_list) + pygchdr = next_old + pygchdr_continue_isolate = pygchdr + consistent &= isolate_consistent + self._debug_check_consistency(print_label="end-check-consistency") + + if consistent: + free_p_list.foreach(self._free_p_list, None) + else: + # keep linked non-gc alive + while free_p_list.non_empty(): + self.p_list_old.append(free_p_list.pop()) + # continue previous loop, keep objects alive + pygchdr = pygchdr_continue_gc + while pygchdr <> self.pyobj_list: + pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT + pygchdr = pygchdr.c_gc_next + pygchdr = self.pyobj_old_list.c_gc_next + # resurrect "dead" objects + while pygchdr <> self.pyobj_old_list: + pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT + pygchdr = pygchdr.c_gc_next + # merge lists + if not self._gc_list_is_empty(self.pyobj_old_list): + self._gc_list_merge(self.pyobj_old_list, self.pyobj_list) + + if isolate_consistent: + if not self._gc_list_is_empty(self.pyobj_isolate_old_list): + self._gc_list_merge(self.pyobj_isolate_old_list, + self.pyobj_list) + if not self._gc_list_is_empty(self.pyobj_isolate_dead_list): + self._gc_list_merge(self.pyobj_isolate_dead_list, + self.pyobj_dead_list) + else: + # continue previous loop, keep objects alive + pygchdr = pygchdr_continue_isolate + while pygchdr <> self.pyobj_isolate_old_list: + pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT + pygchdr = pygchdr.c_gc_next + # resurrect "dead" objects + while pygchdr <> self.pyobj_isolate_dead_list: + pygchdr.c_gc_refs = 1 << self.RAWREFCOUNT_REFS_SHIFT + pygchdr = pygchdr.c_gc_next + # merge lists + if not self._gc_list_is_empty(self.pyobj_isolate_old_list): + self._gc_list_merge(self.pyobj_isolate_old_list, + self.pyobj_list) + if not self._gc_list_is_empty(self.pyobj_isolate_dead_list): + self._gc_list_merge(self.pyobj_isolate_dead_list, + self.pyobj_list) + + def _check_consistency_gc(self, pygchdr, pylist_dead_target): + snapobj = self.snapshot_objs[pygchdr.c_gc_refs - 1] + pygchdr.c_gc_refs = snapobj.refcnt + if snapobj.refcnt == 0: # object considered dead + # check consistency (dead subgraphs can never change): + pyobj = self.gc_as_pyobj(pygchdr) + # refcount equal + consistent = snapobj.refcnt_original == pyobj.c_ob_refcnt + if not consistent: + return False + # outgoing (internal) references equal + self.snapshot_curr = snapobj + self.snapshot_curr_index = 0 + self._check_snapshot_traverse(pyobj) + consistent = self.snapshot_consistent + if not consistent: + return False + # consistent -> prepare object for collection + self._gc_list_remove(pygchdr) + self._gc_list_add(pylist_dead_target, pygchdr) + return True + def _debug_print_snap(self, print_label=None): debug_start("snap " + print_label) for i in range(0, self.total_objs): @@ -272,21 +310,19 @@ snapobj.status = 0 return alive - def _take_snapshot(self, pygclist): - from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY - from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT + def _take_snapshot(self): + total_refcnt = 0 + total_objs = 0 # calculate size of memory buffer for snapshot - total_refcnt = 0 - total_objs = 0 - pygchdr = pygclist.c_gc_next - while pygchdr <> pygclist: - refcnt = self.gc_as_pyobj(pygchdr).c_ob_refcnt - if refcnt >= REFCNT_FROM_PYPY_LIGHT: - refcnt -= REFCNT_FROM_PYPY_LIGHT - elif refcnt >= REFCNT_FROM_PYPY: - refcnt -= REFCNT_FROM_PYPY - total_refcnt += refcnt + pygchdr = self.pyobj_list.c_gc_next + while pygchdr <> self.pyobj_list: + total_refcnt += self._take_snapshot_count_gc(pygchdr) + total_objs += 1 + pygchdr = pygchdr.c_gc_next + pygchdr = self.pyobj_isolate_old_list.c_gc_next + while pygchdr <> self.pyobj_isolate_old_list: + total_refcnt += self._take_snapshot_count_gc(pygchdr) total_objs += 1 pygchdr = pygchdr.c_gc_next self.p_list_count = 0 @@ -309,33 +345,16 @@ # take snapshot of p_list_old self.p_list_old.foreach(self._take_snapshot_pyobject, None) - # take snapshot of gc objs TODO: include finalizer_list from last cycle - pygchdr = pygclist.c_gc_next - while pygchdr <> pygclist: - pyobj = self.gc_as_pyobj(pygchdr) - refcnt = pyobj.c_ob_refcnt - if refcnt >= REFCNT_FROM_PYPY_LIGHT: - refcnt -= REFCNT_FROM_PYPY_LIGHT - elif refcnt >= REFCNT_FROM_PYPY: - refcnt -= REFCNT_FROM_PYPY - if pyobj.c_ob_pypy_link != 0: - addr = llmemory.cast_int_to_adr(pyobj.c_ob_pypy_link) - if self.gc.header(addr).tid & (self.GCFLAG_VISITED | - self.GCFLAG_NO_HEAP_PTRS): - refcnt += 1 - pygchdr.c_gc_refs = self.objs_index + 1 - obj = self.snapshot_objs[self.objs_index] - obj.pyobj = llmemory.cast_ptr_to_adr(pyobj) - obj.status = 1 - obj.refcnt_original = pyobj.c_ob_refcnt - obj.refcnt = refcnt - obj.refs_index = self.refs_index - obj.refs_len = 0 - obj.pypy_link = pyobj.c_ob_pypy_link - self.snapshot_curr = obj - self._take_snapshot_traverse(pyobj) - self.objs_index += 1 - self.refs_index += obj.refs_len + # take snapshot of gc objs + pygchdr = self.pyobj_list.c_gc_next + while pygchdr <> self.pyobj_list: + self._take_snapshot_gc(pygchdr) + pygchdr = pygchdr.c_gc_next + + # include isolates from last cycle + pygchdr = self.pyobj_isolate_old_list.c_gc_next + while pygchdr <> self.pyobj_isolate_old_list: + self._take_snapshot_gc(pygchdr) pygchdr = pygchdr.c_gc_next # fix references @@ -353,6 +372,46 @@ # fix links of p_list_old back self.p_list_old.foreach(self._take_snapshot_fixlink, None) + def _take_snapshot_count_gc(self, pygchdr): + from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY + from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT + # + refcnt = self.gc_as_pyobj(pygchdr).c_ob_refcnt + if refcnt >= REFCNT_FROM_PYPY_LIGHT: + refcnt -= REFCNT_FROM_PYPY_LIGHT + elif refcnt >= REFCNT_FROM_PYPY: + refcnt -= REFCNT_FROM_PYPY + return refcnt + + def _take_snapshot_gc(self, pygchdr): + from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY + from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT + # + pyobj = self.gc_as_pyobj(pygchdr) + refcnt = pyobj.c_ob_refcnt + if refcnt >= REFCNT_FROM_PYPY_LIGHT: + refcnt -= REFCNT_FROM_PYPY_LIGHT + elif refcnt >= REFCNT_FROM_PYPY: + refcnt -= REFCNT_FROM_PYPY + if pyobj.c_ob_pypy_link != 0: + addr = llmemory.cast_int_to_adr(pyobj.c_ob_pypy_link) + if self.gc.header(addr).tid & (self.GCFLAG_VISITED | + self.GCFLAG_NO_HEAP_PTRS): + refcnt += 1 + pygchdr.c_gc_refs = self.objs_index + 1 + obj = self.snapshot_objs[self.objs_index] + obj.pyobj = llmemory.cast_ptr_to_adr(pyobj) + obj.status = 1 + obj.refcnt_original = pyobj.c_ob_refcnt + obj.refcnt = refcnt + obj.refs_index = self.refs_index + obj.refs_len = 0 + obj.pypy_link = pyobj.c_ob_pypy_link + self.snapshot_curr = obj + self._take_snapshot_traverse(pyobj) + self.objs_index += 1 + self.refs_index += obj.refs_len + def _take_snapshot_count(self, pyobject, foo): from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT diff --git a/rpython/memory/gc/rrc/mark.py b/rpython/memory/gc/rrc/mark.py --- a/rpython/memory/gc/rrc/mark.py +++ b/rpython/memory/gc/rrc/mark.py @@ -18,30 +18,15 @@ self._untrack_tuples() # Only trace and mark rawrefcounted object if we are not doing - # something special, like building gc.garbage. - if self.state == self.STATE_MARKING and self.cycle_enabled: - - # check if objects with finalizers from last collection cycle - # have been resurrected - dead_list_empty = True - if not self._gc_list_is_empty(self.pyobj_old_list): - dead_list_empty = self._check_finalizer() - # TODO: cannot work this way -> must first do full collection of - # new graph, bc back ref over non-rrc from new rrc graph (#1) - # TODO: see incmark (instead of take_snapshot during collect_roots) + # something special, like building gc.garbage and if all finalizers + # have been processed. + if (self.state == self.STATE_MARKING and self.cycle_enabled and + self._gc_list_is_empty(self.pyobj_isolate_list)): # collect all rawrefcounted roots self._collect_roots() self._debug_check_consistency(print_label="roots-marked") - if not dead_list_empty: - # set all refcounts to zero for objects in dead list - # (might have been incremented) by fix_refcnt - gchdr = self.pyobj_dead_list.c_gc_next - while gchdr <> self.pyobj_dead_list: - gchdr.c_gc_refs = 0 - gchdr = gchdr.c_gc_next - # mark all objects reachable from rawrefcounted roots self._mark_rawrefcount() self._debug_check_consistency(print_label="before-fin") @@ -59,6 +44,9 @@ self._gc_list_move(self.pyobj_old_list, self.pyobj_isolate_list) use_cylicrc = not found_finalizer + if not self._gc_list_is_empty(self.pyobj_isolate_old_list): + self._gc_list_move(self.pyobj_isolate_old_list, + self.pyobj_old_list) self._debug_check_consistency(print_label="end-mark-cyclic") # mark all pypy objects at the border which are linked to live @@ -90,6 +78,7 @@ def _collect_roots(self): # Initialize the cyclic refcount with the real refcount. self._collect_roots_init_list(self.pyobj_list) + self._collect_roots_init_list(self.pyobj_isolate_old_list) # Save the real refcount of objects at border (they don't necessarily # have a rrc header, as not all of them are garbage collected on the @@ -103,6 +92,7 @@ # Subtract all internal refcounts from the cyclic refcount # of rawrefcounted objects self._collect_roots_subtract_internal(self.pyobj_list) + self._collect_roots_subtract_internal(self.pyobj_isolate_old_list) # For all non-gc pyobjects which have a refcount > 0, # mark all reachable objects on the pypy side @@ -189,6 +179,11 @@ next_old = gchdr.c_gc_next found_alive |= self._mark_rawrefcount_obj(gchdr, pyobj_old) gchdr = next_old + gchdr = self.pyobj_isolate_old_list.c_gc_next + while gchdr <> self.pyobj_isolate_old_list: + next_old = gchdr.c_gc_next + found_alive |= self._mark_rawrefcount_obj(gchdr, pyobj_old) + gchdr = next_old # # now all rawrefcounted objects, which are alive, have a cyclic # refcount > 0 or are marked diff --git a/rpython/memory/gc/test/dot/keep_finalizer_simple_1b.dot b/rpython/memory/gc/test/dot/keep_finalizer_complex_1.dot copy from rpython/memory/gc/test/dot/keep_finalizer_simple_1b.dot copy to rpython/memory/gc/test/dot/keep_finalizer_complex_1.dot --- a/rpython/memory/gc/test/dot/keep_finalizer_simple_1b.dot +++ b/rpython/memory/gc/test/dot/keep_finalizer_complex_1.dot @@ -1,14 +1,14 @@ digraph G { - "a" [type=P, alive=y]; - "b" [type=B, alive=y]; - "c" [type=C, alive=y, finalizer=modern, resurrect="c"]; - "d" [type=C, alive=y]; + "a" [type=C, alive=n]; + "b" [type=C, alive=y]; + "c" [type=B, alive=y]; + "d" [type=P, alive=y]; "e" [type=B, alive=y]; - "f" [type=P, alive=y]; + "f" [type=C, alive=y, finalizer=modern, resurrect="b"]; "a" -> "b"; "b" -> "c"; "c" -> "d"; "d" -> "e"; "e" -> "f"; - "f" -> "a"; + "f" -> "f"; } diff --git a/rpython/memory/gc/test/test_rawrefcount.py b/rpython/memory/gc/test/test_rawrefcount.py --- a/rpython/memory/gc/test/test_rawrefcount.py +++ b/rpython/memory/gc/test/test_rawrefcount.py @@ -776,9 +776,13 @@ while next <> llmemory.NULL: pyobj = llmemory.cast_adr_to_ptr(next, self.gc.rrc_gc.PYOBJ_HDR_PTR) - pyobj.c_ob_refcnt += 1 - finalize_modern(pyobj) - decref(pyobj, None) + index = self.pyobjs.index(pyobj) + if (self.pyobj_finalizer.has_key(index) and + self.pyobj_finalizer[index] == + RAWREFCOUNT_FINALIZER_MODERN): + pyobj.c_ob_refcnt += 1 + finalize_modern(pyobj) + decref(pyobj, None) next = self.gc.rawrefcount_next_cyclic_isolate() next_dead = self.gc.rawrefcount_cyclic_garbage_head() From pypy.commits at gmail.com Tue Sep 24 05:26:32 2019 From: pypy.commits at gmail.com (arigo) Date: Tue, 24 Sep 2019 02:26:32 -0700 (PDT) Subject: [pypy-commit] pypy default: Update the sandbox warning Message-ID: <5d89e148.1c69fb81.a1a9a.693b@mx.google.com> Author: Armin Rigo Branch: Changeset: r97596:c911fdf57c7d Date: 2019-09-24 11:25 +0200 http://bitbucket.org/pypy/pypy/changeset/c911fdf57c7d/ Log: Update the sandbox warning diff --git a/pypy/doc/sandbox.rst b/pypy/doc/sandbox.rst --- a/pypy/doc/sandbox.rst +++ b/pypy/doc/sandbox.rst @@ -3,10 +3,11 @@ PyPy's sandboxing features ========================== -.. warning:: This is not actively maintained. You will likely have to fix - some issues yourself, or otherwise play around on your own. We provide - this documentation for historical reasions, it will not translate or - run on the latest PyPy code base. +.. warning:: This describes the old, unmaintained version. A new version + is in progress and should be merged back to trunk at some point soon. + Please see its description here: + https://mail.python.org/pipermail/pypy-dev/2019-August/015797.html + Introduction ------------ From pypy.commits at gmail.com Tue Sep 24 05:49:40 2019 From: pypy.commits at gmail.com (stevie_92) Date: Tue, 24 Sep 2019 02:49:40 -0700 (PDT) Subject: [pypy-commit] pypy cpyext-gc-cycle: Removed obsolete code and TODOs Message-ID: <5d89e6b4.1c69fb81.babdd.54ff@mx.google.com> Author: Stefan Beyer Branch: cpyext-gc-cycle Changeset: r97597:5172b6ed9d6c Date: 2019-09-24 11:49 +0200 http://bitbucket.org/pypy/pypy/changeset/5172b6ed9d6c/ Log: Removed obsolete code and TODOs diff --git a/pypy/module/cpyext/state.py b/pypy/module/cpyext/state.py --- a/pypy/module/cpyext/state.py +++ b/pypy/module/cpyext/state.py @@ -162,20 +162,6 @@ pyobj_dealloc_action = PyObjDeallocAction(space) self.dealloc_trigger = lambda: pyobj_dealloc_action.fire() - def _clear_weakref_callbacks(gcref): - from pypy.module._weakref.interp__weakref import \ - W_Weakref, W_CallableProxy - from pypy.module.gc.referents import \ - try_cast_gcref_to_w_root - w_obj = try_cast_gcref_to_w_root(gcref) - if type(w_obj) is W_Weakref: - w_obj.w_callable = None - elif type(w_obj) is W_CallableProxy: - w_obj.w_callable = None - - self.clear_weakref_callbacks = \ - (lambda w_obj: _clear_weakref_callbacks(w_obj)) - def _tp_traverse(pyobj_ptr, callback, args): from pypy.module.cpyext.api import PyObject, \ generic_cpy_call @@ -248,8 +234,6 @@ pypyobj_list, pypyobj_tuple_list, self.C._PyPy_gc_as_pyobj, self.C._PyPy_pyobj_as_gc, self.C._PyPy_finalizer_type, - llhelper(rawrefcount.RAWREFCOUNT_CLEAR_WR_TYPE, - self.clear_weakref_callbacks), self.C._PyTuple_MaybeUntrack) self.builder.attach_all(space) diff --git a/rpython/memory/gc/incminimark.py b/rpython/memory/gc/incminimark.py --- a/rpython/memory/gc/incminimark.py +++ b/rpython/memory/gc/incminimark.py @@ -3094,7 +3094,6 @@ RAWREFCOUNT_GC_AS_PYOBJ = RawRefCountBaseGC.RAWREFCOUNT_GC_AS_PYOBJ RAWREFCOUNT_PYOBJ_AS_GC = RawRefCountBaseGC.RAWREFCOUNT_PYOBJ_AS_GC RAWREFCOUNT_FINALIZER_TYPE = RawRefCountBaseGC.RAWREFCOUNT_FINALIZER_TYPE - RAWREFCOUNT_CLEAR_WR_TYPE = RawRefCountBaseGC.RAWREFCOUNT_CLEAR_WR_TYPE RAWREFCOUNT_MAYBE_UNTRACK_TUPLE = \ RawRefCountBaseGC.RAWREFCOUNT_MAYBE_UNTRACK_TUPLE @@ -3103,15 +3102,13 @@ def rawrefcount_init(self, dealloc_trigger_callback, tp_traverse, pyobj_list, tuple_list, gc_as_pyobj, pyobj_as_gc, - finalizer_type, clear_weakref_callback, - tuple_maybe_untrack): + finalizer_type, tuple_maybe_untrack): if not self.rrc_enabled: gc_flags = (GCFLAG_VISITED_RMY, GCFLAG_VISITED, GCFLAG_NO_HEAP_PTRS, GCFLAG_GARBAGE) self.rrc_gc.init(self, gc_flags, dealloc_trigger_callback, tp_traverse, pyobj_list, tuple_list, gc_as_pyobj, - pyobj_as_gc, finalizer_type, - clear_weakref_callback, tuple_maybe_untrack) + pyobj_as_gc, finalizer_type, tuple_maybe_untrack) self.rrc_enabled = True def activate_rawrefcount_cycle(self): diff --git a/rpython/memory/gc/rrc/base.py b/rpython/memory/gc/rrc/base.py --- a/rpython/memory/gc/rrc/base.py +++ b/rpython/memory/gc/rrc/base.py @@ -72,8 +72,6 @@ PYOBJ_GC_HDR_PTR)) RAWREFCOUNT_FINALIZER_TYPE = lltype.Ptr(lltype.FuncType([PYOBJ_GC_HDR_PTR], lltype.Signed)) - RAWREFCOUNT_CLEAR_WR_TYPE = lltype.Ptr(lltype.FuncType([llmemory.GCREF], - lltype.Void)) RAWREFCOUNT_MAYBE_UNTRACK_TUPLE = \ lltype.Ptr(lltype.FuncType([PYOBJ_HDR_PTR], lltype.Signed)) RAWREFCOUNT_FINALIZER_NONE = 0 @@ -90,7 +88,7 @@ def init(self, gc, gc_flags, dealloc_trigger_callback, tp_traverse, pyobj_list, tuple_list, gc_as_pyobj, pyobj_as_gc, finalizer_type, - clear_weakref_callback, tuple_maybe_untrack): + tuple_maybe_untrack): # see pypy/doc/discussion/rawrefcount.rst self.gc = gc (self.GCFLAG_VISITED_RMY, self.GCFLAG_VISITED, @@ -117,7 +115,6 @@ self.gc_as_pyobj = gc_as_pyobj self.pyobj_as_gc = pyobj_as_gc self.finalizer_type = finalizer_type - self.clear_weakref_callback = clear_weakref_callback self.tuple_maybe_untrack = tuple_maybe_untrack self.state = self.STATE_DEFAULT self.cycle_enabled = True @@ -347,7 +344,6 @@ def _major_trace(self, pyobject, flags): from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT - # TODO: add flag; if set: if marked, keep rc-proxy (use_cylicrefcnt, use_dict) = flags # pyobj = self._pyobj(pyobject) @@ -575,8 +571,6 @@ elif pyobj.c_ob_pypy_link != 0: pyobj.c_ob_refcnt += self.refcnt_add if self.refcnt_add > 0: - #intobj = pyobj.c_ob_pypy_link - #obj = llmemory.cast_int_to_adr(intobj) pyobject = llmemory.cast_ptr_to_adr(pyobj) obj = self.refcnt_dict.get(pyobject) self.gc.objects_to_trace.append(obj) diff --git a/rpython/memory/gc/rrc/mark.py b/rpython/memory/gc/rrc/mark.py --- a/rpython/memory/gc/rrc/mark.py +++ b/rpython/memory/gc/rrc/mark.py @@ -52,7 +52,7 @@ # mark all pypy objects at the border which are linked to live # non-gc pyobjs which are not directly referenced by any gc pyobj debug_print("use_cylicrc", use_cylicrc) - self.p_list_old.foreach(self._major_trace, (use_cylicrc, True)) # TODO: set flag to keep marked, check other occurences + self.p_list_old.foreach(self._major_trace, (use_cylicrc, True)) self._debug_check_consistency(print_label="end-mark") # fix refcnt back @@ -61,7 +61,7 @@ self.refcnt_dict = self.gc.AddressDict() self.use_refcntdict = False else: - self.p_list_old.foreach(self._major_trace, (False, False)) # TODO: set flag to keep marked, check other occurences + self.p_list_old.foreach(self._major_trace, (False, False)) self._debug_check_consistency(print_label="end-mark") self.state = self.STATE_DEFAULT diff --git a/rpython/memory/gc/test/test_rawrefcount.py b/rpython/memory/gc/test/test_rawrefcount.py --- a/rpython/memory/gc/test/test_rawrefcount.py +++ b/rpython/memory/gc/test/test_rawrefcount.py @@ -72,14 +72,6 @@ else: return RAWREFCOUNT_FINALIZER_NONE - def rawrefcount_clear_wr(gc): - cleared = False - for weakrefs in self.pyobj_weakrefs: - for weakref in weakrefs: - if gc._obj.container == weakref.p._obj: - weakref.callback_cleared = True - cleared = True - def rawrefcount_tuple_maybe_untrack(obj): #if foo: # gchdr = rawrefcount_pyobj_as_gc(obj) @@ -104,7 +96,6 @@ rawrefcount_gc_as_pyobj, rawrefcount_pyobj_as_gc, rawrefcount_finalizer_type, - rawrefcount_clear_wr, rawrefcount_tuple_maybe_untrack) def _collect(self, major, expected_trigger=0): diff --git a/rpython/memory/gctransform/framework.py b/rpython/memory/gctransform/framework.py --- a/rpython/memory/gctransform/framework.py +++ b/rpython/memory/gctransform/framework.py @@ -494,7 +494,6 @@ SomePtr(GCClass.RAWREFCOUNT_GC_AS_PYOBJ), SomePtr(GCClass.RAWREFCOUNT_PYOBJ_AS_GC), SomePtr(GCClass.RAWREFCOUNT_FINALIZER_TYPE), - SomePtr(GCClass.RAWREFCOUNT_CLEAR_WR_TYPE), SomePtr(GCClass.RAWREFCOUNT_MAYBE_UNTRACK_TUPLE)], annmodel.s_None) self.rawrefcount_create_link_pypy_ptr = getfn( @@ -1374,7 +1373,7 @@ def gct_gc_rawrefcount_init(self, hop): [v_fnptr, v_fnptr2, v_pyobj_list, v_tuple_list, v_fnptr3, v_fnptr4, - v_fnptr5, v_fnptr6, v_fnptr7] = hop.spaceop.args + v_fnptr5, v_fnptr6] = hop.spaceop.args assert v_fnptr.concretetype == self.GCClass.RAWREFCOUNT_DEALLOC_TRIGGER assert v_fnptr2.concretetype == self.GCClass.RAWREFCOUNT_TRAVERSE # TODO add assert for v_pyobj_list, improve asserts (types not same but equal) @@ -1383,7 +1382,7 @@ hop.genop("direct_call", [self.rawrefcount_init_ptr, self.c_const_gc, v_fnptr, v_fnptr2, v_pyobj_list, v_tuple_list, v_fnptr3, v_fnptr4, - v_fnptr5, v_fnptr6, v_fnptr7]) + v_fnptr5, v_fnptr6]) def gct_gc_rawrefcount_create_link_pypy(self, hop): [v_gcobj, v_pyobject] = hop.spaceop.args diff --git a/rpython/rlib/rawrefcount.py b/rpython/rlib/rawrefcount.py --- a/rpython/rlib/rawrefcount.py +++ b/rpython/rlib/rawrefcount.py @@ -36,8 +36,6 @@ PYOBJ_HDR_PTR)) RAWREFCOUNT_PYOBJ_AS_GC = lltype.Ptr(lltype.FuncType([PYOBJ_HDR_PTR], PYOBJ_GC_HDR_PTR)) -RAWREFCOUNT_CLEAR_WR_TYPE = lltype.Ptr(lltype.FuncType([llmemory.GCREF], - lltype.Void)) def _build_pypy_link(p): @@ -310,26 +308,24 @@ def compute_result_annotation(self, s_dealloc_callback, s_tp_traverse, s_pyobj_list, v_tuple_list, s_as_gc, s_as_pyobj, - a_finalizer_type, a_clear_wr, - a_maybe_untrack_tuple): + a_finalizer_type, a_maybe_untrack_tuple): from rpython.rtyper.llannotation import SomePtr assert isinstance(s_dealloc_callback, SomePtr) # ll-ptr-to-function assert isinstance(s_tp_traverse, SomePtr) assert isinstance(s_as_gc, SomePtr) assert isinstance(s_as_pyobj, SomePtr) assert isinstance(a_finalizer_type, SomePtr) - assert isinstance(a_clear_wr, SomePtr) assert isinstance(a_maybe_untrack_tuple, SomePtr) def specialize_call(self, hop): hop.exception_cannot_occur() v_dealloc_callback, v_tp_traverse, v_pyobj_list, v_tuple_list, \ - v_as_gc, v_as_pyobj, v_finalizer_type, \ - v_clear_wr, v_maybe_untrack_tuple = hop.inputargs(*hop.args_r) + v_as_gc, v_as_pyobj, v_finalizer_type, v_maybe_untrack_tuple = \ + hop.inputargs(*hop.args_r) hop.genop('gc_rawrefcount_init', [v_dealloc_callback, v_tp_traverse, v_pyobj_list, v_tuple_list, v_as_gc, v_as_pyobj, - v_finalizer_type, v_clear_wr, + v_finalizer_type, v_maybe_untrack_tuple]) From pypy.commits at gmail.com Tue Sep 24 08:41:22 2019 From: pypy.commits at gmail.com (arigo) Date: Tue, 24 Sep 2019 05:41:22 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Update logic to CPython 3.6.9 for setting f_lineno. Issue #3066 is not resolved; I guess CPython doesn't do the same dead code elimination Message-ID: <5d8a0ef2.1c69fb81.cafcf.b1ac@mx.google.com> Author: Armin Rigo Branch: py3.6 Changeset: r97598:29268d8eba51 Date: 2019-09-24 14:40 +0200 http://bitbucket.org/pypy/pypy/changeset/29268d8eba51/ Log: Update logic to CPython 3.6.9 for setting f_lineno. Issue #3066 is not resolved; I guess CPython doesn't do the same dead code elimination diff --git a/pypy/interpreter/executioncontext.py b/pypy/interpreter/executioncontext.py --- a/pypy/interpreter/executioncontext.py +++ b/pypy/interpreter/executioncontext.py @@ -329,8 +329,11 @@ # if it does not exist yet and the tracer accesses it via # frame.f_locals, it is filled by PyFrame.getdictscope frame.fast2locals() + prev_line_tracing = d.is_in_line_tracing self.is_tracing += 1 try: + if event == 'line': + d.is_in_line_tracing = True try: w_result = space.call_function(w_callback, frame, space.newtext(event), w_arg) if space.is_w(w_result, space.w_None): @@ -345,6 +348,7 @@ raise finally: self.is_tracing -= 1 + d.is_in_line_tracing = prev_line_tracing if d.w_locals is not None: frame.locals2fast() diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py --- a/pypy/interpreter/pyframe.py +++ b/pypy/interpreter/pyframe.py @@ -23,7 +23,7 @@ # Define some opcodes used for op in '''DUP_TOP POP_TOP SETUP_LOOP SETUP_EXCEPT SETUP_FINALLY SETUP_WITH -SETUP_ASYNC_WITH POP_BLOCK END_FINALLY'''.split(): +SETUP_ASYNC_WITH POP_BLOCK END_FINALLY WITH_CLEANUP_START'''.split(): globals()[op] = stdlib_opcode.opmap[op] class FrameDebugData(object): @@ -35,6 +35,7 @@ instr_prev_plus_one = 0 f_lineno = 0 # current lineno for tracing is_being_profiled = False + is_in_line_tracing = False w_locals = None hidden_operationerr = None @@ -667,20 +668,30 @@ except OperationError: raise oefmt(space.w_ValueError, "lineno must be an integer") + # You can only do this from within a trace function, not via + # _getframe or similar hackery. if self.get_w_f_trace() is None: raise oefmt(space.w_ValueError, "f_lineno can only be set by a trace function.") + # Only allow jumps when we're tracing a line event. + d = self.getorcreatedebug() + if not d.is_in_line_tracing: + raise oefmt(space.w_ValueError, + "can only jump from a 'line' trace event") + line = self.pycode.co_firstlineno if new_lineno < line: raise oefmt(space.w_ValueError, - "line %d comes before the current code.", new_lineno) + "line %d comes before the current code block", new_lineno) elif new_lineno == line: new_lasti = 0 else: + # Find the bytecode offset for the start of the given + # line, or the first code-owning line after it. + lnotab = self.pycode.co_lnotab + addr = 0 new_lasti = -1 - addr = 0 - lnotab = self.pycode.co_lnotab for offset in xrange(0, len(lnotab), 2): addr += ord(lnotab[offset]) line_offset = ord(lnotab[offset + 1]) @@ -692,23 +703,47 @@ new_lineno = line break + # If we didn't reach the requested line, return an error. if new_lasti == -1: raise oefmt(space.w_ValueError, - "line %d comes after the current code.", new_lineno) + "line %d comes after the current code block", new_lineno) - # Don't jump to a line with an except in it. + min_addr = min(new_lasti, self.last_instr) + max_addr = max(new_lasti, self.last_instr) + + # You can't jump onto a line with an 'except' statement on it - + # they expect to have an exception on the top of the stack, which + # won't be true if you jump to them. They always start with code + # that either pops the exception using POP_TOP (plain 'except:' + # lines do this) or duplicates the exception on the stack using + # DUP_TOP (if there's an exception type specified). See compile.c, + # 'com_try_except' for the full details. There aren't any other + # cases (AFAIK) where a line's code can start with DUP_TOP or + # POP_TOP, but if any ever appear, they'll be subject to the same + # restriction (but with a different error message). code = self.pycode.co_code if ord(code[new_lasti]) in (DUP_TOP, POP_TOP): raise oefmt(space.w_ValueError, "can't jump to 'except' line as there's no exception") - # Don't jump inside or out of an except or a finally block. - # Note that CPython doesn't check except blocks, - # but that results in crashes (tested on 3.5.2+). - f_lasti_handler_addr = -1 - new_lasti_handler_addr = -1 + # You can't jump into or out of a 'finally' block because the 'try' + # block leaves something on the stack for the END_FINALLY to clean + # up. So we walk the bytecode, maintaining a simulated blockstack. + # When we reach the old or new address and it's in a 'finally' block + # we note the address of the corresponding SETUP_FINALLY. The jump + # is only legal if neither address is in a 'finally' block or + # they're both in the same one. 'blockstack' is a stack of the + # bytecode addresses of the SETUP_X opcodes, and 'in_finally' tracks + # whether we're in a 'finally' block at each blockstack level. + + # PYPY NOTE: CPython (at least 3.5.2+) doesn't check except blocks, + # but that results in crashes. But for now I'm going to follow the + # logic of CPython 3.6.9 exactly anyway, which is quite messy already. + + f_lasti_setup_addr = -1 + new_lasti_setup_addr = -1 blockstack = [] # current blockstack (addresses of SETUP_*) - endblock = [-1] # current finally/except block stack + in_finally = [] # list of flags "is this a finally block?" addr = 0 while addr < len(code): assert addr & 1 == 0 @@ -716,47 +751,69 @@ if op in (SETUP_LOOP, SETUP_EXCEPT, SETUP_FINALLY, SETUP_WITH, SETUP_ASYNC_WITH): blockstack.append(addr) + in_finally.append(False) elif op == POP_BLOCK: if len(blockstack) == 0: raise oefmt(space.w_SystemError, "POP_BLOCK not properly nested in this bytecode") - setup_op = ord(code[blockstack.pop()]) - if setup_op != SETUP_LOOP: - endblock.append(addr) + setup_op = ord(code[blockstack[-1]]) + if setup_op in (SETUP_FINALLY, SETUP_WITH, SETUP_ASYNC_WITH): + in_finally[-1] = True + else: + del blockstack[-1] elif op == END_FINALLY: - if len(endblock) <= 1: - raise oefmt(space.w_SystemError, - "END_FINALLY not properly nested in this bytecode") - endblock.pop() + # Ignore END_FINALLYs for SETUP_EXCEPTs - they exist + # in the bytecode but don't correspond to an actual + # 'finally' block. (If len(blockstack) is 0, we must + # be seeing such an END_FINALLY.) + if len(blockstack) > 0: + setup_op = ord(code[blockstack[-1]]) + if setup_op in (SETUP_FINALLY, SETUP_WITH, SETUP_ASYNC_WITH): + del blockstack[-1] - if addr == new_lasti: - new_lasti_handler_addr = endblock[-1] - if addr == self.last_instr: - f_lasti_handler_addr = endblock[-1] + # For the addresses we're interested in, see whether they're + # within a 'finally' block and if so, remember the address + # of the SETUP_FINALLY. + if addr == new_lasti or addr == self.last_instr: + setup_addr = -1 + for i in xrange(len(blockstack) - 1, -1, -1): + if in_finally[i]: + setup_addr = blockstack[i] + break + if setup_addr != -1: + if addr == new_lasti: + new_lasti_setup_addr = setup_addr + if addr == self.last_instr: + f_lasti_setup_addr = setup_addr addr += 2 - if len(blockstack) != 0 or len(endblock) != 1: + # Verify that the blockstack tracking code didn't get lost. + if len(blockstack) != 0: raise oefmt(space.w_SystemError, "blocks not properly nested in this bytecode") - if new_lasti_handler_addr != f_lasti_handler_addr: + # After all that, are we jumping into / out of a 'finally' block? + if new_lasti_setup_addr != f_lasti_setup_addr: raise oefmt(space.w_ValueError, - "can't jump into or out of an 'expect' or " - "'finally' block (%d -> %d)", - f_lasti_handler_addr, new_lasti_handler_addr) + "can't jump into or out of a 'finally' block " + "(%d -> %d)", + f_lasti_setup_addr, new_lasti_setup_addr) # now we know we're not jumping into or out of a place which # needs a SysExcInfoRestorer. Check that we're not jumping # *into* a block, but only (potentially) out of some blocks. - if new_lasti < self.last_instr: - min_addr = new_lasti - max_addr = self.last_instr - else: - min_addr = self.last_instr - max_addr = new_lasti - delta_iblock = min_delta_iblock = 0 # see below for comment + # Police block-jumping (you can't jump into the middle of a block) + # and ensure that the blockstack finishes up in a sensible state (by + # popping any blocks we're jumping out of). We look at all the + # blockstack operations between the current position and the new + # one, and keep track of how many blocks we drop out of on the way. + # By also keeping track of the lowest blockstack position we see, we + # can tell whether the jump goes into any blocks without coming out + # again - in that case we raise an exception below. + + delta_iblock = min_delta_iblock = 0 addr = min_addr while addr < max_addr: assert addr & 1 == 0 @@ -767,29 +824,33 @@ delta_iblock += 1 elif op == POP_BLOCK: delta_iblock -= 1 - if delta_iblock < min_delta_iblock: - min_delta_iblock = delta_iblock + min_delta_iblock = min(min_delta_iblock, delta_iblock) addr += 2 # 'min_delta_iblock' is <= 0; its absolute value is the number of # blocks we exit. 'go_iblock' is the delta number of blocks # between the last_instr and the new_lasti, in this order. if new_lasti > self.last_instr: - go_iblock = delta_iblock + go_iblock = delta_iblock # Forwards jump. else: - go_iblock = -delta_iblock + go_iblock = -delta_iblock # Backwards jump. if go_iblock > min_delta_iblock: raise oefmt(space.w_ValueError, "can't jump into the middle of a block") assert go_iblock <= 0 + # Pop any blocks that we're jumping out of. + from pypy.interpreter.pyopcode import FinallyBlock for ii in range(-go_iblock): block = self.pop_block() block.cleanupstack(self) + if (isinstance(block, FinallyBlock) and + ord(code[block.handlerposition]) == WITH_CLEANUP_START): + self.popvalue() # Pop the exit function. - self.getorcreatedebug().f_lineno = new_lineno + d.f_lineno = new_lineno assert new_lasti & 1 == 0 self.last_instr = new_lasti From pypy.commits at gmail.com Tue Sep 24 09:04:09 2019 From: pypy.commits at gmail.com (arigo) Date: Tue, 24 Sep 2019 06:04:09 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Skip a test that now crashes just like it does on CPython Message-ID: <5d8a1449.1c69fb81.3c95d.d3af@mx.google.com> Author: Armin Rigo Branch: py3.6 Changeset: r97599:d9f0a8eedf66 Date: 2019-09-24 15:03 +0200 http://bitbucket.org/pypy/pypy/changeset/d9f0a8eedf66/ Log: Skip a test that now crashes just like it does on CPython diff --git a/pypy/interpreter/test/apptest_pyframe.py b/pypy/interpreter/test/apptest_pyframe.py --- a/pypy/interpreter/test/apptest_pyframe.py +++ b/pypy/interpreter/test/apptest_pyframe.py @@ -117,6 +117,8 @@ # assert did not crash def test_f_lineno_set_2(): + skip("this test is known to crash CPython (verified in 3.6.9). " + "Now it crashes PyPy too. Too bad?") counter = [0] errors = [] From pypy.commits at gmail.com Tue Sep 24 09:07:39 2019 From: pypy.commits at gmail.com (arigo) Date: Tue, 24 Sep 2019 06:07:39 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Issue #3066: fix just by not removing dead bytecodes Message-ID: <5d8a151b.1c69fb81.789a7.f52c@mx.google.com> Author: Armin Rigo Branch: py3.6 Changeset: r97600:68e1f1bd6ea6 Date: 2019-09-24 15:07 +0200 http://bitbucket.org/pypy/pypy/changeset/68e1f1bd6ea6/ Log: Issue #3066: fix just by not removing dead bytecodes diff --git a/pypy/interpreter/astcompiler/assemble.py b/pypy/interpreter/astcompiler/assemble.py --- a/pypy/interpreter/astcompiler/assemble.py +++ b/pypy/interpreter/astcompiler/assemble.py @@ -226,8 +226,10 @@ def is_dead_code(self): """Return False if any code can be meaningfully added to the current block, or True if it would be dead code.""" - # currently only True after a RETURN_VALUE. - return self.current_block.have_return + # PyPy2 only returns True after a RETURN_VALUE. Here we don't even + # do that, because otherwise the setter for f_lineno gets very confused. + # See test_f_lineno_set_4 in apptest_pyframe.py + return False # self.current_block.have_return def emit_op(self, op): """Emit an opcode without an argument.""" diff --git a/pypy/interpreter/test/apptest_pyframe.py b/pypy/interpreter/test/apptest_pyframe.py --- a/pypy/interpreter/test/apptest_pyframe.py +++ b/pypy/interpreter/test/apptest_pyframe.py @@ -169,7 +169,6 @@ assert output == [2, 9] def test_f_lineno_set_4(): - pytest.skip("test is failing on pypy") def jump_in_nested_finally(output): try: output.append(2) From pypy.commits at gmail.com Tue Sep 24 11:51:36 2019 From: pypy.commits at gmail.com (arigo) Date: Tue, 24 Sep 2019 08:51:36 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: #3066: revert the change in the code, which was not needed after all Message-ID: <5d8a3b88.1c69fb81.848f3.c5a5@mx.google.com> Author: Armin Rigo Branch: py3.6 Changeset: r97604:63d044a9a08a Date: 2019-09-24 17:49 +0200 http://bitbucket.org/pypy/pypy/changeset/63d044a9a08a/ Log: #3066: revert the change in the code, which was not needed after all diff --git a/pypy/interpreter/astcompiler/assemble.py b/pypy/interpreter/astcompiler/assemble.py --- a/pypy/interpreter/astcompiler/assemble.py +++ b/pypy/interpreter/astcompiler/assemble.py @@ -226,10 +226,8 @@ def is_dead_code(self): """Return False if any code can be meaningfully added to the current block, or True if it would be dead code.""" - # PyPy2 only returns True after a RETURN_VALUE. Here we don't even - # do that, because otherwise the setter for f_lineno gets very confused. - # See test_f_lineno_set_4 in apptest_pyframe.py - return False # self.current_block.have_return + # currently only True after a RETURN_VALUE. + return self.current_block.have_return def emit_op(self, op): """Emit an opcode without an argument.""" From pypy.commits at gmail.com Wed Sep 25 11:06:20 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 25 Sep 2019 08:06:20 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: remove windows ^M line endings Message-ID: <5d8b826c.1c69fb81.2588.1c11@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97605:388678c00faf Date: 2019-09-25 18:02 +0300 http://bitbucket.org/pypy/pypy/changeset/388678c00faf/ Log: remove windows ^M line endings diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py --- a/pypy/interpreter/pyframe.py +++ b/pypy/interpreter/pyframe.py @@ -668,15 +668,15 @@ except OperationError: raise oefmt(space.w_ValueError, "lineno must be an integer") - # You can only do this from within a trace function, not via - # _getframe or similar hackery. + # You can only do this from within a trace function, not via + # _getframe or similar hackery. if self.get_w_f_trace() is None: raise oefmt(space.w_ValueError, - "f_lineno can only be set by a trace function.") + "f_lineno can only be set by a trace function") - # Only allow jumps when we're tracing a line event. - d = self.getorcreatedebug() - if not d.is_in_line_tracing: + # Only allow jumps when we're tracing a line event. + d = self.getorcreatedebug() + if not d.is_in_line_tracing: raise oefmt(space.w_ValueError, "can only jump from a 'line' trace event") @@ -687,7 +687,7 @@ elif new_lineno == line: new_lasti = 0 else: - # Find the bytecode offset for the start of the given + # Find the bytecode offset for the start of the given # line, or the first code-owning line after it. lnotab = self.pycode.co_lnotab addr = 0 @@ -708,33 +708,33 @@ raise oefmt(space.w_ValueError, "line %d comes after the current code block", new_lineno) - min_addr = min(new_lasti, self.last_instr) + min_addr = min(new_lasti, self.last_instr) max_addr = max(new_lasti, self.last_instr) - # You can't jump onto a line with an 'except' statement on it - - # they expect to have an exception on the top of the stack, which - # won't be true if you jump to them. They always start with code - # that either pops the exception using POP_TOP (plain 'except:' - # lines do this) or duplicates the exception on the stack using - # DUP_TOP (if there's an exception type specified). See compile.c, - # 'com_try_except' for the full details. There aren't any other - # cases (AFAIK) where a line's code can start with DUP_TOP or - # POP_TOP, but if any ever appear, they'll be subject to the same - # restriction (but with a different error message). + # You can't jump onto a line with an 'except' statement on it - + # they expect to have an exception on the top of the stack, which + # won't be true if you jump to them. They always start with code + # that either pops the exception using POP_TOP (plain 'except:' + # lines do this) or duplicates the exception on the stack using + # DUP_TOP (if there's an exception type specified). See compile.c, + # 'com_try_except' for the full details. There aren't any other + # cases (AFAIK) where a line's code can start with DUP_TOP or + # POP_TOP, but if any ever appear, they'll be subject to the same + # restriction (but with a different error message). code = self.pycode.co_code if ord(code[new_lasti]) in (DUP_TOP, POP_TOP): raise oefmt(space.w_ValueError, "can't jump to 'except' line as there's no exception") - # You can't jump into or out of a 'finally' block because the 'try' - # block leaves something on the stack for the END_FINALLY to clean - # up. So we walk the bytecode, maintaining a simulated blockstack. - # When we reach the old or new address and it's in a 'finally' block - # we note the address of the corresponding SETUP_FINALLY. The jump - # is only legal if neither address is in a 'finally' block or - # they're both in the same one. 'blockstack' is a stack of the - # bytecode addresses of the SETUP_X opcodes, and 'in_finally' tracks - # whether we're in a 'finally' block at each blockstack level. + # You can't jump into or out of a 'finally' block because the 'try' + # block leaves something on the stack for the END_FINALLY to clean + # up. So we walk the bytecode, maintaining a simulated blockstack. + # When we reach the old or new address and it's in a 'finally' block + # we note the address of the corresponding SETUP_FINALLY. The jump + # is only legal if neither address is in a 'finally' block or + # they're both in the same one. 'blockstack' is a stack of the + # bytecode addresses of the SETUP_X opcodes, and 'in_finally' tracks + # whether we're in a 'finally' block at each blockstack level. # PYPY NOTE: CPython (at least 3.5.2+) doesn't check except blocks, # but that results in crashes. But for now I'm going to follow the @@ -762,17 +762,17 @@ else: del blockstack[-1] elif op == END_FINALLY: - # Ignore END_FINALLYs for SETUP_EXCEPTs - they exist - # in the bytecode but don't correspond to an actual - # 'finally' block. (If len(blockstack) is 0, we must - # be seeing such an END_FINALLY.) + # Ignore END_FINALLYs for SETUP_EXCEPTs - they exist + # in the bytecode but don't correspond to an actual + # 'finally' block. (If len(blockstack) is 0, we must + # be seeing such an END_FINALLY.) if len(blockstack) > 0: - setup_op = ord(code[blockstack[-1]]) - if setup_op in (SETUP_FINALLY, SETUP_WITH, SETUP_ASYNC_WITH): - del blockstack[-1] + setup_op = ord(code[blockstack[-1]]) + if setup_op in (SETUP_FINALLY, SETUP_WITH, SETUP_ASYNC_WITH): + del blockstack[-1] - # For the addresses we're interested in, see whether they're - # within a 'finally' block and if so, remember the address + # For the addresses we're interested in, see whether they're + # within a 'finally' block and if so, remember the address # of the SETUP_FINALLY. if addr == new_lasti or addr == self.last_instr: setup_addr = -1 @@ -781,11 +781,11 @@ setup_addr = blockstack[i] break - if setup_addr != -1: - if addr == new_lasti: - new_lasti_setup_addr = setup_addr - if addr == self.last_instr: - f_lasti_setup_addr = setup_addr + if setup_addr != -1: + if addr == new_lasti: + new_lasti_setup_addr = setup_addr + if addr == self.last_instr: + f_lasti_setup_addr = setup_addr addr += 2 # Verify that the blockstack tracking code didn't get lost. @@ -804,14 +804,14 @@ # needs a SysExcInfoRestorer. Check that we're not jumping # *into* a block, but only (potentially) out of some blocks. - # Police block-jumping (you can't jump into the middle of a block) - # and ensure that the blockstack finishes up in a sensible state (by - # popping any blocks we're jumping out of). We look at all the - # blockstack operations between the current position and the new - # one, and keep track of how many blocks we drop out of on the way. - # By also keeping track of the lowest blockstack position we see, we - # can tell whether the jump goes into any blocks without coming out - # again - in that case we raise an exception below. + # Police block-jumping (you can't jump into the middle of a block) + # and ensure that the blockstack finishes up in a sensible state (by + # popping any blocks we're jumping out of). We look at all the + # blockstack operations between the current position and the new + # one, and keep track of how many blocks we drop out of on the way. + # By also keeping track of the lowest blockstack position we see, we + # can tell whether the jump goes into any blocks without coming out + # again - in that case we raise an exception below. delta_iblock = min_delta_iblock = 0 addr = min_addr From pypy.commits at gmail.com Wed Sep 25 11:06:22 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 25 Sep 2019 08:06:22 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: cpython compatibility Message-ID: <5d8b826e.1c69fb81.ab075.6f56@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97606:c9039acb3770 Date: 2019-09-25 18:03 +0300 http://bitbucket.org/pypy/pypy/changeset/c9039acb3770/ Log: cpython compatibility diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py --- a/pypy/interpreter/pyframe.py +++ b/pypy/interpreter/pyframe.py @@ -670,6 +670,9 @@ # You can only do this from within a trace function, not via # _getframe or similar hackery. + if space.int_w(self.fget_f_lasti(space)) == -1: + raise oefmt(space.w_ValueError, + "can't jump from the 'call' trace event of a new frame") if self.get_w_f_trace() is None: raise oefmt(space.w_ValueError, "f_lineno can only be set by a trace function") From pypy.commits at gmail.com Wed Sep 25 11:31:38 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 25 Sep 2019 08:31:38 -0700 (PDT) Subject: [pypy-commit] pypy default: Update the release note Message-ID: <5d8b885a.1c69fb81.3e2d.b4ca@mx.google.com> Author: Matti Picus Branch: Changeset: r97607:63d4875300a6 Date: 2019-09-25 18:19 +0300 http://bitbucket.org/pypy/pypy/changeset/63d4875300a6/ Log: Update the release note diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst --- a/pypy/doc/release-v7.2.0.rst +++ b/pypy/doc/release-v7.2.0.rst @@ -49,6 +49,9 @@ Thanks to Anvil_, we revived the `PyPy Sandbox`_, which allows total control over a python interpreter's interactions with the external world. +We implemented a new JSON decoder that is much faster, uses less memory, and +uses a JIT-friendly specialized dictionary. + As always, this release is 100% compatible with the previous one and fixed several issues and bugs raised by the growing community of PyPy users. We strongly recommend updating. Many of the fixes are the direct result of @@ -201,7 +204,7 @@ * Make ``CDLL(None)`` on win32 raise ``TypeError`` * Change ``sys.getfilesystemcodeerors()`` to ``'strict'`` on win32 * Update vendored version of ``pycparser`` to version 2.19 -* Implement a much faster json decoder (3x speedup for large json files, 2x less memory) +* Implement a much faster JSON decoder (3x speedup for large json files, 2x less memory) C-API (cpyext) and c-extensions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -277,6 +280,7 @@ * Raise ``SyntaxError`` instead of ``DeprecationWarning`` when treating invalid escapes in bytes as errors (CPython issue 28691_) * Handle locale in `time.strftime()`. (`issue 3079`_) +* Fix an issue when calling ``PyFrame.fset_f_lineno`` (`issue 3066`_) Python 3.6 c-API ~~~~~~~~~~~~~~~~ @@ -338,3 +342,4 @@ .. _`issue 3072`: https://bitbucket.com/pypy/pypy/issues/3072 .. _`issue 3073`: https://bitbucket.com/pypy/pypy/issues/3073 .. _`issue 3079`: https://bitbucket.com/pypy/pypy/issues/3079 +.. _`issue 3066`: https://bitbucket.com/pypy/pypy/issues/3066 From pypy.commits at gmail.com Wed Sep 25 11:31:43 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 25 Sep 2019 08:31:43 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default into branch Message-ID: <5d8b885f.1c69fb81.60a23.53e2@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97609:533072912c5f Date: 2019-09-25 18:20 +0300 http://bitbucket.org/pypy/pypy/changeset/533072912c5f/ Log: merge default into branch diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst --- a/pypy/doc/release-v7.2.0.rst +++ b/pypy/doc/release-v7.2.0.rst @@ -49,6 +49,9 @@ Thanks to Anvil_, we revived the `PyPy Sandbox`_, which allows total control over a python interpreter's interactions with the external world. +We implemented a new JSON decoder that is much faster, uses less memory, and +uses a JIT-friendly specialized dictionary. + As always, this release is 100% compatible with the previous one and fixed several issues and bugs raised by the growing community of PyPy users. We strongly recommend updating. Many of the fixes are the direct result of @@ -126,7 +129,7 @@ * Package windows DLLs needed by cffi modules next to the cffi c-extensions (`issue 2988`_) * Cleanup and refactor JIT code to remove ``rpython.jit.metainterp.typesystem`` -* Fix memoryviews of ctype structures with padding, (cpython issue 32780_) +* Fix memoryviews of ctype structures with padding, (CPython issue 32780_) Changes to Python 3.6 released in v7.1.1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,6 +188,23 @@ * Correctly wrap the I/O errors we can get when importing modules * Fix bad output from JSON with ``'skipkeys=True'`` (`issue 3052`_) * Fix compatibility with latest virtualenv HEAD +* Avoid ``RuntimeError`` in ``repr()`` of recursive ``dictviews`` (CPython + issue 18533_) +* Fix for printing after ``gc.get_objects()`` (`issue 2979`) +* Optimize many fast-paths through utf-8 code when we know it is ascii or no + surroagates are present +* Check for a rare case of someone shrinking a buffer from another thread + while using it in a ``read()`` variant. One of the issues discovered when + reviewing the code for the sandbox. +* Prevent segfault when slicing ``array.array`` with a large step size +* Support building ``ncurses`` on Suse Linux +* Update statically-linked ``_ssl`` OpenSSL to 1.1.0c on ``darwin`` +* Optimize ``W_TextIOWrapper._readline`` and ``ByteBuffer.getslice`` +* Fix possible race condition in threading ``Lock.release()`` (`issue 3072`_) +* Make ``CDLL(None)`` on win32 raise ``TypeError`` +* Change ``sys.getfilesystemcodeerors()`` to ``'strict'`` on win32 +* Update vendored version of ``pycparser`` to version 2.19 +* Implement a much faster JSON decoder (3x speedup for large json files, 2x less memory) C-API (cpyext) and c-extensions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -211,7 +231,7 @@ 3003`_) * Fix parsing for converting strings with underscore into ints * Add ``memoryview.obj`` which stores a reference, (`issue 3016`_) -* Fix datetime.fromtimestamp for win32 (cpython issue 29097_) +* Fix datetime.fromtimestamp for win32 (CPython issue 29097_) * Improve multiprocessing support on win32 * Support negative offsets in ``lnotab`` (`issue 2943`_) * Fix leak of file descriptor with `_io.FileIO('dir/')` @@ -232,19 +252,62 @@ * Fix case where ``int()`` would go into infinite recursion * Don't ignore fold parameter in ``(date,)time.replace()`` * Fix logic bug for ``memoryview.cast`` (when ``view.format`` is not ``'B'``) +* Implement retry-on-EINTR in fcntl module (CPython issue 35189_) +* Fix handling of 1st argument to ``hashlib.blake2{b,s}()`` (CPython issue + 33729_) +* Prevent overflow in ``_hashlib`` ``digest()`` (CPython issue 34922_) +* ``IOBase.readlines()`` relies on the iterator protocol instead of calling + ``readline()`` directly +* Don't inherit ``IS_ABSTRACT`` flag in classes +* Reset raw_pos after unwinding the raw stream (CPython issue 32228_) +* Add existing options ``-b`` and ``-d`` to ``pypy3 --help`` text +* Clean up ``_codecs`` error handling code +* Add support for using stdlib as a zipfile +* Check return type of ``__prepare__()`` (CPython issue 31588_) +* Fix logic in ``_curses.get_wch`` (`issue 3064`_) +* Match CPython exit code when failing to flush stdout/stderr at exit +* Improve SyntaxError message output +* Add ``range.__bool__`` +* Add cursor validity check to ``_sqlite.Cursor.close`` +* Improve message when mistakenly using ``print something`` in Python3 +* Handle generator exit in ``athrow()`` (CPython issue 33786_) +* Support unmarshalling ``TYPE_INT64`` and turn ``OverflowErrors`` from + ``marshal.loads`` into ``ValueErrors`` +* Update ``_posixsubprocess.c`` to match CPython (CPython issue 32270_) +* Remove unused ``_posixsubprocess.cloexec_pipe()`` +* Add missing constants to ``stat`` and ``kill _stat`` (`issue 3073`_) +* Fix argument handling in ``select.poll().poll()`` +* Raise ``SyntaxError`` instead of ``DeprecationWarning`` when treating invalid + escapes in bytes as errors (CPython issue 28691_) +* Handle locale in `time.strftime()`. (`issue 3079`_) +* Fix an issue when calling ``PyFrame.fset_f_lineno`` (`issue 3066`_) Python 3.6 c-API ~~~~~~~~~~~~~~~~ * Add ``PyStructSequence_InitType2``, ``Py_RETURN_NOTIMPLEMENTED``, - ``PyGILState_Check``, ``PyUnicode_AsUCS4``, ``PyUnicode_AsUCS4Copy`` + ``PyGILState_Check``, ``PyUnicode_AsUCS4``, ``PyUnicode_AsUCS4Copy``, + ``PyErr_SetFromWindowsErr``, * Sync the various ``Py**Flag`` constants with CPython +* Allow ``PyTypeObject`` with ``tp_doc==""`` (`issue 3055`_) +* Update ``pymacro.h`` to match CPython 3.6.9 +* Support more datetime C functions and definitions .. _`Lehmer's algorithm`: https://en.wikipedia.org/wiki/Lehmer's_GCD_algorithm .. _29097: https://bugs.python.org/issue29097 .. _32780: https://bugs.python.org/issue32780 .. _35409 : https://bugs.python.org/issue35409 .. _27169 : https://bugs.python.org/issue27169 +.. _18533 : https://bugs.python.org/issue18533 +.. _35189 : https://bugs.python.org/issue35189 +.. _33279 : https://bugs.python.org/issue33279 +.. _34922 : https://bugs.python.org/issue34922 +.. _32228 : https://bugs.python.org/issue32228 +.. _31588 : https://bugs.python.org/issue31588 +.. _33786 : https://bugs.python.org/issue33786 +.. _32270 : https://bugs.python.org/issue32270 +.. _28691 : https://bugs.python.org/issue28691 + .. _opencv2: https://github.com/skvark/opencv-python/ .. _`issue 2617`: https://bitbucket.com/pypy/pypy/issues/2617 .. _`issue 2722`: https://bitbucket.com/pypy/pypy/issues/2722 @@ -273,3 +336,10 @@ .. _`issue 3049`: https://bitbucket.com/pypy/pypy/issues/3049 .. _`issue 3050`: https://bitbucket.com/pypy/pypy/issues/3050 .. _`issue 3052`: https://bitbucket.com/pypy/pypy/issues/3052 +.. _`issue 3055`: https://bitbucket.com/pypy/pypy/issues/3055 +.. _`issue 2979`: https://bitbucket.com/pypy/pypy/issues/2979 +.. _`issue 3064`: https://bitbucket.com/pypy/pypy/issues/3064 +.. _`issue 3072`: https://bitbucket.com/pypy/pypy/issues/3072 +.. _`issue 3073`: https://bitbucket.com/pypy/pypy/issues/3073 +.. _`issue 3079`: https://bitbucket.com/pypy/pypy/issues/3079 +.. _`issue 3066`: https://bitbucket.com/pypy/pypy/issues/3066 diff --git a/pypy/doc/sandbox.rst b/pypy/doc/sandbox.rst --- a/pypy/doc/sandbox.rst +++ b/pypy/doc/sandbox.rst @@ -3,10 +3,11 @@ PyPy's sandboxing features ========================== -.. warning:: This is not actively maintained. You will likely have to fix - some issues yourself, or otherwise play around on your own. We provide - this documentation for historical reasions, it will not translate or - run on the latest PyPy code base. +.. warning:: This describes the old, unmaintained version. A new version + is in progress and should be merged back to trunk at some point soon. + Please see its description here: + https://mail.python.org/pipermail/pypy-dev/2019-August/015797.html + Introduction ------------ From pypy.commits at gmail.com Wed Sep 25 11:31:41 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 25 Sep 2019 08:31:41 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy2.7-v7.x: merge default into branch Message-ID: <5d8b885d.1c69fb81.c99de.eb20@mx.google.com> Author: Matti Picus Branch: release-pypy2.7-v7.x Changeset: r97608:1dbbc67ce3f1 Date: 2019-09-25 18:19 +0300 http://bitbucket.org/pypy/pypy/changeset/1dbbc67ce3f1/ Log: merge default into branch diff too long, truncating to 2000 out of 2917 lines diff --git a/lib_pypy/cffi/_pycparser/README b/lib_pypy/cffi/_pycparser/README --- a/lib_pypy/cffi/_pycparser/README +++ b/lib_pypy/cffi/_pycparser/README @@ -10,3 +10,8 @@ ^^^^^^^^^^^^^^^ yacctab='cffi._pycparser.yacctab', ^^^^^^^^^^^^^^^ + +Also, when updating the version of this in-place, you must regenerate the +lextab.py and yacctab.py files. They will be regenerated on import if they +are not found, so they should be removed, then regenrated, then the new +versions committed. diff --git a/lib_pypy/cffi/_pycparser/_c_ast.cfg b/lib_pypy/cffi/_pycparser/_c_ast.cfg --- a/lib_pypy/cffi/_pycparser/_c_ast.cfg +++ b/lib_pypy/cffi/_pycparser/_c_ast.cfg @@ -9,7 +9,7 @@ # ** - a sequence of child nodes # - an attribute # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- @@ -187,3 +187,5 @@ Union: [name, decls**] While: [cond*, stmt*] + +Pragma: [string] diff --git a/lib_pypy/cffi/_pycparser/lextab.py b/lib_pypy/cffi/_pycparser/lextab.py --- a/lib_pypy/cffi/_pycparser/lextab.py +++ b/lib_pypy/cffi/_pycparser/lextab.py @@ -1,9 +1,10 @@ -# pycparser.lextab.py. This file automatically created by PLY (version 3.4). Don't edit! -_tabversion = '3.4' -_lextokens = {'VOID': 1, 'LBRACKET': 1, 'WCHAR_CONST': 1, 'FLOAT_CONST': 1, 'MINUS': 1, 'RPAREN': 1, 'LONG': 1, 'PLUS': 1, 'ELLIPSIS': 1, 'GT': 1, 'GOTO': 1, 'ENUM': 1, 'PERIOD': 1, 'GE': 1, 'INT_CONST_DEC': 1, 'ARROW': 1, 'HEX_FLOAT_CONST': 1, 'DOUBLE': 1, 'MINUSEQUAL': 1, 'INT_CONST_OCT': 1, 'TIMESEQUAL': 1, 'OR': 1, 'SHORT': 1, 'RETURN': 1, 'RSHIFTEQUAL': 1, 'RESTRICT': 1, 'STATIC': 1, 'SIZEOF': 1, 'UNSIGNED': 1, 'UNION': 1, 'COLON': 1, 'WSTRING_LITERAL': 1, 'DIVIDE': 1, 'FOR': 1, 'PLUSPLUS': 1, 'EQUALS': 1, 'ELSE': 1, 'INLINE': 1, 'EQ': 1, 'AND': 1, 'TYPEID': 1, 'LBRACE': 1, 'PPHASH': 1, 'INT': 1, 'SIGNED': 1, 'CONTINUE': 1, 'NOT': 1, 'OREQUAL': 1, 'MOD': 1, 'RSHIFT': 1, 'DEFAULT': 1, 'CHAR': 1, 'WHILE': 1, 'DIVEQUAL': 1, 'EXTERN': 1, 'CASE': 1, 'LAND': 1, 'REGISTER': 1, 'MODEQUAL': 1, 'NE': 1, 'SWITCH': 1, 'INT_CONST_HEX': 1, '_COMPLEX': 1, 'PLUSEQUAL': 1, 'STRUCT': 1, 'CONDOP': 1, 'BREAK': 1, 'VOLATILE': 1, 'ANDEQUAL': 1, 'INT_CONST_BIN': 1, 'DO': 1, 'LNOT': 1, 'CONST': 1, 'LOR': 1, 'CHAR_CONST': 1, 'LSHIFT': 1, 'RBRACE': 1, '_BOOL': 1, 'LE': 1, 'SEMI': 1, 'LT': 1, 'COMMA': 1, 'OFFSETOF': 1, 'TYPEDEF': 1, 'XOR': 1, 'AUTO': 1, 'TIMES': 1, 'LPAREN': 1, 'MINUSMINUS': 1, 'ID': 1, 'IF': 1, 'STRING_LITERAL': 1, 'FLOAT': 1, 'XOREQUAL': 1, 'LSHIFTEQUAL': 1, 'RBRACKET': 1} -_lexreflags = 0 +# lextab.py. This file automatically created by PLY (version 3.10). Don't edit! +_tabversion = '3.10' +_lextokens = set(('_BOOL', '_COMPLEX', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN', 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', 'REGISTER', 'OFFSETOF', 'RESTRICT', 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', 'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID', 'VOLATILE', 'WHILE', '__INT128', 'ID', 'TYPEID', 'INT_CONST_DEC', 'INT_CONST_OCT', 'INT_CONST_HEX', 'INT_CONST_BIN', 'FLOAT_CONST', 'HEX_FLOAT_CONST', 'CHAR_CONST', 'WCHAR_CONST', 'STRING_LITERAL', 'WSTRING_LITERAL', 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MOD', 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', 'LOR', 'LAND', 'LNOT', 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', 'PLUSEQUAL', 'MINUSEQUAL', 'LSHIFTEQUAL', 'RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', 'OREQUAL', 'PLUSPLUS', 'MINUSMINUS', 'ARROW', 'CONDOP', 'LPAREN', 'RPAREN', 'LBRACKET', 'RBRACKET', 'LBRACE', 'RBRACE', 'COMMA', 'PERIOD', 'SEMI', 'COLON', 'ELLIPSIS', 'PPHASH', 'PPPRAGMA', 'PPPRAGMASTR')) +_lexreflags = 64 _lexliterals = '' -_lexstateinfo = {'ppline': 'exclusive', 'pppragma': 'exclusive', 'INITIAL': 'inclusive'} -_lexstatere = {'ppline': [('(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, None, None, None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR'), None, None, None, None, None, None, ('t_pppragma_ID', 'ID')])], 'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P\\.\\.\\.)|(?P\\+\\+)|(?P\\|\\|)|(?P\\^=)|(?P\\|=)|(?P<<=)|(?P>>=)|(?P\\+=)|(?P\\*=)|(?P\\+)|(?P%=)|(?P/=)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, None, None, None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, None, None, None, None, (None, 'ELLIPSIS'), (None, 'PLUSPLUS'), (None, 'LOR'), (None, 'XOREQUAL'), (None, 'OREQUAL'), (None, 'LSHIFTEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'PLUSEQUAL'), (None, 'TIMESEQUAL'), (None, 'PLUS'), (None, 'MODEQUAL'), (None, 'DIVEQUAL')]), ('(?P\\])|(?P\\?)|(?P\\^)|(?P<<)|(?P<=)|(?P\\()|(?P->)|(?P==)|(?P!=)|(?P--)|(?P\\|)|(?P\\*)|(?P\\[)|(?P>=)|(?P\\))|(?P&&)|(?P>>)|(?P-=)|(?P\\.)|(?P&=)|(?P=)|(?P<)|(?P,)|(?P/)|(?P&)|(?P%)|(?P;)|(?P-)|(?P>)|(?P:)|(?P~)|(?P!)', [None, (None, 'RBRACKET'), (None, 'CONDOP'), (None, 'XOR'), (None, 'LSHIFT'), (None, 'LE'), (None, 'LPAREN'), (None, 'ARROW'), (None, 'EQ'), (None, 'NE'), (None, 'MINUSMINUS'), (None, 'OR'), (None, 'TIMES'), (None, 'LBRACKET'), (None, 'GE'), (None, 'RPAREN'), (None, 'LAND'), (None, 'RSHIFT'), (None, 'MINUSEQUAL'), (None, 'PERIOD'), (None, 'ANDEQUAL'), (None, 'EQUALS'), (None, 'LT'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'AND'), (None, 'MOD'), (None, 'SEMI'), (None, 'MINUS'), (None, 'GT'), (None, 'COLON'), (None, 'NOT'), (None, 'LNOT')])]} -_lexstateignore = {'ppline': ' \t', 'pppragma': ' \t<>.-{}();=+-*/$%@&^~!?:,0123456789', 'INITIAL': ' \t'} -_lexstateerrorf = {'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error', 'INITIAL': 't_error'} +_lexstateinfo = {'INITIAL': 'inclusive', 'ppline': 'exclusive', 'pppragma': 'exclusive'} +_lexstatere = {'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-9])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-9])([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P\\.\\.\\.)|(?P\\|\\|)|(?P\\+\\+)|(?P<<=)|(?P\\|=)|(?P\\+=)|(?P>>=)|(?P\\*=)|(?P\\^=)|(?P&=)|(?P->)|(?P\\?)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, (None, 'ELLIPSIS'), (None, 'LOR'), (None, 'PLUSPLUS'), (None, 'LSHIFTEQUAL'), (None, 'OREQUAL'), (None, 'PLUSEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'TIMESEQUAL'), (None, 'XOREQUAL'), (None, 'ANDEQUAL'), (None, 'ARROW'), (None, 'CONDOP')]), ('(?P/=)|(?P==)|(?P>=)|(?P&&)|(?P\\[)|(?P<=)|(?P\\()|(?P<<)|(?P-=)|(?P--)|(?P%=)|(?P!=)|(?P\\|)|(?P\\.)|(?P\\+)|(?P\\])|(?P\\))|(?P>>)|(?P\\*)|(?P\\^)|(?P&)|(?P:)|(?P,)|(?P/)|(?P=)|(?P>)|(?P!)|(?P<)|(?P-)|(?P%)|(?P~)|(?P;)', [None, (None, 'DIVEQUAL'), (None, 'EQ'), (None, 'GE'), (None, 'LAND'), (None, 'LBRACKET'), (None, 'LE'), (None, 'LPAREN'), (None, 'LSHIFT'), (None, 'MINUSEQUAL'), (None, 'MINUSMINUS'), (None, 'MODEQUAL'), (None, 'NE'), (None, 'OR'), (None, 'PERIOD'), (None, 'PLUS'), (None, 'RBRACKET'), (None, 'RPAREN'), (None, 'RSHIFT'), (None, 'TIMES'), (None, 'XOR'), (None, 'AND'), (None, 'COLON'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'EQUALS'), (None, 'GT'), (None, 'LNOT'), (None, 'LT'), (None, 'MINUS'), (None, 'MOD'), (None, 'NOT'), (None, 'SEMI')])], 'ppline': [('(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P.+)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR')])]} +_lexstateignore = {'INITIAL': ' \t', 'ppline': ' \t', 'pppragma': ' \t'} +_lexstateerrorf = {'INITIAL': 't_error', 'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error'} +_lexstateeoff = {} diff --git a/lib_pypy/cffi/_pycparser/yacctab.py b/lib_pypy/cffi/_pycparser/yacctab.py --- a/lib_pypy/cffi/_pycparser/yacctab.py +++ b/lib_pypy/cffi/_pycparser/yacctab.py @@ -1,292 +1,338 @@ # yacctab.py # This file is automatically generated. Do not edit. -_tabversion = '3.2' +_tabversion = '3.10' _lr_method = 'LALR' -_lr_signature = '\x11\x82\x05\xfb:\x10\xfeo5\xb4\x11N\xe7S\xb4b' +_lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMOD_BOOL _COMPLEX AUTO BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM EXTERN FLOAT FOR GOTO IF INLINE INT LONG REGISTER OFFSETOF RESTRICT RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH TYPEDEF UNION UNSIGNED VOID VOLATILE WHILE __INT128 ID TYPEID INT_CONST_DEC INT_CONST_OCT INT_CONST_HEX INT_CONST_BIN FLOAT_CONST HEX_FLOAT_CONST CHAR_CONST WCHAR_CONST STRING_LITERAL WSTRING_LITERAL PLUS MINUS TIMES DIVIDE MOD OR AND NOT XOR LSHIFT RSHIFT LOR LAND LNOT LT LE GT GE EQ NE EQUALS TIMESEQUAL DIVEQUAL MODEQUAL PLUSEQUAL MINUSEQUAL LSHIFTEQUAL RSHIFTEQUAL ANDEQUAL XOREQUAL OREQUAL PLUSPLUS MINUSMINUS ARROW CONDOP LPAREN RPAREN LBRACKET RBRACKET LBRACE RBRACE COMMA PERIOD SEMI COLON ELLIPSIS PPHASH PPPRAGMA PPPRAGMASTRabstract_declarator_opt : empty\n| abstract_declaratorassignment_expression_opt : empty\n| assignment_expressionblock_item_list_opt : empty\n| block_item_listdeclaration_list_opt : empty\n| declaration_listdeclaration_specifiers_no_type_opt : empty\n| declaration_specifiers_no_typedesignation_opt : empty\n| designationexpression_opt : empty\n| expressionid_init_declarator_list_opt : empty\n| id_init_declarator_listidentifier_list_opt : empty\n| identifier_listinit_declarator_list_opt : empty\n| init_declarator_listinitializer_list_opt : empty\n| initializer_listparameter_type_list_opt : empty\n| parameter_type_liststruct_declarator_list_opt : empty\n| struct_declarator_listtype_qualifier_list_opt : empty\n| type_qualifier_list direct_id_declarator : ID\n direct_id_declarator : LPAREN id_declarator RPAREN\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_id_declarator : direct_id_declarator LPAREN parameter_type_list RPAREN\n | direct_id_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_declarator : TYPEID\n direct_typeid_declarator : LPAREN typeid_declarator RPAREN\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_noparen_declarator : TYPEID\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN\n id_declarator : direct_id_declarator\n id_declarator : pointer direct_id_declarator\n typeid_declarator : direct_typeid_declarator\n typeid_declarator : pointer direct_typeid_declarator\n typeid_noparen_declarator : direct_typeid_noparen_declarator\n typeid_noparen_declarator : pointer direct_typeid_noparen_declarator\n translation_unit_or_empty : translation_unit\n | empty\n translation_unit : external_declaration\n translation_unit : translation_unit external_declaration\n external_declaration : function_definition\n external_declaration : declaration\n external_declaration : pp_directive\n | pppragma_directive\n external_declaration : SEMI\n pp_directive : PPHASH\n pppragma_directive : PPPRAGMA\n | PPPRAGMA PPPRAGMASTR\n function_definition : id_declarator declaration_list_opt compound_statement\n function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement\n statement : labeled_statement\n | expression_statement\n | compound_statement\n | selection_statement\n | iteration_statement\n | jump_statement\n | pppragma_directive\n pragmacomp_or_statement : pppragma_directive statement\n | statement\n decl_body : declaration_specifiers init_declarator_list_opt\n | declaration_specifiers_no_type id_init_declarator_list_opt\n declaration : decl_body SEMI\n declaration_list : declaration\n | declaration_list declaration\n declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt\n declaration_specifiers : declaration_specifiers type_qualifier\n declaration_specifiers : declaration_specifiers storage_class_specifier\n declaration_specifiers : declaration_specifiers function_specifier\n declaration_specifiers : declaration_specifiers type_specifier_no_typeid\n declaration_specifiers : type_specifier\n declaration_specifiers : declaration_specifiers_no_type type_specifier\n storage_class_specifier : AUTO\n | REGISTER\n | STATIC\n | EXTERN\n | TYPEDEF\n function_specifier : INLINE\n type_specifier_no_typeid : VOID\n | _BOOL\n | CHAR\n | SHORT\n | INT\n | LONG\n | FLOAT\n | DOUBLE\n | _COMPLEX\n | SIGNED\n | UNSIGNED\n | __INT128\n type_specifier : typedef_name\n | enum_specifier\n | struct_or_union_specifier\n | type_specifier_no_typeid\n type_qualifier : CONST\n | RESTRICT\n | VOLATILE\n init_declarator_list : init_declarator\n | init_declarator_list COMMA init_declarator\n init_declarator : declarator\n | declarator EQUALS initializer\n id_init_declarator_list : id_init_declarator\n | id_init_declarator_list COMMA init_declarator\n id_init_declarator : id_declarator\n | id_declarator EQUALS initializer\n specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid\n specifier_qualifier_list : specifier_qualifier_list type_qualifier\n specifier_qualifier_list : type_specifier\n specifier_qualifier_list : type_qualifier_list type_specifier\n struct_or_union_specifier : struct_or_union ID\n | struct_or_union TYPEID\n struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close\n | struct_or_union brace_open brace_close\n struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close\n | struct_or_union ID brace_open brace_close\n | struct_or_union TYPEID brace_open struct_declaration_list brace_close\n | struct_or_union TYPEID brace_open brace_close\n struct_or_union : STRUCT\n | UNION\n struct_declaration_list : struct_declaration\n | struct_declaration_list struct_declaration\n struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI\n struct_declaration : SEMI\n struct_declaration : pppragma_directive\n struct_declarator_list : struct_declarator\n | struct_declarator_list COMMA struct_declarator\n struct_declarator : declarator\n struct_declarator : declarator COLON constant_expression\n | COLON constant_expression\n enum_specifier : ENUM ID\n | ENUM TYPEID\n enum_specifier : ENUM brace_open enumerator_list brace_close\n enum_specifier : ENUM ID brace_open enumerator_list brace_close\n | ENUM TYPEID brace_open enumerator_list brace_close\n enumerator_list : enumerator\n | enumerator_list COMMA\n | enumerator_list COMMA enumerator\n enumerator : ID\n | ID EQUALS constant_expression\n declarator : id_declarator\n | typeid_declarator\n pointer : TIMES type_qualifier_list_opt\n | TIMES type_qualifier_list_opt pointer\n type_qualifier_list : type_qualifier\n | type_qualifier_list type_qualifier\n parameter_type_list : parameter_list\n | parameter_list COMMA ELLIPSIS\n parameter_list : parameter_declaration\n | parameter_list COMMA parameter_declaration\n parameter_declaration : declaration_specifiers id_declarator\n | declaration_specifiers typeid_noparen_declarator\n parameter_declaration : declaration_specifiers abstract_declarator_opt\n identifier_list : identifier\n | identifier_list COMMA identifier\n initializer : assignment_expression\n initializer : brace_open initializer_list_opt brace_close\n | brace_open initializer_list COMMA brace_close\n initializer_list : designation_opt initializer\n | initializer_list COMMA designation_opt initializer\n designation : designator_list EQUALS\n designator_list : designator\n | designator_list designator\n designator : LBRACKET constant_expression RBRACKET\n | PERIOD identifier\n type_name : specifier_qualifier_list abstract_declarator_opt\n abstract_declarator : pointer\n abstract_declarator : pointer direct_abstract_declarator\n abstract_declarator : direct_abstract_declarator\n direct_abstract_declarator : LPAREN abstract_declarator RPAREN direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET\n direct_abstract_declarator : LBRACKET TIMES RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN\n direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN\n block_item : declaration\n | statement\n block_item_list : block_item\n | block_item_list block_item\n compound_statement : brace_open block_item_list_opt brace_close labeled_statement : ID COLON pragmacomp_or_statement labeled_statement : CASE constant_expression COLON pragmacomp_or_statement labeled_statement : DEFAULT COLON pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement jump_statement : GOTO ID SEMI jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI\n | RETURN SEMI\n expression_statement : expression_opt SEMI expression : assignment_expression\n | expression COMMA assignment_expression\n typedef_name : TYPEID assignment_expression : conditional_expression\n | unary_expression assignment_operator assignment_expression\n assignment_operator : EQUALS\n | XOREQUAL\n | TIMESEQUAL\n | DIVEQUAL\n | MODEQUAL\n | PLUSEQUAL\n | MINUSEQUAL\n | LSHIFTEQUAL\n | RSHIFTEQUAL\n | ANDEQUAL\n | OREQUAL\n constant_expression : conditional_expression conditional_expression : binary_expression\n | binary_expression CONDOP expression COLON conditional_expression\n binary_expression : cast_expression\n | binary_expression TIMES binary_expression\n | binary_expression DIVIDE binary_expression\n | binary_expression MOD binary_expression\n | binary_expression PLUS binary_expression\n | binary_expression MINUS binary_expression\n | binary_expression RSHIFT binary_expression\n | binary_expression LSHIFT binary_expression\n | binary_expression LT binary_expression\n | binary_expression LE binary_expression\n | binary_expression GE binary_expression\n | binary_expression GT binary_expression\n | binary_expression EQ binary_expression\n | binary_expression NE binary_expression\n | binary_expression AND binary_expression\n | binary_expression OR binary_expression\n | binary_expression XOR binary_expression\n | binary_expression LAND binary_expression\n | binary_expression LOR binary_expression\n cast_expression : unary_expression cast_expression : LPAREN type_name RPAREN cast_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression\n | MINUSMINUS unary_expression\n | unary_operator cast_expression\n unary_expression : SIZEOF unary_expression\n | SIZEOF LPAREN type_name RPAREN\n unary_operator : AND\n | TIMES\n | PLUS\n | MINUS\n | NOT\n | LNOT\n postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN\n | postfix_expression LPAREN RPAREN\n postfix_expression : postfix_expression PERIOD ID\n | postfix_expression PERIOD TYPEID\n | postfix_expression ARROW ID\n | postfix_expression ARROW TYPEID\n postfix_expression : postfix_expression PLUSPLUS\n | postfix_expression MINUSMINUS\n postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close\n | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close\n primary_expression : identifier primary_expression : constant primary_expression : unified_string_literal\n | unified_wstring_literal\n primary_expression : LPAREN expression RPAREN primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN\n offsetof_member_designator : identifier\n | offsetof_member_designator PERIOD identifier\n | offsetof_member_designator LBRACKET expression RBRACKET\n argument_expression_list : assignment_expression\n | argument_expression_list COMMA assignment_expression\n identifier : ID constant : INT_CONST_DEC\n | INT_CONST_OCT\n | INT_CONST_HEX\n | INT_CONST_BIN\n constant : FLOAT_CONST\n | HEX_FLOAT_CONST\n constant : CHAR_CONST\n | WCHAR_CONST\n unified_string_literal : STRING_LITERAL\n | unified_string_literal STRING_LITERAL\n unified_wstring_literal : WSTRING_LITERAL\n | unified_wstring_literal WSTRING_LITERAL\n brace_open : LBRACE\n brace_close : RBRACE\n empty : ' -_lr_action_items = {'VOID':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[6,6,-63,-74,-73,-60,-56,-57,-35,-31,-61,6,-36,-55,-70,-65,-54,6,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,6,-69,6,-72,-76,6,-59,-86,-261,-85,6,-113,-112,-32,-102,-101,6,6,6,-47,-48,6,-115,6,6,6,6,-92,6,6,6,6,-38,6,-49,6,6,-87,-93,-262,-103,-121,-120,6,6,6,6,6,-39,-41,-44,-40,-42,6,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,6,-175,-174,6,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LBRACKET':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,30,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,60,62,63,67,68,69,70,74,78,81,83,84,86,90,94,96,97,110,112,115,116,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,153,155,166,167,174,176,177,178,179,180,191,197,198,218,221,222,224,228,235,239,262,267,269,270,300,302,303,310,311,314,315,323,324,325,326,329,334,338,339,360,362,364,366,367,368,388,389,391,392,399,401,428,429,430,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,65,-68,-263,-71,72,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,65,-102,-101,-28,-122,-124,-27,72,72,164,-50,-53,72,-115,-263,-263,72,72,-248,-125,-123,-252,-243,-255,-259,-256,-253,-241,-242,226,-251,-228,-257,-249,-240,-254,-250,164,264,72,72,-87,-262,-23,-84,-24,-83,-103,-121,-120,-260,-258,-237,-236,-150,-152,72,-140,264,-154,-148,-248,-89,-88,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,72,72,-143,264,-141,-149,-151,-153,-118,-117,-229,-230,264,-142,-245,264,-238,-239,]),'WCHAR_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,124,124,-47,124,-28,-263,-125,-227,124,-225,124,-224,124,-223,124,124,-222,-226,-263,-223,124,124,124,-262,124,124,-223,124,124,-184,-187,-185,-181,-182,-186,-188,124,-190,-191,-183,-189,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,-12,124,124,-11,-223,-41,-44,-40,124,-42,124,124,-156,-155,-45,-157,124,-43,124,124,124,-263,-139,-175,-174,124,-172,124,124,-158,124,-171,-159,124,124,124,124,-263,124,124,-11,-170,-173,124,-162,124,-160,124,124,-161,124,124,124,-263,124,-166,-165,-163,124,124,124,-167,-164,124,-169,-168,]),'FLOAT_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,125,125,-47,125,-28,-263,-125,-227,125,-225,125,-224,125,-223,125,125,-222,-226,-263,-223,125,125,125,-262,125,125,-223,125,125,-184,-187,-185,-181,-182,-186,-188,125,-190,-191,-183,-189,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,-12,125,125,-11,-223,-41,-44,-40,125,-42,125,125,-156,-155,-45,-157,125,-43,125,125,125,-263,-139,-175,-174,125,-172,125,125,-158,125,-171,-159,125,125,125,125,-263,125,125,-11,-170,-173,125,-162,125,-160,125,125,-161,125,125,125,-263,125,-166,-165,-163,125,125,125,-167,-164,125,-169,-168,]),'MINUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,128,128,-47,128,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,128,-225,-242,-216,-195,128,-224,128,-251,-223,-228,128,128,-257,-222,-249,-240,244,-254,-250,-226,-263,-223,128,128,128,-262,128,128,-223,128,128,-184,-187,-185,-181,-182,-186,-188,128,-190,-191,-183,-189,-260,128,-220,-258,-237,-236,128,128,128,-214,-219,128,-217,-218,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,-12,128,128,-11,-223,-41,-44,-40,128,-42,128,128,-156,-155,-45,-157,128,-43,-248,128,-235,-234,-233,-232,-231,-244,128,128,244,244,244,-200,244,244,244,-199,244,244,-197,-196,244,244,244,244,244,-198,-263,-139,-175,-174,128,-172,128,128,-158,128,-171,-159,128,128,-221,-229,-230,128,128,-215,-263,128,128,-11,-170,-173,128,-162,128,-160,128,128,-161,128,128,128,-245,-263,-238,128,-166,-165,-163,-239,128,128,128,-167,-164,128,-169,-168,]),'RPAREN':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,53,54,56,58,59,60,62,63,66,67,68,69,70,74,78,81,83,84,90,94,96,106,107,108,109,110,111,112,113,114,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,158,159,160,161,165,166,167,174,176,177,178,179,180,191,197,198,199,200,201,202,218,220,221,222,224,227,228,231,232,234,235,236,237,238,239,240,269,270,275,285,302,303,310,311,314,315,318,319,320,321,322,323,324,325,326,328,329,330,332,333,334,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,366,367,368,378,388,389,390,391,392,397,398,410,412,415,416,417,419,428,430,432,435,437,438,439,442,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-263,-71,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,90,-86,-85,-51,-113,-112,-102,-101,-263,-28,-122,-124,-27,-145,-263,-147,-50,-53,-115,-263,-263,197,-15,198,-128,-263,-16,-248,-126,-132,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-21,-22,269,270,-263,-145,-263,-87,-262,-23,-84,-24,-83,-103,-121,-120,-131,-1,-2,-130,-260,-220,-258,-237,-236,329,-150,-214,-219,-217,-152,334,336,-176,-263,-218,-154,-148,368,-14,-89,-88,-105,-104,-116,-119,-133,-127,-129,-180,390,-235,-234,-233,-232,-246,-231,392,395,396,-244,-144,-263,-145,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-149,-151,-153,-13,-118,-117,-221,-229,-230,-177,-215,423,425,427,-247,428,-194,-245,-238,-263,440,-239,-263,443,446,]),'LONG':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[19,19,-63,-74,-73,-60,-56,-57,-35,-31,-61,19,-36,-55,-70,-65,-54,19,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,19,-69,19,-72,-76,19,-59,-86,-261,-85,19,-113,-112,-32,-102,-101,19,19,19,-47,-48,19,-115,19,19,19,19,-92,19,19,19,19,-38,19,-49,19,19,-87,-93,-262,-103,-121,-120,19,19,19,19,19,-39,-41,-44,-40,-42,19,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,19,-175,-174,19,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PLUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,135,135,-47,135,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,135,-225,-242,-216,-195,135,-224,135,-251,-223,-228,135,135,-257,-222,-249,-240,248,-254,-250,-226,-263,-223,135,135,135,-262,135,135,-223,135,135,-184,-187,-185,-181,-182,-186,-188,135,-190,-191,-183,-189,-260,135,-220,-258,-237,-236,135,135,135,-214,-219,135,-217,-218,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,-12,135,135,-11,-223,-41,-44,-40,135,-42,135,135,-156,-155,-45,-157,135,-43,-248,135,-235,-234,-233,-232,-231,-244,135,135,248,248,248,-200,248,248,248,-199,248,248,-197,-196,248,248,248,248,248,-198,-263,-139,-175,-174,135,-172,135,135,-158,135,-171,-159,135,135,-221,-229,-230,135,135,-215,-263,135,135,-11,-170,-173,135,-162,135,-160,135,135,-161,135,135,135,-245,-263,-238,135,-166,-165,-163,-239,135,135,135,-167,-164,135,-169,-168,]),'ELLIPSIS':([204,],[319,]),'GT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,249,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,249,-202,-200,-204,249,-203,-199,-206,249,-197,-196,-205,249,249,249,249,-198,-221,-229,-230,-215,-245,-238,-239,]),'GOTO':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,278,-262,-41,-44,-40,-42,278,-156,-155,-45,-157,278,-43,-175,-174,-172,278,-158,-171,-159,278,-170,-173,-162,278,-160,278,-161,278,278,-166,-165,-163,278,278,-167,-164,278,-169,-168,]),'ENUM':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[24,24,-63,-74,-73,-60,-56,-57,-35,-31,-61,24,-36,-55,-70,-65,-54,24,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,24,-69,24,-72,-76,24,-59,-86,-261,-85,24,-113,-112,-32,-102,-101,24,24,24,-47,-48,24,-115,24,24,24,24,-92,24,24,24,24,-38,24,-49,24,24,-87,-93,-262,-103,-121,-120,24,24,24,24,24,-39,-41,-44,-40,-42,24,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,24,-175,-174,24,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PERIOD':([55,112,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,155,176,218,221,222,224,262,267,300,323,324,325,326,329,334,360,362,364,391,392,399,401,428,429,430,437,],[-261,-248,-252,-243,-255,-259,-256,-253,-241,-242,225,-251,-228,-257,-249,-240,-254,-250,263,-262,-260,-258,-237,-236,-140,263,-248,-235,-234,-233,-232,-231,-244,-143,263,-141,-229,-230,263,-142,-245,263,-238,-239,]),'GE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,253,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,253,-202,-200,-204,253,-203,-199,-206,253,-197,-196,-205,253,253,253,253,-198,-221,-229,-230,-215,-245,-238,-239,]),'INT_CONST_DEC':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,145,145,-47,145,-28,-263,-125,-227,145,-225,145,-224,145,-223,145,145,-222,-226,-263,-223,145,145,145,-262,145,145,-223,145,145,-184,-187,-185,-181,-182,-186,-188,145,-190,-191,-183,-189,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,-12,145,145,-11,-223,-41,-44,-40,145,-42,145,145,-156,-155,-45,-157,145,-43,145,145,145,-263,-139,-175,-174,145,-172,145,145,-158,145,-171,-159,145,145,145,145,-263,145,145,-11,-170,-173,145,-162,145,-160,145,145,-161,145,145,145,-263,145,-166,-165,-163,145,145,145,-167,-164,145,-169,-168,]),'ARROW':([112,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,221,222,224,300,323,324,325,326,329,334,391,392,428,430,437,],[-248,-252,-243,-255,-259,-256,-253,-241,-242,223,-251,-228,-257,-249,-240,-254,-250,-262,-260,-258,-237,-236,-248,-235,-234,-233,-232,-231,-244,-229,-230,-245,-238,-239,]),'HEX_FLOAT_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,148,148,-47,148,-28,-263,-125,-227,148,-225,148,-224,148,-223,148,148,-222,-226,-263,-223,148,148,148,-262,148,148,-223,148,148,-184,-187,-185,-181,-182,-186,-188,148,-190,-191,-183,-189,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,-12,148,148,-11,-223,-41,-44,-40,148,-42,148,148,-156,-155,-45,-157,148,-43,148,148,148,-263,-139,-175,-174,148,-172,148,148,-158,148,-171,-159,148,148,148,148,-263,148,148,-11,-170,-173,148,-162,148,-160,148,148,-161,148,148,148,-263,148,-166,-165,-163,148,148,148,-167,-164,148,-169,-168,]),'DOUBLE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[40,40,-63,-74,-73,-60,-56,-57,-35,-31,-61,40,-36,-55,-70,-65,-54,40,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,40,-69,40,-72,-76,40,-59,-86,-261,-85,40,-113,-112,-32,-102,-101,40,40,40,-47,-48,40,-115,40,40,40,40,-92,40,40,40,40,-38,40,-49,40,40,-87,-93,-262,-103,-121,-120,40,40,40,40,40,-39,-41,-44,-40,-42,40,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,40,-175,-174,40,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'MINUSEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,207,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'INT_CONST_OCT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,149,149,-47,149,-28,-263,-125,-227,149,-225,149,-224,149,-223,149,149,-222,-226,-263,-223,149,149,149,-262,149,149,-223,149,149,-184,-187,-185,-181,-182,-186,-188,149,-190,-191,-183,-189,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,-12,149,149,-11,-223,-41,-44,-40,149,-42,149,149,-156,-155,-45,-157,149,-43,149,149,149,-263,-139,-175,-174,149,-172,149,149,-158,149,-171,-159,149,149,149,149,-263,149,149,-11,-170,-173,149,-162,149,-160,149,149,-161,149,149,149,-263,149,-166,-165,-163,149,149,149,-167,-164,149,-169,-168,]),'TIMESEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,216,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'OR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,258,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,258,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,258,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'SHORT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[2,2,-63,-74,-73,-60,-56,-57,-35,-31,-61,2,-36,-55,-70,-65,-54,2,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,2,-69,2,-72,-76,2,-59,-86,-261,-85,2,-113,-112,-32,-102,-101,2,2,2,-47,-48,2,-115,2,2,2,2,-92,2,2,2,2,-38,2,-49,2,2,-87,-93,-262,-103,-121,-120,2,2,2,2,2,-39,-41,-44,-40,-42,2,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,2,-175,-174,2,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'RETURN':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,281,-262,-41,-44,-40,-42,281,-156,-155,-45,-157,281,-43,-175,-174,-172,281,-158,-171,-159,281,-170,-173,-162,281,-160,281,-161,281,281,-166,-165,-163,281,281,-167,-164,281,-169,-168,]),'RSHIFTEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,217,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'RESTRICT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[32,32,-63,-74,-73,-60,-56,-57,-35,-31,-61,32,-36,-55,-70,-65,-54,32,-58,-178,-111,-68,32,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,32,-69,32,-72,-76,32,-59,-86,-261,-85,32,-113,-112,-32,-102,-101,32,32,32,-124,32,32,-47,-48,32,-115,32,32,32,32,-92,32,32,32,-125,32,32,32,-38,32,-49,32,32,-87,-93,-262,-103,-121,-120,32,32,32,32,32,-39,-41,-44,-40,-42,32,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,32,-175,-174,32,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'STATIC':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,65,66,69,78,80,82,87,89,90,104,115,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[9,9,-63,-74,-73,-60,-56,-57,-35,-31,-61,9,-36,-55,-70,-65,-54,9,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,9,-69,9,-72,-76,9,-59,-86,-261,-85,-113,-112,-32,-102,-101,105,9,-124,9,9,-47,-48,9,-115,195,-125,9,9,-38,9,-49,-87,-262,-103,-121,-120,9,-39,-41,-44,-40,-42,9,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,9,-175,-174,9,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'SIZEOF':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,127,127,-47,127,-28,-263,-125,-227,127,-225,127,-224,127,-223,127,127,-222,-226,-263,-223,127,127,127,-262,127,127,-223,127,127,-184,-187,-185,-181,-182,-186,-188,127,-190,-191,-183,-189,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,-12,127,127,-11,-223,-41,-44,-40,127,-42,127,127,-156,-155,-45,-157,127,-43,127,127,127,-263,-139,-175,-174,127,-172,127,127,-158,127,-171,-159,127,127,127,127,-263,127,127,-11,-170,-173,127,-162,127,-160,127,127,-161,127,127,127,-263,127,-166,-165,-163,127,127,127,-167,-164,127,-169,-168,]),'UNSIGNED':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[18,18,-63,-74,-73,-60,-56,-57,-35,-31,-61,18,-36,-55,-70,-65,-54,18,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,18,-69,18,-72,-76,18,-59,-86,-261,-85,18,-113,-112,-32,-102,-101,18,18,18,-47,-48,18,-115,18,18,18,18,-92,18,18,18,18,-38,18,-49,18,18,-87,-93,-262,-103,-121,-120,18,18,18,18,18,-39,-41,-44,-40,-42,18,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,18,-175,-174,18,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'UNION':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[20,20,-63,-74,-73,-60,-56,-57,-35,-31,-61,20,-36,-55,-70,-65,-54,20,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,20,-69,20,-72,-76,20,-59,-86,-261,-85,20,-113,-112,-32,-102,-101,20,20,20,-47,-48,20,-115,20,20,20,20,-92,20,20,20,20,-38,20,-49,20,20,-87,-93,-262,-103,-121,-120,20,20,20,20,20,-39,-41,-44,-40,-42,20,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,20,-175,-174,20,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'COLON':([2,3,5,6,13,18,19,25,26,27,29,32,33,35,37,39,40,43,45,46,54,56,59,60,62,63,90,94,96,97,112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,174,176,177,178,179,180,187,191,197,198,218,220,221,222,224,231,232,234,238,240,286,300,302,303,305,306,310,311,314,315,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,377,388,389,390,391,392,397,398,419,428,430,437,],[-63,-74,-73,-60,-61,-70,-65,-178,-111,-68,-71,-75,-114,-66,-62,-64,-67,-69,-72,-76,-86,-85,-113,-112,-102,-101,-115,-263,-263,181,-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-87,-262,-23,-84,-24,-83,309,-103,-121,-120,-260,-220,-258,-237,-236,-214,-219,-217,-176,-218,375,384,-89,-88,-192,181,-105,-104,-116,-119,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,400,-210,-198,411,-118,-117,-221,-229,-230,-177,-215,-194,-245,-238,-239,]),'$end':([0,8,11,12,15,22,31,36,38,47,61,82,169,176,272,383,],[-263,0,-35,-31,-36,-29,-34,-33,-37,-30,-32,-47,-38,-262,-39,-159,]),'WSTRING_LITERAL':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,121,123,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,123,123,-47,123,-28,-263,-125,-227,218,-259,123,-225,123,-224,123,-223,123,123,-222,-226,-263,-223,123,123,123,-262,123,123,-223,123,123,-184,-187,-185,-181,-182,-186,-188,123,-190,-191,-183,-189,-260,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,-12,123,123,-11,-223,-41,-44,-40,123,-42,123,123,-156,-155,-45,-157,123,-43,123,123,123,-263,-139,-175,-174,123,-172,123,123,-158,123,-171,-159,123,123,123,123,-263,123,123,-11,-170,-173,123,-162,123,-160,123,123,-161,123,123,123,-263,123,-166,-165,-163,123,123,123,-167,-164,123,-169,-168,]),'DIVIDE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,251,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,251,251,251,251,251,251,251,251,251,251,-197,-196,251,251,251,251,251,-198,-221,-229,-230,-215,-245,-238,-239,]),'FOR':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,283,-262,-41,-44,-40,-42,283,-156,-155,-45,-157,283,-43,-175,-174,-172,283,-158,-171,-159,283,-170,-173,-162,283,-160,283,-161,283,283,-166,-165,-163,283,283,-167,-164,283,-169,-168,]),'PLUSPLUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,121,122,123,124,125,126,127,128,129,130,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,391,392,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,137,137,-47,137,-28,-263,-248,-125,-252,-227,-243,-255,-259,-256,-253,-241,137,-225,-242,224,137,-224,137,-251,-223,-228,137,137,-257,-222,-249,-240,-254,-250,-226,-263,-223,137,137,137,-262,137,137,-223,137,137,-184,-187,-185,-181,-182,-186,-188,137,-190,-191,-183,-189,-260,137,-258,-237,-236,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,-12,137,137,-11,-223,-41,-44,-40,137,-42,137,137,-156,-155,-45,-157,137,-43,-248,137,-235,-234,-233,-232,-231,-244,137,137,-263,-139,-175,-174,137,-172,137,137,-158,137,-171,-159,137,137,-229,-230,137,137,-263,137,137,-11,-170,-173,137,-162,137,-160,137,137,-161,137,137,137,-245,-263,-238,137,-166,-165,-163,-239,137,137,137,-167,-164,137,-169,-168,]),'EQUALS':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,29,30,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,56,58,59,60,62,63,80,83,84,86,90,102,112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,168,174,176,191,197,198,218,220,221,222,224,231,232,234,240,262,267,300,302,303,310,311,314,315,323,324,325,326,329,334,360,364,388,389,390,391,392,398,401,428,430,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-71,77,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-85,-51,-113,-112,-102,-101,162,-50,-53,77,-115,192,-248,-252,209,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,162,-87,-262,-103,-121,-120,-260,-220,-258,-237,-236,-214,-219,-217,-218,-140,365,-248,-89,-88,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,-143,-141,-118,-117,-221,-229,-230,-215,-142,-245,-238,-239,]),'ELSE':([176,276,277,280,282,293,298,370,371,374,381,383,405,406,409,414,424,433,434,436,444,445,447,448,],[-262,-41,-44,-40,-42,-45,-43,-175,-174,-172,-171,-159,-170,-173,-162,-160,-161,-166,-165,441,-167,-164,-169,-168,]),'ANDEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,214,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'EQ':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,255,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,255,-202,-200,-204,-208,-203,-199,-206,255,-197,-196,-205,255,-207,255,255,-198,-221,-229,-230,-215,-245,-238,-239,]),'AND':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,144,144,-47,144,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,144,-225,-242,-216,-195,144,-224,144,-251,-223,-228,144,144,-257,-222,-249,-240,256,-254,-250,-226,-263,-223,144,144,144,-262,144,144,-223,144,144,-184,-187,-185,-181,-182,-186,-188,144,-190,-191,-183,-189,-260,144,-220,-258,-237,-236,144,144,144,-214,-219,144,-217,-218,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,-12,144,144,-11,-223,-41,-44,-40,144,-42,144,144,-156,-155,-45,-157,144,-43,-248,144,-235,-234,-233,-232,-231,-244,144,144,-201,256,-202,-200,-204,-208,-203,-199,-206,256,-197,-196,-205,256,-207,-209,256,-198,-263,-139,-175,-174,144,-172,144,144,-158,144,-171,-159,144,144,-221,-229,-230,144,144,-215,-263,144,144,-11,-170,-173,144,-162,144,-160,144,144,-161,144,144,144,-245,-263,-238,144,-166,-165,-163,-239,144,144,144,-167,-164,144,-169,-168,]),'TYPEID':([0,1,2,3,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,67,68,69,70,74,78,80,82,87,89,90,91,92,93,94,95,96,115,116,141,165,166,167,169,170,171,172,173,174,175,176,191,197,198,204,219,223,225,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[25,25,-63,-74,-73,-60,54,-56,-57,-35,-31,-61,25,-36,59,-55,-70,-65,-91,-54,25,-58,62,-178,-111,-68,-263,-71,-34,-75,-114,-90,-66,-33,-62,-37,-64,-67,25,-69,25,-72,-76,25,-59,-86,-261,-85,25,-113,-112,-32,-102,-101,25,-28,-122,-124,-27,59,25,25,-47,-48,25,-115,25,25,25,25,-92,25,-125,-123,25,25,59,25,-38,25,-49,25,25,-87,-93,-262,-103,-121,-120,25,25,323,325,25,25,25,-39,-41,-44,-40,-42,25,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,25,-175,-174,25,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LBRACE':([7,20,24,26,33,34,48,54,55,56,59,60,62,63,77,80,82,85,87,88,89,90,155,162,163,170,171,176,197,198,260,266,268,276,277,280,282,289,291,292,293,295,297,298,314,315,336,362,365,370,371,374,375,379,381,383,384,388,389,390,395,396,399,402,403,405,406,409,411,414,423,424,425,427,429,433,434,436,441,443,444,445,446,447,448,],[55,-91,55,-111,-114,-90,-263,55,-261,55,-113,-112,55,55,55,-263,-47,-7,-48,55,-8,-115,-263,55,55,55,-49,-262,-121,-120,-12,55,-11,-41,-44,-40,-42,55,-156,-155,-45,-157,55,-43,-116,-119,55,-263,-139,-175,-174,-172,55,-158,-171,-159,55,-118,-117,55,55,55,-263,55,-11,-170,-173,-162,55,-160,55,-161,55,55,-263,-166,-165,-163,55,55,-167,-164,55,-169,-168,]),'PPHASH':([0,11,12,15,22,31,36,38,61,82,169,176,272,383,],[38,-35,-31,-36,38,-34,-33,-37,-32,-47,-38,-262,-39,-159,]),'INT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[39,39,-63,-74,-73,-60,-56,-57,-35,-31,-61,39,-36,-55,-70,-65,-54,39,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,39,-69,39,-72,-76,39,-59,-86,-261,-85,39,-113,-112,-32,-102,-101,39,39,39,-47,-48,39,-115,39,39,39,39,-92,39,39,39,39,-38,39,-49,39,39,-87,-93,-262,-103,-121,-120,39,39,39,39,39,-39,-41,-44,-40,-42,39,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,39,-175,-174,39,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'SIGNED':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[43,43,-63,-74,-73,-60,-56,-57,-35,-31,-61,43,-36,-55,-70,-65,-54,43,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,43,-69,43,-72,-76,43,-59,-86,-261,-85,43,-113,-112,-32,-102,-101,43,43,43,-47,-48,43,-115,43,43,43,43,-92,43,43,43,43,-38,43,-49,43,43,-87,-93,-262,-103,-121,-120,43,43,43,43,43,-39,-41,-44,-40,-42,43,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,43,-175,-174,43,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CONTINUE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,284,-262,-41,-44,-40,-42,284,-156,-155,-45,-157,284,-43,-175,-174,-172,284,-158,-171,-159,284,-170,-173,-162,284,-160,284,-161,284,284,-166,-165,-163,284,284,-167,-164,284,-169,-168,]),'NOT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,152,152,-47,152,-28,-263,-125,-227,152,-225,152,-224,152,-223,152,152,-222,-226,-263,-223,152,152,152,-262,152,152,-223,152,152,-184,-187,-185,-181,-182,-186,-188,152,-190,-191,-183,-189,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,-12,152,152,-11,-223,-41,-44,-40,152,-42,152,152,-156,-155,-45,-157,152,-43,152,152,152,-263,-139,-175,-174,152,-172,152,152,-158,152,-171,-159,152,152,152,152,-263,152,152,-11,-170,-173,152,-162,152,-160,152,152,-161,152,152,152,-263,152,-166,-165,-163,152,152,152,-167,-164,152,-169,-168,]),'OREQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,215,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'MOD':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,259,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,259,259,259,259,259,259,259,259,259,259,-197,-196,259,259,259,259,259,-198,-221,-229,-230,-215,-245,-238,-239,]),'RSHIFT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,241,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,241,-202,-200,241,241,241,-199,241,241,-197,-196,241,241,241,241,241,-198,-221,-229,-230,-215,-245,-238,-239,]),'DEFAULT':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,286,-262,-41,-44,-40,-42,286,-156,-155,-45,-157,286,-43,-175,-174,-172,286,-158,-171,-159,286,-170,-173,-162,286,-160,286,-161,286,286,-166,-165,-163,286,286,-167,-164,286,-169,-168,]),'CHAR':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[37,37,-63,-74,-73,-60,-56,-57,-35,-31,-61,37,-36,-55,-70,-65,-54,37,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,37,-69,37,-72,-76,37,-59,-86,-261,-85,37,-113,-112,-32,-102,-101,37,37,37,-47,-48,37,-115,37,37,37,37,-92,37,37,37,37,-38,37,-49,37,37,-87,-93,-262,-103,-121,-120,37,37,37,37,37,-39,-41,-44,-40,-42,37,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,37,-175,-174,37,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'WHILE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,382,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,287,-262,-41,-44,-40,-42,287,-156,-155,-45,-157,287,-43,-175,-174,-172,287,-158,-171,413,-159,287,-170,-173,-162,287,-160,287,-161,287,287,-166,-165,-163,287,287,-167,-164,287,-169,-168,]),'DIVEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,206,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'EXTERN':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[10,10,-63,-74,-73,-60,-56,-57,-35,-31,-61,10,-36,-55,-70,-65,-54,10,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,10,-69,10,-72,-76,10,-59,-86,-261,-85,-113,-112,-32,-102,-101,10,10,10,-47,-48,10,-115,10,10,-38,10,-49,-87,-262,-103,-121,-120,10,-39,-41,-44,-40,-42,10,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,10,-175,-174,10,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CASE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,288,-262,-41,-44,-40,-42,288,-156,-155,-45,-157,288,-43,-175,-174,-172,288,-158,-171,-159,288,-170,-173,-162,288,-160,288,-161,288,288,-166,-165,-163,288,288,-167,-164,288,-169,-168,]),'LAND':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,254,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,254,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'REGISTER':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[17,17,-63,-74,-73,-60,-56,-57,-35,-31,-61,17,-36,-55,-70,-65,-54,17,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,17,-69,17,-72,-76,17,-59,-86,-261,-85,-113,-112,-32,-102,-101,17,17,17,-47,-48,17,-115,17,17,-38,17,-49,-87,-262,-103,-121,-120,17,-39,-41,-44,-40,-42,17,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,17,-175,-174,17,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'MODEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,208,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'NE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,246,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,246,-202,-200,-204,-208,-203,-199,-206,246,-197,-196,-205,246,-207,246,246,-198,-221,-229,-230,-215,-245,-238,-239,]),'SWITCH':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,290,-262,-41,-44,-40,-42,290,-156,-155,-45,-157,290,-43,-175,-174,-172,290,-158,-171,-159,290,-170,-173,-162,290,-160,290,-161,290,290,-166,-165,-163,290,290,-167,-164,290,-169,-168,]),'INT_CONST_HEX':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,138,138,-47,138,-28,-263,-125,-227,138,-225,138,-224,138,-223,138,138,-222,-226,-263,-223,138,138,138,-262,138,138,-223,138,138,-184,-187,-185,-181,-182,-186,-188,138,-190,-191,-183,-189,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,-12,138,138,-11,-223,-41,-44,-40,138,-42,138,138,-156,-155,-45,-157,138,-43,138,138,138,-263,-139,-175,-174,138,-172,138,138,-158,138,-171,-159,138,138,138,138,-263,138,138,-11,-170,-173,138,-162,138,-160,138,138,-161,138,138,138,-263,138,-166,-165,-163,138,138,138,-167,-164,138,-169,-168,]),'_COMPLEX':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[27,27,-63,-74,-73,-60,-56,-57,-35,-31,-61,27,-36,-55,-70,-65,-54,27,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,27,-69,27,-72,-76,27,-59,-86,-261,-85,27,-113,-112,-32,-102,-101,27,27,27,-47,-48,27,-115,27,27,27,27,-92,27,27,27,27,-38,27,-49,27,27,-87,-93,-262,-103,-121,-120,27,27,27,27,27,-39,-41,-44,-40,-42,27,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,27,-175,-174,27,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PLUSEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,211,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'STRUCT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[34,34,-63,-74,-73,-60,-56,-57,-35,-31,-61,34,-36,-55,-70,-65,-54,34,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,34,-69,34,-72,-76,34,-59,-86,-261,-85,34,-113,-112,-32,-102,-101,34,34,34,-47,-48,34,-115,34,34,34,34,-92,34,34,34,34,-38,34,-49,34,34,-87,-93,-262,-103,-121,-120,34,34,34,34,34,-39,-41,-44,-40,-42,34,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,34,-175,-174,34,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CONDOP':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,257,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'BREAK':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,294,-262,-41,-44,-40,-42,294,-156,-155,-45,-157,294,-43,-175,-174,-172,294,-158,-171,-159,294,-170,-173,-162,294,-160,294,-161,294,294,-166,-165,-163,294,294,-167,-164,294,-169,-168,]),'VOLATILE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[46,46,-63,-74,-73,-60,-56,-57,-35,-31,-61,46,-36,-55,-70,-65,-54,46,-58,-178,-111,-68,46,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,46,-69,46,-72,-76,46,-59,-86,-261,-85,46,-113,-112,-32,-102,-101,46,46,46,-124,46,46,-47,-48,46,-115,46,46,46,46,-92,46,46,46,-125,46,46,46,-38,46,-49,46,46,-87,-93,-262,-103,-121,-120,46,46,46,46,46,-39,-41,-44,-40,-42,46,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,46,-175,-174,46,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'INLINE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[49,49,-63,-74,-73,-60,-56,-57,-35,-31,-61,49,-36,-55,-70,-65,-54,49,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,49,-69,49,-72,-76,49,-59,-86,-261,-85,-113,-112,-32,-102,-101,49,49,49,-47,-48,49,-115,49,49,-38,49,-49,-87,-262,-103,-121,-120,49,-39,-41,-44,-40,-42,49,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,49,-175,-174,49,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'INT_CONST_BIN':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,118,118,-47,118,-28,-263,-125,-227,118,-225,118,-224,118,-223,118,118,-222,-226,-263,-223,118,118,118,-262,118,118,-223,118,118,-184,-187,-185,-181,-182,-186,-188,118,-190,-191,-183,-189,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,-12,118,118,-11,-223,-41,-44,-40,118,-42,118,118,-156,-155,-45,-157,118,-43,118,118,118,-263,-139,-175,-174,118,-172,118,118,-158,118,-171,-159,118,118,118,118,-263,118,118,-11,-170,-173,118,-162,118,-160,118,118,-161,118,118,118,-263,118,-166,-165,-163,118,118,118,-167,-164,118,-169,-168,]),'DO':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,297,-262,-41,-44,-40,-42,297,-156,-155,-45,-157,297,-43,-175,-174,-172,297,-158,-171,-159,297,-170,-173,-162,297,-160,297,-161,297,297,-166,-165,-163,297,297,-167,-164,297,-169,-168,]),'LNOT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,119,119,-47,119,-28,-263,-125,-227,119,-225,119,-224,119,-223,119,119,-222,-226,-263,-223,119,119,119,-262,119,119,-223,119,119,-184,-187,-185,-181,-182,-186,-188,119,-190,-191,-183,-189,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,-12,119,119,-11,-223,-41,-44,-40,119,-42,119,119,-156,-155,-45,-157,119,-43,119,119,119,-263,-139,-175,-174,119,-172,119,119,-158,119,-171,-159,119,119,119,119,-263,119,119,-11,-170,-173,119,-162,119,-160,119,119,-161,119,119,119,-263,119,-166,-165,-163,119,119,119,-167,-164,119,-169,-168,]),'CONST':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[3,3,-63,-74,-73,-60,-56,-57,-35,-31,-61,3,-36,-55,-70,-65,-54,3,-58,-178,-111,-68,3,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,3,-69,3,-72,-76,3,-59,-86,-261,-85,3,-113,-112,-32,-102,-101,3,3,3,-124,3,3,-47,-48,3,-115,3,3,3,3,-92,3,3,3,-125,3,3,3,-38,3,-49,3,3,-87,-93,-262,-103,-121,-120,3,3,3,3,3,-39,-41,-44,-40,-42,3,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,3,-175,-174,3,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LOR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,242,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'CHAR_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,122,122,-47,122,-28,-263,-125,-227,122,-225,122,-224,122,-223,122,122,-222,-226,-263,-223,122,122,122,-262,122,122,-223,122,122,-184,-187,-185,-181,-182,-186,-188,122,-190,-191,-183,-189,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,-12,122,122,-11,-223,-41,-44,-40,122,-42,122,122,-156,-155,-45,-157,122,-43,122,122,122,-263,-139,-175,-174,122,-172,122,122,-158,122,-171,-159,122,122,122,122,-263,122,122,-11,-170,-173,122,-162,122,-160,122,122,-161,122,122,122,-263,122,-166,-165,-163,122,122,122,-167,-164,122,-169,-168,]),'LSHIFT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,243,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,243,-202,-200,243,243,243,-199,243,243,-197,-196,243,243,243,243,243,-198,-221,-229,-230,-215,-245,-238,-239,]),'RBRACE':([55,82,93,95,100,101,102,112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,155,156,170,172,173,175,176,188,189,190,218,220,221,222,224,231,232,234,240,261,265,268,276,277,280,282,289,291,292,293,295,296,298,299,305,307,308,312,313,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,359,362,363,370,371,374,379,381,383,390,391,392,398,404,405,406,409,414,418,419,420,424,428,429,430,433,434,436,437,444,445,447,448,],[-261,-47,176,-92,-106,176,-109,-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-263,-134,-263,176,176,-93,-262,176,176,-107,-260,-220,-258,-237,-236,-214,-219,-217,-218,176,-20,-19,-41,-44,-40,-42,-6,-156,-155,-45,-157,-5,-43,176,-192,-94,-95,-108,-110,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-135,176,-137,-175,-174,-172,-158,-171,-159,-221,-229,-230,-215,-136,-170,-173,-162,-160,176,-194,-138,-161,-245,176,-238,-166,-165,-163,-239,-167,-164,-169,-168,]),'_BOOL':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[13,13,-63,-74,-73,-60,-56,-57,-35,-31,-61,13,-36,-55,-70,-65,-54,13,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,13,-69,13,-72,-76,13,-59,-86,-261,-85,13,-113,-112,-32,-102,-101,13,13,13,-47,-48,13,-115,13,13,13,13,-92,13,13,13,13,-38,13,-49,13,13,-87,-93,-262,-103,-121,-120,13,13,13,13,13,-39,-41,-44,-40,-42,13,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,13,-175,-174,13,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,245,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,245,-202,-200,-204,245,-203,-199,-206,245,-197,-196,-205,245,245,245,245,-198,-221,-229,-230,-215,-245,-238,-239,]),'SEMI':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,49,50,51,52,54,55,56,58,59,60,61,62,63,67,68,69,70,71,73,74,75,76,79,80,81,82,83,84,86,90,94,96,97,112,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,154,156,166,168,169,170,174,176,177,178,179,180,182,183,184,185,186,187,191,197,198,205,218,220,221,222,224,228,231,232,234,235,238,240,269,270,271,272,276,277,279,280,281,282,284,285,289,291,292,293,294,295,296,297,298,300,302,303,304,305,310,311,314,315,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,359,366,367,368,369,370,371,372,373,374,375,378,379,381,383,384,386,387,388,389,390,391,392,397,398,404,405,406,407,408,409,411,414,419,421,422,423,424,425,427,428,430,431,433,434,436,437,440,441,443,444,445,446,447,448,],[15,-263,-63,-74,-73,-60,-56,-57,-35,-31,-61,-263,-36,-55,-70,-65,-54,15,-58,-178,-111,-68,-263,-71,-263,-34,-75,-114,-66,-33,-62,-37,-64,-67,82,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-113,-112,-32,-102,-101,-28,-122,-124,-27,-18,-46,-145,-77,-17,-80,-81,-147,-47,-50,-53,-263,-115,-263,-263,-263,-248,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-79,-134,-145,-81,-38,-263,-87,-262,-23,-84,-24,-83,-26,307,-96,308,-25,-98,-103,-121,-120,-78,-260,-220,-258,-237,-236,-150,-214,-219,-217,-152,-176,-218,-154,-148,-82,-39,-41,-44,370,-40,371,-42,374,-14,-263,-156,-155,-45,381,-157,-13,-263,-43,-248,-89,-88,-100,-192,-105,-104,-116,-119,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-135,-149,-151,-153,405,-175,-174,406,-263,-172,-263,-13,-158,-171,-159,-263,-97,-99,-118,-117,-221,-229,-230,-177,-215,-136,-170,-173,421,-263,-162,-263,-160,-194,-263,432,-263,-161,-263,-263,-245,-238,438,-166,-165,-163,-239,444,-263,-263,-167,-164,-263,-169,-168,]),'LT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,247,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,247,-202,-200,-204,247,-203,-199,-206,247,-197,-196,-205,247,247,247,247,-198,-221,-229,-230,-215,-245,-238,-239,]),'COMMA':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,56,58,59,60,62,63,67,68,69,70,71,74,75,79,80,81,83,84,90,94,96,100,101,102,109,110,111,112,113,114,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,154,156,166,168,174,176,177,178,179,180,182,184,187,188,189,190,191,197,198,199,200,201,202,205,218,220,221,222,224,228,231,232,234,235,236,238,239,240,265,269,270,271,285,300,302,303,304,305,310,311,312,313,314,315,318,320,321,323,324,325,326,327,328,329,330,331,334,337,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,363,366,367,368,372,386,387,388,389,390,391,392,397,398,404,410,412,415,416,418,419,420,428,430,435,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-263,-71,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-85,-51,-113,-112,-102,-101,-28,-122,-124,-27,117,-145,-77,-80,-81,-147,-50,-53,-115,-263,-263,-106,190,-109,-128,-263,203,-248,204,-132,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-79,-134,-145,-81,-87,-262,-23,-84,-24,-83,306,-96,-98,190,190,-107,-103,-121,-120,-131,-1,-2,-130,-78,-260,-220,-258,-237,-236,-150,-214,-219,-217,-152,335,-176,-263,-218,362,-154,-148,-82,335,-248,-89,-88,-100,-192,-105,-104,-108,-110,-116,-119,-133,-129,-180,-235,-234,-233,-232,335,-246,-231,393,394,-244,-144,-145,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,335,-210,-198,-135,-137,-149,-151,-153,335,-97,-99,-118,-117,-221,-229,-230,-177,-215,-136,335,335,335,-247,429,-194,-138,-245,-238,335,-239,]),'OFFSETOF':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,133,133,-47,133,-28,-263,-125,-227,133,-225,133,-224,133,-223,133,133,-222,-226,-263,-223,133,133,133,-262,133,133,-223,133,133,-184,-187,-185,-181,-182,-186,-188,133,-190,-191,-183,-189,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,-12,133,133,-11,-223,-41,-44,-40,133,-42,133,133,-156,-155,-45,-157,133,-43,133,133,133,-263,-139,-175,-174,133,-172,133,133,-158,133,-171,-159,133,133,133,133,-263,133,133,-11,-170,-173,133,-162,133,-160,133,133,-161,133,133,133,-263,133,-166,-165,-163,133,133,133,-167,-164,133,-169,-168,]),'TYPEDEF':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[23,23,-63,-74,-73,-60,-56,-57,-35,-31,-61,23,-36,-55,-70,-65,-54,23,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,23,-69,23,-72,-76,23,-59,-86,-261,-85,-113,-112,-32,-102,-101,23,23,23,-47,-48,23,-115,23,23,-38,23,-49,-87,-262,-103,-121,-120,23,-39,-41,-44,-40,-42,23,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,23,-175,-174,23,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'XOR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,250,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,250,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,250,-207,-209,250,-198,-221,-229,-230,-215,-245,-238,-239,]),'AUTO':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[21,21,-63,-74,-73,-60,-56,-57,-35,-31,-61,21,-36,-55,-70,-65,-54,21,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,21,-69,21,-72,-76,21,-59,-86,-261,-85,-113,-112,-32,-102,-101,21,21,21,-47,-48,21,-115,21,21,-38,21,-49,-87,-262,-103,-121,-120,21,-39,-41,-44,-40,-42,21,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,21,-175,-174,21,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'TIMES':([0,1,2,3,4,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,27,28,29,30,31,32,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,61,62,63,65,67,68,69,70,72,77,78,82,83,84,86,94,96,97,103,104,105,110,112,115,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,167,169,170,174,176,177,178,179,180,181,191,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,272,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,302,303,306,309,310,311,323,324,325,326,329,334,335,336,338,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[28,-263,-63,-74,28,-73,-60,-56,-57,-35,-31,-61,-263,-36,-55,-70,-65,-54,28,-58,-178,-68,-263,-71,28,-34,-75,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-32,-102,-101,-263,-28,28,-124,-27,139,157,28,-47,-50,-53,28,-263,-263,28,194,-28,-263,28,-248,-125,28,-252,-227,-214,-243,-255,-259,-256,-253,-241,157,-225,-242,-216,-195,157,-224,157,-251,-223,-228,157,157,-257,-222,-249,-240,252,-254,-250,-226,-263,-223,157,274,28,-38,157,-87,-262,-23,-84,-24,-83,157,-103,157,-223,157,157,-184,-187,-185,-181,-182,-186,-188,157,-190,-191,-183,-189,-260,157,-220,-258,-237,-236,157,157,157,-214,-219,157,-217,28,-218,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,-12,157,157,-11,-39,-223,-41,-44,-40,157,-42,157,157,-156,-155,-45,-157,157,-43,-248,-89,-88,28,157,-105,-104,-235,-234,-233,-232,-231,-244,157,157,28,252,252,252,252,252,252,252,252,252,252,-197,-196,252,252,252,252,252,-198,-263,-139,-175,-174,157,-172,157,157,-158,157,-171,-159,157,157,-221,-229,-230,157,157,-215,-263,157,157,-11,-170,-173,157,-162,157,-160,157,157,-161,157,157,157,-245,-263,-238,157,-166,-165,-163,-239,157,157,157,-167,-164,157,-169,-168,]),'LPAREN':([0,1,2,3,4,5,6,9,10,11,12,13,14,15,16,17,18,19,21,22,23,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,60,61,62,63,65,67,68,69,70,72,74,77,78,81,82,83,84,86,90,94,96,97,103,104,105,110,112,115,116,117,118,119,121,122,123,124,125,126,127,128,129,130,133,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,153,155,157,162,164,166,167,169,170,174,176,177,178,179,180,181,191,192,194,195,196,197,198,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,228,230,233,235,239,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,269,270,272,274,276,277,280,281,282,283,287,288,289,290,291,292,293,295,297,298,300,301,302,303,306,309,310,311,314,315,323,324,325,326,329,334,335,336,338,339,362,365,366,367,368,370,371,373,374,375,376,379,380,381,383,384,385,388,389,391,392,393,395,399,400,402,403,405,406,408,409,411,413,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[4,-263,-63,-74,4,-73,-60,-56,-57,-35,-31,-61,-263,-36,4,-55,-70,-65,-54,4,-58,-178,66,-68,-263,-71,78,-34,-75,-114,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,66,-32,-102,-101,-263,-28,-122,-124,-27,141,78,141,78,165,-47,-50,-53,167,-115,-263,-263,167,141,-28,-263,78,-248,-125,-123,4,-252,-227,-243,-255,-259,-256,-253,-241,219,-225,-242,227,229,230,-224,233,-251,-223,-228,141,233,-257,-222,-249,-240,-254,-250,-226,165,-263,-223,141,141,167,167,-38,141,-87,-262,-23,-84,-24,-83,230,-103,230,-223,141,141,-121,-120,-184,-187,-185,-181,-182,-186,-188,141,-190,-191,-183,-189,-260,141,-258,-237,-236,141,141,-150,141,141,-152,338,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,141,230,230,-12,230,141,-11,-154,-148,-39,-223,-41,-44,-40,141,-42,373,376,230,141,380,-156,-155,-45,-157,141,-43,-248,385,-89,-88,4,230,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,141,230,338,338,-263,-139,-149,-151,-153,-175,-174,141,-172,141,141,-158,141,-171,-159,141,141,-118,-117,-229,-230,141,230,-263,230,141,-11,-170,-173,141,-162,141,426,-160,141,141,-161,141,141,141,-245,-263,-238,141,-166,-165,-163,-239,141,141,141,-167,-164,141,-169,-168,]),'MINUSMINUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,121,122,123,124,125,126,127,128,129,130,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,391,392,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,142,142,-47,142,-28,-263,-248,-125,-252,-227,-243,-255,-259,-256,-253,-241,142,-225,-242,222,142,-224,142,-251,-223,-228,142,142,-257,-222,-249,-240,-254,-250,-226,-263,-223,142,142,142,-262,142,142,-223,142,142,-184,-187,-185,-181,-182,-186,-188,142,-190,-191,-183,-189,-260,142,-258,-237,-236,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,-12,142,142,-11,-223,-41,-44,-40,142,-42,142,142,-156,-155,-45,-157,142,-43,-248,142,-235,-234,-233,-232,-231,-244,142,142,-263,-139,-175,-174,142,-172,142,142,-158,142,-171,-159,142,142,-229,-230,142,142,-263,142,142,-11,-170,-173,142,-162,142,-160,142,142,-161,142,142,142,-245,-263,-238,142,-166,-165,-163,-239,142,142,142,-167,-164,142,-169,-168,]),'ID':([0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,34,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,61,62,63,64,65,66,67,68,69,70,72,74,77,78,82,83,84,86,94,96,97,98,99,103,104,105,110,115,116,117,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,166,167,169,170,174,176,177,178,179,180,181,190,191,192,194,195,196,203,206,207,208,209,210,211,212,213,214,215,216,217,219,223,225,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,263,264,266,268,272,274,276,277,278,280,281,282,288,289,291,292,293,295,297,298,302,303,306,309,310,311,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,394,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[33,-263,-63,-74,33,-73,-60,56,-56,-57,-35,-31,-61,-263,-36,33,-55,-70,-65,-91,-54,33,-58,63,-178,-68,-263,-71,33,-34,-75,-90,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-32,-102,-101,102,-263,112,-28,-122,-124,-27,112,33,112,33,-47,-50,-53,33,-263,-263,33,102,102,112,-28,-263,33,-125,-123,33,-227,112,-225,112,-224,112,-223,112,112,-222,-226,-263,-223,112,112,33,33,-38,300,-87,-262,-23,-84,-24,-83,112,102,-103,112,-223,112,112,112,-184,-187,-185,-181,-182,-186,-188,112,-190,-191,-183,-189,112,324,326,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,-12,112,112,112,-11,-39,-223,-41,-44,369,-40,112,-42,112,300,-156,-155,-45,-157,300,-43,-89,-88,33,112,-105,-104,112,112,-263,-139,-175,-174,112,-172,300,112,-158,112,-171,-159,300,112,112,112,112,-263,112,112,-11,-170,-173,112,-162,300,-160,112,300,-161,300,112,300,-263,112,-166,-165,-163,112,300,300,-167,-164,300,-169,-168,]),'IF':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,301,-262,-41,-44,-40,-42,301,-156,-155,-45,-157,301,-43,-175,-174,-172,301,-158,-171,-159,301,-170,-173,-162,301,-160,301,-161,301,301,-166,-165,-163,301,301,-167,-164,301,-169,-168,]),'STRING_LITERAL':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,129,134,135,137,139,141,142,143,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,221,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,143,143,-47,143,-28,-263,-125,-227,143,-225,221,143,-224,143,-223,143,143,-257,-222,-226,-263,-223,143,143,143,-262,143,143,-223,143,143,-184,-187,-185,-181,-182,-186,-188,143,-190,-191,-183,-189,143,-258,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,-12,143,143,-11,-223,-41,-44,-40,143,-42,143,143,-156,-155,-45,-157,143,-43,143,143,143,-263,-139,-175,-174,143,-172,143,143,-158,143,-171,-159,143,143,143,143,-263,143,143,-11,-170,-173,143,-162,143,-160,143,143,-161,143,143,143,-263,143,-166,-165,-163,143,143,143,-167,-164,143,-169,-168,]),'FLOAT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[35,35,-63,-74,-73,-60,-56,-57,-35,-31,-61,35,-36,-55,-70,-65,-54,35,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,35,-69,35,-72,-76,35,-59,-86,-261,-85,35,-113,-112,-32,-102,-101,35,35,35,-47,-48,35,-115,35,35,35,35,-92,35,35,35,35,-38,35,-49,35,35,-87,-93,-262,-103,-121,-120,35,35,35,35,35,-39,-41,-44,-40,-42,35,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,35,-175,-174,35,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'XOREQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,210,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'LSHIFTEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,212,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'RBRACKET':([3,32,46,65,69,70,72,103,104,112,115,118,120,121,122,123,124,125,126,129,130,131,132,136,138,139,140,143,145,146,147,148,149,150,151,164,176,193,194,218,220,221,222,224,231,232,234,238,240,273,274,305,316,317,321,323,324,325,326,327,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,361,390,391,392,397,398,419,428,430,437,],[-74,-75,-76,-263,-124,-27,-263,-263,-28,-248,-125,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,228,-195,-4,-251,235,-228,-257,-249,-240,-193,-254,-250,-3,-179,-263,-262,314,315,-260,-220,-258,-237,-236,-214,-219,-217,-176,-218,366,367,-192,388,389,-180,-235,-234,-233,-232,391,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,401,-221,-229,-230,-177,-215,-194,-245,-238,-239,]),} +_lr_action_items = {'$end':([0,1,2,3,4,5,6,7,8,9,13,14,55,77,78,105,144,210,264,],[-309,0,-58,-59,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-70,-308,-71,-202,]),'SEMI':([0,2,4,5,6,7,8,9,11,12,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,62,63,64,65,66,67,69,70,72,73,74,75,76,77,78,81,82,83,84,85,86,87,88,89,90,91,92,98,99,101,102,103,104,105,106,108,110,127,131,139,140,141,142,143,144,145,146,147,148,151,152,153,154,155,156,157,158,159,160,161,162,163,166,169,172,175,176,177,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,227,228,242,243,246,249,250,251,252,253,254,255,256,257,258,259,260,261,263,264,265,266,267,269,270,272,273,282,283,284,285,286,287,288,289,325,326,327,329,330,331,333,334,349,350,351,352,371,372,375,376,377,380,381,382,384,387,391,395,396,397,398,399,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,431,438,439,442,443,456,457,458,460,462,463,464,466,467,469,470,473,475,479,480,491,492,494,495,497,499,508,509,511,514,519,520,521,523,526,527,529,],[9,9,-60,-62,-63,-64,-65,-66,-309,77,-67,-68,-52,-309,-309,-309,-116,-93,-309,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,-309,-309,-162,-89,-90,-91,-92,-81,-19,-20,-120,-122,-163,-54,-37,-83,-69,-53,-86,-9,-10,-87,-88,-94,-82,-15,-16,-124,-126,-152,-153,-307,-132,-133,146,-70,-309,-162,-55,-294,-30,146,146,146,-135,-142,-308,-309,-145,-146,-130,-13,-309,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,273,-14,-309,286,287,289,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-121,-38,-123,-177,-35,-36,-125,-127,-154,146,-137,146,-139,-134,-143,377,-128,-129,-25,-26,-147,-149,-131,-202,-201,-13,-309,-235,-257,-309,-218,-78,-80,-309,398,-214,-215,399,-217,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-155,-156,-136,-138,-144,-151,-203,-309,-205,-287,-220,-79,466,-309,-213,-216,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-178,-39,-42,-32,-33,-148,-150,-204,-309,-258,-309,-309,-309,498,-272,-273,-264,-179,-40,-41,-206,-80,-208,-209,512,-237,-309,-281,521,-288,-207,-282,-210,-309,-309,-212,-211,]),'PPHASH':([0,2,4,5,6,7,8,9,13,14,55,77,78,105,144,210,264,],[13,13,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-70,-308,-71,-202,]),'PPPRAGMA':([0,2,4,5,6,7,8,9,13,14,55,77,78,101,104,105,106,139,140,141,143,144,146,147,152,153,154,155,156,157,158,159,160,161,162,172,210,249,251,254,264,265,267,272,273,282,283,286,287,289,377,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[14,14,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-307,14,-70,14,14,14,14,-142,-308,-145,-146,14,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,14,-71,14,14,-143,-202,-201,14,14,-218,14,-80,-214,-215,-217,-144,-203,14,-205,-79,-213,-216,-204,14,14,14,-206,-80,-208,-209,14,-207,-210,14,14,-212,-211,]),'ID':([0,2,4,5,6,7,8,9,11,13,14,16,17,18,19,20,21,22,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,60,61,63,64,65,66,68,71,77,78,79,80,82,83,84,85,86,87,94,95,96,97,98,99,100,101,102,103,105,106,111,113,114,115,116,117,118,126,129,130,132,133,134,135,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,164,168,172,174,177,183,184,185,187,188,189,190,191,193,194,210,215,216,217,218,222,225,226,230,234,238,239,246,247,248,250,252,253,256,257,262,263,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,328,332,338,339,340,343,344,346,347,348,360,361,364,367,369,371,372,375,376,378,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,474,476,477,482,483,484,491,492,494,495,498,508,510,512,515,516,519,521,523,526,527,529,],[23,23,-60,-62,-63,-64,-65,-66,23,-67,-68,23,-309,-309,-309,-116,-93,23,23,-97,-309,-113,-114,-115,-221,98,102,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-140,-141,-61,23,23,-89,-90,-91,-92,23,23,-83,-69,-309,127,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,138,-307,-132,-133,-70,163,23,127,-309,127,127,-309,-28,23,23,127,-165,-167,138,138,-135,-308,23,-130,163,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,127,127,163,285,127,127,127,127,127,-266,-267,-268,-265,-269,-270,-71,-309,127,-309,-28,-266,127,127,127,23,23,-309,-154,138,127,-137,-139,-134,-128,-129,127,-131,-202,-201,163,127,163,-218,127,127,127,127,163,-80,127,-214,-215,-217,127,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,424,426,127,127,-11,127,-12,127,127,-266,127,127,-309,127,23,127,127,-155,-156,-136,-138,23,127,-203,163,-205,127,-79,127,-213,-216,-309,-182,127,-309,-28,-266,-204,127,163,-309,163,163,127,127,127,127,127,127,-11,-266,127,127,-206,-80,-208,-209,127,163,-309,127,127,127,-207,-210,163,163,-212,-211,]),'LPAREN':([0,2,4,5,6,7,8,9,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,63,64,65,66,68,71,75,76,77,78,79,81,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,105,106,110,111,113,114,116,117,118,126,127,129,130,131,132,133,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,163,164,167,168,170,171,172,173,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,212,215,216,217,218,222,225,226,227,228,234,235,238,239,240,241,246,248,250,252,253,256,257,262,263,264,265,267,271,272,273,274,277,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,349,350,351,352,358,359,360,364,367,369,371,372,375,376,378,379,381,382,384,386,387,389,390,394,395,397,398,399,422,424,425,426,427,432,434,438,439,442,443,444,445,446,449,450,452,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,479,480,482,483,484,485,486,487,488,489,490,491,492,494,495,498,504,505,508,509,510,512,514,516,517,518,519,520,521,523,526,527,529,],[24,24,-60,-62,-63,-64,-65,-66,71,-67,-68,80,24,-309,-309,-309,-116,-93,24,-29,24,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,71,24,-89,-90,-91,-92,71,71,115,-37,-83,-69,-309,80,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,-70,168,115,71,168,-309,168,-309,-28,238,-294,71,168,-30,-165,-167,-135,-308,71,-130,168,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,271,274,168,279,280,168,284,168,322,328,328,271,332,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,335,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-38,-309,168,-309,-28,-266,168,168,-35,-36,238,361,238,-309,-45,370,-154,271,-137,-139,-134,-128,-129,271,-131,-202,-201,168,168,168,-218,168,390,168,168,168,168,-80,168,-214,-215,-217,168,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,168,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,168,168,-279,-280,168,168,-304,-306,-11,168,-12,271,-266,168,168,-43,-44,-31,-34,361,370,-309,238,168,168,-155,-156,-136,-138,71,271,-203,168,-205,271,-287,390,390,465,-79,168,-213,-216,-274,-275,-276,-277,-278,-309,-182,-39,-42,-32,-33,168,-309,-28,-191,-197,-195,-266,-204,271,168,-309,168,168,168,168,271,-272,-273,168,168,-11,-40,-41,-266,168,168,-50,-51,-193,-192,-194,-196,-206,-80,-208,-209,168,-46,-49,168,-281,-309,168,-288,168,-47,-48,-207,-282,-210,168,168,-212,-211,]),'TIMES':([0,2,4,5,6,7,8,9,11,13,14,17,18,19,20,21,22,24,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,63,64,65,66,71,77,78,79,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,105,106,111,113,114,116,117,118,126,127,129,130,133,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,210,215,216,217,218,222,225,226,238,239,246,248,250,252,253,256,257,262,263,264,265,267,270,271,272,273,274,277,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,371,372,375,376,378,379,381,382,384,386,387,390,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[26,26,-60,-62,-63,-64,-65,-66,26,-67,-68,-309,-309,-309,-116,-93,26,26,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,26,26,-89,-90,-91,-92,26,-83,-69,-309,-86,-9,-10,-87,-88,-94,26,-27,-28,-166,-152,-153,-307,-132,-133,-70,188,26,188,-309,222,-309,-28,26,-294,26,188,-167,-135,-308,26,-130,188,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,188,188,188,188,-257,303,-259,188,188,188,-238,188,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-309,346,-309,-28,-266,188,188,26,368,-154,188,-137,-139,-134,-128,-129,188,-131,-202,-201,188,-257,188,188,-218,188,26,188,188,188,188,-80,188,-214,-215,-217,188,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,-279,-280,-260,188,-261,-262,-263,188,-304,-306,-11,188,-12,188,-266,188,188,-309,188,454,-155,-156,-136,-138,26,188,-203,188,-205,188,-287,26,-79,188,-213,-216,-239,-240,-241,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,-274,-275,-276,-277,-278,-309,-182,482,-309,-28,-266,-204,188,188,-309,-258,188,188,188,188,188,-272,-273,188,-264,188,-11,-266,188,188,-206,-80,-208,-209,188,188,-281,-309,188,-288,188,-207,-282,-210,188,188,-212,-211,]),'TYPEID':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,58,59,60,61,62,63,64,65,66,68,71,77,78,80,81,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,104,105,106,107,111,115,126,128,129,131,132,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,234,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,282,283,284,286,287,289,323,324,328,332,335,351,352,361,370,371,372,375,376,377,378,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[30,30,-60,-62,-63,-64,-65,-66,30,76,-67,-68,-52,-309,-309,-309,-116,-93,30,-29,-97,-309,-113,-114,-115,-221,99,103,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-140,-141,-61,30,-84,76,30,30,-89,-90,-91,-92,76,76,-83,-69,30,-53,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,30,-70,30,-85,76,30,240,30,76,-30,-165,-167,30,30,30,-135,-142,-308,76,-145,-146,-130,30,30,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,30,-71,-35,-36,30,240,30,-154,30,-137,30,-139,-134,-143,-128,-129,-131,-202,-201,30,-218,-78,-80,30,-214,-215,-217,425,427,30,30,30,-31,-34,30,30,-155,-156,-136,-138,-144,76,-203,-205,30,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'ENUM':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[31,31,-60,-62,-63,-64,-65,-66,31,-67,-68,-52,-309,-309,-309,31,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,31,-84,31,31,-83,-69,31,-53,-86,-9,-10,-87,-88,-166,-307,31,-70,31,-85,31,31,-30,-167,31,31,31,-142,-308,-145,-146,31,31,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,31,-71,-35,-36,31,31,31,31,-143,-202,-201,31,-218,-78,-80,31,-214,-215,-217,31,31,31,-31,-34,31,31,-144,-203,-205,31,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'VOID':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[33,33,-60,-62,-63,-64,-65,-66,33,33,-67,-68,-52,-309,-309,-309,-116,-93,33,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,33,-84,33,33,33,-89,-90,-91,-92,-83,-69,33,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,33,-70,33,-85,33,33,33,-30,-167,33,33,33,-135,-142,-308,33,-145,-146,-130,33,33,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,33,-71,-35,-36,33,33,-154,33,-137,33,-139,-134,-143,-128,-129,-131,-202,-201,33,-218,33,-78,-80,33,-214,-215,-217,33,33,33,-31,-34,33,33,-155,-156,-136,-138,-144,-203,-205,33,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'_BOOL':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[34,34,-60,-62,-63,-64,-65,-66,34,34,-67,-68,-52,-309,-309,-309,-116,-93,34,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,34,-84,34,34,34,-89,-90,-91,-92,-83,-69,34,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,34,-70,34,-85,34,34,34,-30,-167,34,34,34,-135,-142,-308,34,-145,-146,-130,34,34,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,34,-71,-35,-36,34,34,-154,34,-137,34,-139,-134,-143,-128,-129,-131,-202,-201,34,-218,34,-78,-80,34,-214,-215,-217,34,34,34,-31,-34,34,34,-155,-156,-136,-138,-144,-203,-205,34,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'CHAR':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[35,35,-60,-62,-63,-64,-65,-66,35,35,-67,-68,-52,-309,-309,-309,-116,-93,35,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,35,-84,35,35,35,-89,-90,-91,-92,-83,-69,35,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,35,-70,35,-85,35,35,35,-30,-167,35,35,35,-135,-142,-308,35,-145,-146,-130,35,35,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,35,-71,-35,-36,35,35,-154,35,-137,35,-139,-134,-143,-128,-129,-131,-202,-201,35,-218,35,-78,-80,35,-214,-215,-217,35,35,35,-31,-34,35,35,-155,-156,-136,-138,-144,-203,-205,35,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'SHORT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[36,36,-60,-62,-63,-64,-65,-66,36,36,-67,-68,-52,-309,-309,-309,-116,-93,36,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,36,-84,36,36,36,-89,-90,-91,-92,-83,-69,36,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,36,-70,36,-85,36,36,36,-30,-167,36,36,36,-135,-142,-308,36,-145,-146,-130,36,36,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,36,-71,-35,-36,36,36,-154,36,-137,36,-139,-134,-143,-128,-129,-131,-202,-201,36,-218,36,-78,-80,36,-214,-215,-217,36,36,36,-31,-34,36,36,-155,-156,-136,-138,-144,-203,-205,36,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'INT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[37,37,-60,-62,-63,-64,-65,-66,37,37,-67,-68,-52,-309,-309,-309,-116,-93,37,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,37,-84,37,37,37,-89,-90,-91,-92,-83,-69,37,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,37,-70,37,-85,37,37,37,-30,-167,37,37,37,-135,-142,-308,37,-145,-146,-130,37,37,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,37,-71,-35,-36,37,37,-154,37,-137,37,-139,-134,-143,-128,-129,-131,-202,-201,37,-218,37,-78,-80,37,-214,-215,-217,37,37,37,-31,-34,37,37,-155,-156,-136,-138,-144,-203,-205,37,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'LONG':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[38,38,-60,-62,-63,-64,-65,-66,38,38,-67,-68,-52,-309,-309,-309,-116,-93,38,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,38,-84,38,38,38,-89,-90,-91,-92,-83,-69,38,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,38,-70,38,-85,38,38,38,-30,-167,38,38,38,-135,-142,-308,38,-145,-146,-130,38,38,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,38,-71,-35,-36,38,38,-154,38,-137,38,-139,-134,-143,-128,-129,-131,-202,-201,38,-218,38,-78,-80,38,-214,-215,-217,38,38,38,-31,-34,38,38,-155,-156,-136,-138,-144,-203,-205,38,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'FLOAT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[39,39,-60,-62,-63,-64,-65,-66,39,39,-67,-68,-52,-309,-309,-309,-116,-93,39,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,39,-84,39,39,39,-89,-90,-91,-92,-83,-69,39,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,39,-70,39,-85,39,39,39,-30,-167,39,39,39,-135,-142,-308,39,-145,-146,-130,39,39,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,39,-71,-35,-36,39,39,-154,39,-137,39,-139,-134,-143,-128,-129,-131,-202,-201,39,-218,39,-78,-80,39,-214,-215,-217,39,39,39,-31,-34,39,39,-155,-156,-136,-138,-144,-203,-205,39,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'DOUBLE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[40,40,-60,-62,-63,-64,-65,-66,40,40,-67,-68,-52,-309,-309,-309,-116,-93,40,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,40,-84,40,40,40,-89,-90,-91,-92,-83,-69,40,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,40,-70,40,-85,40,40,40,-30,-167,40,40,40,-135,-142,-308,40,-145,-146,-130,40,40,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,40,-71,-35,-36,40,40,-154,40,-137,40,-139,-134,-143,-128,-129,-131,-202,-201,40,-218,40,-78,-80,40,-214,-215,-217,40,40,40,-31,-34,40,40,-155,-156,-136,-138,-144,-203,-205,40,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'_COMPLEX':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[41,41,-60,-62,-63,-64,-65,-66,41,41,-67,-68,-52,-309,-309,-309,-116,-93,41,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,41,-84,41,41,41,-89,-90,-91,-92,-83,-69,41,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,41,-70,41,-85,41,41,41,-30,-167,41,41,41,-135,-142,-308,41,-145,-146,-130,41,41,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,41,-71,-35,-36,41,41,-154,41,-137,41,-139,-134,-143,-128,-129,-131,-202,-201,41,-218,41,-78,-80,41,-214,-215,-217,41,41,41,-31,-34,41,41,-155,-156,-136,-138,-144,-203,-205,41,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'SIGNED':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[42,42,-60,-62,-63,-64,-65,-66,42,42,-67,-68,-52,-309,-309,-309,-116,-93,42,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,42,-84,42,42,42,-89,-90,-91,-92,-83,-69,42,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,42,-70,42,-85,42,42,42,-30,-167,42,42,42,-135,-142,-308,42,-145,-146,-130,42,42,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,42,-71,-35,-36,42,42,-154,42,-137,42,-139,-134,-143,-128,-129,-131,-202,-201,42,-218,42,-78,-80,42,-214,-215,-217,42,42,42,-31,-34,42,42,-155,-156,-136,-138,-144,-203,-205,42,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'UNSIGNED':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[43,43,-60,-62,-63,-64,-65,-66,43,43,-67,-68,-52,-309,-309,-309,-116,-93,43,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,43,-84,43,43,43,-89,-90,-91,-92,-83,-69,43,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,43,-70,43,-85,43,43,43,-30,-167,43,43,43,-135,-142,-308,43,-145,-146,-130,43,43,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,43,-71,-35,-36,43,43,-154,43,-137,43,-139,-134,-143,-128,-129,-131,-202,-201,43,-218,43,-78,-80,43,-214,-215,-217,43,43,43,-31,-34,43,43,-155,-156,-136,-138,-144,-203,-205,43,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'__INT128':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[44,44,-60,-62,-63,-64,-65,-66,44,44,-67,-68,-52,-309,-309,-309,-116,-93,44,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,44,-84,44,44,44,-89,-90,-91,-92,-83,-69,44,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,44,-70,44,-85,44,44,44,-30,-167,44,44,44,-135,-142,-308,44,-145,-146,-130,44,44,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,44,-71,-35,-36,44,44,-154,44,-137,44,-139,-134,-143,-128,-129,-131,-202,-201,44,-218,44,-78,-80,44,-214,-215,-217,44,44,44,-31,-34,44,44,-155,-156,-136,-138,-144,-203,-205,44,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'CONST':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[45,45,-60,-62,-63,-64,-65,-66,45,45,-67,-68,-52,45,45,45,-116,-93,-29,-97,45,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,45,-84,45,45,-89,-90,-91,-92,-83,-69,45,45,-53,-94,45,-166,-152,-153,-307,-132,-133,45,-70,45,-85,45,45,45,45,45,-30,-167,45,45,45,-135,-142,-308,45,-145,-146,-130,45,45,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,45,-71,45,45,-35,-36,45,45,45,-154,45,-137,45,-139,-134,-143,-128,-129,-131,-202,-201,45,-218,45,-78,-80,45,-214,-215,-217,45,45,45,-31,-34,45,45,45,-155,-156,-136,-138,-144,-203,-205,45,-79,-213,-216,-32,-33,45,45,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'RESTRICT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[46,46,-60,-62,-63,-64,-65,-66,46,46,-67,-68,-52,46,46,46,-116,-93,-29,-97,46,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,46,-84,46,46,-89,-90,-91,-92,-83,-69,46,46,-53,-94,46,-166,-152,-153,-307,-132,-133,46,-70,46,-85,46,46,46,46,46,-30,-167,46,46,46,-135,-142,-308,46,-145,-146,-130,46,46,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,46,-71,46,46,-35,-36,46,46,46,-154,46,-137,46,-139,-134,-143,-128,-129,-131,-202,-201,46,-218,46,-78,-80,46,-214,-215,-217,46,46,46,-31,-34,46,46,46,-155,-156,-136,-138,-144,-203,-205,46,-79,-213,-216,-32,-33,46,46,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'VOLATILE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[47,47,-60,-62,-63,-64,-65,-66,47,47,-67,-68,-52,47,47,47,-116,-93,-29,-97,47,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,47,-84,47,47,-89,-90,-91,-92,-83,-69,47,47,-53,-94,47,-166,-152,-153,-307,-132,-133,47,-70,47,-85,47,47,47,47,47,-30,-167,47,47,47,-135,-142,-308,47,-145,-146,-130,47,47,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,47,-71,47,47,-35,-36,47,47,47,-154,47,-137,47,-139,-134,-143,-128,-129,-131,-202,-201,47,-218,47,-78,-80,47,-214,-215,-217,47,47,47,-31,-34,47,47,47,-155,-156,-136,-138,-144,-203,-205,47,-79,-213,-216,-32,-33,47,47,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'AUTO':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[48,48,-60,-62,-63,-64,-65,-66,48,48,-67,-68,-52,48,48,48,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,48,-84,48,48,-89,-90,-91,-92,-83,-69,48,-53,-94,-152,-153,-307,-132,-133,-70,48,-85,48,48,-30,-135,-308,48,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,48,48,-154,-137,-139,-134,-202,-201,-218,-78,-80,48,-214,-215,-217,-31,-34,48,48,-155,-156,-136,-138,-203,-205,48,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'REGISTER':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[49,49,-60,-62,-63,-64,-65,-66,49,49,-67,-68,-52,49,49,49,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,49,-84,49,49,-89,-90,-91,-92,-83,-69,49,-53,-94,-152,-153,-307,-132,-133,-70,49,-85,49,49,-30,-135,-308,49,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,49,49,-154,-137,-139,-134,-202,-201,-218,-78,-80,49,-214,-215,-217,-31,-34,49,49,-155,-156,-136,-138,-203,-205,49,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'STATIC':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,97,98,99,101,102,103,105,106,107,114,115,118,126,131,133,142,144,152,153,154,155,156,157,158,159,160,161,162,210,218,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,360,361,370,371,372,375,376,381,384,390,395,398,399,442,443,446,458,491,492,494,495,519,521,527,529,],[25,25,-60,-62,-63,-64,-65,-66,25,25,-67,-68,-52,25,25,25,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,25,-84,25,25,-89,-90,-91,-92,-83,-69,117,25,-53,-94,-166,-152,-153,-307,-132,-133,-70,25,-85,217,25,226,25,-30,-167,-135,-308,25,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,348,-35,-36,25,25,-154,-137,-139,-134,-202,-201,-218,-78,-80,25,-214,-215,-217,-31,-34,445,25,25,-155,-156,-136,-138,-203,-205,25,-79,-213,-216,-32,-33,484,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'EXTERN':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[50,50,-60,-62,-63,-64,-65,-66,50,50,-67,-68,-52,50,50,50,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,50,-84,50,50,-89,-90,-91,-92,-83,-69,50,-53,-94,-152,-153,-307,-132,-133,-70,50,-85,50,50,-30,-135,-308,50,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,50,50,-154,-137,-139,-134,-202,-201,-218,-78,-80,50,-214,-215,-217,-31,-34,50,50,-155,-156,-136,-138,-203,-205,50,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'TYPEDEF':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[51,51,-60,-62,-63,-64,-65,-66,51,51,-67,-68,-52,51,51,51,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,51,-84,51,51,-89,-90,-91,-92,-83,-69,51,-53,-94,-152,-153,-307,-132,-133,-70,51,-85,51,51,-30,-135,-308,51,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,51,51,-154,-137,-139,-134,-202,-201,-218,-78,-80,51,-214,-215,-217,-31,-34,51,51,-155,-156,-136,-138,-203,-205,51,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'INLINE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[52,52,-60,-62,-63,-64,-65,-66,52,52,-67,-68,-52,52,52,52,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,52,-84,52,52,-89,-90,-91,-92,-83,-69,52,-53,-94,-152,-153,-307,-132,-133,-70,52,-85,52,52,-30,-135,-308,52,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,52,52,-154,-137,-139,-134,-202,-201,-218,-78,-80,52,-214,-215,-217,-31,-34,52,52,-155,-156,-136,-138,-203,-205,52,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'STRUCT':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[53,53,-60,-62,-63,-64,-65,-66,53,-67,-68,-52,-309,-309,-309,53,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,53,-84,53,53,-83,-69,53,-53,-86,-9,-10,-87,-88,-166,-307,53,-70,53,-85,53,53,-30,-167,53,53,53,-142,-308,-145,-146,53,53,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,53,-71,-35,-36,53,53,53,53,-143,-202,-201,53,-218,-78,-80,53,-214,-215,-217,53,53,53,-31,-34,53,53,-144,-203,-205,53,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'UNION':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[54,54,-60,-62,-63,-64,-65,-66,54,-67,-68,-52,-309,-309,-309,54,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,54,-84,54,54,-83,-69,54,-53,-86,-9,-10,-87,-88,-166,-307,54,-70,54,-85,54,54,-30,-167,54,54,54,-142,-308,-145,-146,54,54,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,54,-71,-35,-36,54,54,54,54,-143,-202,-201,54,-218,-78,-80,54,-214,-215,-217,54,54,54,-31,-34,54,54,-144,-203,-205,54,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'LBRACE':([10,14,15,23,31,32,53,54,56,57,58,59,62,77,78,81,98,99,101,102,103,106,107,109,113,130,131,144,152,153,154,155,156,157,158,159,160,161,162,172,215,227,228,264,265,267,272,273,282,283,286,287,289,338,339,340,351,352,381,382,384,386,395,398,399,432,434,442,443,458,459,460,461,463,464,472,473,476,477,491,492,494,495,508,510,519,521,523,526,527,529,],[-309,-68,-52,-29,101,101,-140,-141,101,-7,-8,-84,-309,-83,-69,-53,101,101,-307,101,101,101,-85,101,101,101,-30,-308,101,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,101,-309,-35,-36,-202,-201,101,101,-218,101,-80,-214,-215,-217,-11,101,-12,-31,-34,-203,101,-205,101,-79,-213,-216,-309,-182,-32,-33,-204,101,101,-309,101,101,101,101,101,-11,-206,-80,-208,-209,101,-309,-207,-210,101,101,-212,-211,]),'RBRACE':([14,77,78,101,104,106,127,136,137,138,139,140,141,143,144,146,147,150,151,152,153,154,155,156,157,158,159,160,161,162,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,214,215,244,245,247,249,251,254,264,265,269,270,273,282,283,286,287,289,325,326,327,329,330,331,333,334,336,337,338,373,374,377,381,384,387,395,398,399,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,431,432,433,458,462,469,470,473,475,491,492,493,494,495,499,503,509,510,514,519,520,521,527,529,],[-68,-83,-69,-307,144,-309,-294,144,-157,-160,144,144,144,-142,-308,-145,-146,144,-5,-6,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-177,-309,144,144,-158,144,144,-143,-202,-201,-235,-257,-218,-78,-80,-214,-215,-217,-279,-280,-260,-261,-262,-263,-304,-306,144,-22,-21,-159,-161,-144,-203,-205,-287,-79,-213,-216,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-178,144,-180,-204,-258,-272,-273,-264,-179,-206,-80,144,-208,-209,-237,-181,-281,144,-288,-207,-282,-210,-212,-211,]),'CASE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,164,-308,164,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,164,-202,-201,164,164,-218,164,-80,-214,-215,-217,-203,164,-205,-79,-213,-216,-204,164,164,164,-206,-80,-208,-209,164,-207,-210,164,164,-212,-211,]),'DEFAULT':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,165,-308,165,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,165,-202,-201,165,165,-218,165,-80,-214,-215,-217,-203,165,-205,-79,-213,-216,-204,165,165,165,-206,-80,-208,-209,165,-207,-210,165,165,-212,-211,]),'IF':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,167,-308,167,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,167,-202,-201,167,167,-218,167,-80,-214,-215,-217,-203,167,-205,-79,-213,-216,-204,167,167,167,-206,-80,-208,-209,167,-207,-210,167,167,-212,-211,]),'SWITCH':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,170,-308,170,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,170,-202,-201,170,170,-218,170,-80,-214,-215,-217,-203,170,-205,-79,-213,-216,-204,170,170,170,-206,-80,-208,-209,170,-207,-210,170,170,-212,-211,]),'WHILE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,281,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,171,-308,171,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,171,-202,-201,171,171,-218,394,171,-80,-214,-215,-217,-203,171,-205,-79,-213,-216,-204,171,171,171,-206,-80,-208,-209,171,-207,-210,171,171,-212,-211,]),'DO':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,172,-308,172,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,172,-202,-201,172,172,-218,172,-80,-214,-215,-217,-203,172,-205,-79,-213,-216,-204,172,172,172,-206,-80,-208,-209,172,-207,-210,172,172,-212,-211,]),'FOR':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,173,-308,173,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,173,-202,-201,173,173,-218,173,-80,-214,-215,-217,-203,173,-205,-79,-213,-216,-204,173,173,173,-206,-80,-208,-209,173,-207,-210,173,173,-212,-211,]),'GOTO':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,174,-308,174,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,174,-202,-201,174,174,-218,174,-80,-214,-215,-217,-203,174,-205,-79,-213,-216,-204,174,174,174,-206,-80,-208,-209,174,-207,-210,174,174,-212,-211,]),'BREAK':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,175,-308,175,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,175,-202,-201,175,175,-218,175,-80,-214,-215,-217,-203,175,-205,-79,-213,-216,-204,175,175,175,-206,-80,-208,-209,175,-207,-210,175,175,-212,-211,]),'CONTINUE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,176,-308,176,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,176,-202,-201,176,176,-218,176,-80,-214,-215,-217,-203,176,-205,-79,-213,-216,-204,176,176,176,-206,-80,-208,-209,176,-207,-210,176,176,-212,-211,]),'RETURN':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,177,-308,177,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,177,-202,-201,177,177,-218,177,-80,-214,-215,-217,-203,177,-205,-79,-213,-216,-204,177,177,177,-206,-80,-208,-209,177,-207,-210,177,177,-212,-211,]),'PLUSPLUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,183,183,-309,183,-309,-28,-294,183,-167,-308,183,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,183,183,183,183,325,183,183,183,183,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,183,-309,-28,-266,183,183,-309,183,183,-202,-201,183,183,183,-218,183,183,183,183,183,-80,183,-214,-215,-217,183,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,-279,-280,183,183,-304,-306,-11,183,-12,183,-266,183,183,-309,183,183,183,-203,183,-205,183,-287,-79,183,-213,-216,-274,-275,-276,-277,-278,-309,-182,183,-309,-28,-266,-204,183,183,-309,183,183,183,183,183,-272,-273,183,183,-11,-266,183,183,-206,-80,-208,-209,183,183,-281,-309,183,-288,183,-207,-282,-210,183,183,-212,-211,]),'MINUSMINUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,184,184,-309,184,-309,-28,-294,184,-167,-308,184,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,184,184,184,184,326,184,184,184,184,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,184,-309,-28,-266,184,184,-309,184,184,-202,-201,184,184,184,-218,184,184,184,184,184,-80,184,-214,-215,-217,184,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,-279,-280,184,184,-304,-306,-11,184,-12,184,-266,184,184,-309,184,184,184,-203,184,-205,184,-287,-79,184,-213,-216,-274,-275,-276,-277,-278,-309,-182,184,-309,-28,-266,-204,184,184,-309,184,184,184,184,184,-272,-273,184,184,-11,-266,184,184,-206,-80,-208,-209,184,184,-281,-309,184,-288,184,-207,-282,-210,184,184,-212,-211,]),'SIZEOF':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,187,187,-309,187,-309,-28,187,-167,-308,187,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,187,187,187,187,187,187,187,187,-266,-267,-268,-265,-269,-270,-309,187,-309,-28,-266,187,187,-309,187,187,-202,-201,187,187,187,-218,187,187,187,187,187,-80,187,-214,-215,-217,187,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,-11,187,-12,187,-266,187,187,-309,187,187,187,-203,187,-205,187,-79,187,-213,-216,-309,-182,187,-309,-28,-266,-204,187,187,-309,187,187,187,187,187,187,187,-11,-266,187,187,-206,-80,-208,-209,187,187,-309,187,187,-207,-210,187,187,-212,-211,]),'AND':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,191,191,-309,191,-309,-28,-294,191,-167,-308,191,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,191,191,191,191,-257,316,-259,191,191,191,-238,191,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,191,-309,-28,-266,191,191,-309,191,191,-202,-201,191,-257,191,191,-218,191,191,191,191,191,-80,191,-214,-215,-217,191,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,-279,-280,-260,191,-261,-262,-263,191,-304,-306,-11,191,-12,191,-266,191,191,-309,191,191,191,-203,191,-205,191,-287,-79,191,-213,-216,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,316,316,316,316,-274,-275,-276,-277,-278,-309,-182,191,-309,-28,-266,-204,191,191,-309,-258,191,191,191,191,191,-272,-273,191,-264,191,-11,-266,191,191,-206,-80,-208,-209,191,191,-281,-309,191,-288,191,-207,-282,-210,191,191,-212,-211,]),'PLUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,189,189,-309,189,-309,-28,-294,189,-167,-308,189,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,189,189,189,189,-257,306,-259,189,189,189,-238,189,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,189,-309,-28,-266,189,189,-309,189,189,-202,-201,189,-257,189,189,-218,189,189,189,189,189,-80,189,-214,-215,-217,189,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,-279,-280,-260,189,-261,-262,-263,189,-304,-306,-11,189,-12,189,-266,189,189,-309,189,189,189,-203,189,-205,189,-287,-79,189,-213,-216,-239,-240,-241,-242,-243,306,306,306,306,306,306,306,306,306,306,306,306,306,-274,-275,-276,-277,-278,-309,-182,189,-309,-28,-266,-204,189,189,-309,-258,189,189,189,189,189,-272,-273,189,-264,189,-11,-266,189,189,-206,-80,-208,-209,189,189,-281,-309,189,-288,189,-207,-282,-210,189,189,-212,-211,]),'MINUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,190,190,-309,190,-309,-28,-294,190,-167,-308,190,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,190,190,190,190,-257,307,-259,190,190,190,-238,190,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,190,-309,-28,-266,190,190,-309,190,190,-202,-201,190,-257,190,190,-218,190,190,190,190,190,-80,190,-214,-215,-217,190,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,-279,-280,-260,190,-261,-262,-263,190,-304,-306,-11,190,-12,190,-266,190,190,-309,190,190,190,-203,190,-205,190,-287,-79,190,-213,-216,-239,-240,-241,-242,-243,307,307,307,307,307,307,307,307,307,307,307,307,307,-274,-275,-276,-277,-278,-309,-182,190,-309,-28,-266,-204,190,190,-309,-258,190,190,190,190,190,-272,-273,190,-264,190,-11,-266,190,190,-206,-80,-208,-209,190,190,-281,-309,190,-288,190,-207,-282,-210,190,190,-212,-211,]),'NOT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,193,193,-309,193,-309,-28,193,-167,-308,193,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,193,193,193,193,193,193,193,193,-266,-267,-268,-265,-269,-270,-309,193,-309,-28,-266,193,193,-309,193,193,-202,-201,193,193,193,-218,193,193,193,193,193,-80,193,-214,-215,-217,193,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,-11,193,-12,193,-266,193,193,-309,193,193,193,-203,193,-205,193,-79,193,-213,-216,-309,-182,193,-309,-28,-266,-204,193,193,-309,193,193,193,193,193,193,193,-11,-266,193,193,-206,-80,-208,-209,193,193,-309,193,193,-207,-210,193,193,-212,-211,]),'LNOT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,194,194,-309,194,-309,-28,194,-167,-308,194,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,194,194,194,194,194,194,194,194,-266,-267,-268,-265,-269,-270,-309,194,-309,-28,-266,194,194,-309,194,194,-202,-201,194,194,194,-218,194,194,194,194,194,-80,194,-214,-215,-217,194,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,-11,194,-12,194,-266,194,194,-309,194,194,194,-203,194,-205,194,-79,194,-213,-216,-309,-182,194,-309,-28,-266,-204,194,194,-309,194,194,194,194,194,194,194,-11,-266,194,194,-206,-80,-208,-209,194,194,-309,194,194,-207,-210,194,194,-212,-211,]),'OFFSETOF':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,199,199,-309,199,-309,-28,199,-167,-308,199,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,199,199,199,199,199,199,199,199,-266,-267,-268,-265,-269,-270,-309,199,-309,-28,-266,199,199,-309,199,199,-202,-201,199,199,199,-218,199,199,199,199,199,-80,199,-214,-215,-217,199,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,-11,199,-12,199,-266,199,199,-309,199,199,199,-203,199,-205,199,-79,199,-213,-216,-309,-182,199,-309,-28,-266,-204,199,199,-309,199,199,199,199,199,199,199,-11,-266,199,199,-206,-80,-208,-209,199,199,-309,199,199,-207,-210,199,199,-212,-211,]),'INT_CONST_DEC':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,200,200,-309,200,-309,-28,200,-167,-308,200,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,200,200,200,200,200,200,200,200,-266,-267,-268,-265,-269,-270,-309,200,-309,-28,-266,200,200,-309,200,200,-202,-201,200,200,200,-218,200,200,200,200,200,-80,200,-214,-215,-217,200,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,-11,200,-12,200,-266,200,200,-309,200,200,200,-203,200,-205,200,-79,200,-213,-216,-309,-182,200,-309,-28,-266,-204,200,200,-309,200,200,200,200,200,200,200,-11,-266,200,200,-206,-80,-208,-209,200,200,-309,200,200,-207,-210,200,200,-212,-211,]),'INT_CONST_OCT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,201,201,-309,201,-309,-28,201,-167,-308,201,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,201,201,201,201,201,201,201,201,-266,-267,-268,-265,-269,-270,-309,201,-309,-28,-266,201,201,-309,201,201,-202,-201,201,201,201,-218,201,201,201,201,201,-80,201,-214,-215,-217,201,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,-11,201,-12,201,-266,201,201,-309,201,201,201,-203,201,-205,201,-79,201,-213,-216,-309,-182,201,-309,-28,-266,-204,201,201,-309,201,201,201,201,201,201,201,-11,-266,201,201,-206,-80,-208,-209,201,201,-309,201,201,-207,-210,201,201,-212,-211,]),'INT_CONST_HEX':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,202,202,-309,202,-309,-28,202,-167,-308,202,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,202,202,202,202,202,202,202,202,-266,-267,-268,-265,-269,-270,-309,202,-309,-28,-266,202,202,-309,202,202,-202,-201,202,202,202,-218,202,202,202,202,202,-80,202,-214,-215,-217,202,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,-11,202,-12,202,-266,202,202,-309,202,202,202,-203,202,-205,202,-79,202,-213,-216,-309,-182,202,-309,-28,-266,-204,202,202,-309,202,202,202,202,202,202,202,-11,-266,202,202,-206,-80,-208,-209,202,202,-309,202,202,-207,-210,202,202,-212,-211,]),'INT_CONST_BIN':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,203,203,-309,203,-309,-28,203,-167,-308,203,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,203,203,203,203,203,203,203,203,-266,-267,-268,-265,-269,-270,-309,203,-309,-28,-266,203,203,-309,203,203,-202,-201,203,203,203,-218,203,203,203,203,203,-80,203,-214,-215,-217,203,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,-11,203,-12,203,-266,203,203,-309,203,203,203,-203,203,-205,203,-79,203,-213,-216,-309,-182,203,-309,-28,-266,-204,203,203,-309,203,203,203,203,203,203,203,-11,-266,203,203,-206,-80,-208,-209,203,203,-309,203,203,-207,-210,203,203,-212,-211,]),'FLOAT_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,204,204,-309,204,-309,-28,204,-167,-308,204,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,204,204,204,204,204,204,204,204,-266,-267,-268,-265,-269,-270,-309,204,-309,-28,-266,204,204,-309,204,204,-202,-201,204,204,204,-218,204,204,204,204,204,-80,204,-214,-215,-217,204,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,-11,204,-12,204,-266,204,204,-309,204,204,204,-203,204,-205,204,-79,204,-213,-216,-309,-182,204,-309,-28,-266,-204,204,204,-309,204,204,204,204,204,204,204,-11,-266,204,204,-206,-80,-208,-209,204,204,-309,204,204,-207,-210,204,204,-212,-211,]),'HEX_FLOAT_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,205,205,-309,205,-309,-28,205,-167,-308,205,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,205,205,205,205,205,205,205,205,-266,-267,-268,-265,-269,-270,-309,205,-309,-28,-266,205,205,-309,205,205,-202,-201,205,205,205,-218,205,205,205,205,205,-80,205,-214,-215,-217,205,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,-11,205,-12,205,-266,205,205,-309,205,205,205,-203,205,-205,205,-79,205,-213,-216,-309,-182,205,-309,-28,-266,-204,205,205,-309,205,205,205,205,205,205,205,-11,-266,205,205,-206,-80,-208,-209,205,205,-309,205,205,-207,-210,205,205,-212,-211,]),'CHAR_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,206,206,-309,206,-309,-28,206,-167,-308,206,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,206,206,206,206,206,206,206,206,-266,-267,-268,-265,-269,-270,-309,206,-309,-28,-266,206,206,-309,206,206,-202,-201,206,206,206,-218,206,206,206,206,206,-80,206,-214,-215,-217,206,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,-11,206,-12,206,-266,206,206,-309,206,206,206,-203,206,-205,206,-79,206,-213,-216,-309,-182,206,-309,-28,-266,-204,206,206,-309,206,206,206,206,206,206,206,-11,-266,206,206,-206,-80,-208,-209,206,206,-309,206,206,-207,-210,206,206,-212,-211,]),'WCHAR_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,207,207,-309,207,-309,-28,207,-167,-308,207,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,207,207,207,207,207,207,207,207,-266,-267,-268,-265,-269,-270,-309,207,-309,-28,-266,207,207,-309,207,207,-202,-201,207,207,207,-218,207,207,207,207,207,-80,207,-214,-215,-217,207,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,-11,207,-12,207,-266,207,207,-309,207,207,207,-203,207,-205,207,-79,207,-213,-216,-309,-182,207,-309,-28,-266,-204,207,207,-309,207,207,207,207,207,207,207,-11,-266,207,207,-206,-80,-208,-209,207,207,-309,207,207,-207,-210,207,207,-212,-211,]),'STRING_LITERAL':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,197,208,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,333,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,208,208,-309,208,-309,-28,208,-167,-308,208,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,208,208,208,208,208,208,208,208,-266,-267,-268,-265,-269,-270,333,-303,-309,208,-309,-28,-266,208,208,-309,208,208,-202,-201,208,208,208,-218,208,208,208,208,208,-80,208,-214,-215,-217,208,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,-304,-11,208,-12,208,-266,208,208,-309,208,208,208,-203,208,-205,208,-79,208,-213,-216,-309,-182,208,-309,-28,-266,-204,208,208,-309,208,208,208,208,208,208,208,-11,-266,208,208,-206,-80,-208,-209,208,208,-309,208,208,-207,-210,208,208,-212,-211,]),'WSTRING_LITERAL':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,198,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,209,209,-309,209,-309,-28,209,-167,-308,209,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,209,209,209,209,209,209,209,209,-266,-267,-268,-265,-269,-270,334,-305,-309,209,-309,-28,-266,209,209,-309,209,209,-202,-201,209,209,209,-218,209,209,209,209,209,-80,209,-214,-215,-217,209,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,-306,-11,209,-12,209,-266,209,209,-309,209,209,209,-203,209,-205,209,-79,209,-213,-216,-309,-182,209,-309,-28,-266,-204,209,209,-309,209,209,209,209,209,209,209,-11,-266,209,209,-206,-80,-208,-209,209,209,-309,209,209,-207,-210,209,209,-212,-211,]),'ELSE':([14,78,144,156,157,158,159,160,161,162,264,273,282,283,286,287,289,381,384,395,398,399,458,491,492,494,495,519,521,527,529,],[-68,-69,-308,-72,-73,-74,-75,-76,-77,-78,-202,-218,-78,-80,-214,-215,-217,-203,-205,-79,-213,-216,-204,-206,508,-208,-209,-207,-210,-212,-211,]),'PPPRAGMASTR':([14,],[78,]),'EQUALS':([15,23,62,73,74,75,76,81,92,108,110,127,131,138,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,227,228,270,325,326,327,329,330,331,333,334,341,342,349,350,351,352,387,422,424,425,426,427,435,437,438,439,442,443,462,469,470,473,478,479,480,509,514,520,],[-52,-29,-162,113,-163,-54,-37,-53,130,-162,-55,-294,-30,248,-308,-294,291,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,-35,-36,-257,-279,-280,-260,-261,-262,-263,-304,-306,434,-183,-43,-44,-31,-34,-287,-274,-275,-276,-277,-278,-184,-186,-39,-42,-32,-33,-258,-272,-273,-264,-185,-40,-41,-281,-288,-282,]),'COMMA':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,62,63,64,65,66,70,72,73,74,75,76,81,87,90,91,92,94,95,96,97,98,99,102,103,108,110,121,123,124,125,126,127,131,132,133,136,137,138,142,144,148,163,169,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,211,212,213,214,227,228,231,232,233,234,235,236,237,240,241,242,243,244,245,246,247,250,252,253,256,257,259,260,261,263,269,270,276,277,288,325,326,327,329,330,331,333,334,337,349,350,351,352,356,357,358,359,371,372,373,374,375,376,380,385,387,388,389,391,392,393,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,430,431,433,438,439,442,443,449,450,452,456,457,462,469,470,473,475,479,480,485,486,487,488,489,490,493,496,499,500,503,504,505,509,514,517,518,520,525,],[-52,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-162,-89,-90,-91,-92,111,-120,-122,-163,-54,-37,-53,-94,129,-124,-126,-164,-27,-28,-166,-152,-153,-132,-133,-162,-55,229,230,-170,-175,-309,-294,-30,-165,-167,247,-157,-160,-135,-308,-130,-294,278,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-121,-38,-123,-177,-35,-36,-172,-173,-174,-188,-56,-1,-2,-45,-190,-125,-127,247,247,-154,-158,-137,-139,-134,-128,-129,378,-147,-149,-131,-235,-257,278,-309,278,-279,-280,-260,-261,-262,-263,-304,-306,432,-43,-44,-31,-34,-171,-176,-57,-189,-155,-156,-159,-161,-136,-138,-151,278,-287,-187,-188,-220,278,278,-223,278,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,278,471,-274,-292,-275,-276,-277,-278,474,-178,-180,-39,-42,-32,-33,-191,-197,-195,-148,-150,-258,-272,-273,-264,-179,-40,-41,-50,-51,-193,-192,-194,-196,510,278,-237,-293,-181,-46,-49,-281,-288,-47,-48,-282,278,]),'RPAREN':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,63,64,65,66,75,76,80,81,87,93,94,95,96,97,98,99,102,103,110,112,115,119,120,121,122,123,124,125,126,127,131,132,133,142,144,148,169,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,219,220,227,228,231,232,233,234,235,236,237,238,240,241,246,250,252,253,256,257,263,266,270,275,276,277,322,325,326,327,329,330,331,333,334,349,350,351,352,355,356,357,358,359,361,362,363,364,365,366,370,371,372,375,376,383,385,387,388,389,390,391,392,393,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,421,422,423,424,425,426,427,428,429,438,439,442,443,447,448,449,450,452,455,462,469,470,473,479,480,485,486,487,488,489,490,496,498,499,500,501,502,504,505,509,512,513,514,517,518,520,522,524,528,],[-52,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-89,-90,-91,-92,-54,-37,-309,-53,-94,131,-164,-27,-28,-166,-152,-153,-132,-133,-55,212,-309,227,228,-168,-17,-18,-170,-175,-309,-294,-30,-165,-167,-135,-308,-130,-14,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,349,350,-35,-36,-172,-173,-174,-188,-56,-1,-2,-309,-45,-190,-154,-137,-139,-134,-128,-129,-131,-13,-257,386,387,-309,422,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-169,-171,-176,-57,-189,-309,449,450,-188,-23,-24,-309,-155,-156,-136,-138,459,460,-287,-187,-188,-309,-220,463,464,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,470,-274,-292,-275,-276,-277,-278,472,473,-39,-42,-32,-33,485,486,-191,-197,-195,490,-258,-272,-273,-264,-40,-41,-50,-51,-193,-192,-194,-196,511,-309,-237,-293,514,-289,-46,-49,-281,-309,523,-288,-47,-48,-282,526,-290,-291,]),'COLON':([15,20,23,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,74,75,76,81,98,99,102,103,108,110,127,131,142,144,145,148,163,165,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,227,228,246,250,252,253,256,257,261,263,268,269,270,325,326,327,329,330,331,333,334,349,350,351,352,371,372,375,376,378,387,391,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,438,439,442,443,462,469,470,473,479,480,499,509,514,520,],[-52,-116,-29,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-163,-54,-37,-53,-152,-153,-132,-133,-162,-55,-294,-30,-135,-308,262,-130,267,272,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,-35,-36,-154,-137,-139,-134,-128,-129,379,-131,382,-235,-257,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-155,-156,-136,-138,262,-287,-220,-223,468,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-39,-42,-32,-33,-258,-272,-273,-264,-40,-41,-237,-281,-288,-282,]),'LBRACKET':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,63,64,65,66,75,76,81,87,94,95,96,97,98,99,101,102,103,110,126,127,131,132,133,142,144,148,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,215,227,228,234,235,238,240,241,246,250,252,253,256,257,263,277,325,326,333,334,341,342,349,350,351,352,358,359,364,371,372,375,376,387,389,390,422,424,425,426,427,432,435,437,438,439,442,443,449,450,452,461,469,470,478,479,480,485,486,487,488,489,490,501,502,504,505,509,510,514,517,518,520,524,528,],[79,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-89,-90,-91,-92,114,-37,79,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,114,239,-294,-30,-165,-167,-135,-308,-130,-294,321,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,343,-35,-36,239,360,239,-45,369,-154,-137,-139,-134,-128,-129,-131,239,-279,-280,-304,-306,343,-183,-43,-44,-31,-34,360,369,239,-155,-156,-136,-138,-287,239,239,-274,-275,-276,-277,-278,343,-184,-186,-39,-42,-32,-33,-191,-197,-195,343,-272,-273,-185,-40,-41,-50,-51,-193,-192,-194,-196,516,-289,-46,-49,-281,343,-288,-47,-48,-282,-290,-291,]),'RBRACKET':([45,46,47,79,95,96,97,114,116,118,127,133,144,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,216,218,221,222,223,224,239,269,270,325,326,327,329,330,331,333,334,345,346,353,354,360,367,368,369,387,391,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,422,424,425,426,427,436,440,441,444,446,451,453,454,462,469,470,473,481,482,499,506,507,509,514,520,525,],[-117,-118,-119,-309,-27,-28,-166,-309,-309,-28,-294,-167,-308,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,-28,351,352,-3,-4,-309,-235,-257,-279,-280,-260,-261,-262,-263,-304,-306,438,439,442,443,-309,-309,452,-309,-287,-220,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,469,-274,-275,-276,-277,-278,478,479,480,-309,-28,487,488,489,-258,-272,-273,-264,504,505,-237,517,518,-281,-288,-282,528,]),'PERIOD':([101,127,144,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,325,326,333,334,341,342,387,422,424,425,426,427,432,435,437,461,469,470,478,501,502,509,510,514,520,524,528,],[-307,-294,-308,-294,323,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,344,-279,-280,-304,-306,344,-183,-287,-274,-275,-276,-277,-278,344,-184,-186,344,-272,-273,-185,515,-289,-281,344,-288,-282,-290,-291,]),'ARROW':([127,144,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,325,326,333,334,387,422,424,425,426,427,469,470,509,514,520,],[-294,-308,-294,324,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-279,-280,-304,-306,-287,-274,-275,-276,-277,-278,-272,-273,-281,-288,-282,]),'XOREQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,292,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'TIMESEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,293,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'DIVEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,294,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MODEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,295,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'PLUSEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,296,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MINUSEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,297,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LSHIFTEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,298,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'RSHIFTEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,299,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'ANDEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,300,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'OREQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,301,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'CONDOP':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,302,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'DIVIDE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,304,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MOD':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,305,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'RSHIFT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,308,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,308,308,308,308,308,308,308,308,308,308,308,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LSHIFT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,309,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,309,309,309,309,309,309,309,309,309,309,309,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,310,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,310,310,310,310,310,310,310,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,311,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,311,311,311,311,311,311,311,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'GE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,312,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,312,312,312,312,312,312,312,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'GT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,313,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,313,313,313,313,313,313,313,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'EQ':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,314,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,314,314,314,314,314,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'NE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,315,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,315,315,315,315,315,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'OR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,317,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,317,317,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'XOR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,318,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,318,-254,318,318,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LAND':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,319,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,319,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LOR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,320,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'ELLIPSIS':([229,],[355,]),} -_lr_action = { } +_lr_action = {} for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): - if not _x in _lr_action: _lr_action[_x] = { } + if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items -_lr_goto_items = {'storage_class_specifier':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,]),'identifier_list_opt':([66,],[106,]),'selection_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[298,298,298,298,298,298,298,298,298,298,298,298,]),'constant':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,]),'unary_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[120,120,120,220,231,234,120,240,120,120,120,231,231,120,120,120,120,120,120,120,120,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,120,231,231,231,120,120,231,120,120,231,120,231,120,120,120,120,120,120,120,231,231,120,120,120,120,120,120,120,120,120,120,120,120,120,]),'conditional_expression':([72,77,103,141,162,164,170,181,192,195,196,213,219,226,227,230,233,257,264,266,281,288,289,297,309,335,373,375,376,380,384,385,393,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[151,151,151,151,151,151,151,305,305,151,151,151,151,151,151,151,151,151,305,151,151,305,151,151,305,151,151,151,151,151,151,151,151,419,151,151,151,151,151,151,151,151,151,151,151,151,151,]),'brace_close':([93,101,172,173,188,189,261,299,362,418,429,],[174,191,302,303,310,311,359,383,404,430,437,]),'struct_or_union_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,]),'unified_wstring_literal':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,]),'abstract_declarator_opt':([110,239,],[199,337,]),'iteration_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[277,277,277,277,277,277,277,277,277,277,277,277,]),'init_declarator_list':([30,86,],[71,71,]),'translation_unit_or_empty':([0,],[8,]),'struct_declaration_list':([57,91,92,],[93,172,173,]),'block_item_list_opt':([170,],[299,]),'enumerator':([64,98,99,190,],[100,100,100,312,]),'pp_directive':([0,22,],[11,11,]),'abstract_declarator':([30,78,86,97,110,167,239,338,],[79,161,79,185,201,161,201,161,]),'declaration_specifiers_opt':([1,14,42,44,],[50,58,83,84,]),'external_declaration':([0,22,],[12,61,]),'type_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[14,14,14,14,14,14,14,94,14,14,14,14,94,94,94,94,94,94,14,14,14,94,94,14,94,94,94,94,14,14,14,]),'designation':([155,362,399,429,],[260,260,260,260,]),'compound_statement':([88,163,170,289,297,375,384,411,423,425,427,441,443,446,],[169,272,282,282,282,282,282,282,282,282,282,282,282,282,]),'pointer':([0,4,22,30,68,78,86,97,110,117,167,239,306,338,],[16,16,16,74,116,74,166,166,74,16,166,339,16,339,]),'type_name':([141,219,229,230,233,],[237,322,331,332,333,]),'unified_string_literal':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,]),'postfix_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,]),'assignment_expression_opt':([72,103,164,],[131,193,273,]),'designation_opt':([155,362,399,429,],[266,402,266,402,]),'expression_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[276,276,276,276,276,276,276,276,276,276,276,276,]),'parameter_declaration':([66,78,165,167,204,338,],[109,109,109,109,320,109,]),'initializer_list_opt':([155,],[261,]),'cast_expression':([72,77,103,134,141,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[132,132,132,232,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,398,132,132,132,132,132,132,132,398,132,132,132,132,132,132,132,132,132,132,132,132,132,132,]),'init_declarator':([30,86,117,],[75,75,205,]),'struct_declarator_list':([97,],[182,]),'unary_operator':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,]),'brace_open':([7,24,54,56,62,63,77,88,162,163,170,266,289,297,336,375,384,390,395,396,402,411,423,425,427,441,443,446,],[57,64,91,92,98,99,155,170,155,170,170,155,170,170,399,170,170,399,399,399,155,170,170,170,170,170,170,170,]),'assignment_operator':([120,],[213,]),'struct_or_union':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,]),'identifier':([66,72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,203,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,263,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,394,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[114,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,318,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,360,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,417,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,]),'struct_declaration':([57,91,92,93,172,173,],[95,95,95,175,175,175,]),'assignment_expression':([72,77,103,141,162,164,170,195,196,213,219,226,227,230,233,257,266,281,289,297,335,373,375,376,380,384,385,393,402,408,411,421,423,425,426,427,432,438,441,443,446,],[136,156,136,238,156,136,238,316,317,321,238,238,328,238,238,238,156,238,238,238,397,238,238,238,238,238,238,416,156,238,238,238,238,238,238,238,238,238,238,238,238,]),'parameter_type_list':([66,78,165,167,338,],[108,159,159,159,159,]),'type_qualifier_list_opt':([28,65,105,],[68,103,196,]),'direct_declarator':([0,4,16,22,30,74,78,86,97,110,117,166,167,306,],[26,26,60,26,26,60,26,26,26,26,26,60,26,26,]),'type_qualifier_list':([28,65,105,],[67,104,67,]),'designator':([155,267,362,399,429,],[262,364,262,262,262,]),'argument_expression_list':([227,],[330,]),'initializer':([77,162,266,402,],[154,271,363,420,]),'specifier_qualifier_list_opt':([94,96,],[178,180,]),'constant_expression':([181,192,264,288,309,],[304,313,361,377,387,]),'expression_opt':([170,289,297,373,375,384,408,411,421,423,425,427,432,438,441,443,446,],[279,279,279,407,279,279,422,279,431,279,279,279,439,442,279,279,279,]),'primary_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,]),'declaration_specifiers':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[30,52,52,30,52,52,86,110,110,86,86,110,110,86,110,86,110,86,]),'declaration':([0,22,48,80,89,170,289,373,],[31,31,87,87,171,292,292,408,]),'struct_declarator_list_opt':([97,],[183,]),'identifier_list':([66,],[111,]),'typedef_name':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,]),'parameter_type_list_opt':([78,165,167,338,],[160,275,160,160,]),'jump_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[293,293,293,293,293,293,293,293,293,293,293,293,]),'declaration_list_opt':([48,80,],[88,163,]),'struct_declarator':([97,306,],[184,386,]),'function_definition':([0,22,],[36,36,]),'binary_expression':([72,77,103,141,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,373,375,376,380,384,385,393,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,147,357,358,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,]),'parameter_list':([66,78,165,167,338,],[113,113,113,113,113,]),'init_declarator_list_opt':([30,86,],[73,73,]),'enum_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,]),'decl_body':([0,22,48,80,89,170,289,373,],[41,41,41,41,41,41,41,41,]),'type_qualifier':([0,1,14,22,28,42,44,48,57,65,66,67,78,80,89,91,92,93,94,96,104,105,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[42,42,42,42,69,42,42,42,96,69,42,115,42,42,42,96,96,96,96,96,115,69,96,42,42,42,96,96,42,96,96,96,96,42,42,42,]),'statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[291,291,382,409,414,424,433,434,436,445,447,448,]),'enumerator_list':([64,98,99,],[101,188,189,]),'labeled_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[280,280,280,280,280,280,280,280,280,280,280,280,]),'function_specifier':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,]),'specifier_qualifier_list':([57,91,92,93,94,96,141,172,173,219,229,230,233,],[97,97,97,97,179,179,239,97,97,239,239,239,239,]),'block_item':([170,289,],[295,379,]),'block_item_list':([170,],[289,]),'empty':([0,1,14,28,30,42,44,48,65,66,72,78,80,86,94,96,97,103,105,110,155,164,165,167,170,239,289,297,338,362,373,375,384,399,408,411,421,423,425,427,429,432,438,441,443,446,],[47,51,51,70,76,51,51,85,70,107,150,158,85,76,177,177,186,150,70,200,268,150,158,158,296,200,378,378,158,403,378,378,378,403,378,378,378,378,378,378,403,378,378,378,378,378,]),'translation_unit':([0,],[22,]),'initializer_list':([155,399,],[265,418,]),'declarator':([0,4,22,30,78,86,97,110,117,167,306,],[48,53,48,80,53,168,187,202,168,53,187,]),'direct_abstract_declarator':([30,74,78,86,97,110,166,167,239,338,339,],[81,153,81,81,81,81,153,81,81,81,153,]),'designator_list':([155,362,399,429,],[267,267,267,267,]),'declaration_list':([48,80,],[89,89,]),'expression':([141,170,219,226,230,233,257,281,289,297,373,375,376,380,384,385,408,411,421,423,425,426,427,432,438,441,443,446,],[236,285,236,327,236,236,356,372,285,285,285,285,410,412,285,415,285,285,285,285,285,435,285,285,285,285,285,285,]),} +_lr_goto_items = {'translation_unit_or_empty':([0,],[1,]),'translation_unit':([0,],[2,]),'empty':([0,10,11,17,18,19,22,26,60,61,62,79,80,106,114,115,116,117,126,145,152,172,215,216,217,238,239,267,272,277,282,284,360,361,367,369,370,382,390,397,432,444,445,460,461,463,464,466,498,508,510,512,523,526,],[3,57,69,83,83,83,89,95,69,89,57,95,122,151,95,122,223,95,236,258,266,266,338,223,95,365,95,266,266,236,266,266,95,122,223,223,365,266,365,266,477,223,95,266,477,266,266,266,266,266,477,266,266,266,]),'external_declaration':([0,2,],[4,55,]),'function_definition':([0,2,],[5,5,]),'declaration':([0,2,10,58,62,106,152,284,],[6,6,59,107,59,154,154,397,]),'pp_directive':([0,2,],[7,7,]),'pppragma_directive':([0,2,104,106,139,140,141,152,172,249,251,267,272,282,382,460,463,464,508,523,526,],[8,8,147,162,147,147,147,162,282,147,147,282,282,162,282,282,282,282,282,282,282,]),'id_declarator':([0,2,11,22,24,60,61,71,111,126,129,145,238,378,],[10,10,62,92,93,108,92,93,108,231,108,108,93,108,]),'declaration_specifiers':([0,2,10,58,62,80,106,115,152,229,238,284,361,370,390,],[11,11,60,60,60,126,60,126,60,126,126,60,126,126,126,]),'decl_body':([0,2,10,58,62,106,152,284,],[12,12,12,12,12,12,12,12,]),'direct_id_declarator':([0,2,11,16,22,24,60,61,68,71,111,126,129,145,234,238,364,378,],[15,15,15,81,15,15,15,15,81,15,15,15,15,15,81,15,81,15,]),'pointer':([0,2,11,22,24,60,61,71,94,111,126,129,145,238,277,378,390,],[16,16,68,16,16,68,16,68,132,68,234,68,68,364,389,68,389,]),'type_qualifier':([0,2,10,11,17,18,19,26,58,60,62,79,80,96,104,106,114,115,117,118,126,139,140,141,145,149,152,168,217,218,229,238,239,249,251,271,277,284,328,332,335,360,361,370,390,445,446,],[17,17,17,63,17,17,17,97,17,63,17,97,17,133,97,17,97,17,97,133,63,97,97,97,257,133,17,97,97,133,17,17,97,97,97,97,257,17,97,97,97,97,17,17,17,97,133,]),'storage_class_specifier':([0,2,10,11,17,18,19,58,60,62,80,106,115,126,152,229,238,284,361,370,390,],[18,18,18,64,18,18,18,18,64,18,18,18,18,64,18,18,18,18,18,18,18,]),'function_specifier':([0,2,10,11,17,18,19,58,60,62,80,106,115,126,152,229,238,284,361,370,390,],[19,19,19,65,19,19,19,19,65,19,19,19,19,65,19,19,19,19,19,19,19,]),'type_specifier_no_typeid':([0,2,10,11,22,58,60,61,62,80,104,106,115,126,128,139,140,141,145,149,152,168,229,238,249,251,271,277,284,328,332,335,361,370,390,],[20,20,20,66,20,20,66,20,20,20,20,20,20,66,20,20,20,20,256,20,20,20,20,20,20,20,20,256,20,20,20,20,20,20,20,]),'type_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[21,21,21,87,21,87,21,21,148,21,21,87,148,148,148,263,21,148,21,21,148,148,148,21,148,148,148,21,21,21,]),'declaration_specifiers_no_type':([0,2,10,17,18,19,58,62,80,106,115,152,229,238,284,361,370,390,],[22,22,61,84,84,84,61,61,128,61,128,61,128,128,61,128,128,128,]),'typedef_name':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,]),'enum_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,]),'struct_or_union_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,]),'struct_or_union':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,]),'declaration_list_opt':([10,62,],[56,109,]),'declaration_list':([10,62,],[58,58,]),'init_declarator_list_opt':([11,60,],[67,67,]),'init_declarator_list':([11,60,],[70,70,]),'init_declarator':([11,60,111,129,],[72,72,211,242,]),'declarator':([11,60,111,129,145,378,],[73,73,73,73,261,261,]),'typeid_declarator':([11,60,71,111,129,145,378,],[74,74,112,74,74,74,74,]),'direct_typeid_declarator':([11,60,68,71,111,129,145,378,],[75,75,110,75,75,75,75,75,]),'declaration_specifiers_no_type_opt':([17,18,19,],[82,85,86,]),'id_init_declarator_list_opt':([22,61,],[88,88,]),'id_init_declarator_list':([22,61,],[90,90,]),'id_init_declarator':([22,61,],[91,91,]),'type_qualifier_list_opt':([26,79,114,117,217,239,360,445,],[94,116,216,225,347,367,444,483,]),'type_qualifier_list':([26,79,104,114,117,139,140,141,168,217,239,249,251,271,328,332,335,360,445,],[96,118,149,218,96,149,149,149,149,96,96,149,149,149,149,149,149,446,96,]),'brace_open':([31,32,56,98,99,102,103,106,109,113,130,152,172,267,272,282,339,382,386,459,460,463,464,472,473,476,508,523,526,],[100,104,106,134,135,139,140,106,106,215,215,106,106,106,106,106,215,106,461,461,106,106,106,461,461,215,106,106,106,]),'compound_statement':([56,106,109,152,172,267,272,282,382,460,463,464,508,523,526,],[105,158,210,158,158,158,158,158,158,158,158,158,158,158,158,]),'parameter_type_list':([80,115,238,361,370,390,],[119,219,366,447,366,366,]),'identifier_list_opt':([80,115,361,],[120,220,448,]),'parameter_list':([80,115,238,361,370,390,],[121,121,121,121,121,121,]),'identifier_list':([80,115,361,],[123,123,123,]),'parameter_declaration':([80,115,229,238,361,370,390,],[124,124,356,124,124,124,124,]),'identifier':([80,106,113,115,116,130,152,164,168,172,177,183,184,185,187,216,225,226,230,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,344,347,348,361,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,474,476,483,484,498,508,512,515,516,523,526,],[125,195,195,125,195,195,195,195,195,195,195,195,195,195,195,195,195,195,357,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,437,195,195,125,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,502,195,195,195,195,195,195,524,195,195,195,]),'enumerator_list':([100,134,135,],[136,244,245,]),'enumerator':([100,134,135,247,],[137,137,137,373,]),'struct_declaration_list':([104,139,140,],[141,249,251,]),'brace_close':([104,136,139,140,141,150,244,245,249,251,336,432,493,510,],[142,246,250,252,253,264,371,372,375,376,431,475,509,520,]),'struct_declaration':([104,139,140,141,249,251,],[143,143,143,254,254,254,]),'specifier_qualifier_list':([104,139,140,141,168,249,251,271,328,332,335,],[145,145,145,145,277,145,145,277,277,277,277,]),'block_item_list_opt':([106,],[150,]),'block_item_list':([106,],[152,]),'block_item':([106,152,],[153,265,]),'statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[155,155,283,283,283,395,283,492,283,283,283,283,283,]),'labeled_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[156,156,156,156,156,156,156,156,156,156,156,156,156,]),'expression_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[157,157,157,157,157,157,157,157,157,157,157,157,157,]),'selection_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[159,159,159,159,159,159,159,159,159,159,159,159,159,]),'iteration_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[160,160,160,160,160,160,160,160,160,160,160,160,160,]),'jump_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[161,161,161,161,161,161,161,161,161,161,161,161,161,]),'expression_opt':([106,152,172,267,272,282,284,382,397,460,463,464,466,498,508,512,523,526,],[166,166,166,166,166,166,396,166,467,166,166,166,497,513,166,522,166,166,]),'expression':([106,152,168,172,177,267,271,272,274,279,280,282,284,302,321,328,332,382,397,460,463,464,465,466,498,508,512,516,523,526,],[169,169,276,169,288,169,276,169,385,392,393,169,169,401,420,276,276,169,169,169,169,169,496,169,169,169,169,525,169,169,]),'assignment_expression':([106,113,116,130,152,168,172,177,216,225,226,267,271,272,274,278,279,280,282,284,290,302,321,322,328,332,339,347,348,367,369,382,397,444,460,463,464,465,466,471,476,483,484,498,508,512,516,523,526,],[178,214,224,214,178,178,178,178,224,353,354,178,178,178,178,391,178,178,178,178,400,178,178,423,178,178,214,440,441,224,224,178,178,224,178,178,178,178,178,500,214,506,507,178,178,178,178,178,178,]),'conditional_expression':([106,113,116,130,152,164,168,172,177,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,321,322,328,332,339,343,347,348,367,369,379,382,397,444,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[179,179,179,179,179,269,179,179,179,179,179,179,269,269,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,269,179,179,179,179,269,179,179,179,179,179,179,179,179,499,179,179,179,179,179,179,179,179,179,179,]),'unary_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[180,180,180,180,180,270,180,180,180,327,329,270,331,180,180,180,270,270,180,180,180,180,180,180,180,180,180,180,180,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,180,180,180,180,180,270,180,180,180,180,270,180,270,180,180,270,180,180,180,180,180,270,180,180,180,180,180,180,180,180,180,180,]),'binary_expression':([106,113,116,130,152,164,168,172,177,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,397,444,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,]),'postfix_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,]),'unary_operator':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,]),'cast_expression':([106,113,116,130,152,164,168,172,177,185,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[186,186,186,186,186,186,186,186,186,330,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,462,186,186,462,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,]),'primary_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,]),'constant':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,]),'unified_string_literal':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,]),'unified_wstring_literal':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,]),'initializer':([113,130,339,476,],[213,243,433,503,]),'assignment_expression_opt':([116,216,367,369,444,],[221,345,451,453,481,]),'typeid_noparen_declarator':([126,],[232,]),'abstract_declarator_opt':([126,277,],[233,388,]),'direct_typeid_noparen_declarator':([126,234,],[235,358,]),'abstract_declarator':([126,238,277,390,],[237,362,237,362,]),'direct_abstract_declarator':([126,234,238,277,364,389,390,],[241,359,241,241,359,359,241,]),'struct_declarator_list_opt':([145,],[255,]),'struct_declarator_list':([145,],[259,]),'struct_declarator':([145,378,],[260,456,]),'constant_expression':([164,248,262,343,379,],[268,374,380,436,457,]),'type_name':([168,271,328,332,335,],[275,383,428,429,430,]),'pragmacomp_or_statement':([172,267,272,382,460,463,464,508,523,526,],[281,381,384,458,491,494,495,519,527,529,]),'assignment_operator':([180,],[290,]),'initializer_list_opt':([215,],[336,]),'initializer_list':([215,461,],[337,493,]),'designation_opt':([215,432,461,510,],[339,476,339,476,]),'designation':([215,432,461,510,],[340,340,340,340,]),'designator_list':([215,432,461,510,],[341,341,341,341,]),'designator':([215,341,432,461,510,],[342,435,342,342,342,]),'parameter_type_list_opt':([238,370,390,],[363,455,363,]),'argument_expression_list':([322,],[421,]),'offsetof_member_designator':([474,],[501,]),} -_lr_goto = { } +_lr_goto = {} for _k, _v in _lr_goto_items.items(): - for _x,_y in zip(_v[0],_v[1]): - if not _x in _lr_goto: _lr_goto[_x] = { } + for _x, _y in zip(_v[0], _v[1]): + if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> translation_unit_or_empty","S'",1,None,None,None), - ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','../pycparser/plyparser.py',42), - ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','../pycparser/plyparser.py',43), - ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','../pycparser/plyparser.py',42), - ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','../pycparser/plyparser.py',43), - ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','../pycparser/plyparser.py',42), - ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','../pycparser/plyparser.py',43), - ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','../pycparser/plyparser.py',42), - ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','../pycparser/plyparser.py',43), - ('declaration_specifiers_opt -> empty','declaration_specifiers_opt',1,'p_declaration_specifiers_opt','../pycparser/plyparser.py',42), - ('declaration_specifiers_opt -> declaration_specifiers','declaration_specifiers_opt',1,'p_declaration_specifiers_opt','../pycparser/plyparser.py',43), - ('designation_opt -> empty','designation_opt',1,'p_designation_opt','../pycparser/plyparser.py',42), - ('designation_opt -> designation','designation_opt',1,'p_designation_opt','../pycparser/plyparser.py',43), - ('expression_opt -> empty','expression_opt',1,'p_expression_opt','../pycparser/plyparser.py',42), - ('expression_opt -> expression','expression_opt',1,'p_expression_opt','../pycparser/plyparser.py',43), - ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','../pycparser/plyparser.py',42), - ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','../pycparser/plyparser.py',43), - ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','../pycparser/plyparser.py',42), - ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','../pycparser/plyparser.py',43), - ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','../pycparser/plyparser.py',42), - ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','../pycparser/plyparser.py',43), - ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','../pycparser/plyparser.py',42), - ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','../pycparser/plyparser.py',43), - ('specifier_qualifier_list_opt -> empty','specifier_qualifier_list_opt',1,'p_specifier_qualifier_list_opt','../pycparser/plyparser.py',42), - ('specifier_qualifier_list_opt -> specifier_qualifier_list','specifier_qualifier_list_opt',1,'p_specifier_qualifier_list_opt','../pycparser/plyparser.py',43), - ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','../pycparser/plyparser.py',42), - ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','../pycparser/plyparser.py',43), - ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','../pycparser/plyparser.py',42), - ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','../pycparser/plyparser.py',43), - ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','../pycparser/c_parser.py',494), - ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','../pycparser/c_parser.py',495), - ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','../pycparser/c_parser.py',503), - ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','../pycparser/c_parser.py',510), - ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','../pycparser/c_parser.py',522), - ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','../pycparser/c_parser.py',527), - ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','../pycparser/c_parser.py',532), - ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','../pycparser/c_parser.py',537), - ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','../pycparser/c_parser.py',542), - ('function_definition -> declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','../pycparser/c_parser.py',551), - ('function_definition -> declaration_specifiers declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','../pycparser/c_parser.py',568), - ('statement -> labeled_statement','statement',1,'p_statement','../pycparser/c_parser.py',579), - ('statement -> expression_statement','statement',1,'p_statement','../pycparser/c_parser.py',580), - ('statement -> compound_statement','statement',1,'p_statement','../pycparser/c_parser.py',581), - ('statement -> selection_statement','statement',1,'p_statement','../pycparser/c_parser.py',582), - ('statement -> iteration_statement','statement',1,'p_statement','../pycparser/c_parser.py',583), - ('statement -> jump_statement','statement',1,'p_statement','../pycparser/c_parser.py',584), - ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','../pycparser/c_parser.py',598), - ('declaration -> decl_body SEMI','declaration',2,'p_declaration','../pycparser/c_parser.py',657), - ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','../pycparser/c_parser.py',666), - ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','../pycparser/c_parser.py',667), - ('declaration_specifiers -> type_qualifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_1','../pycparser/c_parser.py',672), - ('declaration_specifiers -> type_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_2','../pycparser/c_parser.py',677), - ('declaration_specifiers -> storage_class_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_3','../pycparser/c_parser.py',682), - ('declaration_specifiers -> function_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_4','../pycparser/c_parser.py',687), - ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',692), - ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',693), - ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',694), - ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',695), - ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',696), - ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','../pycparser/c_parser.py',701), - ('type_specifier -> VOID','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',706), - ('type_specifier -> _BOOL','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',707), - ('type_specifier -> CHAR','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',708), - ('type_specifier -> SHORT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',709), - ('type_specifier -> INT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',710), - ('type_specifier -> LONG','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',711), - ('type_specifier -> FLOAT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',712), - ('type_specifier -> DOUBLE','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',713), - ('type_specifier -> _COMPLEX','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',714), - ('type_specifier -> SIGNED','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',715), - ('type_specifier -> UNSIGNED','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',716), - ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',721), - ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',722), - ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',723), - ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',728), - ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',729), - ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',730), - ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list_1','../pycparser/c_parser.py',735), - ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list_1','../pycparser/c_parser.py',736), - ('init_declarator_list -> EQUALS initializer','init_declarator_list',2,'p_init_declarator_list_2','../pycparser/c_parser.py',746), - ('init_declarator_list -> abstract_declarator','init_declarator_list',1,'p_init_declarator_list_3','../pycparser/c_parser.py',754), - ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','../pycparser/c_parser.py',762), - ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','../pycparser/c_parser.py',763), - ('specifier_qualifier_list -> type_qualifier specifier_qualifier_list_opt','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','../pycparser/c_parser.py',768), - ('specifier_qualifier_list -> type_specifier specifier_qualifier_list_opt','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','../pycparser/c_parser.py',773), - ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','../pycparser/c_parser.py',781), - ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','../pycparser/c_parser.py',782), - ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','../pycparser/c_parser.py',791), - ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','../pycparser/c_parser.py',800), - ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','../pycparser/c_parser.py',801), - ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','../pycparser/c_parser.py',810), - ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','../pycparser/c_parser.py',811), - ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','../pycparser/c_parser.py',818), - ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','../pycparser/c_parser.py',819), - ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','../pycparser/c_parser.py',824), - ('struct_declaration -> specifier_qualifier_list abstract_declarator SEMI','struct_declaration',3,'p_struct_declaration_2','../pycparser/c_parser.py',862), - ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','../pycparser/c_parser.py',876), - ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','../pycparser/c_parser.py',877), - ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','../pycparser/c_parser.py',885), - ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','../pycparser/c_parser.py',890), - ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','../pycparser/c_parser.py',891), - ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','../pycparser/c_parser.py',899), - ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','../pycparser/c_parser.py',900), - ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','../pycparser/c_parser.py',905), - ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','../pycparser/c_parser.py',910), - ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','../pycparser/c_parser.py',911), - ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','../pycparser/c_parser.py',916), - ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','../pycparser/c_parser.py',917), - ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','../pycparser/c_parser.py',918), - ('enumerator -> ID','enumerator',1,'p_enumerator','../pycparser/c_parser.py',929), - ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','../pycparser/c_parser.py',930), - ('declarator -> direct_declarator','declarator',1,'p_declarator_1','../pycparser/c_parser.py',945), - ('declarator -> pointer direct_declarator','declarator',2,'p_declarator_2','../pycparser/c_parser.py',950), - ('declarator -> pointer TYPEID','declarator',2,'p_declarator_3','../pycparser/c_parser.py',959), - ('direct_declarator -> ID','direct_declarator',1,'p_direct_declarator_1','../pycparser/c_parser.py',970), - ('direct_declarator -> LPAREN declarator RPAREN','direct_declarator',3,'p_direct_declarator_2','../pycparser/c_parser.py',979), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_declarator',5,'p_direct_declarator_3','../pycparser/c_parser.py',984), - ('direct_declarator -> direct_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_declarator',6,'p_direct_declarator_4','../pycparser/c_parser.py',998), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_declarator',6,'p_direct_declarator_4','../pycparser/c_parser.py',999), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_declarator',5,'p_direct_declarator_5','../pycparser/c_parser.py',1019), - ('direct_declarator -> direct_declarator LPAREN parameter_type_list RPAREN','direct_declarator',4,'p_direct_declarator_6','../pycparser/c_parser.py',1030), - ('direct_declarator -> direct_declarator LPAREN identifier_list_opt RPAREN','direct_declarator',4,'p_direct_declarator_6','../pycparser/c_parser.py',1031), - ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','../pycparser/c_parser.py',1058), - ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','../pycparser/c_parser.py',1059), - ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','../pycparser/c_parser.py',1088), - ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','../pycparser/c_parser.py',1089), - ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','../pycparser/c_parser.py',1094), - ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','../pycparser/c_parser.py',1095), - ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','../pycparser/c_parser.py',1103), - ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','../pycparser/c_parser.py',1104), - ('parameter_declaration -> declaration_specifiers declarator','parameter_declaration',2,'p_parameter_declaration_1','../pycparser/c_parser.py',1113), - ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','../pycparser/c_parser.py',1124), - ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','../pycparser/c_parser.py',1155), - ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','../pycparser/c_parser.py',1156), - ('initializer -> assignment_expression','initializer',1,'p_initializer_1','../pycparser/c_parser.py',1165), - ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','../pycparser/c_parser.py',1170), - ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','../pycparser/c_parser.py',1171), - ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','../pycparser/c_parser.py',1179), - ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','../pycparser/c_parser.py',1180), - ('designation -> designator_list EQUALS','designation',2,'p_designation','../pycparser/c_parser.py',1191), - ('designator_list -> designator','designator_list',1,'p_designator_list','../pycparser/c_parser.py',1199), - ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','../pycparser/c_parser.py',1200), - ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','../pycparser/c_parser.py',1205), - ('designator -> PERIOD identifier','designator',2,'p_designator','../pycparser/c_parser.py',1206), - ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','../pycparser/c_parser.py',1211), - ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','../pycparser/c_parser.py',1228), - ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','../pycparser/c_parser.py',1236), - ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','../pycparser/c_parser.py',1241), - ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','../pycparser/c_parser.py',1251), - ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','../pycparser/c_parser.py',1255), - ('direct_abstract_declarator -> LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_3','../pycparser/c_parser.py',1266), - ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','../pycparser/c_parser.py',1275), - ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','../pycparser/c_parser.py',1286), - ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','../pycparser/c_parser.py',1295), - ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','../pycparser/c_parser.py',1305), - ('block_item -> declaration','block_item',1,'p_block_item','../pycparser/c_parser.py',1316), - ('block_item -> statement','block_item',1,'p_block_item','../pycparser/c_parser.py',1317), - ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','../pycparser/c_parser.py',1324), - ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','../pycparser/c_parser.py',1325), - ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','../pycparser/c_parser.py',1331), - ('labeled_statement -> ID COLON statement','labeled_statement',3,'p_labeled_statement_1','../pycparser/c_parser.py',1337), - ('labeled_statement -> CASE constant_expression COLON statement','labeled_statement',4,'p_labeled_statement_2','../pycparser/c_parser.py',1341), - ('labeled_statement -> DEFAULT COLON statement','labeled_statement',3,'p_labeled_statement_3','../pycparser/c_parser.py',1345), - ('selection_statement -> IF LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_1','../pycparser/c_parser.py',1349), - ('selection_statement -> IF LPAREN expression RPAREN statement ELSE statement','selection_statement',7,'p_selection_statement_2','../pycparser/c_parser.py',1353), - ('selection_statement -> SWITCH LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_3','../pycparser/c_parser.py',1357), - ('iteration_statement -> WHILE LPAREN expression RPAREN statement','iteration_statement',5,'p_iteration_statement_1','../pycparser/c_parser.py',1362), - ('iteration_statement -> DO statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','../pycparser/c_parser.py',1366), - ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement','iteration_statement',9,'p_iteration_statement_3','../pycparser/c_parser.py',1370), - ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN statement','iteration_statement',8,'p_iteration_statement_4','../pycparser/c_parser.py',1374), - ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','../pycparser/c_parser.py',1379), - ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','../pycparser/c_parser.py',1383), - ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','../pycparser/c_parser.py',1387), - ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','../pycparser/c_parser.py',1391), - ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','../pycparser/c_parser.py',1392), - ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','../pycparser/c_parser.py',1397), - ('expression -> assignment_expression','expression',1,'p_expression','../pycparser/c_parser.py',1404), - ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','../pycparser/c_parser.py',1405), - ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','../pycparser/c_parser.py',1417), - ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','../pycparser/c_parser.py',1421), - ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','../pycparser/c_parser.py',1422), - ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1435), - ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1436), - ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1437), - ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1438), - ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1439), - ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1440), - ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1441), - ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1442), - ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1443), - ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1444), - ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1445), - ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','../pycparser/c_parser.py',1450), - ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','../pycparser/c_parser.py',1454), - ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','../pycparser/c_parser.py',1455), - ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','../pycparser/c_parser.py',1463), - ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1464), - ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1465), - ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1466), - ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1467), - ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1468), - ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1469), - ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1470), - ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1471), - ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1472), - ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1473), - ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1474), - ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1475), - ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1476), - ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1477), - ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1478), - ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1479), - ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1480), - ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1481), - ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','../pycparser/c_parser.py',1489), - ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','../pycparser/c_parser.py',1493), - ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','../pycparser/c_parser.py',1497), - ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1501), - ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1502), - ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1503), - ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','../pycparser/c_parser.py',1508), - ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','../pycparser/c_parser.py',1509), - ('unary_operator -> AND','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1517), - ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1518), - ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1519), - ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1520), - ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1521), - ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1522), - ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','../pycparser/c_parser.py',1527), - ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','../pycparser/c_parser.py',1531), - ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','../pycparser/c_parser.py',1535), - ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','../pycparser/c_parser.py',1536), - ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1541), - ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1542), - ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1543), - ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1544), - ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','../pycparser/c_parser.py',1550), - ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','../pycparser/c_parser.py',1551), - ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','../pycparser/c_parser.py',1556), - ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','../pycparser/c_parser.py',1557), - ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','../pycparser/c_parser.py',1562), - ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','../pycparser/c_parser.py',1566), - ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','../pycparser/c_parser.py',1570), - ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','../pycparser/c_parser.py',1571), - ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','../pycparser/c_parser.py',1576), - ('primary_expression -> OFFSETOF LPAREN type_name COMMA identifier RPAREN','primary_expression',6,'p_primary_expression_5','../pycparser/c_parser.py',1580), - ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','../pycparser/c_parser.py',1588), - ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','../pycparser/c_parser.py',1589), - ('identifier -> ID','identifier',1,'p_identifier','../pycparser/c_parser.py',1598), - ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','../pycparser/c_parser.py',1602), - ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','../pycparser/c_parser.py',1603), - ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','../pycparser/c_parser.py',1604), - ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','../pycparser/c_parser.py',1605), - ('constant -> FLOAT_CONST','constant',1,'p_constant_2','../pycparser/c_parser.py',1611), - ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','../pycparser/c_parser.py',1612), - ('constant -> CHAR_CONST','constant',1,'p_constant_3','../pycparser/c_parser.py',1618), - ('constant -> WCHAR_CONST','constant',1,'p_constant_3','../pycparser/c_parser.py',1619), - ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','../pycparser/c_parser.py',1630), - ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','../pycparser/c_parser.py',1631), - ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','../pycparser/c_parser.py',1641), - ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','../pycparser/c_parser.py',1642), - ('brace_open -> LBRACE','brace_open',1,'p_brace_open','../pycparser/c_parser.py',1652), - ('brace_close -> RBRACE','brace_close',1,'p_brace_close','../pycparser/c_parser.py',1657), - ('empty -> ','empty',0,'p_empty','../pycparser/c_parser.py',1662), + ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',43), + ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',44), + ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',43), + ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',44), + ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',43), + ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',44), + ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',43), + ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',44), + ('declaration_specifiers_no_type_opt -> empty','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',43), + ('declaration_specifiers_no_type_opt -> declaration_specifiers_no_type','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',44), + ('designation_opt -> empty','designation_opt',1,'p_designation_opt','plyparser.py',43), + ('designation_opt -> designation','designation_opt',1,'p_designation_opt','plyparser.py',44), + ('expression_opt -> empty','expression_opt',1,'p_expression_opt','plyparser.py',43), + ('expression_opt -> expression','expression_opt',1,'p_expression_opt','plyparser.py',44), + ('id_init_declarator_list_opt -> empty','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',43), + ('id_init_declarator_list_opt -> id_init_declarator_list','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',44), + ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',43), + ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',44), + ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',43), + ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',44), + ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',43), + ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',44), + ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',43), + ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',44), + ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',43), + ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',44), + ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',43), + ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',44), + ('direct_id_declarator -> ID','direct_id_declarator',1,'p_direct_id_declarator_1','plyparser.py',126), + ('direct_id_declarator -> LPAREN id_declarator RPAREN','direct_id_declarator',3,'p_direct_id_declarator_2','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_3','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',127), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_5','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN parameter_type_list RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN identifier_list_opt RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',127), + ('direct_typeid_declarator -> TYPEID','direct_typeid_declarator',1,'p_direct_typeid_declarator_1','plyparser.py',126), + ('direct_typeid_declarator -> LPAREN typeid_declarator RPAREN','direct_typeid_declarator',3,'p_direct_typeid_declarator_2','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_3','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',127), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_5','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN parameter_type_list RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',127), + ('direct_typeid_noparen_declarator -> TYPEID','direct_typeid_noparen_declarator',1,'p_direct_typeid_noparen_declarator_1','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_3','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',127), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_5','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',127), + ('id_declarator -> direct_id_declarator','id_declarator',1,'p_id_declarator_1','plyparser.py',126), + ('id_declarator -> pointer direct_id_declarator','id_declarator',2,'p_id_declarator_2','plyparser.py',126), + ('typeid_declarator -> direct_typeid_declarator','typeid_declarator',1,'p_typeid_declarator_1','plyparser.py',126), + ('typeid_declarator -> pointer direct_typeid_declarator','typeid_declarator',2,'p_typeid_declarator_2','plyparser.py',126), + ('typeid_noparen_declarator -> direct_typeid_noparen_declarator','typeid_noparen_declarator',1,'p_typeid_noparen_declarator_1','plyparser.py',126), + ('typeid_noparen_declarator -> pointer direct_typeid_noparen_declarator','typeid_noparen_declarator',2,'p_typeid_noparen_declarator_2','plyparser.py',126), + ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',514), + ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',515), + ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','c_parser.py',523), + ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','c_parser.py',530), + ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','c_parser.py',541), + ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','c_parser.py',546), + ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',551), + ('external_declaration -> pppragma_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',552), + ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','c_parser.py',557), + ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','c_parser.py',562), + ('pppragma_directive -> PPPRAGMA','pppragma_directive',1,'p_pppragma_directive','c_parser.py',568), + ('pppragma_directive -> PPPRAGMA PPPRAGMASTR','pppragma_directive',2,'p_pppragma_directive','c_parser.py',569), + ('function_definition -> id_declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','c_parser.py',580), + ('function_definition -> declaration_specifiers id_declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','c_parser.py',597), + ('statement -> labeled_statement','statement',1,'p_statement','c_parser.py',608), + ('statement -> expression_statement','statement',1,'p_statement','c_parser.py',609), + ('statement -> compound_statement','statement',1,'p_statement','c_parser.py',610), + ('statement -> selection_statement','statement',1,'p_statement','c_parser.py',611), + ('statement -> iteration_statement','statement',1,'p_statement','c_parser.py',612), + ('statement -> jump_statement','statement',1,'p_statement','c_parser.py',613), + ('statement -> pppragma_directive','statement',1,'p_statement','c_parser.py',614), + ('pragmacomp_or_statement -> pppragma_directive statement','pragmacomp_or_statement',2,'p_pragmacomp_or_statement','c_parser.py',661), + ('pragmacomp_or_statement -> statement','pragmacomp_or_statement',1,'p_pragmacomp_or_statement','c_parser.py',662), + ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',681), + ('decl_body -> declaration_specifiers_no_type id_init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',682), + ('declaration -> decl_body SEMI','declaration',2,'p_declaration','c_parser.py',741), + ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','c_parser.py',750), + ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','c_parser.py',751), + ('declaration_specifiers_no_type -> type_qualifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_1','c_parser.py',761), + ('declaration_specifiers_no_type -> storage_class_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_2','c_parser.py',766), + ('declaration_specifiers_no_type -> function_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_3','c_parser.py',771), + ('declaration_specifiers -> declaration_specifiers type_qualifier','declaration_specifiers',2,'p_declaration_specifiers_1','c_parser.py',777), + ('declaration_specifiers -> declaration_specifiers storage_class_specifier','declaration_specifiers',2,'p_declaration_specifiers_2','c_parser.py',782), + ('declaration_specifiers -> declaration_specifiers function_specifier','declaration_specifiers',2,'p_declaration_specifiers_3','c_parser.py',787), + ('declaration_specifiers -> declaration_specifiers type_specifier_no_typeid','declaration_specifiers',2,'p_declaration_specifiers_4','c_parser.py',792), + ('declaration_specifiers -> type_specifier','declaration_specifiers',1,'p_declaration_specifiers_5','c_parser.py',797), + ('declaration_specifiers -> declaration_specifiers_no_type type_specifier','declaration_specifiers',2,'p_declaration_specifiers_6','c_parser.py',802), + ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',808), + ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',809), + ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',810), + ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',811), + ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',812), + ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','c_parser.py',817), + ('type_specifier_no_typeid -> VOID','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',822), + ('type_specifier_no_typeid -> _BOOL','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',823), + ('type_specifier_no_typeid -> CHAR','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',824), + ('type_specifier_no_typeid -> SHORT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',825), + ('type_specifier_no_typeid -> INT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',826), + ('type_specifier_no_typeid -> LONG','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',827), + ('type_specifier_no_typeid -> FLOAT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',828), + ('type_specifier_no_typeid -> DOUBLE','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',829), + ('type_specifier_no_typeid -> _COMPLEX','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',830), + ('type_specifier_no_typeid -> SIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',831), + ('type_specifier_no_typeid -> UNSIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',832), + ('type_specifier_no_typeid -> __INT128','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',833), + ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier','c_parser.py',838), + ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier','c_parser.py',839), + ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier','c_parser.py',840), + ('type_specifier -> type_specifier_no_typeid','type_specifier',1,'p_type_specifier','c_parser.py',841), + ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','c_parser.py',846), + ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','c_parser.py',847), + ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','c_parser.py',848), + ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list','c_parser.py',853), + ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list','c_parser.py',854), + ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','c_parser.py',862), + ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','c_parser.py',863), + ('id_init_declarator_list -> id_init_declarator','id_init_declarator_list',1,'p_id_init_declarator_list','c_parser.py',868), + ('id_init_declarator_list -> id_init_declarator_list COMMA init_declarator','id_init_declarator_list',3,'p_id_init_declarator_list','c_parser.py',869), + ('id_init_declarator -> id_declarator','id_init_declarator',1,'p_id_init_declarator','c_parser.py',874), + ('id_init_declarator -> id_declarator EQUALS initializer','id_init_declarator',3,'p_id_init_declarator','c_parser.py',875), + ('specifier_qualifier_list -> specifier_qualifier_list type_specifier_no_typeid','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','c_parser.py',882), + ('specifier_qualifier_list -> specifier_qualifier_list type_qualifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','c_parser.py',887), + ('specifier_qualifier_list -> type_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_3','c_parser.py',892), + ('specifier_qualifier_list -> type_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_4','c_parser.py',897), + ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',906), + ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',907), + ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','c_parser.py',917), + ('struct_or_union_specifier -> struct_or_union brace_open brace_close','struct_or_union_specifier',3,'p_struct_or_union_specifier_2','c_parser.py',918), + ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',935), + ('struct_or_union_specifier -> struct_or_union ID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',936), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',937), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',938), + ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','c_parser.py',954), + ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','c_parser.py',955), + ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','c_parser.py',962), + ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','c_parser.py',963), + ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','c_parser.py',971), + ('struct_declaration -> SEMI','struct_declaration',1,'p_struct_declaration_2','c_parser.py',1009), + ('struct_declaration -> pppragma_directive','struct_declaration',1,'p_struct_declaration_3','c_parser.py',1014), + ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','c_parser.py',1019), + ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','c_parser.py',1020), + ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','c_parser.py',1028), + ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','c_parser.py',1033), + ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','c_parser.py',1034), + ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1042), + ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1043), + ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','c_parser.py',1048), + ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1053), + ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1054), + ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','c_parser.py',1059), + ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','c_parser.py',1060), + ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','c_parser.py',1061), + ('enumerator -> ID','enumerator',1,'p_enumerator','c_parser.py',1072), + ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','c_parser.py',1073), + ('declarator -> id_declarator','declarator',1,'p_declarator','c_parser.py',1088), + ('declarator -> typeid_declarator','declarator',1,'p_declarator','c_parser.py',1089), + ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','c_parser.py',1200), + ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','c_parser.py',1201), + ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','c_parser.py',1230), + ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','c_parser.py',1231), + ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','c_parser.py',1236), + ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','c_parser.py',1237), + ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','c_parser.py',1245), + ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','c_parser.py',1246), + ('parameter_declaration -> declaration_specifiers id_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1265), + ('parameter_declaration -> declaration_specifiers typeid_noparen_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1266), + ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','c_parser.py',1277), + ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','c_parser.py',1308), + ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','c_parser.py',1309), + ('initializer -> assignment_expression','initializer',1,'p_initializer_1','c_parser.py',1318), + ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','c_parser.py',1323), + ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','c_parser.py',1324), + ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','c_parser.py',1332), + ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','c_parser.py',1333), + ('designation -> designator_list EQUALS','designation',2,'p_designation','c_parser.py',1344), + ('designator_list -> designator','designator_list',1,'p_designator_list','c_parser.py',1352), + ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','c_parser.py',1353), + ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','c_parser.py',1358), + ('designator -> PERIOD identifier','designator',2,'p_designator','c_parser.py',1359), + ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','c_parser.py',1364), + ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','c_parser.py',1375), + ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','c_parser.py',1383), + ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','c_parser.py',1388), + ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','c_parser.py',1398), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','c_parser.py',1402), + ('direct_abstract_declarator -> LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_3','c_parser.py',1413), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','c_parser.py',1423), + ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','c_parser.py',1434), + ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','c_parser.py',1443), + ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','c_parser.py',1453), + ('block_item -> declaration','block_item',1,'p_block_item','c_parser.py',1464), + ('block_item -> statement','block_item',1,'p_block_item','c_parser.py',1465), + ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','c_parser.py',1472), + ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','c_parser.py',1473), + ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','c_parser.py',1479), + ('labeled_statement -> ID COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_1','c_parser.py',1485), + ('labeled_statement -> CASE constant_expression COLON pragmacomp_or_statement','labeled_statement',4,'p_labeled_statement_2','c_parser.py',1489), + ('labeled_statement -> DEFAULT COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_3','c_parser.py',1493), + ('selection_statement -> IF LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_1','c_parser.py',1497), + ('selection_statement -> IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement','selection_statement',7,'p_selection_statement_2','c_parser.py',1501), + ('selection_statement -> SWITCH LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_3','c_parser.py',1505), + ('iteration_statement -> WHILE LPAREN expression RPAREN pragmacomp_or_statement','iteration_statement',5,'p_iteration_statement_1','c_parser.py',1510), + ('iteration_statement -> DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','c_parser.py',1514), + ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',9,'p_iteration_statement_3','c_parser.py',1518), + ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',8,'p_iteration_statement_4','c_parser.py',1522), + ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','c_parser.py',1527), + ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','c_parser.py',1531), + ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','c_parser.py',1535), + ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','c_parser.py',1539), + ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','c_parser.py',1540), + ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','c_parser.py',1545), + ('expression -> assignment_expression','expression',1,'p_expression','c_parser.py',1552), + ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','c_parser.py',1553), + ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','c_parser.py',1565), + ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','c_parser.py',1569), + ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','c_parser.py',1570), + ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','c_parser.py',1583), + ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1584), + ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1585), + ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1586), + ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1587), + ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1588), + ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1589), + ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1590), + ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1591), + ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1592), + ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1593), + ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','c_parser.py',1598), + ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','c_parser.py',1602), + ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','c_parser.py',1603), + ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','c_parser.py',1611), + ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1612), + ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1613), + ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1614), + ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1615), + ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1616), + ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1617), + ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1618), + ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1619), + ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1620), + ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1621), + ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1622), + ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1623), + ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1624), + ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1625), + ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1626), + ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1627), + ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1628), + ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1629), + ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','c_parser.py',1637), + ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','c_parser.py',1641), + ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','c_parser.py',1645), + ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1649), + ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1650), + ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1651), + ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','c_parser.py',1656), + ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1657), + ('unary_operator -> AND','unary_operator',1,'p_unary_operator','c_parser.py',1665), + ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','c_parser.py',1666), + ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','c_parser.py',1667), + ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','c_parser.py',1668), + ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','c_parser.py',1669), + ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','c_parser.py',1670), + ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','c_parser.py',1675), + ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','c_parser.py',1679), + ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','c_parser.py',1683), + ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','c_parser.py',1684), + ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1689), + ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1690), + ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1691), + ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1692), + ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1698), + ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1699), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','c_parser.py',1704), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','c_parser.py',1705), + ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','c_parser.py',1710), + ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','c_parser.py',1714), + ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1718), + ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1719), + ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','c_parser.py',1724), + ('primary_expression -> OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN','primary_expression',6,'p_primary_expression_5','c_parser.py',1728), + ('offsetof_member_designator -> identifier','offsetof_member_designator',1,'p_offsetof_member_designator','c_parser.py',1736), + ('offsetof_member_designator -> offsetof_member_designator PERIOD identifier','offsetof_member_designator',3,'p_offsetof_member_designator','c_parser.py',1737), + ('offsetof_member_designator -> offsetof_member_designator LBRACKET expression RBRACKET','offsetof_member_designator',4,'p_offsetof_member_designator','c_parser.py',1738), + ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','c_parser.py',1751), + ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','c_parser.py',1752), + ('identifier -> ID','identifier',1,'p_identifier','c_parser.py',1761), + ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','c_parser.py',1765), + ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','c_parser.py',1766), + ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','c_parser.py',1767), + ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','c_parser.py',1768), + ('constant -> FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1787), + ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1788), + ('constant -> CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1804), + ('constant -> WCHAR_CONST','constant',1,'p_constant_3','c_parser.py',1805), + ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','c_parser.py',1816), + ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','c_parser.py',1817), + ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1827), + ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1828), + ('brace_open -> LBRACE','brace_open',1,'p_brace_open','c_parser.py',1838), + ('brace_close -> RBRACE','brace_close',1,'p_brace_close','c_parser.py',1844), + ('empty -> ','empty',0,'p_empty','c_parser.py',1850), ] diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst --- a/pypy/doc/release-v7.2.0.rst +++ b/pypy/doc/release-v7.2.0.rst @@ -49,6 +49,9 @@ Thanks to Anvil_, we revived the `PyPy Sandbox`_, which allows total control over a python interpreter's interactions with the external world. +We implemented a new JSON decoder that is much faster, uses less memory, and +uses a JIT-friendly specialized dictionary. + As always, this release is 100% compatible with the previous one and fixed several issues and bugs raised by the growing community of PyPy users. We strongly recommend updating. Many of the fixes are the direct result of @@ -126,7 +129,7 @@ * Package windows DLLs needed by cffi modules next to the cffi c-extensions (`issue 2988`_) * Cleanup and refactor JIT code to remove ``rpython.jit.metainterp.typesystem`` -* Fix memoryviews of ctype structures with padding, (cpython issue 32780_) +* Fix memoryviews of ctype structures with padding, (CPython issue 32780_) Changes to Python 3.6 released in v7.1.1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,6 +188,23 @@ * Correctly wrap the I/O errors we can get when importing modules * Fix bad output from JSON with ``'skipkeys=True'`` (`issue 3052`_) * Fix compatibility with latest virtualenv HEAD +* Avoid ``RuntimeError`` in ``repr()`` of recursive ``dictviews`` (CPython + issue 18533_) +* Fix for printing after ``gc.get_objects()`` (`issue 2979`) +* Optimize many fast-paths through utf-8 code when we know it is ascii or no + surroagates are present +* Check for a rare case of someone shrinking a buffer from another thread + while using it in a ``read()`` variant. One of the issues discovered when + reviewing the code for the sandbox. +* Prevent segfault when slicing ``array.array`` with a large step size +* Support building ``ncurses`` on Suse Linux +* Update statically-linked ``_ssl`` OpenSSL to 1.1.0c on ``darwin`` +* Optimize ``W_TextIOWrapper._readline`` and ``ByteBuffer.getslice`` +* Fix possible race condition in threading ``Lock.release()`` (`issue 3072`_) +* Make ``CDLL(None)`` on win32 raise ``TypeError`` +* Change ``sys.getfilesystemcodeerors()`` to ``'strict'`` on win32 +* Update vendored version of ``pycparser`` to version 2.19 +* Implement a much faster JSON decoder (3x speedup for large json files, 2x less memory) C-API (cpyext) and c-extensions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -211,7 +231,7 @@ 3003`_) * Fix parsing for converting strings with underscore into ints * Add ``memoryview.obj`` which stores a reference, (`issue 3016`_) -* Fix datetime.fromtimestamp for win32 (cpython issue 29097_) +* Fix datetime.fromtimestamp for win32 (CPython issue 29097_) * Improve multiprocessing support on win32 * Support negative offsets in ``lnotab`` (`issue 2943`_) * Fix leak of file descriptor with `_io.FileIO('dir/')` @@ -232,19 +252,62 @@ * Fix case where ``int()`` would go into infinite recursion * Don't ignore fold parameter in ``(date,)time.replace()`` * Fix logic bug for ``memoryview.cast`` (when ``view.format`` is not ``'B'``) +* Implement retry-on-EINTR in fcntl module (CPython issue 35189_) +* Fix handling of 1st argument to ``hashlib.blake2{b,s}()`` (CPython issue + 33729_) +* Prevent overflow in ``_hashlib`` ``digest()`` (CPython issue 34922_) +* ``IOBase.readlines()`` relies on the iterator protocol instead of calling + ``readline()`` directly +* Don't inherit ``IS_ABSTRACT`` flag in classes +* Reset raw_pos after unwinding the raw stream (CPython issue 32228_) +* Add existing options ``-b`` and ``-d`` to ``pypy3 --help`` text +* Clean up ``_codecs`` error handling code +* Add support for using stdlib as a zipfile +* Check return type of ``__prepare__()`` (CPython issue 31588_) +* Fix logic in ``_curses.get_wch`` (`issue 3064`_) +* Match CPython exit code when failing to flush stdout/stderr at exit +* Improve SyntaxError message output +* Add ``range.__bool__`` +* Add cursor validity check to ``_sqlite.Cursor.close`` +* Improve message when mistakenly using ``print something`` in Python3 +* Handle generator exit in ``athrow()`` (CPython issue 33786_) +* Support unmarshalling ``TYPE_INT64`` and turn ``OverflowErrors`` from + ``marshal.loads`` into ``ValueErrors`` +* Update ``_posixsubprocess.c`` to match CPython (CPython issue 32270_) +* Remove unused ``_posixsubprocess.cloexec_pipe()`` +* Add missing constants to ``stat`` and ``kill _stat`` (`issue 3073`_) +* Fix argument handling in ``select.poll().poll()`` +* Raise ``SyntaxError`` instead of ``DeprecationWarning`` when treating invalid + escapes in bytes as errors (CPython issue 28691_) +* Handle locale in `time.strftime()`. (`issue 3079`_) +* Fix an issue when calling ``PyFrame.fset_f_lineno`` (`issue 3066`_) Python 3.6 c-API ~~~~~~~~~~~~~~~~ * Add ``PyStructSequence_InitType2``, ``Py_RETURN_NOTIMPLEMENTED``, - ``PyGILState_Check``, ``PyUnicode_AsUCS4``, ``PyUnicode_AsUCS4Copy`` + ``PyGILState_Check``, ``PyUnicode_AsUCS4``, ``PyUnicode_AsUCS4Copy``, + ``PyErr_SetFromWindowsErr``, * Sync the various ``Py**Flag`` constants with CPython +* Allow ``PyTypeObject`` with ``tp_doc==""`` (`issue 3055`_) +* Update ``pymacro.h`` to match CPython 3.6.9 +* Support more datetime C functions and definitions .. _`Lehmer's algorithm`: https://en.wikipedia.org/wiki/Lehmer's_GCD_algorithm .. _29097: https://bugs.python.org/issue29097 .. _32780: https://bugs.python.org/issue32780 .. _35409 : https://bugs.python.org/issue35409 .. _27169 : https://bugs.python.org/issue27169 +.. _18533 : https://bugs.python.org/issue18533 +.. _35189 : https://bugs.python.org/issue35189 +.. _33279 : https://bugs.python.org/issue33279 +.. _34922 : https://bugs.python.org/issue34922 +.. _32228 : https://bugs.python.org/issue32228 +.. _31588 : https://bugs.python.org/issue31588 +.. _33786 : https://bugs.python.org/issue33786 +.. _32270 : https://bugs.python.org/issue32270 +.. _28691 : https://bugs.python.org/issue28691 + .. _opencv2: https://github.com/skvark/opencv-python/ .. _`issue 2617`: https://bitbucket.com/pypy/pypy/issues/2617 .. _`issue 2722`: https://bitbucket.com/pypy/pypy/issues/2722 @@ -273,3 +336,10 @@ .. _`issue 3049`: https://bitbucket.com/pypy/pypy/issues/3049 .. _`issue 3050`: https://bitbucket.com/pypy/pypy/issues/3050 .. _`issue 3052`: https://bitbucket.com/pypy/pypy/issues/3052 +.. _`issue 3055`: https://bitbucket.com/pypy/pypy/issues/3055 +.. _`issue 2979`: https://bitbucket.com/pypy/pypy/issues/2979 +.. _`issue 3064`: https://bitbucket.com/pypy/pypy/issues/3064 +.. _`issue 3072`: https://bitbucket.com/pypy/pypy/issues/3072 +.. _`issue 3073`: https://bitbucket.com/pypy/pypy/issues/3073 +.. _`issue 3079`: https://bitbucket.com/pypy/pypy/issues/3079 +.. _`issue 3066`: https://bitbucket.com/pypy/pypy/issues/3066 diff --git a/pypy/doc/sandbox.rst b/pypy/doc/sandbox.rst --- a/pypy/doc/sandbox.rst +++ b/pypy/doc/sandbox.rst @@ -3,10 +3,11 @@ PyPy's sandboxing features ========================== -.. warning:: This is not actively maintained. You will likely have to fix - some issues yourself, or otherwise play around on your own. We provide - this documentation for historical reasions, it will not translate or - run on the latest PyPy code base. +.. warning:: This describes the old, unmaintained version. A new version + is in progress and should be merged back to trunk at some point soon. + Please see its description here: + https://mail.python.org/pipermail/pypy-dev/2019-August/015797.html + Introduction ------------ diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -5,3 +5,9 @@ .. this is a revision shortly after release-pypy-7.2.0 .. startrev: 78cd4acbcbec + +.. branch: json-decoder-maps + +Much faster and more memory-efficient JSON decoding. The resulting +dictionaries that come out of the JSON decoder have faster lookups too. + diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -1,11 +1,13 @@ import sys from rpython.rlib.rstring import StringBuilder -from rpython.rlib.objectmodel import specialize, always_inline, r_dict -from rpython.rlib import rfloat, rutf8 +from rpython.rlib.objectmodel import specialize, always_inline +from rpython.rlib import rfloat, runicode, jit, objectmodel, rutf8 from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rlib.rarithmetic import r_uint from pypy.interpreter.error import oefmt from pypy.interpreter import unicodehelper +from pypy.interpreter.baseobjspace import W_Root +from pypy.module._pypyjson import simd OVF_DIGITS = len(str(sys.maxint)) @@ -15,45 +17,107 @@ # precomputing negative powers of 10 is MUCH faster than using e.g. math.pow # at runtime NEG_POW_10 = [10.0**-i for i in range(16)] +del i + def neg_pow_10(x, exp): if exp >= len(NEG_POW_10): return 0.0 return x * NEG_POW_10[exp] -def slice_eq(a, b): - (ll_chars1, start1, length1, _) = a - (ll_chars2, start2, length2, _) = b - if length1 != length2: - return False - j = start2 - for i in range(start1, start1 + length1): - if ll_chars1[i] != ll_chars2[j]: - return False - j += 1 - return True -def slice_hash(a): - (ll_chars, start, length, h) = a - return h +class IntCache(object): + """ A cache for wrapped ints between START and END """ -TYPE_UNKNOWN = 0 -TYPE_STRING = 1 -class JSONDecoder(object): + # I also tried various combinations of having an LRU cache for ints as + # well, didn't really help. + + # XXX one thing to do would be to use withintprebuilt in general again, + # hidden behind a 'we_are_jitted' + + START = -10 + END = 256 + + def __init__(self, space): + self.space = space + self.cache = [self.space.newint(i) + for i in range(self.START, self.END)] + + def newint(self, intval): + if self.START <= intval < self.END: + return self.cache[intval - self.START] + return self.space.newint(intval) + + +class JSONDecoder(W_Root): + + LRU_SIZE = 16 + LRU_MASK = LRU_SIZE - 1 + + DEFAULT_SIZE_SCRATCH = 20 + + # string caching is only used if the total size of the message is larger + # than a megabyte. Below that, there can't be that many repeated big + # strings anyway (some experiments showed this to be a reasonable cutoff + # size) + MIN_SIZE_FOR_STRING_CACHE = 1024 * 1024 + + # evaluate the string cache for 200 strings, before looking at the hit rate + # and deciding whether to keep doing it + STRING_CACHE_EVALUATION_SIZE = 200 + + # keep using the string cache if at least 25% of all decoded strings are a + # hit in the cache + STRING_CACHE_USEFULNESS_FACTOR = 4 + + def __init__(self, space, s): self.space = space + self.w_empty_string = space.newutf8("", 0) + self.s = s + # we put our string in a raw buffer so: # 1) we automatically get the '\0' sentinel at the end of the string, # which means that we never have to check for the "end of string" # 2) we can pass the buffer directly to strtod - self.ll_chars = rffi.str2charp(s) + self.ll_chars, self.llobj, self.flag = rffi.get_nonmovingbuffer_ll_final_null(self.s) self.end_ptr = lltype.malloc(rffi.CCHARPP.TO, 1, flavor='raw') self.pos = 0 - self.cache = r_dict(slice_eq, slice_hash, simple_hash_eq=True) + self.intcache = space.fromcache(IntCache) + + # two caches, one for keys, one for general strings. they both have the + # form {hash-as-int: StringCacheEntry} and they don't deal with + # collisions at all. For every hash there is simply one string stored + # and we ignore collisions. + self.cache_keys = {} + self.cache_values = {} + + # we don't cache *all* non-key strings, that would be too expensive. + # instead, keep a cache of the last 16 strings hashes around and add a + # string to the cache only if its hash is seen a second time + self.lru_cache = [0] * self.LRU_SIZE + self.lru_index = 0 + + self.startmap = self.space.fromcache(Terminator) + + # keep a list of objects that are created with maps that aren't clearly + # useful. If they turn out to be useful in the end we are good, + # otherwise convert them to dicts (see .close()) + self.unclear_objects = [] + + # this is a freelist of lists that store the decoded value of an + # object, before they get copied into the eventual dict + self.scratch = [[None] * self.DEFAULT_SIZE_SCRATCH] + def close(self): - rffi.free_charp(self.ll_chars) + rffi.free_nonmovingbuffer_ll(self.ll_chars, self.llobj, self.flag) lltype.free(self.end_ptr, flavor='raw') + # clean up objects that are instances of now blocked maps + for w_obj in self.unclear_objects: + jsonmap = self._get_jsonmap_from_dict(w_obj) + if jsonmap.is_state_blocked(): + self._devolve_jsonmap_dict(w_obj) def getslice(self, start, end): assert start >= 0 @@ -61,23 +125,22 @@ return self.s[start:end] def skip_whitespace(self, i): + ll_chars = self.ll_chars while True: - ch = self.ll_chars[i] + ch = ll_chars[i] if is_whitespace(ch): - i+=1 + i += 1 else: break return i - @specialize.arg(1) - def _raise(self, msg, *args): - raise oefmt(self.space.w_ValueError, msg, *args) - - def decode_any(self, i): + def decode_any(self, i, contextmap=None): + """ Decode an object at position i. Optionally pass a contextmap, if + the value is decoded as the value of a dict. """ i = self.skip_whitespace(i) ch = self.ll_chars[i] if ch == '"': - return self.decode_string(i+1) + return self.decode_string(i+1, contextmap) elif ch == '[': return self.decode_array(i+1) elif ch == '{': @@ -102,6 +165,11 @@ self._raise("No JSON object could be decoded: unexpected '%s' at char %d", ch, i) + + @specialize.arg(1) + def _raise(self, msg, *args): + raise oefmt(self.space.w_ValueError, msg, *args) + def decode_null(self, i): if (self.ll_chars[i] == 'u' and self.ll_chars[i+1] == 'l' and @@ -162,7 +230,7 @@ return self.decode_int_slow(start) self.pos = i - return self.space.newint(intval) + return self.intcache.newint(intval) def decode_float(self, i): from rpython.rlib import rdtoa @@ -214,7 +282,22 @@ ovf_maybe = (count >= OVF_DIGITS) return i, ovf_maybe, sign * intval + def _raise_control_char_in_string(self, ch, startindex, currindex): + if ch == '\0': + self._raise("Unterminated string starting at char %d", + startindex - 1) + else: + self._raise("Invalid control character at char %d", currindex-1) + + def _raise_object_error(self, ch, start, i): + if ch == '\0': + self._raise("Unterminated object starting at char %d", start) + else: + self._raise("Unexpected '%s' when decoding object (char %d)", + ch, i) + def decode_array(self, i): + """ Decode a list. i must be after the opening '[' """ w_list = self.space.newlist([]) start = i i = self.skip_whitespace(start) @@ -248,62 +331,116 @@ self.pos = i+1 return self.space.newdict() - d = self._create_empty_dict() + if self.scratch: + values_w = self.scratch.pop() + else: + values_w = [None] * self.DEFAULT_SIZE_SCRATCH + nextindex = 0 + currmap = self.startmap while True: # parse a key: value - w_name = self.decode_key(i) + currmap = self.decode_key_map(i, currmap) i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] if ch != ':': self._raise("No ':' found at char %d", i) i += 1 - i = self.skip_whitespace(i) - # - w_value = self.decode_any(i) - d[w_name] = w_value + + w_value = self.decode_any(i, currmap) + + if nextindex == len(values_w): # full + values_w = values_w + [None] * len(values_w) # double + values_w[nextindex] = w_value + nextindex += 1 i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] i += 1 if ch == '}': self.pos = i - return self._create_dict(d) + self.scratch.append(values_w) # can reuse next time + if currmap.is_state_blocked(): + dict_w = self._switch_to_dict(currmap, values_w, nextindex) + return self._create_dict(dict_w) + values_w = values_w[:nextindex] + w_res = self._create_dict_map(values_w, currmap) + if not currmap.is_state_useful(): + self.unclear_objects.append(w_res) + return w_res elif ch == ',': - pass - elif ch == '\0': - self._raise("Unterminated object starting at char %d", start) + i = self.skip_whitespace(i) + if currmap.is_state_blocked(): + self.scratch.append(values_w) # can reuse next time + dict_w = self._switch_to_dict(currmap, values_w, nextindex) + return self.decode_object_dict(i, start, dict_w) else: - self._raise("Unexpected '%s' when decoding object (char %d)", - ch, i-1) + self._raise_object_error(ch, start, i - 1) - def decode_string(self, i): - start = i - bits = 0 + def _create_dict_map(self, values_w, jsonmap): + from pypy.objspace.std.jsondict import from_values_and_jsonmap + return from_values_and_jsonmap(self.space, values_w, jsonmap) + + def _devolve_jsonmap_dict(self, w_dict): + from pypy.objspace.std.jsondict import devolve_jsonmap_dict + devolve_jsonmap_dict(w_dict) + + def _get_jsonmap_from_dict(self, w_dict): + from pypy.objspace.std.jsondict import get_jsonmap_from_dict + return get_jsonmap_from_dict(w_dict) + + def _switch_to_dict(self, currmap, values_w, nextindex): + dict_w = self._create_empty_dict() + currmap.fill_dict(dict_w, values_w) + assert len(dict_w) == nextindex + return dict_w + + def decode_object_dict(self, i, start, dict_w): while True: - # this loop is a fast path for strings which do not contain escape - # characters + # parse a key: value + w_key = self.decode_key_string(i) + i = self.skip_whitespace(self.pos) + ch = self.ll_chars[i] + if ch != ':': + self._raise("No ':' found at char %d", i) + i += 1 + + w_value = self.decode_any(i) + dict_w[w_key] = w_value + i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] i += 1 - bits |= ord(ch) - if ch == '"': + if ch == '}': self.pos = i - return self._create_string(start, i - 1, bits) - elif ch == '\\' or ch < '\x20': - self.pos = i-1 - return self.decode_string_escaped(start) + return self._create_dict(dict_w) + elif ch == ',': + i = self.skip_whitespace(i) + else: + self._raise_object_error(ch, start, i - 1) - def _create_string(self, start, end, bits): - if bits & 0x80: - # the 8th bit is set, it's an utf8 string - content_utf8 = self.getslice(start, end) + def decode_string_uncached(self, i): + start = i + ll_chars = self.ll_chars + nonascii, i = simd.find_end_of_string_no_hash(ll_chars, i, len(self.s)) + ch = ll_chars[i] + if ch == '\\': + self.pos = i + return self.decode_string_escaped(start, nonascii) + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + else: + assert ch == '"' + + self.pos = i + 1 + return self._create_string_wrapped(start, i, nonascii) + + def _create_string_wrapped(self, start, end, nonascii): + content = self.getslice(start, end) + if nonascii: + # contains non-ascii chars, we need to check that it's valid utf-8 lgt = unicodehelper.check_utf8_or_raise(self.space, - content_utf8) - return self.space.newutf8(content_utf8, lgt) + content) else: - # ascii only, fast path (ascii is a strict subset of - # latin1, and we already checked that all the chars are < - # 128) - return self.space.newutf8(self.getslice(start, end), - end - start) + lgt = end - start + return self.space.newutf8(content, lgt) def _create_dict(self, d): from pypy.objspace.std.dictmultiobject import from_unicode_key_dict @@ -313,8 +450,7 @@ from pypy.objspace.std.dictmultiobject import create_empty_unicode_key_dict return create_empty_unicode_key_dict(self.space) - - def decode_string_escaped(self, start): + def decode_string_escaped(self, start, nonascii): i = self.pos builder = StringBuilder((i - start) * 2) # just an estimate assert start >= 0 @@ -325,25 +461,21 @@ i += 1 if ch == '"': content_utf8 = builder.build() - lgt = unicodehelper.check_utf8_or_raise(self.space, + length = unicodehelper.check_utf8_or_raise(self.space, content_utf8) self.pos = i - return self.space.newutf8(content_utf8, lgt) + return self.space.newutf8(content_utf8, length) elif ch == '\\': - i = self.decode_escape_sequence(i, builder) + i = self.decode_escape_sequence_to_utf8(i, builder) elif ch < '\x20': - if ch == '\0': - self._raise("Unterminated string starting at char %d", - start - 1) - else: - self._raise("Invalid control character at char %d", i-1) + self._raise_control_char_in_string(ch, start, i) else: builder.append(ch) - def decode_escape_sequence(self, i, builder): + def decode_escape_sequence_to_utf8(self, i, stringbuilder): ch = self.ll_chars[i] i += 1 - put = builder.append + put = stringbuilder.append if ch == '\\': put('\\') elif ch == '"': put('"' ) elif ch == '/': put('/' ) @@ -353,22 +485,37 @@ elif ch == 'r': put('\r') elif ch == 't': put('\t') elif ch == 'u': - return self.decode_escape_sequence_unicode(i, builder) + # may be a surrogate pair + return self.decode_escape_sequence_unicode(i, stringbuilder) else: self._raise("Invalid \\escape: %s (char %d)", ch, i-1) return i + def _get_int_val_from_hex4(self, i): + ll_chars = self.ll_chars + res = 0 + for i in range(i, i + 4): + ch = ord(ll_chars[i]) + if ord('a') <= ch <= ord('f'): + digit = ch - ord('a') + 10 + elif ord('A') <= ch <= ord('F'): + digit = ch - ord('A') + 10 + elif ord('0') <= ch <= ord('9'): + digit = ch - ord('0') + else: + raise ValueError + res = (res << 4) + digit + return res + def decode_escape_sequence_unicode(self, i, builder): # at this point we are just after the 'u' of the \u1234 sequence. start = i i += 4 - hexdigits = self.getslice(start, i) try: - val = int(hexdigits, 16) + val = self._get_int_val_from_hex4(start) if (0xd800 <= val <= 0xdbff and self.ll_chars[i] == '\\' and self.ll_chars[i+1] == 'u'): - hexdigits = self.getslice(i+2, i+6) - lowsurr = int(hexdigits, 16) + lowsurr = self._get_int_val_from_hex4(i + 2) if 0xdc00 <= lowsurr <= 0xdfff: # decode surrogate pair val = 0x10000 + (((val - 0xd800) << 10) | @@ -383,45 +530,618 @@ builder.append(utf8_ch) return i - def decode_key(self, i): - """ returns a wrapped unicode """ - from rpython.rlib.rarithmetic import intmask - i = self.skip_whitespace(i) + def decode_string(self, i, contextmap=None): + """ Decode a string at position i (which is right after the opening "). + Optionally pass a contextmap, if the value is decoded as the value of a + dict.""" + + ll_chars = self.ll_chars + start = i + ch = ll_chars[i] + if ch == '"': + self.pos = i + 1 + return self.w_empty_string # surprisingly common + + cache = True + if contextmap is not None: + # keep some statistics about the usefulness of the string cache on + # the contextmap + # the intuition about the contextmap is as follows: + # often there are string values stored in dictionaries that can + # never be usefully cached, like unique ids of objects. Then the + # strings *in those fields* of all objects should never be cached. + # However, the content of other fields can still be useful to + # cache. + contextmap.decoded_strings += 1 + if not contextmap.should_cache_strings(): + cache = False + if len(self.s) < self.MIN_SIZE_FOR_STRING_CACHE: + cache = False + + if not cache: + return self.decode_string_uncached(i) + + strhash, nonascii, i = simd.find_end_of_string(ll_chars, i, len(self.s)) + ch = ll_chars[i] + if ch == '\\': + self.pos = i + return self.decode_string_escaped(start, nonascii) + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + else: + assert ch == '"' + + self.pos = i + 1 + + length = i - start + strhash ^= length + + # check cache first: + try: + entry = self.cache_values[strhash] + except KeyError: + w_res = self._create_string_wrapped(start, i, nonascii) + # only add *some* strings to the cache, because keeping them all is + # way too expensive. first we check if the contextmap has caching + # disabled completely. if not, we check whether we have recently + # seen the same hash already, if yes, we cache the string. + if ((contextmap is not None and + contextmap.decoded_strings < self.STRING_CACHE_EVALUATION_SIZE) or + strhash in self.lru_cache): + entry = StringCacheEntry( + self.getslice(start, start + length), w_res) + self.cache_values[strhash] = entry + else: + self.lru_cache[self.lru_index] = strhash + self.lru_index = (self.lru_index + 1) & self.LRU_MASK + return w_res + if not entry.compare(ll_chars, start, length): + # collision! hopefully rare + return self._create_string_wrapped(start, i, nonascii) + if contextmap is not None: + contextmap.cache_hits += 1 + return entry.w_uni + + def decode_key_map(self, i, currmap): + """ Given the current map currmap of an object, decode the next key at + position i. This returns the new map of the object. """ + newmap = self._decode_key_map(i, currmap) + currmap.observe_transition(newmap, self.startmap) + return newmap + + def _decode_key_map(self, i, currmap): + ll_chars = self.ll_chars + # first try to see whether we happen to find currmap.nextmap_first + nextmap = currmap.fast_path_key_parse(self, i) + if nextmap is not None: + return nextmap + + start = i + ch = ll_chars[i] + if ch != '"': + self._raise("Key name must be string at char %d", i) + i += 1 + w_key = self._decode_key_string(i) + return currmap.get_next(w_key, self.s, start, self.pos, self.startmap) + + def _decode_key_string(self, i): + """ decode key at position i as a string. Key strings are always + cached, since they repeat a lot. """ + ll_chars = self.ll_chars + start = i + + strhash, nonascii, i = simd.find_end_of_string(ll_chars, i, len(self.s)) + + ch = ll_chars[i] + if ch == '\\': + self.pos = i + w_key = self.decode_string_escaped(start, nonascii) + return w_key + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + length = i - start + strhash ^= length + self.pos = i + 1 + # check cache first: + try: + entry = self.cache_keys[strhash] + except KeyError: + w_res = self._create_string_wrapped(start, i, nonascii) + entry = StringCacheEntry( + self.getslice(start, start + length), w_res) + self.cache_keys[strhash] = entry + return w_res + if not entry.compare(ll_chars, start, length): + # collision! hopefully rare + w_res = self._create_string_wrapped(start, i, nonascii) + else: + w_res = entry.w_uni + return w_res + + def decode_key_string(self, i): ll_chars = self.ll_chars ch = ll_chars[i] if ch != '"': self._raise("Key name must be string at char %d", i) i += 1 + return self._decode_key_string(i) - start = i - bits = 0 - strhash = ord(ll_chars[i]) << 7 - while True: - ch = ll_chars[i] + +class StringCacheEntry(object): + """ A cache entry, bundling the encoded version of a string as it appears + in the input string, and its wrapped decoded variant. """ + def __init__(self, repr, w_uni): + # repr is the escaped string + self.repr = repr + # uni is the wrapped decoded string + self.w_uni = w_uni + + def compare(self, ll_chars, start, length): + """ Check whether self.repr occurs at ll_chars[start:start+length] """ + if length != len(self.repr): + return False + index = start + for c in self.repr: + if not ll_chars[index] == c: + return False + index += 1 + return True + + +class MapBase(object): + """ A map implementation to speed up parsing of json dicts, and to + represent the resulting dicts more compactly and make access faster. """ + + # the basic problem we are trying to solve is the following: dicts in + # json can either be used as objects, or as dictionaries with arbitrary + # string keys. We want to use maps for the former, but not for the + # latter. But we don't know in advance which kind of dict is which. + + # Therefore we create "preliminary" maps where we aren't quite sure yet + # whether they are really useful maps or not. If we see them used often + # enough, we promote them to "useful" maps, which we will actually + # instantiate objects with. + + # If we determine that a map is not used often enough, we can turn it + # into a "blocked" map, which is a point in the map tree where we will + # switch to regular dicts, when we reach that part of the tree. + + # One added complication: We want to keep the number of preliminary maps + # bounded to prevent generating tons of useless maps. but also not too + # small, to support having a json file that contains many uniform objects + # with tons of keys. That's where the idea of "fringe" maps comes into + # play. They are maps that sit between known useful nodes and preliminary + # nodes in the map transition tree. We bound only the number of fringe + # nodes we are considering (to MAX_FRINGE), but not the number of + # preliminary maps. When we have too many fringe maps, we remove the least + # commonly instantiated fringe map and mark it as blocked. + + # allowed graph edges or nodes in nextmap_all: + # USEFUL ------- + # / \ \ + # v v v + # FRINGE USEFUL BLOCKED + # | + # v + # PRELIMINARY + # | + # v + # PRELIMINARY + + # state transitions: + # PRELIMINARY + # / | \ + # | v v + # | FRINGE -> USEFUL + # | | + # \ | + # v v + # BLOCKED + + # the nextmap_first edge can only be these graph edges: + # USEFUL + # | + # v + # USEFUL + # + # FRINGE + # | + # v + # PRELIMINARY + # | + # v + # PRELIMINARY + + USEFUL = 'u' + PRELIMINARY = 'p' + FRINGE = 'f' # buffer between PRELIMINARY and USEFUL + BLOCKED = 'b' + + # tunable parameters + MAX_FRINGE = 40 + USEFUL_THRESHOLD = 5 + + def __init__(self, space): + self.space = space + + # a single transition is stored in .nextmap_first + self.nextmap_first = None + + # nextmap_all is only initialized after seeing the *second* transition + # but then it also contains .nextmap_first + self.nextmap_all = None # later dict {key: nextmap} + + # keep some statistics about every map: how often it was instantiated + # and how many non-blocked leaves the map transition tree has, starting + # from self + self.instantiation_count = 0 + self.number_of_leaves = 1 + + def _check_invariants(self): + if self.nextmap_all: + for next in self.nextmap_all.itervalues(): + next._check_invariants() + elif self.nextmap_first: + self.nextmap_first._check_invariants() + + def get_next(self, w_key, string, start, stop, terminator): + from pypy.objspace.std.dictmultiobject import unicode_hash, unicode_eq + if isinstance(self, JSONMap): + assert not self.state == MapBase.BLOCKED + nextmap_first = self.nextmap_first + if (nextmap_first is not None and + nextmap_first.w_key.eq_w(w_key)): + return nextmap_first + + assert stop >= 0 + assert start >= 0 + + if nextmap_first is None: + # first transition ever seen, don't initialize nextmap_all + next = self._make_next_map(w_key, string[start:stop]) + self.nextmap_first = next + else: + if self.nextmap_all is None: + # 2nd transition ever seen + self.nextmap_all = objectmodel.r_dict(unicode_eq, unicode_hash, + force_non_null=True, simple_hash_eq=True) + self.nextmap_all[nextmap_first.w_key] = nextmap_first + else: + next = self.nextmap_all.get(w_key, None) + if next is not None: + return next + # if we are at this point we didn't find the transition yet, so + # create a new one + next = self._make_next_map(w_key, string[start:stop]) + self.nextmap_all[w_key] = next + + # one new leaf has been created + self.change_number_of_leaves(1) + + terminator.register_potential_fringe(next) + return next + + def change_number_of_leaves(self, difference): + """ add difference to .number_of_leaves of self and its parents """ + if not difference: + return + parent = self + while isinstance(parent, JSONMap): + parent.number_of_leaves += difference + parent = parent.prev + parent.number_of_leaves += difference # terminator + + def fast_path_key_parse(self, decoder, position): + """ Fast path when parsing the next key: We speculate that we will + always see a commonly seen next key, and use strcmp (implemented in + key_repr_cmp) to check whether that is the case. """ + nextmap_first = self.nextmap_first + if nextmap_first: + ll_chars = decoder.ll_chars + assert isinstance(nextmap_first, JSONMap) + if nextmap_first.key_repr_cmp(ll_chars, position): + decoder.pos = position + len(nextmap_first.key_repr) + return nextmap_first + return None + + def observe_transition(self, newmap, terminator): + """ observe a transition from self to newmap. + This does a few things, including updating the self size estimate with + the knowledge that one object transitioned from self to newmap. + also it potentially decides that self should move to state USEFUL.""" + newmap.instantiation_count += 1 + if isinstance(self, JSONMap) and self.state == MapBase.FRINGE: + if self.is_useful(): + self.mark_useful(terminator) + + def _make_next_map(self, w_key, key_repr): + return JSONMap(self.space, self, w_key, key_repr) + + def fill_dict(self, dict_w, values_w): + """ recursively fill the dictionary dict_w in the correct order, + reading from values_w.""" + raise NotImplementedError("abstract base") + + def _all_dot(self, output): + identity = objectmodel.compute_unique_id(self) + output.append('%s [shape=box%s];' % (identity, self._get_dot_text())) + if self.nextmap_all: + for w_key, value in self.nextmap_all.items(): + assert isinstance(value, JSONMap) + if value is self.nextmap_first: + color = ", color=blue" + else: + color = "" + output.append('%s -> %s [label="%s"%s];' % ( + identity, objectmodel.compute_unique_id(value), value.w_key._utf8, color)) + value._all_dot(output) + elif self.nextmap_first is not None: + value = self.nextmap_first + output.append('%s -> %s [label="%s", color=blue];' % ( + identity, objectmodel.compute_unique_id(value), value.w_key._utf8)) + value._all_dot(output) + + + def _get_dot_text(self): + return ", label=base" + + def view(self): + from dotviewer import graphclient + import pytest + r = ["digraph G {"] + self._all_dot(r) + r.append("}") + p = pytest.ensuretemp("jsonmap").join("temp.dot") + p.write("\n".join(r)) + graphclient.display_dot_file(str(p)) + + +class Terminator(MapBase): + """ The root node of the map transition tree. """ + def __init__(self, space): + MapBase.__init__(self, space) + # a set of all map nodes that are currently in the FRINGE state + self.current_fringe = {} + + def register_potential_fringe(self, prelim): + """ add prelim to the fringe, if its prev is either a Terminator or + useful. """ + prev = prelim.prev + if (isinstance(prev, Terminator) or + isinstance(prev, JSONMap) and prev.state == MapBase.USEFUL): + assert prelim.state == MapBase.PRELIMINARY + prelim.state = MapBase.FRINGE + + if len(self.current_fringe) > MapBase.MAX_FRINGE: + self.cleanup_fringe() + self.current_fringe[prelim] = None + + def remove_from_fringe(self, former_fringe): + """ Remove former_fringe from self.current_fringe. """ + assert former_fringe.state in (MapBase.USEFUL, MapBase.BLOCKED) + del self.current_fringe[former_fringe] + + def cleanup_fringe(self): + """ remove the least-instantiated fringe map and block it.""" + min_fringe = None + min_avg = 1e200 + for f in self.current_fringe: + assert f.state == MapBase.FRINGE + avg = f.average_instantiation() + if avg < min_avg: + min_avg = avg + min_fringe = f + assert min_fringe + min_fringe.mark_blocked(self) + + def fill_dict(self, dict_w, values_w): + """ recursively fill the dictionary dict_w in the correct order, + reading from values_w.""" + return 0 + + def _check_invariants(self): + for fringe in self.current_fringe: + assert fringe.state == MapBase.FRINGE + +class JSONMap(MapBase): + """ A map implementation to speed up parsing """ + + def __init__(self, space, prev, w_key, key_repr): + MapBase.__init__(self, space) + + self.prev = prev + self.w_key = w_key + self.key_repr = key_repr + + self.state = MapBase.PRELIMINARY + + # key decoding stats + self.decoded_strings = 0 + self.cache_hits = 0 + + # for jsondict support + self.key_to_index = None + self.keys_in_order = None + self.strategy_instance = None + + def __repr__(self): + return "" % ( + self.key_repr, self.instantiation_count, self.number_of_leaves, self.prev) + + def _get_terminator(self): # only for _check_invariants + while isinstance(self, JSONMap): + self = self.prev + assert isinstance(self, Terminator) + return self + + def _check_invariants(self): + assert self.state in ( + MapBase.USEFUL, + MapBase.PRELIMINARY, + MapBase.FRINGE, + MapBase.BLOCKED, + ) + + prev = self.prev + if isinstance(prev, JSONMap): + prevstate = prev.state + else: + prevstate = MapBase.USEFUL + + if prevstate == MapBase.USEFUL: + assert self.state != MapBase.PRELIMINARY + elif prevstate == MapBase.PRELIMINARY: + assert self.state == MapBase.PRELIMINARY + elif prevstate == MapBase.FRINGE: + assert self.state == MapBase.PRELIMINARY + else: + # if prevstate is BLOCKED, we shouldn't have recursed here! + assert False, "should be unreachable" + + if self.state == MapBase.BLOCKED: + assert self.nextmap_first is None + assert self.nextmap_all is None + elif self.state == MapBase.FRINGE: + assert self in self._get_terminator().current_fringe + + MapBase._check_invariants(self) + + def mark_useful(self, terminator): + """ mark self as useful, and also the most commonly instantiated + children, recursively """ + was_fringe = self.state == MapBase.FRINGE + assert self.state in (MapBase.FRINGE, MapBase.PRELIMINARY) + self.state = MapBase.USEFUL + if was_fringe: + terminator.remove_from_fringe(self) + # find the most commonly instantiated child, store it into + # nextmap_first and mark it useful, recursively + maxchild = self.nextmap_first + if self.nextmap_all is not None: + for child in self.nextmap_all.itervalues(): + if child.instantiation_count > maxchild.instantiation_count: + maxchild = child + if maxchild is not None: + maxchild.mark_useful(terminator) + if self.nextmap_all: + for child in self.nextmap_all.itervalues(): + if child is not maxchild: + terminator.register_potential_fringe(child) + self.nextmap_first = maxchild + + def mark_blocked(self, terminator): + """ mark self and recursively all its children as blocked.""" + was_fringe = self.state == MapBase.FRINGE + self.state = MapBase.BLOCKED + if was_fringe: + terminator.remove_from_fringe(self) + if self.nextmap_all: + for next in self.nextmap_all.itervalues(): + next.mark_blocked(terminator) + elif self.nextmap_first: + self.nextmap_first.mark_blocked(terminator) + self.nextmap_first = None + self.nextmap_all = None + self.change_number_of_leaves(-self.number_of_leaves + 1) + + def is_state_blocked(self): + return self.state == MapBase.BLOCKED + + def is_state_useful(self): + return self.state == MapBase.USEFUL + + def average_instantiation(self): + """ the number of instantiations, divided by the number of leaves. We + want to favor nodes that have either a high instantiation count, or few + leaves below it. """ + return self.instantiation_count / float(self.number_of_leaves) + + def is_useful(self): + return self.average_instantiation() > self.USEFUL_THRESHOLD + + def should_cache_strings(self): + """ return whether strings parsed in the context of this map should be + cached. """ + # we should cache if either we've seen few strings so far (less than + # STRING_CACHE_EVALUATION_SIZE), or if we've seen many, and the cache + # hit rate has been high enough + return not (self.decoded_strings > JSONDecoder.STRING_CACHE_EVALUATION_SIZE and + self.cache_hits * JSONDecoder.STRING_CACHE_USEFULNESS_FACTOR < self.decoded_strings) + + def key_repr_cmp(self, ll_chars, i): + # XXX should we use "real" memcmp (here in particular, and in other + # places in RPython in general)? + for j, c in enumerate(self.key_repr): + if ll_chars[i] != c: + return False i += 1 - if ch == '"': - break - elif ch == '\\' or ch < '\x20': - self.pos = i-1 - return self.decode_string_escaped(start) - strhash = intmask((1000003 * strhash) ^ ord(ll_chars[i])) - bits |= ord(ch) - length = i - start - 1 - if length == 0: - strhash = -1 + return True + + def fill_dict(self, dict_w, values_w): + index = self.prev.fill_dict(dict_w, values_w) + dict_w[self.w_key] = values_w[index] + return index + 1 + + # _____________________________________________________ + # methods for JsonDictStrategy + + @jit.elidable + def get_index(self, w_key): + from pypy.objspace.std.unicodeobject import W_UnicodeObject + assert isinstance(w_key, W_UnicodeObject) + return self.get_key_to_index().get(w_key, -1) + + def get_key_to_index(self): + from pypy.objspace.std.dictmultiobject import unicode_hash, unicode_eq + key_to_index = self.key_to_index + if key_to_index is None: + key_to_index = self.key_to_index = objectmodel.r_dict(unicode_eq, unicode_hash, + force_non_null=True, simple_hash_eq=True) + # compute depth + curr = self + depth = 0 + while True: + depth += 1 + curr = curr.prev + if not isinstance(curr, JSONMap): + break + + curr = self + while depth: + depth -= 1 + key_to_index[curr.w_key] = depth + curr = curr.prev + if not isinstance(curr, JSONMap): + break + return key_to_index + + def get_keys_in_order(self): + keys_in_order = self.keys_in_order + if keys_in_order is None: + key_to_index = self.get_key_to_index() + keys_in_order = self.keys_in_order = [None] * len(key_to_index) + for w_key, index in key_to_index.iteritems(): + keys_in_order[index] = w_key + return keys_in_order + + # _____________________________________________________ + + def _get_dot_text(self): + if self.nextmap_all is None: + l = int(self.nextmap_first is not None) else: - strhash ^= length - strhash = intmask(strhash) - self.pos = i - # check cache first: - key = (ll_chars, start, length, strhash) - try: - return self.cache[key] - except KeyError: - pass - res = self._create_string(start, i - 1, bits) - self.cache[key] = res + l = len(self.nextmap_all) + extra = "" + if self.decoded_strings: + extra = "\\n%s/%s (%s%%)" % (self.cache_hits, self.decoded_strings, self.cache_hits/float(self.decoded_strings)) + res = ', label="#%s\\nchildren: %s%s"' % (self.instantiation_count, l, extra) + if self.state == MapBase.BLOCKED: + res += ", fillcolor=lightsalmon" + if self.state == MapBase.FRINGE: + res += ", fillcolor=lightgray" + if self.state == MapBase.PRELIMINARY: + res += ", fillcolor=lightslategray" return res @@ -442,3 +1162,4 @@ return w_res finally: decoder.close() + diff --git a/pypy/module/_pypyjson/simd.py b/pypy/module/_pypyjson/simd.py new file mode 100644 --- /dev/null +++ b/pypy/module/_pypyjson/simd.py @@ -0,0 +1,225 @@ +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rlib import objectmodel, unroll +from rpython.rlib.rarithmetic import r_uint, intmask, LONG_BIT +from rpython.jit.backend.detect_cpu import autodetect + +# accelerators for string operations using simd on regular word sizes (*not* +# SSE instructions). this style is sometimes called SWAR (SIMD Within A +# Register) or "broadword techniques" + +# XXX remove wordsize and endianness restrictions properly, so far only x86-64 +# is tested + +USE_SIMD = False +if LONG_BIT == 64: + WORD_SIZE = 8 + EVERY_BYTE_ONE = 0x0101010101010101 + EVERY_BYTE_HIGHEST_BIT = 0x8080808080808080 + if autodetect() == "x86-64": + USE_SIMD = True +else: + WORD_SIZE = 4 + EVERY_BYTE_ONE = 0x01010101 + EVERY_BYTE_HIGHEST_BIT = 0x80808080 + + +# helpers + +unrolling_wordsize = unroll.unrolling_iterable(range(WORD_SIZE)) + +def char_repeated_word_width(ch): + return r_uint(EVERY_BYTE_ONE) * ord(ch) + +def any_char_zero(word): + return (word - r_uint(EVERY_BYTE_ONE)) & ~word & r_uint(EVERY_BYTE_HIGHEST_BIT) + +def any_char_in_words_zero(*words): + return _any_char_in_any_word_zero_accum(0, *words) + +def _any_char_in_any_word_zero_accum(accum, word, *words): + accum |= (word - r_uint(EVERY_BYTE_ONE)) & ~word + if not words: + return accum & r_uint(EVERY_BYTE_HIGHEST_BIT) + return _any_char_in_any_word_zero_accum(accum, *words) + +def print_chars(word): + # for debugging + out = '' + for i in range(WORD_SIZE): + out += chr(word & 0xff) + word >>= 8 + return out + +def index_nonzero(word): + # XXX can be done very cheap in theory + assert word From pypy.commits at gmail.com Wed Sep 25 11:31:48 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 25 Sep 2019 08:31:48 -0700 (PDT) Subject: [pypy-commit] pypy default: add aarch64 to release targets Message-ID: <5d8b8864.1c69fb81.035a.e6f5@mx.google.com> Author: Matti Picus Branch: Changeset: r97611:4a76e7a33530 Date: 2019-09-25 18:30 +0300 http://bitbucket.org/pypy/pypy/changeset/4a76e7a33530/ Log: add aarch64 to release targets diff --git a/pypy/tool/release/force-builds.py b/pypy/tool/release/force-builds.py --- a/pypy/tool/release/force-builds.py +++ b/pypy/tool/release/force-builds.py @@ -28,6 +28,7 @@ 'own-win-x86-32', 'own-linux-s390x', # 'own-macosx-x86-32', + 'own-linux-aarch64', 'pypy-c-jit-linux-x86-32', 'pypy-c-jit-linux-x86-64', # 'pypy-c-jit-freebsd-9-x86-64', @@ -36,6 +37,7 @@ 'pypy-c-jit-linux-s390x', # 'build-pypy-c-jit-linux-armhf-raspbian', # 'build-pypy-c-jit-linux-armel', + 'pypy-c-jit-linux-aarch64', 'rpython-linux-x86-32', 'rpython-linux-x86-64', 'rpython-win-x86-32' diff --git a/pypy/tool/release/repackage.sh b/pypy/tool/release/repackage.sh --- a/pypy/tool/release/repackage.sh +++ b/pypy/tool/release/repackage.sh @@ -28,7 +28,7 @@ # Download latest builds from the buildmaster, rename the top # level directory, and repackage ready to be uploaded to bitbucket actual_ver=xxxxxxxxxxxxxxx -for plat in linux linux64 osx64 s390x # linux-armhf-raspbian linux-armel +for plat in linux linux64 osx64 s390x aarch64 # linux-armhf-raspbian linux-armel do echo downloading package for $plat if wget -q --show-progress http://buildbot.pypy.org/nightly/$branchname/pypy-c-jit-latest-$plat.tar.bz2 From pypy.commits at gmail.com Wed Sep 25 11:31:46 2019 From: pypy.commits at gmail.com (mattip) Date: Wed, 25 Sep 2019 08:31:46 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy3.6-7.x: merge py3.6 into release Message-ID: <5d8b8862.1c69fb81.37b16.b2f8@mx.google.com> Author: Matti Picus Branch: release-pypy3.6-7.x Changeset: r97610:b7e028d5c657 Date: 2019-09-25 18:20 +0300 http://bitbucket.org/pypy/pypy/changeset/b7e028d5c657/ Log: merge py3.6 into release diff too long, truncating to 2000 out of 3654 lines diff --git a/lib-python/3/test/test_time.py b/lib-python/3/test/test_time.py --- a/lib-python/3/test/test_time.py +++ b/lib-python/3/test/test_time.py @@ -530,6 +530,8 @@ self.skipTest('could not set locale.LC_ALL to fr_FR') # This should not cause an exception time.strftime("%B", (2009,2,1,0,0,0,0,0,0)) + # PyPy addition: + time.strftime("%B", (2009,8,1,0,0,0,0,0,0)).lower() class _TestAsctimeYear: diff --git a/lib_pypy/cffi/_pycparser/README b/lib_pypy/cffi/_pycparser/README --- a/lib_pypy/cffi/_pycparser/README +++ b/lib_pypy/cffi/_pycparser/README @@ -10,3 +10,8 @@ ^^^^^^^^^^^^^^^ yacctab='cffi._pycparser.yacctab', ^^^^^^^^^^^^^^^ + +Also, when updating the version of this in-place, you must regenerate the +lextab.py and yacctab.py files. They will be regenerated on import if they +are not found, so they should be removed, then regenrated, then the new +versions committed. diff --git a/lib_pypy/cffi/_pycparser/_c_ast.cfg b/lib_pypy/cffi/_pycparser/_c_ast.cfg --- a/lib_pypy/cffi/_pycparser/_c_ast.cfg +++ b/lib_pypy/cffi/_pycparser/_c_ast.cfg @@ -9,7 +9,7 @@ # ** - a sequence of child nodes # - an attribute # -# Copyright (C) 2008-2015, Eli Bendersky +# Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- @@ -187,3 +187,5 @@ Union: [name, decls**] While: [cond*, stmt*] + +Pragma: [string] diff --git a/lib_pypy/cffi/_pycparser/lextab.py b/lib_pypy/cffi/_pycparser/lextab.py --- a/lib_pypy/cffi/_pycparser/lextab.py +++ b/lib_pypy/cffi/_pycparser/lextab.py @@ -1,9 +1,10 @@ -# pycparser.lextab.py. This file automatically created by PLY (version 3.4). Don't edit! -_tabversion = '3.4' -_lextokens = {'VOID': 1, 'LBRACKET': 1, 'WCHAR_CONST': 1, 'FLOAT_CONST': 1, 'MINUS': 1, 'RPAREN': 1, 'LONG': 1, 'PLUS': 1, 'ELLIPSIS': 1, 'GT': 1, 'GOTO': 1, 'ENUM': 1, 'PERIOD': 1, 'GE': 1, 'INT_CONST_DEC': 1, 'ARROW': 1, 'HEX_FLOAT_CONST': 1, 'DOUBLE': 1, 'MINUSEQUAL': 1, 'INT_CONST_OCT': 1, 'TIMESEQUAL': 1, 'OR': 1, 'SHORT': 1, 'RETURN': 1, 'RSHIFTEQUAL': 1, 'RESTRICT': 1, 'STATIC': 1, 'SIZEOF': 1, 'UNSIGNED': 1, 'UNION': 1, 'COLON': 1, 'WSTRING_LITERAL': 1, 'DIVIDE': 1, 'FOR': 1, 'PLUSPLUS': 1, 'EQUALS': 1, 'ELSE': 1, 'INLINE': 1, 'EQ': 1, 'AND': 1, 'TYPEID': 1, 'LBRACE': 1, 'PPHASH': 1, 'INT': 1, 'SIGNED': 1, 'CONTINUE': 1, 'NOT': 1, 'OREQUAL': 1, 'MOD': 1, 'RSHIFT': 1, 'DEFAULT': 1, 'CHAR': 1, 'WHILE': 1, 'DIVEQUAL': 1, 'EXTERN': 1, 'CASE': 1, 'LAND': 1, 'REGISTER': 1, 'MODEQUAL': 1, 'NE': 1, 'SWITCH': 1, 'INT_CONST_HEX': 1, '_COMPLEX': 1, 'PLUSEQUAL': 1, 'STRUCT': 1, 'CONDOP': 1, 'BREAK': 1, 'VOLATILE': 1, 'ANDEQUAL': 1, 'INT_CONST_BIN': 1, 'DO': 1, 'LNOT': 1, 'CONST': 1, 'LOR': 1, 'CHAR_CONST': 1, 'LSHIFT': 1, 'RBRACE': 1, '_BOOL': 1, 'LE': 1, 'SEMI': 1, 'LT': 1, 'COMMA': 1, 'OFFSETOF': 1, 'TYPEDEF': 1, 'XOR': 1, 'AUTO': 1, 'TIMES': 1, 'LPAREN': 1, 'MINUSMINUS': 1, 'ID': 1, 'IF': 1, 'STRING_LITERAL': 1, 'FLOAT': 1, 'XOREQUAL': 1, 'LSHIFTEQUAL': 1, 'RBRACKET': 1} -_lexreflags = 0 +# lextab.py. This file automatically created by PLY (version 3.10). Don't edit! +_tabversion = '3.10' +_lextokens = set(('_BOOL', '_COMPLEX', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN', 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', 'REGISTER', 'OFFSETOF', 'RESTRICT', 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', 'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID', 'VOLATILE', 'WHILE', '__INT128', 'ID', 'TYPEID', 'INT_CONST_DEC', 'INT_CONST_OCT', 'INT_CONST_HEX', 'INT_CONST_BIN', 'FLOAT_CONST', 'HEX_FLOAT_CONST', 'CHAR_CONST', 'WCHAR_CONST', 'STRING_LITERAL', 'WSTRING_LITERAL', 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MOD', 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', 'LOR', 'LAND', 'LNOT', 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', 'PLUSEQUAL', 'MINUSEQUAL', 'LSHIFTEQUAL', 'RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', 'OREQUAL', 'PLUSPLUS', 'MINUSMINUS', 'ARROW', 'CONDOP', 'LPAREN', 'RPAREN', 'LBRACKET', 'RBRACKET', 'LBRACE', 'RBRACE', 'COMMA', 'PERIOD', 'SEMI', 'COLON', 'ELLIPSIS', 'PPHASH', 'PPPRAGMA', 'PPPRAGMASTR')) +_lexreflags = 64 _lexliterals = '' -_lexstateinfo = {'ppline': 'exclusive', 'pppragma': 'exclusive', 'INITIAL': 'inclusive'} -_lexstatere = {'ppline': [('(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, None, None, None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR'), None, None, None, None, None, None, ('t_pppragma_ID', 'ID')])], 'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P\\.\\.\\.)|(?P\\+\\+)|(?P\\|\\|)|(?P\\^=)|(?P\\|=)|(?P<<=)|(?P>>=)|(?P\\+=)|(?P\\*=)|(?P\\+)|(?P%=)|(?P/=)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, None, None, None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, None, None, None, None, (None, 'ELLIPSIS'), (None, 'PLUSPLUS'), (None, 'LOR'), (None, 'XOREQUAL'), (None, 'OREQUAL'), (None, 'LSHIFTEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'PLUSEQUAL'), (None, 'TIMESEQUAL'), (None, 'PLUS'), (None, 'MODEQUAL'), (None, 'DIVEQUAL')]), ('(?P\\])|(?P\\?)|(?P\\^)|(?P<<)|(?P<=)|(?P\\()|(?P->)|(?P==)|(?P!=)|(?P--)|(?P\\|)|(?P\\*)|(?P\\[)|(?P>=)|(?P\\))|(?P&&)|(?P>>)|(?P-=)|(?P\\.)|(?P&=)|(?P=)|(?P<)|(?P,)|(?P/)|(?P&)|(?P%)|(?P;)|(?P-)|(?P>)|(?P:)|(?P~)|(?P!)', [None, (None, 'RBRACKET'), (None, 'CONDOP'), (None, 'XOR'), (None, 'LSHIFT'), (None, 'LE'), (None, 'LPAREN'), (None, 'ARROW'), (None, 'EQ'), (None, 'NE'), (None, 'MINUSMINUS'), (None, 'OR'), (None, 'TIMES'), (None, 'LBRACKET'), (None, 'GE'), (None, 'RPAREN'), (None, 'LAND'), (None, 'RSHIFT'), (None, 'MINUSEQUAL'), (None, 'PERIOD'), (None, 'ANDEQUAL'), (None, 'EQUALS'), (None, 'LT'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'AND'), (None, 'MOD'), (None, 'SEMI'), (None, 'MINUS'), (None, 'GT'), (None, 'COLON'), (None, 'NOT'), (None, 'LNOT')])]} -_lexstateignore = {'ppline': ' \t', 'pppragma': ' \t<>.-{}();=+-*/$%@&^~!?:,0123456789', 'INITIAL': ' \t'} -_lexstateerrorf = {'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error', 'INITIAL': 't_error'} +_lexstateinfo = {'INITIAL': 'inclusive', 'ppline': 'exclusive', 'pppragma': 'exclusive'} +_lexstatere = {'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-9])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-9])([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P\\.\\.\\.)|(?P\\|\\|)|(?P\\+\\+)|(?P<<=)|(?P\\|=)|(?P\\+=)|(?P>>=)|(?P\\*=)|(?P\\^=)|(?P&=)|(?P->)|(?P\\?)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, (None, 'ELLIPSIS'), (None, 'LOR'), (None, 'PLUSPLUS'), (None, 'LSHIFTEQUAL'), (None, 'OREQUAL'), (None, 'PLUSEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'TIMESEQUAL'), (None, 'XOREQUAL'), (None, 'ANDEQUAL'), (None, 'ARROW'), (None, 'CONDOP')]), ('(?P/=)|(?P==)|(?P>=)|(?P&&)|(?P\\[)|(?P<=)|(?P\\()|(?P<<)|(?P-=)|(?P--)|(?P%=)|(?P!=)|(?P\\|)|(?P\\.)|(?P\\+)|(?P\\])|(?P\\))|(?P>>)|(?P\\*)|(?P\\^)|(?P&)|(?P:)|(?P,)|(?P/)|(?P=)|(?P>)|(?P!)|(?P<)|(?P-)|(?P%)|(?P~)|(?P;)', [None, (None, 'DIVEQUAL'), (None, 'EQ'), (None, 'GE'), (None, 'LAND'), (None, 'LBRACKET'), (None, 'LE'), (None, 'LPAREN'), (None, 'LSHIFT'), (None, 'MINUSEQUAL'), (None, 'MINUSMINUS'), (None, 'MODEQUAL'), (None, 'NE'), (None, 'OR'), (None, 'PERIOD'), (None, 'PLUS'), (None, 'RBRACKET'), (None, 'RPAREN'), (None, 'RSHIFT'), (None, 'TIMES'), (None, 'XOR'), (None, 'AND'), (None, 'COLON'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'EQUALS'), (None, 'GT'), (None, 'LNOT'), (None, 'LT'), (None, 'MINUS'), (None, 'MOD'), (None, 'NOT'), (None, 'SEMI')])], 'ppline': [('(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P.+)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR')])]} +_lexstateignore = {'INITIAL': ' \t', 'ppline': ' \t', 'pppragma': ' \t'} +_lexstateerrorf = {'INITIAL': 't_error', 'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error'} +_lexstateeoff = {} diff --git a/lib_pypy/cffi/_pycparser/yacctab.py b/lib_pypy/cffi/_pycparser/yacctab.py --- a/lib_pypy/cffi/_pycparser/yacctab.py +++ b/lib_pypy/cffi/_pycparser/yacctab.py @@ -1,292 +1,338 @@ # yacctab.py # This file is automatically generated. Do not edit. -_tabversion = '3.2' +_tabversion = '3.10' _lr_method = 'LALR' -_lr_signature = '\x11\x82\x05\xfb:\x10\xfeo5\xb4\x11N\xe7S\xb4b' +_lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMOD_BOOL _COMPLEX AUTO BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM EXTERN FLOAT FOR GOTO IF INLINE INT LONG REGISTER OFFSETOF RESTRICT RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH TYPEDEF UNION UNSIGNED VOID VOLATILE WHILE __INT128 ID TYPEID INT_CONST_DEC INT_CONST_OCT INT_CONST_HEX INT_CONST_BIN FLOAT_CONST HEX_FLOAT_CONST CHAR_CONST WCHAR_CONST STRING_LITERAL WSTRING_LITERAL PLUS MINUS TIMES DIVIDE MOD OR AND NOT XOR LSHIFT RSHIFT LOR LAND LNOT LT LE GT GE EQ NE EQUALS TIMESEQUAL DIVEQUAL MODEQUAL PLUSEQUAL MINUSEQUAL LSHIFTEQUAL RSHIFTEQUAL ANDEQUAL XOREQUAL OREQUAL PLUSPLUS MINUSMINUS ARROW CONDOP LPAREN RPAREN LBRACKET RBRACKET LBRACE RBRACE COMMA PERIOD SEMI COLON ELLIPSIS PPHASH PPPRAGMA PPPRAGMASTRabstract_declarator_opt : empty\n| abstract_declaratorassignment_expression_opt : empty\n| assignment_expressionblock_item_list_opt : empty\n| block_item_listdeclaration_list_opt : empty\n| declaration_listdeclaration_specifiers_no_type_opt : empty\n| declaration_specifiers_no_typedesignation_opt : empty\n| designationexpression_opt : empty\n| expressionid_init_declarator_list_opt : empty\n| id_init_declarator_listidentifier_list_opt : empty\n| identifier_listinit_declarator_list_opt : empty\n| init_declarator_listinitializer_list_opt : empty\n| initializer_listparameter_type_list_opt : empty\n| parameter_type_liststruct_declarator_list_opt : empty\n| struct_declarator_listtype_qualifier_list_opt : empty\n| type_qualifier_list direct_id_declarator : ID\n direct_id_declarator : LPAREN id_declarator RPAREN\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_id_declarator : direct_id_declarator LPAREN parameter_type_list RPAREN\n | direct_id_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_declarator : TYPEID\n direct_typeid_declarator : LPAREN typeid_declarator RPAREN\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_noparen_declarator : TYPEID\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN\n id_declarator : direct_id_declarator\n id_declarator : pointer direct_id_declarator\n typeid_declarator : direct_typeid_declarator\n typeid_declarator : pointer direct_typeid_declarator\n typeid_noparen_declarator : direct_typeid_noparen_declarator\n typeid_noparen_declarator : pointer direct_typeid_noparen_declarator\n translation_unit_or_empty : translation_unit\n | empty\n translation_unit : external_declaration\n translation_unit : translation_unit external_declaration\n external_declaration : function_definition\n external_declaration : declaration\n external_declaration : pp_directive\n | pppragma_directive\n external_declaration : SEMI\n pp_directive : PPHASH\n pppragma_directive : PPPRAGMA\n | PPPRAGMA PPPRAGMASTR\n function_definition : id_declarator declaration_list_opt compound_statement\n function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement\n statement : labeled_statement\n | expression_statement\n | compound_statement\n | selection_statement\n | iteration_statement\n | jump_statement\n | pppragma_directive\n pragmacomp_or_statement : pppragma_directive statement\n | statement\n decl_body : declaration_specifiers init_declarator_list_opt\n | declaration_specifiers_no_type id_init_declarator_list_opt\n declaration : decl_body SEMI\n declaration_list : declaration\n | declaration_list declaration\n declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt\n declaration_specifiers : declaration_specifiers type_qualifier\n declaration_specifiers : declaration_specifiers storage_class_specifier\n declaration_specifiers : declaration_specifiers function_specifier\n declaration_specifiers : declaration_specifiers type_specifier_no_typeid\n declaration_specifiers : type_specifier\n declaration_specifiers : declaration_specifiers_no_type type_specifier\n storage_class_specifier : AUTO\n | REGISTER\n | STATIC\n | EXTERN\n | TYPEDEF\n function_specifier : INLINE\n type_specifier_no_typeid : VOID\n | _BOOL\n | CHAR\n | SHORT\n | INT\n | LONG\n | FLOAT\n | DOUBLE\n | _COMPLEX\n | SIGNED\n | UNSIGNED\n | __INT128\n type_specifier : typedef_name\n | enum_specifier\n | struct_or_union_specifier\n | type_specifier_no_typeid\n type_qualifier : CONST\n | RESTRICT\n | VOLATILE\n init_declarator_list : init_declarator\n | init_declarator_list COMMA init_declarator\n init_declarator : declarator\n | declarator EQUALS initializer\n id_init_declarator_list : id_init_declarator\n | id_init_declarator_list COMMA init_declarator\n id_init_declarator : id_declarator\n | id_declarator EQUALS initializer\n specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid\n specifier_qualifier_list : specifier_qualifier_list type_qualifier\n specifier_qualifier_list : type_specifier\n specifier_qualifier_list : type_qualifier_list type_specifier\n struct_or_union_specifier : struct_or_union ID\n | struct_or_union TYPEID\n struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close\n | struct_or_union brace_open brace_close\n struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close\n | struct_or_union ID brace_open brace_close\n | struct_or_union TYPEID brace_open struct_declaration_list brace_close\n | struct_or_union TYPEID brace_open brace_close\n struct_or_union : STRUCT\n | UNION\n struct_declaration_list : struct_declaration\n | struct_declaration_list struct_declaration\n struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI\n struct_declaration : SEMI\n struct_declaration : pppragma_directive\n struct_declarator_list : struct_declarator\n | struct_declarator_list COMMA struct_declarator\n struct_declarator : declarator\n struct_declarator : declarator COLON constant_expression\n | COLON constant_expression\n enum_specifier : ENUM ID\n | ENUM TYPEID\n enum_specifier : ENUM brace_open enumerator_list brace_close\n enum_specifier : ENUM ID brace_open enumerator_list brace_close\n | ENUM TYPEID brace_open enumerator_list brace_close\n enumerator_list : enumerator\n | enumerator_list COMMA\n | enumerator_list COMMA enumerator\n enumerator : ID\n | ID EQUALS constant_expression\n declarator : id_declarator\n | typeid_declarator\n pointer : TIMES type_qualifier_list_opt\n | TIMES type_qualifier_list_opt pointer\n type_qualifier_list : type_qualifier\n | type_qualifier_list type_qualifier\n parameter_type_list : parameter_list\n | parameter_list COMMA ELLIPSIS\n parameter_list : parameter_declaration\n | parameter_list COMMA parameter_declaration\n parameter_declaration : declaration_specifiers id_declarator\n | declaration_specifiers typeid_noparen_declarator\n parameter_declaration : declaration_specifiers abstract_declarator_opt\n identifier_list : identifier\n | identifier_list COMMA identifier\n initializer : assignment_expression\n initializer : brace_open initializer_list_opt brace_close\n | brace_open initializer_list COMMA brace_close\n initializer_list : designation_opt initializer\n | initializer_list COMMA designation_opt initializer\n designation : designator_list EQUALS\n designator_list : designator\n | designator_list designator\n designator : LBRACKET constant_expression RBRACKET\n | PERIOD identifier\n type_name : specifier_qualifier_list abstract_declarator_opt\n abstract_declarator : pointer\n abstract_declarator : pointer direct_abstract_declarator\n abstract_declarator : direct_abstract_declarator\n direct_abstract_declarator : LPAREN abstract_declarator RPAREN direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET\n direct_abstract_declarator : LBRACKET TIMES RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN\n direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN\n block_item : declaration\n | statement\n block_item_list : block_item\n | block_item_list block_item\n compound_statement : brace_open block_item_list_opt brace_close labeled_statement : ID COLON pragmacomp_or_statement labeled_statement : CASE constant_expression COLON pragmacomp_or_statement labeled_statement : DEFAULT COLON pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement jump_statement : GOTO ID SEMI jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI\n | RETURN SEMI\n expression_statement : expression_opt SEMI expression : assignment_expression\n | expression COMMA assignment_expression\n typedef_name : TYPEID assignment_expression : conditional_expression\n | unary_expression assignment_operator assignment_expression\n assignment_operator : EQUALS\n | XOREQUAL\n | TIMESEQUAL\n | DIVEQUAL\n | MODEQUAL\n | PLUSEQUAL\n | MINUSEQUAL\n | LSHIFTEQUAL\n | RSHIFTEQUAL\n | ANDEQUAL\n | OREQUAL\n constant_expression : conditional_expression conditional_expression : binary_expression\n | binary_expression CONDOP expression COLON conditional_expression\n binary_expression : cast_expression\n | binary_expression TIMES binary_expression\n | binary_expression DIVIDE binary_expression\n | binary_expression MOD binary_expression\n | binary_expression PLUS binary_expression\n | binary_expression MINUS binary_expression\n | binary_expression RSHIFT binary_expression\n | binary_expression LSHIFT binary_expression\n | binary_expression LT binary_expression\n | binary_expression LE binary_expression\n | binary_expression GE binary_expression\n | binary_expression GT binary_expression\n | binary_expression EQ binary_expression\n | binary_expression NE binary_expression\n | binary_expression AND binary_expression\n | binary_expression OR binary_expression\n | binary_expression XOR binary_expression\n | binary_expression LAND binary_expression\n | binary_expression LOR binary_expression\n cast_expression : unary_expression cast_expression : LPAREN type_name RPAREN cast_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression\n | MINUSMINUS unary_expression\n | unary_operator cast_expression\n unary_expression : SIZEOF unary_expression\n | SIZEOF LPAREN type_name RPAREN\n unary_operator : AND\n | TIMES\n | PLUS\n | MINUS\n | NOT\n | LNOT\n postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN\n | postfix_expression LPAREN RPAREN\n postfix_expression : postfix_expression PERIOD ID\n | postfix_expression PERIOD TYPEID\n | postfix_expression ARROW ID\n | postfix_expression ARROW TYPEID\n postfix_expression : postfix_expression PLUSPLUS\n | postfix_expression MINUSMINUS\n postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close\n | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close\n primary_expression : identifier primary_expression : constant primary_expression : unified_string_literal\n | unified_wstring_literal\n primary_expression : LPAREN expression RPAREN primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN\n offsetof_member_designator : identifier\n | offsetof_member_designator PERIOD identifier\n | offsetof_member_designator LBRACKET expression RBRACKET\n argument_expression_list : assignment_expression\n | argument_expression_list COMMA assignment_expression\n identifier : ID constant : INT_CONST_DEC\n | INT_CONST_OCT\n | INT_CONST_HEX\n | INT_CONST_BIN\n constant : FLOAT_CONST\n | HEX_FLOAT_CONST\n constant : CHAR_CONST\n | WCHAR_CONST\n unified_string_literal : STRING_LITERAL\n | unified_string_literal STRING_LITERAL\n unified_wstring_literal : WSTRING_LITERAL\n | unified_wstring_literal WSTRING_LITERAL\n brace_open : LBRACE\n brace_close : RBRACE\n empty : ' -_lr_action_items = {'VOID':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[6,6,-63,-74,-73,-60,-56,-57,-35,-31,-61,6,-36,-55,-70,-65,-54,6,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,6,-69,6,-72,-76,6,-59,-86,-261,-85,6,-113,-112,-32,-102,-101,6,6,6,-47,-48,6,-115,6,6,6,6,-92,6,6,6,6,-38,6,-49,6,6,-87,-93,-262,-103,-121,-120,6,6,6,6,6,-39,-41,-44,-40,-42,6,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,6,-175,-174,6,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LBRACKET':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,30,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,60,62,63,67,68,69,70,74,78,81,83,84,86,90,94,96,97,110,112,115,116,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,153,155,166,167,174,176,177,178,179,180,191,197,198,218,221,222,224,228,235,239,262,267,269,270,300,302,303,310,311,314,315,323,324,325,326,329,334,338,339,360,362,364,366,367,368,388,389,391,392,399,401,428,429,430,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,65,-68,-263,-71,72,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,65,-102,-101,-28,-122,-124,-27,72,72,164,-50,-53,72,-115,-263,-263,72,72,-248,-125,-123,-252,-243,-255,-259,-256,-253,-241,-242,226,-251,-228,-257,-249,-240,-254,-250,164,264,72,72,-87,-262,-23,-84,-24,-83,-103,-121,-120,-260,-258,-237,-236,-150,-152,72,-140,264,-154,-148,-248,-89,-88,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,72,72,-143,264,-141,-149,-151,-153,-118,-117,-229,-230,264,-142,-245,264,-238,-239,]),'WCHAR_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,124,124,-47,124,-28,-263,-125,-227,124,-225,124,-224,124,-223,124,124,-222,-226,-263,-223,124,124,124,-262,124,124,-223,124,124,-184,-187,-185,-181,-182,-186,-188,124,-190,-191,-183,-189,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,-12,124,124,-11,-223,-41,-44,-40,124,-42,124,124,-156,-155,-45,-157,124,-43,124,124,124,-263,-139,-175,-174,124,-172,124,124,-158,124,-171,-159,124,124,124,124,-263,124,124,-11,-170,-173,124,-162,124,-160,124,124,-161,124,124,124,-263,124,-166,-165,-163,124,124,124,-167,-164,124,-169,-168,]),'FLOAT_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,125,125,-47,125,-28,-263,-125,-227,125,-225,125,-224,125,-223,125,125,-222,-226,-263,-223,125,125,125,-262,125,125,-223,125,125,-184,-187,-185,-181,-182,-186,-188,125,-190,-191,-183,-189,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,-12,125,125,-11,-223,-41,-44,-40,125,-42,125,125,-156,-155,-45,-157,125,-43,125,125,125,-263,-139,-175,-174,125,-172,125,125,-158,125,-171,-159,125,125,125,125,-263,125,125,-11,-170,-173,125,-162,125,-160,125,125,-161,125,125,125,-263,125,-166,-165,-163,125,125,125,-167,-164,125,-169,-168,]),'MINUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,128,128,-47,128,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,128,-225,-242,-216,-195,128,-224,128,-251,-223,-228,128,128,-257,-222,-249,-240,244,-254,-250,-226,-263,-223,128,128,128,-262,128,128,-223,128,128,-184,-187,-185,-181,-182,-186,-188,128,-190,-191,-183,-189,-260,128,-220,-258,-237,-236,128,128,128,-214,-219,128,-217,-218,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,-12,128,128,-11,-223,-41,-44,-40,128,-42,128,128,-156,-155,-45,-157,128,-43,-248,128,-235,-234,-233,-232,-231,-244,128,128,244,244,244,-200,244,244,244,-199,244,244,-197,-196,244,244,244,244,244,-198,-263,-139,-175,-174,128,-172,128,128,-158,128,-171,-159,128,128,-221,-229,-230,128,128,-215,-263,128,128,-11,-170,-173,128,-162,128,-160,128,128,-161,128,128,128,-245,-263,-238,128,-166,-165,-163,-239,128,128,128,-167,-164,128,-169,-168,]),'RPAREN':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,53,54,56,58,59,60,62,63,66,67,68,69,70,74,78,81,83,84,90,94,96,106,107,108,109,110,111,112,113,114,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,158,159,160,161,165,166,167,174,176,177,178,179,180,191,197,198,199,200,201,202,218,220,221,222,224,227,228,231,232,234,235,236,237,238,239,240,269,270,275,285,302,303,310,311,314,315,318,319,320,321,322,323,324,325,326,328,329,330,332,333,334,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,366,367,368,378,388,389,390,391,392,397,398,410,412,415,416,417,419,428,430,432,435,437,438,439,442,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-263,-71,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,90,-86,-85,-51,-113,-112,-102,-101,-263,-28,-122,-124,-27,-145,-263,-147,-50,-53,-115,-263,-263,197,-15,198,-128,-263,-16,-248,-126,-132,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-21,-22,269,270,-263,-145,-263,-87,-262,-23,-84,-24,-83,-103,-121,-120,-131,-1,-2,-130,-260,-220,-258,-237,-236,329,-150,-214,-219,-217,-152,334,336,-176,-263,-218,-154,-148,368,-14,-89,-88,-105,-104,-116,-119,-133,-127,-129,-180,390,-235,-234,-233,-232,-246,-231,392,395,396,-244,-144,-263,-145,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-149,-151,-153,-13,-118,-117,-221,-229,-230,-177,-215,423,425,427,-247,428,-194,-245,-238,-263,440,-239,-263,443,446,]),'LONG':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[19,19,-63,-74,-73,-60,-56,-57,-35,-31,-61,19,-36,-55,-70,-65,-54,19,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,19,-69,19,-72,-76,19,-59,-86,-261,-85,19,-113,-112,-32,-102,-101,19,19,19,-47,-48,19,-115,19,19,19,19,-92,19,19,19,19,-38,19,-49,19,19,-87,-93,-262,-103,-121,-120,19,19,19,19,19,-39,-41,-44,-40,-42,19,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,19,-175,-174,19,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PLUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,135,135,-47,135,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,135,-225,-242,-216,-195,135,-224,135,-251,-223,-228,135,135,-257,-222,-249,-240,248,-254,-250,-226,-263,-223,135,135,135,-262,135,135,-223,135,135,-184,-187,-185,-181,-182,-186,-188,135,-190,-191,-183,-189,-260,135,-220,-258,-237,-236,135,135,135,-214,-219,135,-217,-218,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,-12,135,135,-11,-223,-41,-44,-40,135,-42,135,135,-156,-155,-45,-157,135,-43,-248,135,-235,-234,-233,-232,-231,-244,135,135,248,248,248,-200,248,248,248,-199,248,248,-197,-196,248,248,248,248,248,-198,-263,-139,-175,-174,135,-172,135,135,-158,135,-171,-159,135,135,-221,-229,-230,135,135,-215,-263,135,135,-11,-170,-173,135,-162,135,-160,135,135,-161,135,135,135,-245,-263,-238,135,-166,-165,-163,-239,135,135,135,-167,-164,135,-169,-168,]),'ELLIPSIS':([204,],[319,]),'GT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,249,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,249,-202,-200,-204,249,-203,-199,-206,249,-197,-196,-205,249,249,249,249,-198,-221,-229,-230,-215,-245,-238,-239,]),'GOTO':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,278,-262,-41,-44,-40,-42,278,-156,-155,-45,-157,278,-43,-175,-174,-172,278,-158,-171,-159,278,-170,-173,-162,278,-160,278,-161,278,278,-166,-165,-163,278,278,-167,-164,278,-169,-168,]),'ENUM':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[24,24,-63,-74,-73,-60,-56,-57,-35,-31,-61,24,-36,-55,-70,-65,-54,24,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,24,-69,24,-72,-76,24,-59,-86,-261,-85,24,-113,-112,-32,-102,-101,24,24,24,-47,-48,24,-115,24,24,24,24,-92,24,24,24,24,-38,24,-49,24,24,-87,-93,-262,-103,-121,-120,24,24,24,24,24,-39,-41,-44,-40,-42,24,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,24,-175,-174,24,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PERIOD':([55,112,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,155,176,218,221,222,224,262,267,300,323,324,325,326,329,334,360,362,364,391,392,399,401,428,429,430,437,],[-261,-248,-252,-243,-255,-259,-256,-253,-241,-242,225,-251,-228,-257,-249,-240,-254,-250,263,-262,-260,-258,-237,-236,-140,263,-248,-235,-234,-233,-232,-231,-244,-143,263,-141,-229,-230,263,-142,-245,263,-238,-239,]),'GE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,253,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,253,-202,-200,-204,253,-203,-199,-206,253,-197,-196,-205,253,253,253,253,-198,-221,-229,-230,-215,-245,-238,-239,]),'INT_CONST_DEC':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,145,145,-47,145,-28,-263,-125,-227,145,-225,145,-224,145,-223,145,145,-222,-226,-263,-223,145,145,145,-262,145,145,-223,145,145,-184,-187,-185,-181,-182,-186,-188,145,-190,-191,-183,-189,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,-12,145,145,-11,-223,-41,-44,-40,145,-42,145,145,-156,-155,-45,-157,145,-43,145,145,145,-263,-139,-175,-174,145,-172,145,145,-158,145,-171,-159,145,145,145,145,-263,145,145,-11,-170,-173,145,-162,145,-160,145,145,-161,145,145,145,-263,145,-166,-165,-163,145,145,145,-167,-164,145,-169,-168,]),'ARROW':([112,118,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,221,222,224,300,323,324,325,326,329,334,391,392,428,430,437,],[-248,-252,-243,-255,-259,-256,-253,-241,-242,223,-251,-228,-257,-249,-240,-254,-250,-262,-260,-258,-237,-236,-248,-235,-234,-233,-232,-231,-244,-229,-230,-245,-238,-239,]),'HEX_FLOAT_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,148,148,-47,148,-28,-263,-125,-227,148,-225,148,-224,148,-223,148,148,-222,-226,-263,-223,148,148,148,-262,148,148,-223,148,148,-184,-187,-185,-181,-182,-186,-188,148,-190,-191,-183,-189,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,-12,148,148,-11,-223,-41,-44,-40,148,-42,148,148,-156,-155,-45,-157,148,-43,148,148,148,-263,-139,-175,-174,148,-172,148,148,-158,148,-171,-159,148,148,148,148,-263,148,148,-11,-170,-173,148,-162,148,-160,148,148,-161,148,148,148,-263,148,-166,-165,-163,148,148,148,-167,-164,148,-169,-168,]),'DOUBLE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[40,40,-63,-74,-73,-60,-56,-57,-35,-31,-61,40,-36,-55,-70,-65,-54,40,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,40,-69,40,-72,-76,40,-59,-86,-261,-85,40,-113,-112,-32,-102,-101,40,40,40,-47,-48,40,-115,40,40,40,40,-92,40,40,40,40,-38,40,-49,40,40,-87,-93,-262,-103,-121,-120,40,40,40,40,40,-39,-41,-44,-40,-42,40,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,40,-175,-174,40,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'MINUSEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,207,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'INT_CONST_OCT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,149,149,-47,149,-28,-263,-125,-227,149,-225,149,-224,149,-223,149,149,-222,-226,-263,-223,149,149,149,-262,149,149,-223,149,149,-184,-187,-185,-181,-182,-186,-188,149,-190,-191,-183,-189,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,-12,149,149,-11,-223,-41,-44,-40,149,-42,149,149,-156,-155,-45,-157,149,-43,149,149,149,-263,-139,-175,-174,149,-172,149,149,-158,149,-171,-159,149,149,149,149,-263,149,149,-11,-170,-173,149,-162,149,-160,149,149,-161,149,149,149,-263,149,-166,-165,-163,149,149,149,-167,-164,149,-169,-168,]),'TIMESEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,216,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'OR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,258,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,258,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,258,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'SHORT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[2,2,-63,-74,-73,-60,-56,-57,-35,-31,-61,2,-36,-55,-70,-65,-54,2,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,2,-69,2,-72,-76,2,-59,-86,-261,-85,2,-113,-112,-32,-102,-101,2,2,2,-47,-48,2,-115,2,2,2,2,-92,2,2,2,2,-38,2,-49,2,2,-87,-93,-262,-103,-121,-120,2,2,2,2,2,-39,-41,-44,-40,-42,2,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,2,-175,-174,2,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'RETURN':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,281,-262,-41,-44,-40,-42,281,-156,-155,-45,-157,281,-43,-175,-174,-172,281,-158,-171,-159,281,-170,-173,-162,281,-160,281,-161,281,281,-166,-165,-163,281,281,-167,-164,281,-169,-168,]),'RSHIFTEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,217,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'RESTRICT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[32,32,-63,-74,-73,-60,-56,-57,-35,-31,-61,32,-36,-55,-70,-65,-54,32,-58,-178,-111,-68,32,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,32,-69,32,-72,-76,32,-59,-86,-261,-85,32,-113,-112,-32,-102,-101,32,32,32,-124,32,32,-47,-48,32,-115,32,32,32,32,-92,32,32,32,-125,32,32,32,-38,32,-49,32,32,-87,-93,-262,-103,-121,-120,32,32,32,32,32,-39,-41,-44,-40,-42,32,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,32,-175,-174,32,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'STATIC':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,65,66,69,78,80,82,87,89,90,104,115,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[9,9,-63,-74,-73,-60,-56,-57,-35,-31,-61,9,-36,-55,-70,-65,-54,9,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,9,-69,9,-72,-76,9,-59,-86,-261,-85,-113,-112,-32,-102,-101,105,9,-124,9,9,-47,-48,9,-115,195,-125,9,9,-38,9,-49,-87,-262,-103,-121,-120,9,-39,-41,-44,-40,-42,9,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,9,-175,-174,9,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'SIZEOF':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,127,127,-47,127,-28,-263,-125,-227,127,-225,127,-224,127,-223,127,127,-222,-226,-263,-223,127,127,127,-262,127,127,-223,127,127,-184,-187,-185,-181,-182,-186,-188,127,-190,-191,-183,-189,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,-12,127,127,-11,-223,-41,-44,-40,127,-42,127,127,-156,-155,-45,-157,127,-43,127,127,127,-263,-139,-175,-174,127,-172,127,127,-158,127,-171,-159,127,127,127,127,-263,127,127,-11,-170,-173,127,-162,127,-160,127,127,-161,127,127,127,-263,127,-166,-165,-163,127,127,127,-167,-164,127,-169,-168,]),'UNSIGNED':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[18,18,-63,-74,-73,-60,-56,-57,-35,-31,-61,18,-36,-55,-70,-65,-54,18,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,18,-69,18,-72,-76,18,-59,-86,-261,-85,18,-113,-112,-32,-102,-101,18,18,18,-47,-48,18,-115,18,18,18,18,-92,18,18,18,18,-38,18,-49,18,18,-87,-93,-262,-103,-121,-120,18,18,18,18,18,-39,-41,-44,-40,-42,18,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,18,-175,-174,18,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'UNION':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[20,20,-63,-74,-73,-60,-56,-57,-35,-31,-61,20,-36,-55,-70,-65,-54,20,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,20,-69,20,-72,-76,20,-59,-86,-261,-85,20,-113,-112,-32,-102,-101,20,20,20,-47,-48,20,-115,20,20,20,20,-92,20,20,20,20,-38,20,-49,20,20,-87,-93,-262,-103,-121,-120,20,20,20,20,20,-39,-41,-44,-40,-42,20,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,20,-175,-174,20,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'COLON':([2,3,5,6,13,18,19,25,26,27,29,32,33,35,37,39,40,43,45,46,54,56,59,60,62,63,90,94,96,97,112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,174,176,177,178,179,180,187,191,197,198,218,220,221,222,224,231,232,234,238,240,286,300,302,303,305,306,310,311,314,315,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,377,388,389,390,391,392,397,398,419,428,430,437,],[-63,-74,-73,-60,-61,-70,-65,-178,-111,-68,-71,-75,-114,-66,-62,-64,-67,-69,-72,-76,-86,-85,-113,-112,-102,-101,-115,-263,-263,181,-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-87,-262,-23,-84,-24,-83,309,-103,-121,-120,-260,-220,-258,-237,-236,-214,-219,-217,-176,-218,375,384,-89,-88,-192,181,-105,-104,-116,-119,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,400,-210,-198,411,-118,-117,-221,-229,-230,-177,-215,-194,-245,-238,-239,]),'$end':([0,8,11,12,15,22,31,36,38,47,61,82,169,176,272,383,],[-263,0,-35,-31,-36,-29,-34,-33,-37,-30,-32,-47,-38,-262,-39,-159,]),'WSTRING_LITERAL':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,121,123,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,123,123,-47,123,-28,-263,-125,-227,218,-259,123,-225,123,-224,123,-223,123,123,-222,-226,-263,-223,123,123,123,-262,123,123,-223,123,123,-184,-187,-185,-181,-182,-186,-188,123,-190,-191,-183,-189,-260,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,-12,123,123,-11,-223,-41,-44,-40,123,-42,123,123,-156,-155,-45,-157,123,-43,123,123,123,-263,-139,-175,-174,123,-172,123,123,-158,123,-171,-159,123,123,123,123,-263,123,123,-11,-170,-173,123,-162,123,-160,123,123,-161,123,123,123,-263,123,-166,-165,-163,123,123,123,-167,-164,123,-169,-168,]),'DIVIDE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,251,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,251,251,251,251,251,251,251,251,251,251,-197,-196,251,251,251,251,251,-198,-221,-229,-230,-215,-245,-238,-239,]),'FOR':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,283,-262,-41,-44,-40,-42,283,-156,-155,-45,-157,283,-43,-175,-174,-172,283,-158,-171,-159,283,-170,-173,-162,283,-160,283,-161,283,283,-166,-165,-163,283,283,-167,-164,283,-169,-168,]),'PLUSPLUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,121,122,123,124,125,126,127,128,129,130,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,391,392,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,137,137,-47,137,-28,-263,-248,-125,-252,-227,-243,-255,-259,-256,-253,-241,137,-225,-242,224,137,-224,137,-251,-223,-228,137,137,-257,-222,-249,-240,-254,-250,-226,-263,-223,137,137,137,-262,137,137,-223,137,137,-184,-187,-185,-181,-182,-186,-188,137,-190,-191,-183,-189,-260,137,-258,-237,-236,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,-12,137,137,-11,-223,-41,-44,-40,137,-42,137,137,-156,-155,-45,-157,137,-43,-248,137,-235,-234,-233,-232,-231,-244,137,137,-263,-139,-175,-174,137,-172,137,137,-158,137,-171,-159,137,137,-229,-230,137,137,-263,137,137,-11,-170,-173,137,-162,137,-160,137,137,-161,137,137,137,-245,-263,-238,137,-166,-165,-163,-239,137,137,137,-167,-164,137,-169,-168,]),'EQUALS':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,29,30,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,56,58,59,60,62,63,80,83,84,86,90,102,112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,168,174,176,191,197,198,218,220,221,222,224,231,232,234,240,262,267,300,302,303,310,311,314,315,323,324,325,326,329,334,360,364,388,389,390,391,392,398,401,428,430,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-71,77,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-85,-51,-113,-112,-102,-101,162,-50,-53,77,-115,192,-248,-252,209,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,162,-87,-262,-103,-121,-120,-260,-220,-258,-237,-236,-214,-219,-217,-218,-140,365,-248,-89,-88,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,-143,-141,-118,-117,-221,-229,-230,-215,-142,-245,-238,-239,]),'ELSE':([176,276,277,280,282,293,298,370,371,374,381,383,405,406,409,414,424,433,434,436,444,445,447,448,],[-262,-41,-44,-40,-42,-45,-43,-175,-174,-172,-171,-159,-170,-173,-162,-160,-161,-166,-165,441,-167,-164,-169,-168,]),'ANDEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,214,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'EQ':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,255,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,255,-202,-200,-204,-208,-203,-199,-206,255,-197,-196,-205,255,-207,255,255,-198,-221,-229,-230,-215,-245,-238,-239,]),'AND':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,144,144,-47,144,-28,-263,-248,-125,-252,-227,-214,-243,-255,-259,-256,-253,-241,144,-225,-242,-216,-195,144,-224,144,-251,-223,-228,144,144,-257,-222,-249,-240,256,-254,-250,-226,-263,-223,144,144,144,-262,144,144,-223,144,144,-184,-187,-185,-181,-182,-186,-188,144,-190,-191,-183,-189,-260,144,-220,-258,-237,-236,144,144,144,-214,-219,144,-217,-218,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,-12,144,144,-11,-223,-41,-44,-40,144,-42,144,144,-156,-155,-45,-157,144,-43,-248,144,-235,-234,-233,-232,-231,-244,144,144,-201,256,-202,-200,-204,-208,-203,-199,-206,256,-197,-196,-205,256,-207,-209,256,-198,-263,-139,-175,-174,144,-172,144,144,-158,144,-171,-159,144,144,-221,-229,-230,144,144,-215,-263,144,144,-11,-170,-173,144,-162,144,-160,144,144,-161,144,144,144,-245,-263,-238,144,-166,-165,-163,-239,144,144,144,-167,-164,144,-169,-168,]),'TYPEID':([0,1,2,3,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,67,68,69,70,74,78,80,82,87,89,90,91,92,93,94,95,96,115,116,141,165,166,167,169,170,171,172,173,174,175,176,191,197,198,204,219,223,225,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[25,25,-63,-74,-73,-60,54,-56,-57,-35,-31,-61,25,-36,59,-55,-70,-65,-91,-54,25,-58,62,-178,-111,-68,-263,-71,-34,-75,-114,-90,-66,-33,-62,-37,-64,-67,25,-69,25,-72,-76,25,-59,-86,-261,-85,25,-113,-112,-32,-102,-101,25,-28,-122,-124,-27,59,25,25,-47,-48,25,-115,25,25,25,25,-92,25,-125,-123,25,25,59,25,-38,25,-49,25,25,-87,-93,-262,-103,-121,-120,25,25,323,325,25,25,25,-39,-41,-44,-40,-42,25,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,25,-175,-174,25,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LBRACE':([7,20,24,26,33,34,48,54,55,56,59,60,62,63,77,80,82,85,87,88,89,90,155,162,163,170,171,176,197,198,260,266,268,276,277,280,282,289,291,292,293,295,297,298,314,315,336,362,365,370,371,374,375,379,381,383,384,388,389,390,395,396,399,402,403,405,406,409,411,414,423,424,425,427,429,433,434,436,441,443,444,445,446,447,448,],[55,-91,55,-111,-114,-90,-263,55,-261,55,-113,-112,55,55,55,-263,-47,-7,-48,55,-8,-115,-263,55,55,55,-49,-262,-121,-120,-12,55,-11,-41,-44,-40,-42,55,-156,-155,-45,-157,55,-43,-116,-119,55,-263,-139,-175,-174,-172,55,-158,-171,-159,55,-118,-117,55,55,55,-263,55,-11,-170,-173,-162,55,-160,55,-161,55,55,-263,-166,-165,-163,55,55,-167,-164,55,-169,-168,]),'PPHASH':([0,11,12,15,22,31,36,38,61,82,169,176,272,383,],[38,-35,-31,-36,38,-34,-33,-37,-32,-47,-38,-262,-39,-159,]),'INT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[39,39,-63,-74,-73,-60,-56,-57,-35,-31,-61,39,-36,-55,-70,-65,-54,39,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,39,-69,39,-72,-76,39,-59,-86,-261,-85,39,-113,-112,-32,-102,-101,39,39,39,-47,-48,39,-115,39,39,39,39,-92,39,39,39,39,-38,39,-49,39,39,-87,-93,-262,-103,-121,-120,39,39,39,39,39,-39,-41,-44,-40,-42,39,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,39,-175,-174,39,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'SIGNED':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[43,43,-63,-74,-73,-60,-56,-57,-35,-31,-61,43,-36,-55,-70,-65,-54,43,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,43,-69,43,-72,-76,43,-59,-86,-261,-85,43,-113,-112,-32,-102,-101,43,43,43,-47,-48,43,-115,43,43,43,43,-92,43,43,43,43,-38,43,-49,43,43,-87,-93,-262,-103,-121,-120,43,43,43,43,43,-39,-41,-44,-40,-42,43,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,43,-175,-174,43,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CONTINUE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,284,-262,-41,-44,-40,-42,284,-156,-155,-45,-157,284,-43,-175,-174,-172,284,-158,-171,-159,284,-170,-173,-162,284,-160,284,-161,284,284,-166,-165,-163,284,284,-167,-164,284,-169,-168,]),'NOT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,152,152,-47,152,-28,-263,-125,-227,152,-225,152,-224,152,-223,152,152,-222,-226,-263,-223,152,152,152,-262,152,152,-223,152,152,-184,-187,-185,-181,-182,-186,-188,152,-190,-191,-183,-189,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,-12,152,152,-11,-223,-41,-44,-40,152,-42,152,152,-156,-155,-45,-157,152,-43,152,152,152,-263,-139,-175,-174,152,-172,152,152,-158,152,-171,-159,152,152,152,152,-263,152,152,-11,-170,-173,152,-162,152,-160,152,152,-161,152,152,152,-263,152,-166,-165,-163,152,152,152,-167,-164,152,-169,-168,]),'OREQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,215,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'MOD':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,259,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,259,259,259,259,259,259,259,259,259,259,-197,-196,259,259,259,259,259,-198,-221,-229,-230,-215,-245,-238,-239,]),'RSHIFT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,241,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,241,-202,-200,241,241,241,-199,241,241,-197,-196,241,241,241,241,241,-198,-221,-229,-230,-215,-245,-238,-239,]),'DEFAULT':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,286,-262,-41,-44,-40,-42,286,-156,-155,-45,-157,286,-43,-175,-174,-172,286,-158,-171,-159,286,-170,-173,-162,286,-160,286,-161,286,286,-166,-165,-163,286,286,-167,-164,286,-169,-168,]),'CHAR':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[37,37,-63,-74,-73,-60,-56,-57,-35,-31,-61,37,-36,-55,-70,-65,-54,37,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,37,-69,37,-72,-76,37,-59,-86,-261,-85,37,-113,-112,-32,-102,-101,37,37,37,-47,-48,37,-115,37,37,37,37,-92,37,37,37,37,-38,37,-49,37,37,-87,-93,-262,-103,-121,-120,37,37,37,37,37,-39,-41,-44,-40,-42,37,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,37,-175,-174,37,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'WHILE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,382,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,287,-262,-41,-44,-40,-42,287,-156,-155,-45,-157,287,-43,-175,-174,-172,287,-158,-171,413,-159,287,-170,-173,-162,287,-160,287,-161,287,287,-166,-165,-163,287,287,-167,-164,287,-169,-168,]),'DIVEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,206,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'EXTERN':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[10,10,-63,-74,-73,-60,-56,-57,-35,-31,-61,10,-36,-55,-70,-65,-54,10,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,10,-69,10,-72,-76,10,-59,-86,-261,-85,-113,-112,-32,-102,-101,10,10,10,-47,-48,10,-115,10,10,-38,10,-49,-87,-262,-103,-121,-120,10,-39,-41,-44,-40,-42,10,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,10,-175,-174,10,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CASE':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,288,-262,-41,-44,-40,-42,288,-156,-155,-45,-157,288,-43,-175,-174,-172,288,-158,-171,-159,288,-170,-173,-162,288,-160,288,-161,288,288,-166,-165,-163,288,288,-167,-164,288,-169,-168,]),'LAND':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,254,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,254,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'REGISTER':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[17,17,-63,-74,-73,-60,-56,-57,-35,-31,-61,17,-36,-55,-70,-65,-54,17,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,17,-69,17,-72,-76,17,-59,-86,-261,-85,-113,-112,-32,-102,-101,17,17,17,-47,-48,17,-115,17,17,-38,17,-49,-87,-262,-103,-121,-120,17,-39,-41,-44,-40,-42,17,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,17,-175,-174,17,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'MODEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,208,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'NE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,246,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,246,-202,-200,-204,-208,-203,-199,-206,246,-197,-196,-205,246,-207,246,246,-198,-221,-229,-230,-215,-245,-238,-239,]),'SWITCH':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,290,-262,-41,-44,-40,-42,290,-156,-155,-45,-157,290,-43,-175,-174,-172,290,-158,-171,-159,290,-170,-173,-162,290,-160,290,-161,290,290,-166,-165,-163,290,290,-167,-164,290,-169,-168,]),'INT_CONST_HEX':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,138,138,-47,138,-28,-263,-125,-227,138,-225,138,-224,138,-223,138,138,-222,-226,-263,-223,138,138,138,-262,138,138,-223,138,138,-184,-187,-185,-181,-182,-186,-188,138,-190,-191,-183,-189,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,-12,138,138,-11,-223,-41,-44,-40,138,-42,138,138,-156,-155,-45,-157,138,-43,138,138,138,-263,-139,-175,-174,138,-172,138,138,-158,138,-171,-159,138,138,138,138,-263,138,138,-11,-170,-173,138,-162,138,-160,138,138,-161,138,138,138,-263,138,-166,-165,-163,138,138,138,-167,-164,138,-169,-168,]),'_COMPLEX':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[27,27,-63,-74,-73,-60,-56,-57,-35,-31,-61,27,-36,-55,-70,-65,-54,27,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,27,-69,27,-72,-76,27,-59,-86,-261,-85,27,-113,-112,-32,-102,-101,27,27,27,-47,-48,27,-115,27,27,27,27,-92,27,27,27,27,-38,27,-49,27,27,-87,-93,-262,-103,-121,-120,27,27,27,27,27,-39,-41,-44,-40,-42,27,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,27,-175,-174,27,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'PLUSEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,211,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'STRUCT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[34,34,-63,-74,-73,-60,-56,-57,-35,-31,-61,34,-36,-55,-70,-65,-54,34,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,34,-69,34,-72,-76,34,-59,-86,-261,-85,34,-113,-112,-32,-102,-101,34,34,34,-47,-48,34,-115,34,34,34,34,-92,34,34,34,34,-38,34,-49,34,34,-87,-93,-262,-103,-121,-120,34,34,34,34,34,-39,-41,-44,-40,-42,34,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,34,-175,-174,34,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'CONDOP':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,257,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'BREAK':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,294,-262,-41,-44,-40,-42,294,-156,-155,-45,-157,294,-43,-175,-174,-172,294,-158,-171,-159,294,-170,-173,-162,294,-160,294,-161,294,294,-166,-165,-163,294,294,-167,-164,294,-169,-168,]),'VOLATILE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[46,46,-63,-74,-73,-60,-56,-57,-35,-31,-61,46,-36,-55,-70,-65,-54,46,-58,-178,-111,-68,46,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,46,-69,46,-72,-76,46,-59,-86,-261,-85,46,-113,-112,-32,-102,-101,46,46,46,-124,46,46,-47,-48,46,-115,46,46,46,46,-92,46,46,46,-125,46,46,46,-38,46,-49,46,46,-87,-93,-262,-103,-121,-120,46,46,46,46,46,-39,-41,-44,-40,-42,46,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,46,-175,-174,46,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'INLINE':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[49,49,-63,-74,-73,-60,-56,-57,-35,-31,-61,49,-36,-55,-70,-65,-54,49,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,49,-69,49,-72,-76,49,-59,-86,-261,-85,-113,-112,-32,-102,-101,49,49,49,-47,-48,49,-115,49,49,-38,49,-49,-87,-262,-103,-121,-120,49,-39,-41,-44,-40,-42,49,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,49,-175,-174,49,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'INT_CONST_BIN':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,118,118,-47,118,-28,-263,-125,-227,118,-225,118,-224,118,-223,118,118,-222,-226,-263,-223,118,118,118,-262,118,118,-223,118,118,-184,-187,-185,-181,-182,-186,-188,118,-190,-191,-183,-189,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,-12,118,118,-11,-223,-41,-44,-40,118,-42,118,118,-156,-155,-45,-157,118,-43,118,118,118,-263,-139,-175,-174,118,-172,118,118,-158,118,-171,-159,118,118,118,118,-263,118,118,-11,-170,-173,118,-162,118,-160,118,118,-161,118,118,118,-263,118,-166,-165,-163,118,118,118,-167,-164,118,-169,-168,]),'DO':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,297,-262,-41,-44,-40,-42,297,-156,-155,-45,-157,297,-43,-175,-174,-172,297,-158,-171,-159,297,-170,-173,-162,297,-160,297,-161,297,297,-166,-165,-163,297,297,-167,-164,297,-169,-168,]),'LNOT':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,119,119,-47,119,-28,-263,-125,-227,119,-225,119,-224,119,-223,119,119,-222,-226,-263,-223,119,119,119,-262,119,119,-223,119,119,-184,-187,-185,-181,-182,-186,-188,119,-190,-191,-183,-189,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,-12,119,119,-11,-223,-41,-44,-40,119,-42,119,119,-156,-155,-45,-157,119,-43,119,119,119,-263,-139,-175,-174,119,-172,119,119,-158,119,-171,-159,119,119,119,119,-263,119,119,-11,-170,-173,119,-162,119,-160,119,119,-161,119,119,119,-263,119,-166,-165,-163,119,119,119,-167,-164,119,-169,-168,]),'CONST':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,65,66,67,69,78,80,82,87,89,90,91,92,93,94,95,96,104,105,115,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[3,3,-63,-74,-73,-60,-56,-57,-35,-31,-61,3,-36,-55,-70,-65,-54,3,-58,-178,-111,-68,3,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,3,-69,3,-72,-76,3,-59,-86,-261,-85,3,-113,-112,-32,-102,-101,3,3,3,-124,3,3,-47,-48,3,-115,3,3,3,3,-92,3,3,3,-125,3,3,3,-38,3,-49,3,3,-87,-93,-262,-103,-121,-120,3,3,3,3,3,-39,-41,-44,-40,-42,3,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,3,-175,-174,3,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LOR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,242,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-221,-229,-230,-215,-245,-238,-239,]),'CHAR_CONST':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,122,122,-47,122,-28,-263,-125,-227,122,-225,122,-224,122,-223,122,122,-222,-226,-263,-223,122,122,122,-262,122,122,-223,122,122,-184,-187,-185,-181,-182,-186,-188,122,-190,-191,-183,-189,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,-12,122,122,-11,-223,-41,-44,-40,122,-42,122,122,-156,-155,-45,-157,122,-43,122,122,122,-263,-139,-175,-174,122,-172,122,122,-158,122,-171,-159,122,122,122,122,-263,122,122,-11,-170,-173,122,-162,122,-160,122,122,-161,122,122,122,-263,122,-166,-165,-163,122,122,122,-167,-164,122,-169,-168,]),'LSHIFT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,243,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,243,-202,-200,243,243,243,-199,243,243,-197,-196,243,243,243,243,243,-198,-221,-229,-230,-215,-245,-238,-239,]),'RBRACE':([55,82,93,95,100,101,102,112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,155,156,170,172,173,175,176,188,189,190,218,220,221,222,224,231,232,234,240,261,265,268,276,277,280,282,289,291,292,293,295,296,298,299,305,307,308,312,313,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,359,362,363,370,371,374,379,381,383,390,391,392,398,404,405,406,409,414,418,419,420,424,428,429,430,433,434,436,437,444,445,447,448,],[-261,-47,176,-92,-106,176,-109,-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-263,-134,-263,176,176,-93,-262,176,176,-107,-260,-220,-258,-237,-236,-214,-219,-217,-218,176,-20,-19,-41,-44,-40,-42,-6,-156,-155,-45,-157,-5,-43,176,-192,-94,-95,-108,-110,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-135,176,-137,-175,-174,-172,-158,-171,-159,-221,-229,-230,-215,-136,-170,-173,-162,-160,176,-194,-138,-161,-245,176,-238,-166,-165,-163,-239,-167,-164,-169,-168,]),'_BOOL':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[13,13,-63,-74,-73,-60,-56,-57,-35,-31,-61,13,-36,-55,-70,-65,-54,13,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,13,-69,13,-72,-76,13,-59,-86,-261,-85,13,-113,-112,-32,-102,-101,13,13,13,-47,-48,13,-115,13,13,13,13,-92,13,13,13,13,-38,13,-49,13,13,-87,-93,-262,-103,-121,-120,13,13,13,13,13,-39,-41,-44,-40,-42,13,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,13,-175,-174,13,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'LE':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,245,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,245,-202,-200,-204,245,-203,-199,-206,245,-197,-196,-205,245,245,245,245,-198,-221,-229,-230,-215,-245,-238,-239,]),'SEMI':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,49,50,51,52,54,55,56,58,59,60,61,62,63,67,68,69,70,71,73,74,75,76,79,80,81,82,83,84,86,90,94,96,97,112,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,154,156,166,168,169,170,174,176,177,178,179,180,182,183,184,185,186,187,191,197,198,205,218,220,221,222,224,228,231,232,234,235,238,240,269,270,271,272,276,277,279,280,281,282,284,285,289,291,292,293,294,295,296,297,298,300,302,303,304,305,310,311,314,315,321,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,359,366,367,368,369,370,371,372,373,374,375,378,379,381,383,384,386,387,388,389,390,391,392,397,398,404,405,406,407,408,409,411,414,419,421,422,423,424,425,427,428,430,431,433,434,436,437,440,441,443,444,445,446,447,448,],[15,-263,-63,-74,-73,-60,-56,-57,-35,-31,-61,-263,-36,-55,-70,-65,-54,15,-58,-178,-111,-68,-263,-71,-263,-34,-75,-114,-66,-33,-62,-37,-64,-67,82,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-113,-112,-32,-102,-101,-28,-122,-124,-27,-18,-46,-145,-77,-17,-80,-81,-147,-47,-50,-53,-263,-115,-263,-263,-263,-248,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-79,-134,-145,-81,-38,-263,-87,-262,-23,-84,-24,-83,-26,307,-96,308,-25,-98,-103,-121,-120,-78,-260,-220,-258,-237,-236,-150,-214,-219,-217,-152,-176,-218,-154,-148,-82,-39,-41,-44,370,-40,371,-42,374,-14,-263,-156,-155,-45,381,-157,-13,-263,-43,-248,-89,-88,-100,-192,-105,-104,-116,-119,-180,-235,-234,-233,-232,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,-135,-149,-151,-153,405,-175,-174,406,-263,-172,-263,-13,-158,-171,-159,-263,-97,-99,-118,-117,-221,-229,-230,-177,-215,-136,-170,-173,421,-263,-162,-263,-160,-194,-263,432,-263,-161,-263,-263,-245,-238,438,-166,-165,-163,-239,444,-263,-263,-167,-164,-263,-169,-168,]),'LT':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,247,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,247,-202,-200,-204,247,-203,-199,-206,247,-197,-196,-205,247,247,247,247,-198,-221,-229,-230,-215,-245,-238,-239,]),'COMMA':([1,2,3,5,6,9,10,13,14,17,18,19,21,23,25,26,27,28,29,32,33,35,37,39,40,42,43,44,45,46,49,50,51,52,54,56,58,59,60,62,63,67,68,69,70,71,74,75,79,80,81,83,84,90,94,96,100,101,102,109,110,111,112,113,114,115,116,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,151,153,154,156,166,168,174,176,177,178,179,180,182,184,187,188,189,190,191,197,198,199,200,201,202,205,218,220,221,222,224,228,231,232,234,235,236,238,239,240,265,269,270,271,285,300,302,303,304,305,310,311,312,313,314,315,318,320,321,323,324,325,326,327,328,329,330,331,334,337,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,363,366,367,368,372,386,387,388,389,390,391,392,397,398,404,410,412,415,416,418,419,420,428,430,435,437,],[-263,-63,-74,-73,-60,-56,-57,-61,-263,-55,-70,-65,-54,-58,-178,-111,-68,-263,-71,-75,-114,-66,-62,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-85,-51,-113,-112,-102,-101,-28,-122,-124,-27,117,-145,-77,-80,-81,-147,-50,-53,-115,-263,-263,-106,190,-109,-128,-263,203,-248,204,-132,-125,-123,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,-193,-254,-250,-179,-146,-79,-134,-145,-81,-87,-262,-23,-84,-24,-83,306,-96,-98,190,190,-107,-103,-121,-120,-131,-1,-2,-130,-78,-260,-220,-258,-237,-236,-150,-214,-219,-217,-152,335,-176,-263,-218,362,-154,-148,-82,335,-248,-89,-88,-100,-192,-105,-104,-108,-110,-116,-119,-133,-129,-180,-235,-234,-233,-232,335,-246,-231,393,394,-244,-144,-145,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,335,-210,-198,-135,-137,-149,-151,-153,335,-97,-99,-118,-117,-221,-229,-230,-177,-215,-136,335,335,335,-247,429,-194,-138,-245,-238,335,-239,]),'OFFSETOF':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,133,133,-47,133,-28,-263,-125,-227,133,-225,133,-224,133,-223,133,133,-222,-226,-263,-223,133,133,133,-262,133,133,-223,133,133,-184,-187,-185,-181,-182,-186,-188,133,-190,-191,-183,-189,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,-12,133,133,-11,-223,-41,-44,-40,133,-42,133,133,-156,-155,-45,-157,133,-43,133,133,133,-263,-139,-175,-174,133,-172,133,133,-158,133,-171,-159,133,133,133,133,-263,133,133,-11,-170,-173,133,-162,133,-160,133,133,-161,133,133,133,-263,133,-166,-165,-163,133,133,133,-167,-164,133,-169,-168,]),'TYPEDEF':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[23,23,-63,-74,-73,-60,-56,-57,-35,-31,-61,23,-36,-55,-70,-65,-54,23,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,23,-69,23,-72,-76,23,-59,-86,-261,-85,-113,-112,-32,-102,-101,23,23,23,-47,-48,23,-115,23,23,-38,23,-49,-87,-262,-103,-121,-120,23,-39,-41,-44,-40,-42,23,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,23,-175,-174,23,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'XOR':([112,118,120,121,122,123,124,125,126,129,130,132,138,140,143,145,146,147,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,390,391,392,398,428,430,437,],[-248,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,-195,-251,-228,-257,-249,-240,250,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-201,250,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,250,-207,-209,250,-198,-221,-229,-230,-215,-245,-238,-239,]),'AUTO':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,59,60,61,62,63,66,78,80,82,87,89,90,165,167,169,170,171,174,176,191,197,198,204,272,276,277,280,282,289,291,292,293,295,298,302,303,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[21,21,-63,-74,-73,-60,-56,-57,-35,-31,-61,21,-36,-55,-70,-65,-54,21,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,21,-69,21,-72,-76,21,-59,-86,-261,-85,-113,-112,-32,-102,-101,21,21,21,-47,-48,21,-115,21,21,-38,21,-49,-87,-262,-103,-121,-120,21,-39,-41,-44,-40,-42,21,-156,-155,-45,-157,-43,-89,-88,-105,-104,-116,-119,21,-175,-174,21,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'TIMES':([0,1,2,3,4,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,27,28,29,30,31,32,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,61,62,63,65,67,68,69,70,72,77,78,82,83,84,86,94,96,97,103,104,105,110,112,115,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,152,155,157,162,164,167,169,170,174,176,177,178,179,180,181,191,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,226,227,230,231,232,233,234,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,272,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,302,303,306,309,310,311,323,324,325,326,329,334,335,336,338,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,362,365,370,371,373,374,375,376,379,380,381,383,384,385,390,391,392,393,395,398,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[28,-263,-63,-74,28,-73,-60,-56,-57,-35,-31,-61,-263,-36,-55,-70,-65,-54,28,-58,-178,-68,-263,-71,28,-34,-75,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-32,-102,-101,-263,-28,28,-124,-27,139,157,28,-47,-50,-53,28,-263,-263,28,194,-28,-263,28,-248,-125,28,-252,-227,-214,-243,-255,-259,-256,-253,-241,157,-225,-242,-216,-195,157,-224,157,-251,-223,-228,157,157,-257,-222,-249,-240,252,-254,-250,-226,-263,-223,157,274,28,-38,157,-87,-262,-23,-84,-24,-83,157,-103,157,-223,157,157,-184,-187,-185,-181,-182,-186,-188,157,-190,-191,-183,-189,-260,157,-220,-258,-237,-236,157,157,157,-214,-219,157,-217,28,-218,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,-12,157,157,-11,-39,-223,-41,-44,-40,157,-42,157,157,-156,-155,-45,-157,157,-43,-248,-89,-88,28,157,-105,-104,-235,-234,-233,-232,-231,-244,157,157,28,252,252,252,252,252,252,252,252,252,252,-197,-196,252,252,252,252,252,-198,-263,-139,-175,-174,157,-172,157,157,-158,157,-171,-159,157,157,-221,-229,-230,157,157,-215,-263,157,157,-11,-170,-173,157,-162,157,-160,157,157,-161,157,157,157,-245,-263,-238,157,-166,-165,-163,-239,157,157,157,-167,-164,157,-169,-168,]),'LPAREN':([0,1,2,3,4,5,6,9,10,11,12,13,14,15,16,17,18,19,21,22,23,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,60,61,62,63,65,67,68,69,70,72,74,77,78,81,82,83,84,86,90,94,96,97,103,104,105,110,112,115,116,117,118,119,121,122,123,124,125,126,127,128,129,130,133,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,153,155,157,162,164,166,167,169,170,174,176,177,178,179,180,181,191,192,194,195,196,197,198,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,228,230,233,235,239,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,269,270,272,274,276,277,280,281,282,283,287,288,289,290,291,292,293,295,297,298,300,301,302,303,306,309,310,311,314,315,323,324,325,326,329,334,335,336,338,339,362,365,366,367,368,370,371,373,374,375,376,379,380,381,383,384,385,388,389,391,392,393,395,399,400,402,403,405,406,408,409,411,413,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[4,-263,-63,-74,4,-73,-60,-56,-57,-35,-31,-61,-263,-36,4,-55,-70,-65,-54,4,-58,-178,66,-68,-263,-71,78,-34,-75,-114,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,66,-32,-102,-101,-263,-28,-122,-124,-27,141,78,141,78,165,-47,-50,-53,167,-115,-263,-263,167,141,-28,-263,78,-248,-125,-123,4,-252,-227,-243,-255,-259,-256,-253,-241,219,-225,-242,227,229,230,-224,233,-251,-223,-228,141,233,-257,-222,-249,-240,-254,-250,-226,165,-263,-223,141,141,167,167,-38,141,-87,-262,-23,-84,-24,-83,230,-103,230,-223,141,141,-121,-120,-184,-187,-185,-181,-182,-186,-188,141,-190,-191,-183,-189,-260,141,-258,-237,-236,141,141,-150,141,141,-152,338,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,141,230,230,-12,230,141,-11,-154,-148,-39,-223,-41,-44,-40,141,-42,373,376,230,141,380,-156,-155,-45,-157,141,-43,-248,385,-89,-88,4,230,-105,-104,-116,-119,-235,-234,-233,-232,-231,-244,141,230,338,338,-263,-139,-149,-151,-153,-175,-174,141,-172,141,141,-158,141,-171,-159,141,141,-118,-117,-229,-230,141,230,-263,230,141,-11,-170,-173,141,-162,141,426,-160,141,141,-161,141,141,141,-245,-263,-238,141,-166,-165,-163,-239,141,141,141,-167,-164,141,-169,-168,]),'MINUSMINUS':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,112,115,118,119,121,122,123,124,125,126,127,128,129,130,134,135,137,138,139,140,141,142,143,144,145,146,148,149,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,224,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,300,309,323,324,325,326,329,334,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,391,392,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,428,429,430,432,433,434,436,437,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,142,142,-47,142,-28,-263,-248,-125,-252,-227,-243,-255,-259,-256,-253,-241,142,-225,-242,222,142,-224,142,-251,-223,-228,142,142,-257,-222,-249,-240,-254,-250,-226,-263,-223,142,142,142,-262,142,142,-223,142,142,-184,-187,-185,-181,-182,-186,-188,142,-190,-191,-183,-189,-260,142,-258,-237,-236,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,-12,142,142,-11,-223,-41,-44,-40,142,-42,142,142,-156,-155,-45,-157,142,-43,-248,142,-235,-234,-233,-232,-231,-244,142,142,-263,-139,-175,-174,142,-172,142,142,-158,142,-171,-159,142,142,-229,-230,142,142,-263,142,142,-11,-170,-173,142,-162,142,-160,142,142,-161,142,142,142,-245,-263,-238,142,-166,-165,-163,-239,142,142,142,-167,-164,142,-169,-168,]),'ID':([0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,34,35,36,37,38,39,40,42,43,44,45,46,49,50,51,52,54,55,56,58,61,62,63,64,65,66,67,68,69,70,72,74,77,78,82,83,84,86,94,96,97,98,99,103,104,105,110,115,116,117,119,127,128,134,135,137,139,141,142,144,152,155,157,162,164,166,167,169,170,174,176,177,178,179,180,181,190,191,192,194,195,196,203,206,207,208,209,210,211,212,213,214,215,216,217,219,223,225,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,263,264,266,268,272,274,276,277,278,280,281,282,288,289,291,292,293,295,297,298,302,303,306,309,310,311,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,394,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[33,-263,-63,-74,33,-73,-60,56,-56,-57,-35,-31,-61,-263,-36,33,-55,-70,-65,-91,-54,33,-58,63,-178,-68,-263,-71,33,-34,-75,-90,-66,-33,-62,-37,-64,-67,-263,-69,-263,-72,-76,-59,-52,-9,-10,-86,-261,-85,-51,-32,-102,-101,102,-263,112,-28,-122,-124,-27,112,33,112,33,-47,-50,-53,33,-263,-263,33,102,102,112,-28,-263,33,-125,-123,33,-227,112,-225,112,-224,112,-223,112,112,-222,-226,-263,-223,112,112,33,33,-38,300,-87,-262,-23,-84,-24,-83,112,102,-103,112,-223,112,112,112,-184,-187,-185,-181,-182,-186,-188,112,-190,-191,-183,-189,112,324,326,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,-12,112,112,112,-11,-39,-223,-41,-44,369,-40,112,-42,112,300,-156,-155,-45,-157,300,-43,-89,-88,33,112,-105,-104,112,112,-263,-139,-175,-174,112,-172,300,112,-158,112,-171,-159,300,112,112,112,112,-263,112,112,-11,-170,-173,112,-162,300,-160,112,300,-161,300,112,300,-263,112,-166,-165,-163,112,300,300,-167,-164,300,-169,-168,]),'IF':([55,82,170,176,276,277,280,282,289,291,292,293,295,297,298,370,371,374,375,379,381,383,384,405,406,409,411,414,423,424,425,427,433,434,436,441,443,444,445,446,447,448,],[-261,-47,301,-262,-41,-44,-40,-42,301,-156,-155,-45,-157,301,-43,-175,-174,-172,301,-158,-171,-159,301,-170,-173,-162,301,-160,301,-161,301,301,-166,-165,-163,301,301,-167,-164,301,-169,-168,]),'STRING_LITERAL':([3,32,46,55,65,67,69,70,72,77,82,103,104,105,115,119,127,128,129,134,135,137,139,141,142,143,144,152,155,157,162,164,170,176,181,192,194,195,196,206,207,208,209,210,211,212,213,214,215,216,217,219,221,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,264,266,268,274,276,277,280,281,282,288,289,291,292,293,295,297,298,309,335,336,362,365,370,371,373,374,375,376,379,380,381,383,384,385,393,395,399,400,402,403,405,406,408,409,411,414,421,423,424,425,426,427,429,432,433,434,436,438,441,443,444,445,446,447,448,],[-74,-75,-76,-261,-263,-28,-124,-27,143,143,-47,143,-28,-263,-125,-227,143,-225,221,143,-224,143,-223,143,143,-257,-222,-226,-263,-223,143,143,143,-262,143,143,-223,143,143,-184,-187,-185,-181,-182,-186,-188,143,-190,-191,-183,-189,143,-258,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,-12,143,143,-11,-223,-41,-44,-40,143,-42,143,143,-156,-155,-45,-157,143,-43,143,143,143,-263,-139,-175,-174,143,-172,143,143,-158,143,-171,-159,143,143,143,143,-263,143,143,-11,-170,-173,143,-162,143,-160,143,143,-161,143,143,143,-263,143,-166,-165,-163,143,143,143,-167,-164,143,-169,-168,]),'FLOAT':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54,55,56,57,59,60,61,62,63,66,78,80,82,87,89,90,91,92,93,94,95,96,141,165,167,169,170,171,172,173,174,175,176,191,197,198,204,219,229,230,233,272,276,277,280,282,289,291,292,293,295,298,302,303,307,308,310,311,314,315,338,370,371,373,374,379,381,383,388,389,405,406,409,414,424,433,434,436,444,445,447,448,],[35,35,-63,-74,-73,-60,-56,-57,-35,-31,-61,35,-36,-55,-70,-65,-54,35,-58,-178,-111,-68,-71,-34,-75,-114,-66,-33,-62,-37,-64,-67,35,-69,35,-72,-76,35,-59,-86,-261,-85,35,-113,-112,-32,-102,-101,35,35,35,-47,-48,35,-115,35,35,35,35,-92,35,35,35,35,-38,35,-49,35,35,-87,-93,-262,-103,-121,-120,35,35,35,35,35,-39,-41,-44,-40,-42,35,-156,-155,-45,-157,-43,-89,-88,-94,-95,-105,-104,-116,-119,35,-175,-174,35,-172,-158,-171,-159,-118,-117,-170,-173,-162,-160,-161,-166,-165,-163,-167,-164,-169,-168,]),'XOREQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,210,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'LSHIFTEQUAL':([112,118,120,121,122,123,124,125,126,129,130,138,140,143,145,146,148,149,176,218,220,221,222,224,231,232,234,240,300,323,324,325,326,329,334,390,391,392,398,428,430,437,],[-248,-252,212,-243,-255,-259,-256,-253,-241,-242,-216,-251,-228,-257,-249,-240,-254,-250,-262,-260,-220,-258,-237,-236,-214,-219,-217,-218,-248,-235,-234,-233,-232,-231,-244,-221,-229,-230,-215,-245,-238,-239,]),'RBRACKET':([3,32,46,65,69,70,72,103,104,112,115,118,120,121,122,123,124,125,126,129,130,131,132,136,138,139,140,143,145,146,147,148,149,150,151,164,176,193,194,218,220,221,222,224,231,232,234,238,240,273,274,305,316,317,321,323,324,325,326,327,329,334,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,357,358,361,390,391,392,397,398,419,428,430,437,],[-74,-75,-76,-263,-124,-27,-263,-263,-28,-248,-125,-252,-214,-243,-255,-259,-256,-253,-241,-242,-216,228,-195,-4,-251,235,-228,-257,-249,-240,-193,-254,-250,-3,-179,-263,-262,314,315,-260,-220,-258,-237,-236,-214,-219,-217,-176,-218,366,367,-192,388,389,-180,-235,-234,-233,-232,391,-231,-244,-201,-213,-202,-200,-204,-208,-203,-199,-206,-211,-197,-196,-205,-212,-207,-209,-210,-198,401,-221,-229,-230,-177,-215,-194,-245,-238,-239,]),} +_lr_action_items = {'$end':([0,1,2,3,4,5,6,7,8,9,13,14,55,77,78,105,144,210,264,],[-309,0,-58,-59,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-70,-308,-71,-202,]),'SEMI':([0,2,4,5,6,7,8,9,11,12,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,62,63,64,65,66,67,69,70,72,73,74,75,76,77,78,81,82,83,84,85,86,87,88,89,90,91,92,98,99,101,102,103,104,105,106,108,110,127,131,139,140,141,142,143,144,145,146,147,148,151,152,153,154,155,156,157,158,159,160,161,162,163,166,169,172,175,176,177,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,227,228,242,243,246,249,250,251,252,253,254,255,256,257,258,259,260,261,263,264,265,266,267,269,270,272,273,282,283,284,285,286,287,288,289,325,326,327,329,330,331,333,334,349,350,351,352,371,372,375,376,377,380,381,382,384,387,391,395,396,397,398,399,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,431,438,439,442,443,456,457,458,460,462,463,464,466,467,469,470,473,475,479,480,491,492,494,495,497,499,508,509,511,514,519,520,521,523,526,527,529,],[9,9,-60,-62,-63,-64,-65,-66,-309,77,-67,-68,-52,-309,-309,-309,-116,-93,-309,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,-309,-309,-162,-89,-90,-91,-92,-81,-19,-20,-120,-122,-163,-54,-37,-83,-69,-53,-86,-9,-10,-87,-88,-94,-82,-15,-16,-124,-126,-152,-153,-307,-132,-133,146,-70,-309,-162,-55,-294,-30,146,146,146,-135,-142,-308,-309,-145,-146,-130,-13,-309,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,273,-14,-309,286,287,289,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-121,-38,-123,-177,-35,-36,-125,-127,-154,146,-137,146,-139,-134,-143,377,-128,-129,-25,-26,-147,-149,-131,-202,-201,-13,-309,-235,-257,-309,-218,-78,-80,-309,398,-214,-215,399,-217,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-155,-156,-136,-138,-144,-151,-203,-309,-205,-287,-220,-79,466,-309,-213,-216,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-178,-39,-42,-32,-33,-148,-150,-204,-309,-258,-309,-309,-309,498,-272,-273,-264,-179,-40,-41,-206,-80,-208,-209,512,-237,-309,-281,521,-288,-207,-282,-210,-309,-309,-212,-211,]),'PPHASH':([0,2,4,5,6,7,8,9,13,14,55,77,78,105,144,210,264,],[13,13,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-70,-308,-71,-202,]),'PPPRAGMA':([0,2,4,5,6,7,8,9,13,14,55,77,78,101,104,105,106,139,140,141,143,144,146,147,152,153,154,155,156,157,158,159,160,161,162,172,210,249,251,254,264,265,267,272,273,282,283,286,287,289,377,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[14,14,-60,-62,-63,-64,-65,-66,-67,-68,-61,-83,-69,-307,14,-70,14,14,14,14,-142,-308,-145,-146,14,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,14,-71,14,14,-143,-202,-201,14,14,-218,14,-80,-214,-215,-217,-144,-203,14,-205,-79,-213,-216,-204,14,14,14,-206,-80,-208,-209,14,-207,-210,14,14,-212,-211,]),'ID':([0,2,4,5,6,7,8,9,11,13,14,16,17,18,19,20,21,22,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,60,61,63,64,65,66,68,71,77,78,79,80,82,83,84,85,86,87,94,95,96,97,98,99,100,101,102,103,105,106,111,113,114,115,116,117,118,126,129,130,132,133,134,135,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,164,168,172,174,177,183,184,185,187,188,189,190,191,193,194,210,215,216,217,218,222,225,226,230,234,238,239,246,247,248,250,252,253,256,257,262,263,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,328,332,338,339,340,343,344,346,347,348,360,361,364,367,369,371,372,375,376,378,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,474,476,477,482,483,484,491,492,494,495,498,508,510,512,515,516,519,521,523,526,527,529,],[23,23,-60,-62,-63,-64,-65,-66,23,-67,-68,23,-309,-309,-309,-116,-93,23,23,-97,-309,-113,-114,-115,-221,98,102,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-140,-141,-61,23,23,-89,-90,-91,-92,23,23,-83,-69,-309,127,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,138,-307,-132,-133,-70,163,23,127,-309,127,127,-309,-28,23,23,127,-165,-167,138,138,-135,-308,23,-130,163,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,127,127,163,285,127,127,127,127,127,-266,-267,-268,-265,-269,-270,-71,-309,127,-309,-28,-266,127,127,127,23,23,-309,-154,138,127,-137,-139,-134,-128,-129,127,-131,-202,-201,163,127,163,-218,127,127,127,127,163,-80,127,-214,-215,-217,127,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,424,426,127,127,-11,127,-12,127,127,-266,127,127,-309,127,23,127,127,-155,-156,-136,-138,23,127,-203,163,-205,127,-79,127,-213,-216,-309,-182,127,-309,-28,-266,-204,127,163,-309,163,163,127,127,127,127,127,127,-11,-266,127,127,-206,-80,-208,-209,127,163,-309,127,127,127,-207,-210,163,163,-212,-211,]),'LPAREN':([0,2,4,5,6,7,8,9,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,63,64,65,66,68,71,75,76,77,78,79,81,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,105,106,110,111,113,114,116,117,118,126,127,129,130,131,132,133,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,163,164,167,168,170,171,172,173,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,212,215,216,217,218,222,225,226,227,228,234,235,238,239,240,241,246,248,250,252,253,256,257,262,263,264,265,267,271,272,273,274,277,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,349,350,351,352,358,359,360,364,367,369,371,372,375,376,378,379,381,382,384,386,387,389,390,394,395,397,398,399,422,424,425,426,427,432,434,438,439,442,443,444,445,446,449,450,452,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,479,480,482,483,484,485,486,487,488,489,490,491,492,494,495,498,504,505,508,509,510,512,514,516,517,518,519,520,521,523,526,527,529,],[24,24,-60,-62,-63,-64,-65,-66,71,-67,-68,80,24,-309,-309,-309,-116,-93,24,-29,24,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,71,24,-89,-90,-91,-92,71,71,115,-37,-83,-69,-309,80,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,-70,168,115,71,168,-309,168,-309,-28,238,-294,71,168,-30,-165,-167,-135,-308,71,-130,168,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,271,274,168,279,280,168,284,168,322,328,328,271,332,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,335,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-38,-309,168,-309,-28,-266,168,168,-35,-36,238,361,238,-309,-45,370,-154,271,-137,-139,-134,-128,-129,271,-131,-202,-201,168,168,168,-218,168,390,168,168,168,168,-80,168,-214,-215,-217,168,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,168,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,168,168,-279,-280,168,168,-304,-306,-11,168,-12,271,-266,168,168,-43,-44,-31,-34,361,370,-309,238,168,168,-155,-156,-136,-138,71,271,-203,168,-205,271,-287,390,390,465,-79,168,-213,-216,-274,-275,-276,-277,-278,-309,-182,-39,-42,-32,-33,168,-309,-28,-191,-197,-195,-266,-204,271,168,-309,168,168,168,168,271,-272,-273,168,168,-11,-40,-41,-266,168,168,-50,-51,-193,-192,-194,-196,-206,-80,-208,-209,168,-46,-49,168,-281,-309,168,-288,168,-47,-48,-207,-282,-210,168,168,-212,-211,]),'TIMES':([0,2,4,5,6,7,8,9,11,13,14,17,18,19,20,21,22,24,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,60,61,63,64,65,66,71,77,78,79,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,105,106,111,113,114,116,117,118,126,127,129,130,133,142,144,145,148,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,210,215,216,217,218,222,225,226,238,239,246,248,250,252,253,256,257,262,263,264,265,267,270,271,272,273,274,277,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,371,372,375,376,378,379,381,382,384,386,387,390,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[26,26,-60,-62,-63,-64,-65,-66,26,-67,-68,-309,-309,-309,-116,-93,26,26,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,26,26,-89,-90,-91,-92,26,-83,-69,-309,-86,-9,-10,-87,-88,-94,26,-27,-28,-166,-152,-153,-307,-132,-133,-70,188,26,188,-309,222,-309,-28,26,-294,26,188,-167,-135,-308,26,-130,188,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,188,188,188,188,-257,303,-259,188,188,188,-238,188,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-71,-309,346,-309,-28,-266,188,188,26,368,-154,188,-137,-139,-134,-128,-129,188,-131,-202,-201,188,-257,188,188,-218,188,26,188,188,188,188,-80,188,-214,-215,-217,188,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,-279,-280,-260,188,-261,-262,-263,188,-304,-306,-11,188,-12,188,-266,188,188,-309,188,454,-155,-156,-136,-138,26,188,-203,188,-205,188,-287,26,-79,188,-213,-216,-239,-240,-241,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,-274,-275,-276,-277,-278,-309,-182,482,-309,-28,-266,-204,188,188,-309,-258,188,188,188,188,188,-272,-273,188,-264,188,-11,-266,188,188,-206,-80,-208,-209,188,188,-281,-309,188,-288,188,-207,-282,-210,188,188,-212,-211,]),'TYPEID':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,58,59,60,61,62,63,64,65,66,68,71,77,78,80,81,82,83,84,85,86,87,94,95,96,97,98,99,101,102,103,104,105,106,107,111,115,126,128,129,131,132,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,234,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,282,283,284,286,287,289,323,324,328,332,335,351,352,361,370,371,372,375,376,377,378,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[30,30,-60,-62,-63,-64,-65,-66,30,76,-67,-68,-52,-309,-309,-309,-116,-93,30,-29,-97,-309,-113,-114,-115,-221,99,103,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-140,-141,-61,30,-84,76,30,30,-89,-90,-91,-92,76,76,-83,-69,30,-53,-86,-9,-10,-87,-88,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,30,-70,30,-85,76,30,240,30,76,-30,-165,-167,30,30,30,-135,-142,-308,76,-145,-146,-130,30,30,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,30,-71,-35,-36,30,240,30,-154,30,-137,30,-139,-134,-143,-128,-129,-131,-202,-201,30,-218,-78,-80,30,-214,-215,-217,425,427,30,30,30,-31,-34,30,30,-155,-156,-136,-138,-144,76,-203,-205,30,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'ENUM':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[31,31,-60,-62,-63,-64,-65,-66,31,-67,-68,-52,-309,-309,-309,31,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,31,-84,31,31,-83,-69,31,-53,-86,-9,-10,-87,-88,-166,-307,31,-70,31,-85,31,31,-30,-167,31,31,31,-142,-308,-145,-146,31,31,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,31,-71,-35,-36,31,31,31,31,-143,-202,-201,31,-218,-78,-80,31,-214,-215,-217,31,31,31,-31,-34,31,31,-144,-203,-205,31,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'VOID':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[33,33,-60,-62,-63,-64,-65,-66,33,33,-67,-68,-52,-309,-309,-309,-116,-93,33,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,33,-84,33,33,33,-89,-90,-91,-92,-83,-69,33,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,33,-70,33,-85,33,33,33,-30,-167,33,33,33,-135,-142,-308,33,-145,-146,-130,33,33,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,33,-71,-35,-36,33,33,-154,33,-137,33,-139,-134,-143,-128,-129,-131,-202,-201,33,-218,33,-78,-80,33,-214,-215,-217,33,33,33,-31,-34,33,33,-155,-156,-136,-138,-144,-203,-205,33,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'_BOOL':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[34,34,-60,-62,-63,-64,-65,-66,34,34,-67,-68,-52,-309,-309,-309,-116,-93,34,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,34,-84,34,34,34,-89,-90,-91,-92,-83,-69,34,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,34,-70,34,-85,34,34,34,-30,-167,34,34,34,-135,-142,-308,34,-145,-146,-130,34,34,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,34,-71,-35,-36,34,34,-154,34,-137,34,-139,-134,-143,-128,-129,-131,-202,-201,34,-218,34,-78,-80,34,-214,-215,-217,34,34,34,-31,-34,34,34,-155,-156,-136,-138,-144,-203,-205,34,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'CHAR':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[35,35,-60,-62,-63,-64,-65,-66,35,35,-67,-68,-52,-309,-309,-309,-116,-93,35,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,35,-84,35,35,35,-89,-90,-91,-92,-83,-69,35,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,35,-70,35,-85,35,35,35,-30,-167,35,35,35,-135,-142,-308,35,-145,-146,-130,35,35,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,35,-71,-35,-36,35,35,-154,35,-137,35,-139,-134,-143,-128,-129,-131,-202,-201,35,-218,35,-78,-80,35,-214,-215,-217,35,35,35,-31,-34,35,35,-155,-156,-136,-138,-144,-203,-205,35,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'SHORT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[36,36,-60,-62,-63,-64,-65,-66,36,36,-67,-68,-52,-309,-309,-309,-116,-93,36,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,36,-84,36,36,36,-89,-90,-91,-92,-83,-69,36,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,36,-70,36,-85,36,36,36,-30,-167,36,36,36,-135,-142,-308,36,-145,-146,-130,36,36,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,36,-71,-35,-36,36,36,-154,36,-137,36,-139,-134,-143,-128,-129,-131,-202,-201,36,-218,36,-78,-80,36,-214,-215,-217,36,36,36,-31,-34,36,36,-155,-156,-136,-138,-144,-203,-205,36,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'INT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[37,37,-60,-62,-63,-64,-65,-66,37,37,-67,-68,-52,-309,-309,-309,-116,-93,37,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,37,-84,37,37,37,-89,-90,-91,-92,-83,-69,37,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,37,-70,37,-85,37,37,37,-30,-167,37,37,37,-135,-142,-308,37,-145,-146,-130,37,37,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,37,-71,-35,-36,37,37,-154,37,-137,37,-139,-134,-143,-128,-129,-131,-202,-201,37,-218,37,-78,-80,37,-214,-215,-217,37,37,37,-31,-34,37,37,-155,-156,-136,-138,-144,-203,-205,37,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'LONG':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[38,38,-60,-62,-63,-64,-65,-66,38,38,-67,-68,-52,-309,-309,-309,-116,-93,38,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,38,-84,38,38,38,-89,-90,-91,-92,-83,-69,38,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,38,-70,38,-85,38,38,38,-30,-167,38,38,38,-135,-142,-308,38,-145,-146,-130,38,38,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,38,-71,-35,-36,38,38,-154,38,-137,38,-139,-134,-143,-128,-129,-131,-202,-201,38,-218,38,-78,-80,38,-214,-215,-217,38,38,38,-31,-34,38,38,-155,-156,-136,-138,-144,-203,-205,38,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'FLOAT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[39,39,-60,-62,-63,-64,-65,-66,39,39,-67,-68,-52,-309,-309,-309,-116,-93,39,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,39,-84,39,39,39,-89,-90,-91,-92,-83,-69,39,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,39,-70,39,-85,39,39,39,-30,-167,39,39,39,-135,-142,-308,39,-145,-146,-130,39,39,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,39,-71,-35,-36,39,39,-154,39,-137,39,-139,-134,-143,-128,-129,-131,-202,-201,39,-218,39,-78,-80,39,-214,-215,-217,39,39,39,-31,-34,39,39,-155,-156,-136,-138,-144,-203,-205,39,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'DOUBLE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[40,40,-60,-62,-63,-64,-65,-66,40,40,-67,-68,-52,-309,-309,-309,-116,-93,40,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,40,-84,40,40,40,-89,-90,-91,-92,-83,-69,40,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,40,-70,40,-85,40,40,40,-30,-167,40,40,40,-135,-142,-308,40,-145,-146,-130,40,40,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,40,-71,-35,-36,40,40,-154,40,-137,40,-139,-134,-143,-128,-129,-131,-202,-201,40,-218,40,-78,-80,40,-214,-215,-217,40,40,40,-31,-34,40,40,-155,-156,-136,-138,-144,-203,-205,40,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'_COMPLEX':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[41,41,-60,-62,-63,-64,-65,-66,41,41,-67,-68,-52,-309,-309,-309,-116,-93,41,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,41,-84,41,41,41,-89,-90,-91,-92,-83,-69,41,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,41,-70,41,-85,41,41,41,-30,-167,41,41,41,-135,-142,-308,41,-145,-146,-130,41,41,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,41,-71,-35,-36,41,41,-154,41,-137,41,-139,-134,-143,-128,-129,-131,-202,-201,41,-218,41,-78,-80,41,-214,-215,-217,41,41,41,-31,-34,41,41,-155,-156,-136,-138,-144,-203,-205,41,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'SIGNED':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[42,42,-60,-62,-63,-64,-65,-66,42,42,-67,-68,-52,-309,-309,-309,-116,-93,42,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,42,-84,42,42,42,-89,-90,-91,-92,-83,-69,42,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,42,-70,42,-85,42,42,42,-30,-167,42,42,42,-135,-142,-308,42,-145,-146,-130,42,42,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,42,-71,-35,-36,42,42,-154,42,-137,42,-139,-134,-143,-128,-129,-131,-202,-201,42,-218,42,-78,-80,42,-214,-215,-217,42,42,42,-31,-34,42,42,-155,-156,-136,-138,-144,-203,-205,42,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'UNSIGNED':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[43,43,-60,-62,-63,-64,-65,-66,43,43,-67,-68,-52,-309,-309,-309,-116,-93,43,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,43,-84,43,43,43,-89,-90,-91,-92,-83,-69,43,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,43,-70,43,-85,43,43,43,-30,-167,43,43,43,-135,-142,-308,43,-145,-146,-130,43,43,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,43,-71,-35,-36,43,43,-154,43,-137,43,-139,-134,-143,-128,-129,-131,-202,-201,43,-218,43,-78,-80,43,-214,-215,-217,43,43,43,-31,-34,43,43,-155,-156,-136,-138,-144,-203,-205,43,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'__INT128':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,61,62,63,64,65,66,77,78,80,81,82,83,84,85,86,87,97,98,99,101,102,103,104,105,106,107,115,126,128,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[44,44,-60,-62,-63,-64,-65,-66,44,44,-67,-68,-52,-309,-309,-309,-116,-93,44,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,44,-84,44,44,44,-89,-90,-91,-92,-83,-69,44,-53,-86,-9,-10,-87,-88,-94,-166,-152,-153,-307,-132,-133,44,-70,44,-85,44,44,44,-30,-167,44,44,44,-135,-142,-308,44,-145,-146,-130,44,44,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,44,-71,-35,-36,44,44,-154,44,-137,44,-139,-134,-143,-128,-129,-131,-202,-201,44,-218,44,-78,-80,44,-214,-215,-217,44,44,44,-31,-34,44,44,-155,-156,-136,-138,-144,-203,-205,44,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'CONST':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[45,45,-60,-62,-63,-64,-65,-66,45,45,-67,-68,-52,45,45,45,-116,-93,-29,-97,45,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,45,-84,45,45,-89,-90,-91,-92,-83,-69,45,45,-53,-94,45,-166,-152,-153,-307,-132,-133,45,-70,45,-85,45,45,45,45,45,-30,-167,45,45,45,-135,-142,-308,45,-145,-146,-130,45,45,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,45,-71,45,45,-35,-36,45,45,45,-154,45,-137,45,-139,-134,-143,-128,-129,-131,-202,-201,45,-218,45,-78,-80,45,-214,-215,-217,45,45,45,-31,-34,45,45,45,-155,-156,-136,-138,-144,-203,-205,45,-79,-213,-216,-32,-33,45,45,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'RESTRICT':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[46,46,-60,-62,-63,-64,-65,-66,46,46,-67,-68,-52,46,46,46,-116,-93,-29,-97,46,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,46,-84,46,46,-89,-90,-91,-92,-83,-69,46,46,-53,-94,46,-166,-152,-153,-307,-132,-133,46,-70,46,-85,46,46,46,46,46,-30,-167,46,46,46,-135,-142,-308,46,-145,-146,-130,46,46,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,46,-71,46,46,-35,-36,46,46,46,-154,46,-137,46,-139,-134,-143,-128,-129,-131,-202,-201,46,-218,46,-78,-80,46,-214,-215,-217,46,46,46,-31,-34,46,46,46,-155,-156,-136,-138,-144,-203,-205,46,-79,-213,-216,-32,-33,46,46,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'VOLATILE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,96,97,98,99,101,102,103,104,105,106,107,114,115,117,118,126,131,133,139,140,141,142,143,144,145,146,147,148,149,152,153,154,155,156,157,158,159,160,161,162,168,210,217,218,227,228,229,238,239,246,249,250,251,252,253,254,256,257,263,264,265,271,273,277,282,283,284,286,287,289,328,332,335,351,352,360,361,370,371,372,375,376,377,381,384,390,395,398,399,442,443,445,446,458,491,492,494,495,519,521,527,529,],[47,47,-60,-62,-63,-64,-65,-66,47,47,-67,-68,-52,47,47,47,-116,-93,-29,-97,47,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,47,-84,47,47,-89,-90,-91,-92,-83,-69,47,47,-53,-94,47,-166,-152,-153,-307,-132,-133,47,-70,47,-85,47,47,47,47,47,-30,-167,47,47,47,-135,-142,-308,47,-145,-146,-130,47,47,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,47,-71,47,47,-35,-36,47,47,47,-154,47,-137,47,-139,-134,-143,-128,-129,-131,-202,-201,47,-218,47,-78,-80,47,-214,-215,-217,47,47,47,-31,-34,47,47,47,-155,-156,-136,-138,-144,-203,-205,47,-79,-213,-216,-32,-33,47,47,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'AUTO':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[48,48,-60,-62,-63,-64,-65,-66,48,48,-67,-68,-52,48,48,48,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,48,-84,48,48,-89,-90,-91,-92,-83,-69,48,-53,-94,-152,-153,-307,-132,-133,-70,48,-85,48,48,-30,-135,-308,48,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,48,48,-154,-137,-139,-134,-202,-201,-218,-78,-80,48,-214,-215,-217,-31,-34,48,48,-155,-156,-136,-138,-203,-205,48,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'REGISTER':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[49,49,-60,-62,-63,-64,-65,-66,49,49,-67,-68,-52,49,49,49,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,49,-84,49,49,-89,-90,-91,-92,-83,-69,49,-53,-94,-152,-153,-307,-132,-133,-70,49,-85,49,49,-30,-135,-308,49,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,49,49,-154,-137,-139,-134,-202,-201,-218,-78,-80,49,-214,-215,-217,-31,-34,49,49,-155,-156,-136,-138,-203,-205,49,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'STATIC':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,79,80,81,87,97,98,99,101,102,103,105,106,107,114,115,118,126,131,133,142,144,152,153,154,155,156,157,158,159,160,161,162,210,218,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,360,361,370,371,372,375,376,381,384,390,395,398,399,442,443,446,458,491,492,494,495,519,521,527,529,],[25,25,-60,-62,-63,-64,-65,-66,25,25,-67,-68,-52,25,25,25,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,25,-84,25,25,-89,-90,-91,-92,-83,-69,117,25,-53,-94,-166,-152,-153,-307,-132,-133,-70,25,-85,217,25,226,25,-30,-167,-135,-308,25,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,348,-35,-36,25,25,-154,-137,-139,-134,-202,-201,-218,-78,-80,25,-214,-215,-217,-31,-34,445,25,25,-155,-156,-136,-138,-203,-205,25,-79,-213,-216,-32,-33,484,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'EXTERN':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[50,50,-60,-62,-63,-64,-65,-66,50,50,-67,-68,-52,50,50,50,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,50,-84,50,50,-89,-90,-91,-92,-83,-69,50,-53,-94,-152,-153,-307,-132,-133,-70,50,-85,50,50,-30,-135,-308,50,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,50,50,-154,-137,-139,-134,-202,-201,-218,-78,-80,50,-214,-215,-217,-31,-34,50,50,-155,-156,-136,-138,-203,-205,50,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'TYPEDEF':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[51,51,-60,-62,-63,-64,-65,-66,51,51,-67,-68,-52,51,51,51,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,51,-84,51,51,-89,-90,-91,-92,-83,-69,51,-53,-94,-152,-153,-307,-132,-133,-70,51,-85,51,51,-30,-135,-308,51,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,51,51,-154,-137,-139,-134,-202,-201,-218,-78,-80,51,-214,-215,-217,-31,-34,51,51,-155,-156,-136,-138,-203,-205,51,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'INLINE':([0,2,4,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,23,25,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55,58,59,60,62,63,64,65,66,77,78,80,81,87,98,99,101,102,103,105,106,107,115,126,131,142,144,152,153,154,155,156,157,158,159,160,161,162,210,227,228,229,238,246,250,252,253,264,265,273,282,283,284,286,287,289,351,352,361,370,371,372,375,376,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[52,52,-60,-62,-63,-64,-65,-66,52,52,-67,-68,-52,52,52,52,-116,-93,-29,-97,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-61,52,-84,52,52,-89,-90,-91,-92,-83,-69,52,-53,-94,-152,-153,-307,-132,-133,-70,52,-85,52,52,-30,-135,-308,52,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-71,-35,-36,52,52,-154,-137,-139,-134,-202,-201,-218,-78,-80,52,-214,-215,-217,-31,-34,52,52,-155,-156,-136,-138,-203,-205,52,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'STRUCT':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[53,53,-60,-62,-63,-64,-65,-66,53,-67,-68,-52,-309,-309,-309,53,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,53,-84,53,53,-83,-69,53,-53,-86,-9,-10,-87,-88,-166,-307,53,-70,53,-85,53,53,-30,-167,53,53,53,-142,-308,-145,-146,53,53,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,53,-71,-35,-36,53,53,53,53,-143,-202,-201,53,-218,-78,-80,53,-214,-215,-217,53,53,53,-31,-34,53,53,-144,-203,-205,53,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'UNION':([0,2,4,5,6,7,8,9,10,13,14,15,17,18,19,22,23,25,45,46,47,48,49,50,51,52,55,58,59,61,62,77,78,80,81,82,83,84,85,86,97,101,104,105,106,107,115,128,131,133,139,140,141,143,144,146,147,149,152,153,154,155,156,157,158,159,160,161,162,168,210,227,228,229,238,249,251,254,264,265,271,273,282,283,284,286,287,289,328,332,335,351,352,361,370,377,381,384,390,395,398,399,442,443,458,491,492,494,495,519,521,527,529,],[54,54,-60,-62,-63,-64,-65,-66,54,-67,-68,-52,-309,-309,-309,54,-29,-97,-117,-118,-119,-95,-96,-98,-99,-100,-61,54,-84,54,54,-83,-69,54,-53,-86,-9,-10,-87,-88,-166,-307,54,-70,54,-85,54,54,-30,-167,54,54,54,-142,-308,-145,-146,54,54,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,54,-71,-35,-36,54,54,54,54,-143,-202,-201,54,-218,-78,-80,54,-214,-215,-217,54,54,54,-31,-34,54,54,-144,-203,-205,54,-79,-213,-216,-32,-33,-204,-206,-80,-208,-209,-207,-210,-212,-211,]),'LBRACE':([10,14,15,23,31,32,53,54,56,57,58,59,62,77,78,81,98,99,101,102,103,106,107,109,113,130,131,144,152,153,154,155,156,157,158,159,160,161,162,172,215,227,228,264,265,267,272,273,282,283,286,287,289,338,339,340,351,352,381,382,384,386,395,398,399,432,434,442,443,458,459,460,461,463,464,472,473,476,477,491,492,494,495,508,510,519,521,523,526,527,529,],[-309,-68,-52,-29,101,101,-140,-141,101,-7,-8,-84,-309,-83,-69,-53,101,101,-307,101,101,101,-85,101,101,101,-30,-308,101,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,101,-309,-35,-36,-202,-201,101,101,-218,101,-80,-214,-215,-217,-11,101,-12,-31,-34,-203,101,-205,101,-79,-213,-216,-309,-182,-32,-33,-204,101,101,-309,101,101,101,101,101,-11,-206,-80,-208,-209,101,-309,-207,-210,101,101,-212,-211,]),'RBRACE':([14,77,78,101,104,106,127,136,137,138,139,140,141,143,144,146,147,150,151,152,153,154,155,156,157,158,159,160,161,162,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,214,215,244,245,247,249,251,254,264,265,269,270,273,282,283,286,287,289,325,326,327,329,330,331,333,334,336,337,338,373,374,377,381,384,387,395,398,399,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,431,432,433,458,462,469,470,473,475,491,492,493,494,495,499,503,509,510,514,519,520,521,527,529,],[-68,-83,-69,-307,144,-309,-294,144,-157,-160,144,144,144,-142,-308,-145,-146,144,-5,-6,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-177,-309,144,144,-158,144,144,-143,-202,-201,-235,-257,-218,-78,-80,-214,-215,-217,-279,-280,-260,-261,-262,-263,-304,-306,144,-22,-21,-159,-161,-144,-203,-205,-287,-79,-213,-216,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-178,144,-180,-204,-258,-272,-273,-264,-179,-206,-80,144,-208,-209,-237,-181,-281,144,-288,-207,-282,-210,-212,-211,]),'CASE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,164,-308,164,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,164,-202,-201,164,164,-218,164,-80,-214,-215,-217,-203,164,-205,-79,-213,-216,-204,164,164,164,-206,-80,-208,-209,164,-207,-210,164,164,-212,-211,]),'DEFAULT':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,165,-308,165,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,165,-202,-201,165,165,-218,165,-80,-214,-215,-217,-203,165,-205,-79,-213,-216,-204,165,165,165,-206,-80,-208,-209,165,-207,-210,165,165,-212,-211,]),'IF':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,167,-308,167,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,167,-202,-201,167,167,-218,167,-80,-214,-215,-217,-203,167,-205,-79,-213,-216,-204,167,167,167,-206,-80,-208,-209,167,-207,-210,167,167,-212,-211,]),'SWITCH':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,170,-308,170,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,170,-202,-201,170,170,-218,170,-80,-214,-215,-217,-203,170,-205,-79,-213,-216,-204,170,170,170,-206,-80,-208,-209,170,-207,-210,170,170,-212,-211,]),'WHILE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,281,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,171,-308,171,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,171,-202,-201,171,171,-218,394,171,-80,-214,-215,-217,-203,171,-205,-79,-213,-216,-204,171,171,171,-206,-80,-208,-209,171,-207,-210,171,171,-212,-211,]),'DO':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,172,-308,172,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,172,-202,-201,172,172,-218,172,-80,-214,-215,-217,-203,172,-205,-79,-213,-216,-204,172,172,172,-206,-80,-208,-209,172,-207,-210,172,172,-212,-211,]),'FOR':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,173,-308,173,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,173,-202,-201,173,173,-218,173,-80,-214,-215,-217,-203,173,-205,-79,-213,-216,-204,173,173,173,-206,-80,-208,-209,173,-207,-210,173,173,-212,-211,]),'GOTO':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,174,-308,174,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,174,-202,-201,174,174,-218,174,-80,-214,-215,-217,-203,174,-205,-79,-213,-216,-204,174,174,174,-206,-80,-208,-209,174,-207,-210,174,174,-212,-211,]),'BREAK':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,175,-308,175,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,175,-202,-201,175,175,-218,175,-80,-214,-215,-217,-203,175,-205,-79,-213,-216,-204,175,175,175,-206,-80,-208,-209,175,-207,-210,175,175,-212,-211,]),'CONTINUE':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,176,-308,176,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,176,-202,-201,176,176,-218,176,-80,-214,-215,-217,-203,176,-205,-79,-213,-216,-204,176,176,176,-206,-80,-208,-209,176,-207,-210,176,176,-212,-211,]),'RETURN':([14,77,78,101,106,144,152,153,154,155,156,157,158,159,160,161,162,172,264,265,267,272,273,282,283,286,287,289,381,382,384,395,398,399,458,460,463,464,491,492,494,495,508,519,521,523,526,527,529,],[-68,-83,-69,-307,177,-308,177,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,177,-202,-201,177,177,-218,177,-80,-214,-215,-217,-203,177,-205,-79,-213,-216,-204,177,177,177,-206,-80,-208,-209,177,-207,-210,177,177,-212,-211,]),'PLUSPLUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,183,183,-309,183,-309,-28,-294,183,-167,-308,183,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,183,183,183,183,325,183,183,183,183,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,183,-309,-28,-266,183,183,-309,183,183,-202,-201,183,183,183,-218,183,183,183,183,183,-80,183,-214,-215,-217,183,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,-279,-280,183,183,-304,-306,-11,183,-12,183,-266,183,183,-309,183,183,183,-203,183,-205,183,-287,-79,183,-213,-216,-274,-275,-276,-277,-278,-309,-182,183,-309,-28,-266,-204,183,183,-309,183,183,183,183,183,-272,-273,183,183,-11,-266,183,183,-206,-80,-208,-209,183,183,-281,-309,183,-288,183,-207,-282,-210,183,183,-212,-211,]),'MINUSMINUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,328,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,469,470,471,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,184,184,-309,184,-309,-28,-294,184,-167,-308,184,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,184,184,184,184,326,184,184,184,184,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,184,-309,-28,-266,184,184,-309,184,184,-202,-201,184,184,184,-218,184,184,184,184,184,-80,184,-214,-215,-217,184,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,-279,-280,184,184,-304,-306,-11,184,-12,184,-266,184,184,-309,184,184,184,-203,184,-205,184,-287,-79,184,-213,-216,-274,-275,-276,-277,-278,-309,-182,184,-309,-28,-266,-204,184,184,-309,184,184,184,184,184,-272,-273,184,184,-11,-266,184,184,-206,-80,-208,-209,184,184,-281,-309,184,-288,184,-207,-282,-210,184,184,-212,-211,]),'SIZEOF':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,187,187,-309,187,-309,-28,187,-167,-308,187,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,187,187,187,187,187,187,187,187,-266,-267,-268,-265,-269,-270,-309,187,-309,-28,-266,187,187,-309,187,187,-202,-201,187,187,187,-218,187,187,187,187,187,-80,187,-214,-215,-217,187,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,-11,187,-12,187,-266,187,187,-309,187,187,187,-203,187,-205,187,-79,187,-213,-216,-309,-182,187,-309,-28,-266,-204,187,187,-309,187,187,187,187,187,187,187,-11,-266,187,187,-206,-80,-208,-209,187,187,-309,187,187,-207,-210,187,187,-212,-211,]),'AND':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,191,191,-309,191,-309,-28,-294,191,-167,-308,191,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,191,191,191,191,-257,316,-259,191,191,191,-238,191,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,191,-309,-28,-266,191,191,-309,191,191,-202,-201,191,-257,191,191,-218,191,191,191,191,191,-80,191,-214,-215,-217,191,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,-279,-280,-260,191,-261,-262,-263,191,-304,-306,-11,191,-12,191,-266,191,191,-309,191,191,191,-203,191,-205,191,-287,-79,191,-213,-216,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,316,316,316,316,-274,-275,-276,-277,-278,-309,-182,191,-309,-28,-266,-204,191,191,-309,-258,191,191,191,191,191,-272,-273,191,-264,191,-11,-266,191,191,-206,-80,-208,-209,191,191,-281,-309,191,-288,191,-207,-282,-210,191,191,-212,-211,]),'PLUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,189,189,-309,189,-309,-28,-294,189,-167,-308,189,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,189,189,189,189,-257,306,-259,189,189,189,-238,189,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,189,-309,-28,-266,189,189,-309,189,189,-202,-201,189,-257,189,189,-218,189,189,189,189,189,-80,189,-214,-215,-217,189,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,-279,-280,-260,189,-261,-262,-263,189,-304,-306,-11,189,-12,189,-266,189,189,-309,189,189,189,-203,189,-205,189,-287,-79,189,-213,-216,-239,-240,-241,-242,-243,306,306,306,306,306,306,306,306,306,306,306,306,306,-274,-275,-276,-277,-278,-309,-182,189,-309,-28,-266,-204,189,189,-309,-258,189,189,189,189,189,-272,-273,189,-264,189,-11,-266,189,189,-206,-80,-208,-209,189,189,-281,-309,189,-288,189,-207,-282,-210,189,189,-212,-211,]),'MINUS':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,127,130,133,144,152,153,154,155,156,157,158,159,160,161,162,163,164,168,172,177,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,216,217,218,222,225,226,239,248,262,264,265,267,270,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,325,326,327,328,329,330,331,332,333,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,387,395,397,398,399,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,432,434,444,445,446,454,458,459,460,461,462,463,464,465,466,468,469,470,471,473,476,477,482,483,484,491,492,494,495,498,508,509,510,512,514,516,519,520,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,190,190,-309,190,-309,-28,-294,190,-167,-308,190,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,-294,190,190,190,190,-257,307,-259,190,190,190,-238,190,-266,-267,-268,-265,-271,-269,-270,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,190,-309,-28,-266,190,190,-309,190,190,-202,-201,190,-257,190,190,-218,190,190,190,190,190,-80,190,-214,-215,-217,190,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,-279,-280,-260,190,-261,-262,-263,190,-304,-306,-11,190,-12,190,-266,190,190,-309,190,190,190,-203,190,-205,190,-287,-79,190,-213,-216,-239,-240,-241,-242,-243,307,307,307,307,307,307,307,307,307,307,307,307,307,-274,-275,-276,-277,-278,-309,-182,190,-309,-28,-266,-204,190,190,-309,-258,190,190,190,190,190,-272,-273,190,-264,190,-11,-266,190,190,-206,-80,-208,-209,190,190,-281,-309,190,-288,190,-207,-282,-210,190,190,-212,-211,]),'NOT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,193,193,-309,193,-309,-28,193,-167,-308,193,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,193,193,193,193,193,193,193,193,-266,-267,-268,-265,-269,-270,-309,193,-309,-28,-266,193,193,-309,193,193,-202,-201,193,193,193,-218,193,193,193,193,193,-80,193,-214,-215,-217,193,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,-11,193,-12,193,-266,193,193,-309,193,193,193,-203,193,-205,193,-79,193,-213,-216,-309,-182,193,-309,-28,-266,-204,193,193,-309,193,193,193,193,193,193,193,-11,-266,193,193,-206,-80,-208,-209,193,193,-309,193,193,-207,-210,193,193,-212,-211,]),'LNOT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,194,194,-309,194,-309,-28,194,-167,-308,194,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,194,194,194,194,194,194,194,194,-266,-267,-268,-265,-269,-270,-309,194,-309,-28,-266,194,194,-309,194,194,-202,-201,194,194,194,-218,194,194,194,194,194,-80,194,-214,-215,-217,194,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,-11,194,-12,194,-266,194,194,-309,194,194,194,-203,194,-205,194,-79,194,-213,-216,-309,-182,194,-309,-28,-266,-204,194,194,-309,194,194,194,194,194,194,194,-11,-266,194,194,-206,-80,-208,-209,194,194,-309,194,194,-207,-210,194,194,-212,-211,]),'OFFSETOF':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,199,199,-309,199,-309,-28,199,-167,-308,199,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,199,199,199,199,199,199,199,199,-266,-267,-268,-265,-269,-270,-309,199,-309,-28,-266,199,199,-309,199,199,-202,-201,199,199,199,-218,199,199,199,199,199,-80,199,-214,-215,-217,199,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,-11,199,-12,199,-266,199,199,-309,199,199,199,-203,199,-205,199,-79,199,-213,-216,-309,-182,199,-309,-28,-266,-204,199,199,-309,199,199,199,199,199,199,199,-11,-266,199,199,-206,-80,-208,-209,199,199,-309,199,199,-207,-210,199,199,-212,-211,]),'INT_CONST_DEC':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,200,200,-309,200,-309,-28,200,-167,-308,200,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,200,200,200,200,200,200,200,200,-266,-267,-268,-265,-269,-270,-309,200,-309,-28,-266,200,200,-309,200,200,-202,-201,200,200,200,-218,200,200,200,200,200,-80,200,-214,-215,-217,200,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,-11,200,-12,200,-266,200,200,-309,200,200,200,-203,200,-205,200,-79,200,-213,-216,-309,-182,200,-309,-28,-266,-204,200,200,-309,200,200,200,200,200,200,200,-11,-266,200,200,-206,-80,-208,-209,200,200,-309,200,200,-207,-210,200,200,-212,-211,]),'INT_CONST_OCT':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,201,201,-309,201,-309,-28,201,-167,-308,201,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,201,201,201,201,201,201,201,201,-266,-267,-268,-265,-269,-270,-309,201,-309,-28,-266,201,201,-309,201,201,-202,-201,201,201,201,-218,201,201,201,201,201,-80,201,-214,-215,-217,201,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,-11,201,-12,201,-266,201,201,-309,201,201,201,-203,201,-205,201,-79,201,-213,-216,-309,-182,201,-309,-28,-266,-204,201,201,-309,201,201,201,201,201,201,201,-11,-266,201,201,-206,-80,-208,-209,201,201,-309,201,201,-207,-210,201,201,-212,-211,]),'INT_CONST_HEX':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,202,202,-309,202,-309,-28,202,-167,-308,202,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,202,202,202,202,202,202,202,202,-266,-267,-268,-265,-269,-270,-309,202,-309,-28,-266,202,202,-309,202,202,-202,-201,202,202,202,-218,202,202,202,202,202,-80,202,-214,-215,-217,202,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,-11,202,-12,202,-266,202,202,-309,202,202,202,-203,202,-205,202,-79,202,-213,-216,-309,-182,202,-309,-28,-266,-204,202,202,-309,202,202,202,202,202,202,202,-11,-266,202,202,-206,-80,-208,-209,202,202,-309,202,202,-207,-210,202,202,-212,-211,]),'INT_CONST_BIN':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,203,203,-309,203,-309,-28,203,-167,-308,203,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,203,203,203,203,203,203,203,203,-266,-267,-268,-265,-269,-270,-309,203,-309,-28,-266,203,203,-309,203,203,-202,-201,203,203,203,-218,203,203,203,203,203,-80,203,-214,-215,-217,203,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,-11,203,-12,203,-266,203,203,-309,203,203,203,-203,203,-205,203,-79,203,-213,-216,-309,-182,203,-309,-28,-266,-204,203,203,-309,203,203,203,203,203,203,203,-11,-266,203,203,-206,-80,-208,-209,203,203,-309,203,203,-207,-210,203,203,-212,-211,]),'FLOAT_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,204,204,-309,204,-309,-28,204,-167,-308,204,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,204,204,204,204,204,204,204,204,-266,-267,-268,-265,-269,-270,-309,204,-309,-28,-266,204,204,-309,204,204,-202,-201,204,204,204,-218,204,204,204,204,204,-80,204,-214,-215,-217,204,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,-11,204,-12,204,-266,204,204,-309,204,204,204,-203,204,-205,204,-79,204,-213,-216,-309,-182,204,-309,-28,-266,-204,204,204,-309,204,204,204,204,204,204,204,-11,-266,204,204,-206,-80,-208,-209,204,204,-309,204,204,-207,-210,204,204,-212,-211,]),'HEX_FLOAT_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,205,205,-309,205,-309,-28,205,-167,-308,205,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,205,205,205,205,205,205,205,205,-266,-267,-268,-265,-269,-270,-309,205,-309,-28,-266,205,205,-309,205,205,-202,-201,205,205,205,-218,205,205,205,205,205,-80,205,-214,-215,-217,205,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,-11,205,-12,205,-266,205,205,-309,205,205,205,-203,205,-205,205,-79,205,-213,-216,-309,-182,205,-309,-28,-266,-204,205,205,-309,205,205,205,205,205,205,205,-11,-266,205,205,-206,-80,-208,-209,205,205,-309,205,205,-207,-210,205,205,-212,-211,]),'CHAR_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,206,206,-309,206,-309,-28,206,-167,-308,206,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,206,206,206,206,206,206,206,206,-266,-267,-268,-265,-269,-270,-309,206,-309,-28,-266,206,206,-309,206,206,-202,-201,206,206,206,-218,206,206,206,206,206,-80,206,-214,-215,-217,206,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,-11,206,-12,206,-266,206,206,-309,206,206,206,-203,206,-205,206,-79,206,-213,-216,-309,-182,206,-309,-28,-266,-204,206,206,-309,206,206,206,206,206,206,206,-11,-266,206,206,-206,-80,-208,-209,206,206,-309,206,206,-207,-210,206,206,-212,-211,]),'WCHAR_CONST':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,207,207,-309,207,-309,-28,207,-167,-308,207,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,207,207,207,207,207,207,207,207,-266,-267,-268,-265,-269,-270,-309,207,-309,-28,-266,207,207,-309,207,207,-202,-201,207,207,207,-218,207,207,207,207,207,-80,207,-214,-215,-217,207,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,-11,207,-12,207,-266,207,207,-309,207,207,207,-203,207,-205,207,-79,207,-213,-216,-309,-182,207,-309,-28,-266,-204,207,207,-309,207,207,207,207,207,207,207,-11,-266,207,207,-206,-80,-208,-209,207,207,-309,207,207,-207,-210,207,207,-212,-211,]),'STRING_LITERAL':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,197,208,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,333,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,208,208,-309,208,-309,-28,208,-167,-308,208,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,208,208,208,208,208,208,208,208,-266,-267,-268,-265,-269,-270,333,-303,-309,208,-309,-28,-266,208,208,-309,208,208,-202,-201,208,208,208,-218,208,208,208,208,208,-80,208,-214,-215,-217,208,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,-304,-11,208,-12,208,-266,208,208,-309,208,208,208,-203,208,-205,208,-79,208,-213,-216,-309,-182,208,-309,-28,-266,-204,208,208,-309,208,208,208,208,208,208,208,-11,-266,208,208,-206,-80,-208,-209,208,208,-309,208,208,-207,-210,208,208,-212,-211,]),'WSTRING_LITERAL':([14,45,46,47,77,78,79,95,96,97,101,106,113,114,116,117,118,130,133,144,152,153,154,155,156,157,158,159,160,161,162,164,168,172,177,183,184,185,187,188,189,190,191,193,194,198,209,215,216,217,218,222,225,226,239,248,262,264,265,267,271,272,273,274,278,279,280,282,283,284,286,287,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,334,338,339,340,343,346,347,348,360,367,369,379,381,382,384,386,395,397,398,399,432,434,444,445,446,454,458,459,460,461,463,464,465,466,468,471,476,477,482,483,484,491,492,494,495,498,508,510,512,516,519,521,523,526,527,529,],[-68,-117,-118,-119,-83,-69,-309,-27,-28,-166,-307,209,209,-309,209,-309,-28,209,-167,-308,209,-200,-198,-199,-72,-73,-74,-75,-76,-77,-78,209,209,209,209,209,209,209,209,-266,-267,-268,-265,-269,-270,334,-305,-309,209,-309,-28,-266,209,209,-309,209,209,-202,-201,209,209,209,-218,209,209,209,209,209,-80,209,-214,-215,-217,209,-224,-225,-226,-227,-228,-229,-230,-231,-232,-233,-234,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,-306,-11,209,-12,209,-266,209,209,-309,209,209,209,-203,209,-205,209,-79,209,-213,-216,-309,-182,209,-309,-28,-266,-204,209,209,-309,209,209,209,209,209,209,209,-11,-266,209,209,-206,-80,-208,-209,209,209,-309,209,209,-207,-210,209,209,-212,-211,]),'ELSE':([14,78,144,156,157,158,159,160,161,162,264,273,282,283,286,287,289,381,384,395,398,399,458,491,492,494,495,519,521,527,529,],[-68,-69,-308,-72,-73,-74,-75,-76,-77,-78,-202,-218,-78,-80,-214,-215,-217,-203,-205,-79,-213,-216,-204,-206,508,-208,-209,-207,-210,-212,-211,]),'PPPRAGMASTR':([14,],[78,]),'EQUALS':([15,23,62,73,74,75,76,81,92,108,110,127,131,138,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,227,228,270,325,326,327,329,330,331,333,334,341,342,349,350,351,352,387,422,424,425,426,427,435,437,438,439,442,443,462,469,470,473,478,479,480,509,514,520,],[-52,-29,-162,113,-163,-54,-37,-53,130,-162,-55,-294,-30,248,-308,-294,291,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,-35,-36,-257,-279,-280,-260,-261,-262,-263,-304,-306,434,-183,-43,-44,-31,-34,-287,-274,-275,-276,-277,-278,-184,-186,-39,-42,-32,-33,-258,-272,-273,-264,-185,-40,-41,-281,-288,-282,]),'COMMA':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,62,63,64,65,66,70,72,73,74,75,76,81,87,90,91,92,94,95,96,97,98,99,102,103,108,110,121,123,124,125,126,127,131,132,133,136,137,138,142,144,148,163,169,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,211,212,213,214,227,228,231,232,233,234,235,236,237,240,241,242,243,244,245,246,247,250,252,253,256,257,259,260,261,263,269,270,276,277,288,325,326,327,329,330,331,333,334,337,349,350,351,352,356,357,358,359,371,372,373,374,375,376,380,385,387,388,389,391,392,393,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,430,431,433,438,439,442,443,449,450,452,456,457,462,469,470,473,475,479,480,485,486,487,488,489,490,493,496,499,500,503,504,505,509,514,517,518,520,525,],[-52,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-162,-89,-90,-91,-92,111,-120,-122,-163,-54,-37,-53,-94,129,-124,-126,-164,-27,-28,-166,-152,-153,-132,-133,-162,-55,229,230,-170,-175,-309,-294,-30,-165,-167,247,-157,-160,-135,-308,-130,-294,278,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-121,-38,-123,-177,-35,-36,-172,-173,-174,-188,-56,-1,-2,-45,-190,-125,-127,247,247,-154,-158,-137,-139,-134,-128,-129,378,-147,-149,-131,-235,-257,278,-309,278,-279,-280,-260,-261,-262,-263,-304,-306,432,-43,-44,-31,-34,-171,-176,-57,-189,-155,-156,-159,-161,-136,-138,-151,278,-287,-187,-188,-220,278,278,-223,278,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,278,471,-274,-292,-275,-276,-277,-278,474,-178,-180,-39,-42,-32,-33,-191,-197,-195,-148,-150,-258,-272,-273,-264,-179,-40,-41,-50,-51,-193,-192,-194,-196,510,278,-237,-293,-181,-46,-49,-281,-288,-47,-48,-282,278,]),'RPAREN':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,63,64,65,66,75,76,80,81,87,93,94,95,96,97,98,99,102,103,110,112,115,119,120,121,122,123,124,125,126,127,131,132,133,142,144,148,169,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,219,220,227,228,231,232,233,234,235,236,237,238,240,241,246,250,252,253,256,257,263,266,270,275,276,277,322,325,326,327,329,330,331,333,334,349,350,351,352,355,356,357,358,359,361,362,363,364,365,366,370,371,372,375,376,383,385,387,388,389,390,391,392,393,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,421,422,423,424,425,426,427,428,429,438,439,442,443,447,448,449,450,452,455,462,469,470,473,479,480,485,486,487,488,489,490,496,498,499,500,501,502,504,505,509,512,513,514,517,518,520,522,524,528,],[-52,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-89,-90,-91,-92,-54,-37,-309,-53,-94,131,-164,-27,-28,-166,-152,-153,-132,-133,-55,212,-309,227,228,-168,-17,-18,-170,-175,-309,-294,-30,-165,-167,-135,-308,-130,-14,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,349,350,-35,-36,-172,-173,-174,-188,-56,-1,-2,-309,-45,-190,-154,-137,-139,-134,-128,-129,-131,-13,-257,386,387,-309,422,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-169,-171,-176,-57,-189,-309,449,450,-188,-23,-24,-309,-155,-156,-136,-138,459,460,-287,-187,-188,-309,-220,463,464,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,470,-274,-292,-275,-276,-277,-278,472,473,-39,-42,-32,-33,485,486,-191,-197,-195,490,-258,-272,-273,-264,-40,-41,-50,-51,-193,-192,-194,-196,511,-309,-237,-293,514,-289,-46,-49,-281,-309,523,-288,-47,-48,-282,526,-290,-291,]),'COLON':([15,20,23,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,74,75,76,81,98,99,102,103,108,110,127,131,142,144,145,148,163,165,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,227,228,246,250,252,253,256,257,261,263,268,269,270,325,326,327,329,330,331,333,334,349,350,351,352,371,372,375,376,378,387,391,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,438,439,442,443,462,469,470,473,479,480,499,509,514,520,],[-52,-116,-29,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-163,-54,-37,-53,-152,-153,-132,-133,-162,-55,-294,-30,-135,-308,262,-130,267,272,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,-35,-36,-154,-137,-139,-134,-128,-129,379,-131,382,-235,-257,-279,-280,-260,-261,-262,-263,-304,-306,-43,-44,-31,-34,-155,-156,-136,-138,262,-287,-220,-223,468,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-39,-42,-32,-33,-258,-272,-273,-264,-40,-41,-237,-281,-288,-282,]),'LBRACKET':([15,20,21,23,25,26,27,28,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,63,64,65,66,75,76,81,87,94,95,96,97,98,99,101,102,103,110,126,127,131,132,133,142,144,148,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,212,215,227,228,234,235,238,240,241,246,250,252,253,256,257,263,277,325,326,333,334,341,342,349,350,351,352,358,359,364,371,372,375,376,387,389,390,422,424,425,426,427,432,435,437,438,439,442,443,449,450,452,461,469,470,478,479,480,485,486,487,488,489,490,501,502,504,505,509,510,514,517,518,520,524,528,],[79,-116,-93,-29,-97,-309,-113,-114,-115,-221,-101,-102,-103,-104,-105,-106,-107,-108,-109,-110,-111,-112,-117,-118,-119,-95,-96,-98,-99,-100,-89,-90,-91,-92,114,-37,79,-94,-164,-27,-28,-166,-152,-153,-307,-132,-133,114,239,-294,-30,-165,-167,-135,-308,-130,-294,321,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-38,343,-35,-36,239,360,239,-45,369,-154,-137,-139,-134,-128,-129,-131,239,-279,-280,-304,-306,343,-183,-43,-44,-31,-34,360,369,239,-155,-156,-136,-138,-287,239,239,-274,-275,-276,-277,-278,343,-184,-186,-39,-42,-32,-33,-191,-197,-195,343,-272,-273,-185,-40,-41,-50,-51,-193,-192,-194,-196,516,-289,-46,-49,-281,343,-288,-47,-48,-282,-290,-291,]),'RBRACKET':([45,46,47,79,95,96,97,114,116,118,127,133,144,178,179,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,216,218,221,222,223,224,239,269,270,325,326,327,329,330,331,333,334,345,346,353,354,360,367,368,369,387,391,400,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,422,424,425,426,427,436,440,441,444,446,451,453,454,462,469,470,473,481,482,499,506,507,509,514,520,525,],[-117,-118,-119,-309,-27,-28,-166,-309,-309,-28,-294,-167,-308,-219,-222,-257,-236,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-309,-28,351,352,-3,-4,-309,-235,-257,-279,-280,-260,-261,-262,-263,-304,-306,438,439,442,443,-309,-309,452,-309,-287,-220,-223,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,469,-274,-275,-276,-277,-278,478,479,480,-309,-28,487,488,489,-258,-272,-273,-264,504,505,-237,517,518,-281,-288,-282,528,]),'PERIOD':([101,127,144,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,215,325,326,333,334,341,342,387,422,424,425,426,427,432,435,437,461,469,470,478,501,502,509,510,514,520,524,528,],[-307,-294,-308,-294,323,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,344,-279,-280,-304,-306,344,-183,-287,-274,-275,-276,-277,-278,344,-184,-186,344,-272,-273,-185,515,-289,-281,344,-288,-282,-290,-291,]),'ARROW':([127,144,163,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,325,326,333,334,387,422,424,425,426,427,469,470,509,514,520,],[-294,-308,-294,324,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-279,-280,-304,-306,-287,-274,-275,-276,-277,-278,-272,-273,-281,-288,-282,]),'XOREQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,292,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'TIMESEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,293,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'DIVEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,294,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MODEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,295,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'PLUSEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,296,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MINUSEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,297,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LSHIFTEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,298,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'RSHIFTEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,299,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'ANDEQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,300,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'OREQUAL':([127,144,163,180,182,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,301,-259,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'CONDOP':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,302,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'DIVIDE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,304,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'MOD':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,305,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,305,305,305,305,305,305,305,305,305,305,305,305,305,305,305,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'RSHIFT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,308,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,308,308,308,308,308,308,308,308,308,308,308,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LSHIFT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,309,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,309,309,309,309,309,309,309,309,309,309,309,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,310,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,310,310,310,310,310,310,310,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,311,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,311,311,311,311,311,311,311,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'GE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,312,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,312,312,312,312,312,312,312,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'GT':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,313,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,313,313,313,313,313,313,313,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'EQ':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,314,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,314,314,314,314,314,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'NE':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,315,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,315,315,315,315,315,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'OR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,317,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,317,317,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'XOR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,318,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,318,-254,318,318,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LAND':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,319,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,319,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'LOR':([127,144,163,180,181,182,186,192,195,196,197,198,200,201,202,203,204,205,206,207,208,209,270,325,326,327,329,330,331,333,334,387,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,424,425,426,427,462,469,470,473,509,514,520,],[-294,-308,-294,-257,320,-259,-238,-271,-283,-284,-285,-286,-295,-296,-297,-298,-299,-300,-301,-302,-303,-305,-257,-279,-280,-260,-261,-262,-263,-304,-306,-287,-239,-240,-241,-242,-243,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-255,-256,-274,-275,-276,-277,-278,-258,-272,-273,-264,-281,-288,-282,]),'ELLIPSIS':([229,],[355,]),} -_lr_action = { } +_lr_action = {} for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): - if not _x in _lr_action: _lr_action[_x] = { } + if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items -_lr_goto_items = {'storage_class_specifier':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,]),'identifier_list_opt':([66,],[106,]),'selection_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[298,298,298,298,298,298,298,298,298,298,298,298,]),'constant':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,]),'unary_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[120,120,120,220,231,234,120,240,120,120,120,231,231,120,120,120,120,120,120,120,120,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,120,231,231,231,120,120,231,120,120,231,120,231,120,120,120,120,120,120,120,231,231,120,120,120,120,120,120,120,120,120,120,120,120,120,]),'conditional_expression':([72,77,103,141,162,164,170,181,192,195,196,213,219,226,227,230,233,257,264,266,281,288,289,297,309,335,373,375,376,380,384,385,393,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[151,151,151,151,151,151,151,305,305,151,151,151,151,151,151,151,151,151,305,151,151,305,151,151,305,151,151,151,151,151,151,151,151,419,151,151,151,151,151,151,151,151,151,151,151,151,151,]),'brace_close':([93,101,172,173,188,189,261,299,362,418,429,],[174,191,302,303,310,311,359,383,404,430,437,]),'struct_or_union_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,]),'unified_wstring_literal':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,]),'abstract_declarator_opt':([110,239,],[199,337,]),'iteration_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[277,277,277,277,277,277,277,277,277,277,277,277,]),'init_declarator_list':([30,86,],[71,71,]),'translation_unit_or_empty':([0,],[8,]),'struct_declaration_list':([57,91,92,],[93,172,173,]),'block_item_list_opt':([170,],[299,]),'enumerator':([64,98,99,190,],[100,100,100,312,]),'pp_directive':([0,22,],[11,11,]),'abstract_declarator':([30,78,86,97,110,167,239,338,],[79,161,79,185,201,161,201,161,]),'declaration_specifiers_opt':([1,14,42,44,],[50,58,83,84,]),'external_declaration':([0,22,],[12,61,]),'type_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[14,14,14,14,14,14,14,94,14,14,14,14,94,94,94,94,94,94,14,14,14,94,94,14,94,94,94,94,14,14,14,]),'designation':([155,362,399,429,],[260,260,260,260,]),'compound_statement':([88,163,170,289,297,375,384,411,423,425,427,441,443,446,],[169,272,282,282,282,282,282,282,282,282,282,282,282,282,]),'pointer':([0,4,22,30,68,78,86,97,110,117,167,239,306,338,],[16,16,16,74,116,74,166,166,74,16,166,339,16,339,]),'type_name':([141,219,229,230,233,],[237,322,331,332,333,]),'unified_string_literal':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,]),'postfix_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,]),'assignment_expression_opt':([72,103,164,],[131,193,273,]),'designation_opt':([155,362,399,429,],[266,402,266,402,]),'expression_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[276,276,276,276,276,276,276,276,276,276,276,276,]),'parameter_declaration':([66,78,165,167,204,338,],[109,109,109,109,320,109,]),'initializer_list_opt':([155,],[261,]),'cast_expression':([72,77,103,134,141,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[132,132,132,232,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,398,132,132,132,132,132,132,132,398,132,132,132,132,132,132,132,132,132,132,132,132,132,132,]),'init_declarator':([30,86,117,],[75,75,205,]),'struct_declarator_list':([97,],[182,]),'unary_operator':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,]),'brace_open':([7,24,54,56,62,63,77,88,162,163,170,266,289,297,336,375,384,390,395,396,402,411,423,425,427,441,443,446,],[57,64,91,92,98,99,155,170,155,170,170,155,170,170,399,170,170,399,399,399,155,170,170,170,170,170,170,170,]),'assignment_operator':([120,],[213,]),'struct_or_union':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,]),'identifier':([66,72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,203,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,263,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,394,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[114,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,318,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,360,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,417,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,]),'struct_declaration':([57,91,92,93,172,173,],[95,95,95,175,175,175,]),'assignment_expression':([72,77,103,141,162,164,170,195,196,213,219,226,227,230,233,257,266,281,289,297,335,373,375,376,380,384,385,393,402,408,411,421,423,425,426,427,432,438,441,443,446,],[136,156,136,238,156,136,238,316,317,321,238,238,328,238,238,238,156,238,238,238,397,238,238,238,238,238,238,416,156,238,238,238,238,238,238,238,238,238,238,238,238,]),'parameter_type_list':([66,78,165,167,338,],[108,159,159,159,159,]),'type_qualifier_list_opt':([28,65,105,],[68,103,196,]),'direct_declarator':([0,4,16,22,30,74,78,86,97,110,117,166,167,306,],[26,26,60,26,26,60,26,26,26,26,26,60,26,26,]),'type_qualifier_list':([28,65,105,],[67,104,67,]),'designator':([155,267,362,399,429,],[262,364,262,262,262,]),'argument_expression_list':([227,],[330,]),'initializer':([77,162,266,402,],[154,271,363,420,]),'specifier_qualifier_list_opt':([94,96,],[178,180,]),'constant_expression':([181,192,264,288,309,],[304,313,361,377,387,]),'expression_opt':([170,289,297,373,375,384,408,411,421,423,425,427,432,438,441,443,446,],[279,279,279,407,279,279,422,279,431,279,279,279,439,442,279,279,279,]),'primary_expression':([72,77,103,127,134,137,141,142,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,336,373,375,376,380,384,385,393,395,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,]),'declaration_specifiers':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[30,52,52,30,52,52,86,110,110,86,86,110,110,86,110,86,110,86,]),'declaration':([0,22,48,80,89,170,289,373,],[31,31,87,87,171,292,292,408,]),'struct_declarator_list_opt':([97,],[183,]),'identifier_list':([66,],[111,]),'typedef_name':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,]),'parameter_type_list_opt':([78,165,167,338,],[160,275,160,160,]),'jump_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[293,293,293,293,293,293,293,293,293,293,293,293,]),'declaration_list_opt':([48,80,],[88,163,]),'struct_declarator':([97,306,],[184,386,]),'function_definition':([0,22,],[36,36,]),'binary_expression':([72,77,103,141,162,164,170,181,192,195,196,213,219,226,227,230,233,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,264,266,281,288,289,297,309,335,373,375,376,380,384,385,393,400,402,408,411,421,423,425,426,427,432,438,441,443,446,],[147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,147,357,358,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,]),'parameter_list':([66,78,165,167,338,],[113,113,113,113,113,]),'init_declarator_list_opt':([30,86,],[73,73,]),'enum_specifier':([0,1,14,22,42,44,48,57,66,78,80,89,91,92,93,94,96,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,]),'decl_body':([0,22,48,80,89,170,289,373,],[41,41,41,41,41,41,41,41,]),'type_qualifier':([0,1,14,22,28,42,44,48,57,65,66,67,78,80,89,91,92,93,94,96,104,105,141,165,167,170,172,173,204,219,229,230,233,289,338,373,],[42,42,42,42,69,42,42,42,96,69,42,115,42,42,42,96,96,96,96,96,115,69,96,42,42,42,96,96,42,96,96,96,96,42,42,42,]),'statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[291,291,382,409,414,424,433,434,436,445,447,448,]),'enumerator_list':([64,98,99,],[101,188,189,]),'labeled_statement':([170,289,297,375,384,411,423,425,427,441,443,446,],[280,280,280,280,280,280,280,280,280,280,280,280,]),'function_specifier':([0,1,14,22,42,44,48,66,78,80,89,165,167,170,204,289,338,373,],[44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,]),'specifier_qualifier_list':([57,91,92,93,94,96,141,172,173,219,229,230,233,],[97,97,97,97,179,179,239,97,97,239,239,239,239,]),'block_item':([170,289,],[295,379,]),'block_item_list':([170,],[289,]),'empty':([0,1,14,28,30,42,44,48,65,66,72,78,80,86,94,96,97,103,105,110,155,164,165,167,170,239,289,297,338,362,373,375,384,399,408,411,421,423,425,427,429,432,438,441,443,446,],[47,51,51,70,76,51,51,85,70,107,150,158,85,76,177,177,186,150,70,200,268,150,158,158,296,200,378,378,158,403,378,378,378,403,378,378,378,378,378,378,403,378,378,378,378,378,]),'translation_unit':([0,],[22,]),'initializer_list':([155,399,],[265,418,]),'declarator':([0,4,22,30,78,86,97,110,117,167,306,],[48,53,48,80,53,168,187,202,168,53,187,]),'direct_abstract_declarator':([30,74,78,86,97,110,166,167,239,338,339,],[81,153,81,81,81,81,153,81,81,81,153,]),'designator_list':([155,362,399,429,],[267,267,267,267,]),'declaration_list':([48,80,],[89,89,]),'expression':([141,170,219,226,230,233,257,281,289,297,373,375,376,380,384,385,408,411,421,423,425,426,427,432,438,441,443,446,],[236,285,236,327,236,236,356,372,285,285,285,285,410,412,285,415,285,285,285,285,285,435,285,285,285,285,285,285,]),} +_lr_goto_items = {'translation_unit_or_empty':([0,],[1,]),'translation_unit':([0,],[2,]),'empty':([0,10,11,17,18,19,22,26,60,61,62,79,80,106,114,115,116,117,126,145,152,172,215,216,217,238,239,267,272,277,282,284,360,361,367,369,370,382,390,397,432,444,445,460,461,463,464,466,498,508,510,512,523,526,],[3,57,69,83,83,83,89,95,69,89,57,95,122,151,95,122,223,95,236,258,266,266,338,223,95,365,95,266,266,236,266,266,95,122,223,223,365,266,365,266,477,223,95,266,477,266,266,266,266,266,477,266,266,266,]),'external_declaration':([0,2,],[4,55,]),'function_definition':([0,2,],[5,5,]),'declaration':([0,2,10,58,62,106,152,284,],[6,6,59,107,59,154,154,397,]),'pp_directive':([0,2,],[7,7,]),'pppragma_directive':([0,2,104,106,139,140,141,152,172,249,251,267,272,282,382,460,463,464,508,523,526,],[8,8,147,162,147,147,147,162,282,147,147,282,282,162,282,282,282,282,282,282,282,]),'id_declarator':([0,2,11,22,24,60,61,71,111,126,129,145,238,378,],[10,10,62,92,93,108,92,93,108,231,108,108,93,108,]),'declaration_specifiers':([0,2,10,58,62,80,106,115,152,229,238,284,361,370,390,],[11,11,60,60,60,126,60,126,60,126,126,60,126,126,126,]),'decl_body':([0,2,10,58,62,106,152,284,],[12,12,12,12,12,12,12,12,]),'direct_id_declarator':([0,2,11,16,22,24,60,61,68,71,111,126,129,145,234,238,364,378,],[15,15,15,81,15,15,15,15,81,15,15,15,15,15,81,15,81,15,]),'pointer':([0,2,11,22,24,60,61,71,94,111,126,129,145,238,277,378,390,],[16,16,68,16,16,68,16,68,132,68,234,68,68,364,389,68,389,]),'type_qualifier':([0,2,10,11,17,18,19,26,58,60,62,79,80,96,104,106,114,115,117,118,126,139,140,141,145,149,152,168,217,218,229,238,239,249,251,271,277,284,328,332,335,360,361,370,390,445,446,],[17,17,17,63,17,17,17,97,17,63,17,97,17,133,97,17,97,17,97,133,63,97,97,97,257,133,17,97,97,133,17,17,97,97,97,97,257,17,97,97,97,97,17,17,17,97,133,]),'storage_class_specifier':([0,2,10,11,17,18,19,58,60,62,80,106,115,126,152,229,238,284,361,370,390,],[18,18,18,64,18,18,18,18,64,18,18,18,18,64,18,18,18,18,18,18,18,]),'function_specifier':([0,2,10,11,17,18,19,58,60,62,80,106,115,126,152,229,238,284,361,370,390,],[19,19,19,65,19,19,19,19,65,19,19,19,19,65,19,19,19,19,19,19,19,]),'type_specifier_no_typeid':([0,2,10,11,22,58,60,61,62,80,104,106,115,126,128,139,140,141,145,149,152,168,229,238,249,251,271,277,284,328,332,335,361,370,390,],[20,20,20,66,20,20,66,20,20,20,20,20,20,66,20,20,20,20,256,20,20,20,20,20,20,20,20,256,20,20,20,20,20,20,20,]),'type_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[21,21,21,87,21,87,21,21,148,21,21,87,148,148,148,263,21,148,21,21,148,148,148,21,148,148,148,21,21,21,]),'declaration_specifiers_no_type':([0,2,10,17,18,19,58,62,80,106,115,152,229,238,284,361,370,390,],[22,22,61,84,84,84,61,61,128,61,128,61,128,128,61,128,128,128,]),'typedef_name':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,]),'enum_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,]),'struct_or_union_specifier':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,]),'struct_or_union':([0,2,10,22,58,61,62,80,104,106,115,128,139,140,141,149,152,168,229,238,249,251,271,284,328,332,335,361,370,390,],[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,]),'declaration_list_opt':([10,62,],[56,109,]),'declaration_list':([10,62,],[58,58,]),'init_declarator_list_opt':([11,60,],[67,67,]),'init_declarator_list':([11,60,],[70,70,]),'init_declarator':([11,60,111,129,],[72,72,211,242,]),'declarator':([11,60,111,129,145,378,],[73,73,73,73,261,261,]),'typeid_declarator':([11,60,71,111,129,145,378,],[74,74,112,74,74,74,74,]),'direct_typeid_declarator':([11,60,68,71,111,129,145,378,],[75,75,110,75,75,75,75,75,]),'declaration_specifiers_no_type_opt':([17,18,19,],[82,85,86,]),'id_init_declarator_list_opt':([22,61,],[88,88,]),'id_init_declarator_list':([22,61,],[90,90,]),'id_init_declarator':([22,61,],[91,91,]),'type_qualifier_list_opt':([26,79,114,117,217,239,360,445,],[94,116,216,225,347,367,444,483,]),'type_qualifier_list':([26,79,104,114,117,139,140,141,168,217,239,249,251,271,328,332,335,360,445,],[96,118,149,218,96,149,149,149,149,96,96,149,149,149,149,149,149,446,96,]),'brace_open':([31,32,56,98,99,102,103,106,109,113,130,152,172,267,272,282,339,382,386,459,460,463,464,472,473,476,508,523,526,],[100,104,106,134,135,139,140,106,106,215,215,106,106,106,106,106,215,106,461,461,106,106,106,461,461,215,106,106,106,]),'compound_statement':([56,106,109,152,172,267,272,282,382,460,463,464,508,523,526,],[105,158,210,158,158,158,158,158,158,158,158,158,158,158,158,]),'parameter_type_list':([80,115,238,361,370,390,],[119,219,366,447,366,366,]),'identifier_list_opt':([80,115,361,],[120,220,448,]),'parameter_list':([80,115,238,361,370,390,],[121,121,121,121,121,121,]),'identifier_list':([80,115,361,],[123,123,123,]),'parameter_declaration':([80,115,229,238,361,370,390,],[124,124,356,124,124,124,124,]),'identifier':([80,106,113,115,116,130,152,164,168,172,177,183,184,185,187,216,225,226,230,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,344,347,348,361,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,474,476,483,484,498,508,512,515,516,523,526,],[125,195,195,125,195,195,195,195,195,195,195,195,195,195,195,195,195,195,357,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,437,195,195,125,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,502,195,195,195,195,195,195,524,195,195,195,]),'enumerator_list':([100,134,135,],[136,244,245,]),'enumerator':([100,134,135,247,],[137,137,137,373,]),'struct_declaration_list':([104,139,140,],[141,249,251,]),'brace_close':([104,136,139,140,141,150,244,245,249,251,336,432,493,510,],[142,246,250,252,253,264,371,372,375,376,431,475,509,520,]),'struct_declaration':([104,139,140,141,249,251,],[143,143,143,254,254,254,]),'specifier_qualifier_list':([104,139,140,141,168,249,251,271,328,332,335,],[145,145,145,145,277,145,145,277,277,277,277,]),'block_item_list_opt':([106,],[150,]),'block_item_list':([106,],[152,]),'block_item':([106,152,],[153,265,]),'statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[155,155,283,283,283,395,283,492,283,283,283,283,283,]),'labeled_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[156,156,156,156,156,156,156,156,156,156,156,156,156,]),'expression_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[157,157,157,157,157,157,157,157,157,157,157,157,157,]),'selection_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[159,159,159,159,159,159,159,159,159,159,159,159,159,]),'iteration_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[160,160,160,160,160,160,160,160,160,160,160,160,160,]),'jump_statement':([106,152,172,267,272,282,382,460,463,464,508,523,526,],[161,161,161,161,161,161,161,161,161,161,161,161,161,]),'expression_opt':([106,152,172,267,272,282,284,382,397,460,463,464,466,498,508,512,523,526,],[166,166,166,166,166,166,396,166,467,166,166,166,497,513,166,522,166,166,]),'expression':([106,152,168,172,177,267,271,272,274,279,280,282,284,302,321,328,332,382,397,460,463,464,465,466,498,508,512,516,523,526,],[169,169,276,169,288,169,276,169,385,392,393,169,169,401,420,276,276,169,169,169,169,169,496,169,169,169,169,525,169,169,]),'assignment_expression':([106,113,116,130,152,168,172,177,216,225,226,267,271,272,274,278,279,280,282,284,290,302,321,322,328,332,339,347,348,367,369,382,397,444,460,463,464,465,466,471,476,483,484,498,508,512,516,523,526,],[178,214,224,214,178,178,178,178,224,353,354,178,178,178,178,391,178,178,178,178,400,178,178,423,178,178,214,440,441,224,224,178,178,224,178,178,178,178,178,500,214,506,507,178,178,178,178,178,178,]),'conditional_expression':([106,113,116,130,152,164,168,172,177,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,321,322,328,332,339,343,347,348,367,369,379,382,397,444,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[179,179,179,179,179,269,179,179,179,179,179,179,269,269,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,269,179,179,179,179,269,179,179,179,179,179,179,179,179,499,179,179,179,179,179,179,179,179,179,179,]),'unary_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[180,180,180,180,180,270,180,180,180,327,329,270,331,180,180,180,270,270,180,180,180,180,180,180,180,180,180,180,180,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,180,180,180,180,180,270,180,180,180,180,270,180,270,180,180,270,180,180,180,180,180,270,180,180,180,180,180,180,180,180,180,180,]),'binary_expression':([106,113,116,130,152,164,168,172,177,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,397,444,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,]),'postfix_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,]),'unary_operator':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,]),'cast_expression':([106,113,116,130,152,164,168,172,177,185,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[186,186,186,186,186,186,186,186,186,330,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,462,186,186,462,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,]),'primary_expression':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,]),'constant':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,]),'unified_string_literal':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,]),'unified_wstring_literal':([106,113,116,130,152,164,168,172,177,183,184,185,187,216,225,226,248,262,267,271,272,274,278,279,280,282,284,290,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,328,332,339,343,347,348,367,369,379,382,386,397,444,459,460,463,464,465,466,468,471,476,483,484,498,508,512,516,523,526,],[198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,]),'initializer':([113,130,339,476,],[213,243,433,503,]),'assignment_expression_opt':([116,216,367,369,444,],[221,345,451,453,481,]),'typeid_noparen_declarator':([126,],[232,]),'abstract_declarator_opt':([126,277,],[233,388,]),'direct_typeid_noparen_declarator':([126,234,],[235,358,]),'abstract_declarator':([126,238,277,390,],[237,362,237,362,]),'direct_abstract_declarator':([126,234,238,277,364,389,390,],[241,359,241,241,359,359,241,]),'struct_declarator_list_opt':([145,],[255,]),'struct_declarator_list':([145,],[259,]),'struct_declarator':([145,378,],[260,456,]),'constant_expression':([164,248,262,343,379,],[268,374,380,436,457,]),'type_name':([168,271,328,332,335,],[275,383,428,429,430,]),'pragmacomp_or_statement':([172,267,272,382,460,463,464,508,523,526,],[281,381,384,458,491,494,495,519,527,529,]),'assignment_operator':([180,],[290,]),'initializer_list_opt':([215,],[336,]),'initializer_list':([215,461,],[337,493,]),'designation_opt':([215,432,461,510,],[339,476,339,476,]),'designation':([215,432,461,510,],[340,340,340,340,]),'designator_list':([215,432,461,510,],[341,341,341,341,]),'designator':([215,341,432,461,510,],[342,435,342,342,342,]),'parameter_type_list_opt':([238,370,390,],[363,455,363,]),'argument_expression_list':([322,],[421,]),'offsetof_member_designator':([474,],[501,]),} -_lr_goto = { } +_lr_goto = {} for _k, _v in _lr_goto_items.items(): - for _x,_y in zip(_v[0],_v[1]): - if not _x in _lr_goto: _lr_goto[_x] = { } + for _x, _y in zip(_v[0], _v[1]): + if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> translation_unit_or_empty","S'",1,None,None,None), - ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','../pycparser/plyparser.py',42), - ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','../pycparser/plyparser.py',43), - ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','../pycparser/plyparser.py',42), - ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','../pycparser/plyparser.py',43), - ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','../pycparser/plyparser.py',42), - ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','../pycparser/plyparser.py',43), - ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','../pycparser/plyparser.py',42), - ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','../pycparser/plyparser.py',43), - ('declaration_specifiers_opt -> empty','declaration_specifiers_opt',1,'p_declaration_specifiers_opt','../pycparser/plyparser.py',42), - ('declaration_specifiers_opt -> declaration_specifiers','declaration_specifiers_opt',1,'p_declaration_specifiers_opt','../pycparser/plyparser.py',43), - ('designation_opt -> empty','designation_opt',1,'p_designation_opt','../pycparser/plyparser.py',42), - ('designation_opt -> designation','designation_opt',1,'p_designation_opt','../pycparser/plyparser.py',43), - ('expression_opt -> empty','expression_opt',1,'p_expression_opt','../pycparser/plyparser.py',42), - ('expression_opt -> expression','expression_opt',1,'p_expression_opt','../pycparser/plyparser.py',43), - ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','../pycparser/plyparser.py',42), - ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','../pycparser/plyparser.py',43), - ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','../pycparser/plyparser.py',42), - ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','../pycparser/plyparser.py',43), - ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','../pycparser/plyparser.py',42), - ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','../pycparser/plyparser.py',43), - ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','../pycparser/plyparser.py',42), - ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','../pycparser/plyparser.py',43), - ('specifier_qualifier_list_opt -> empty','specifier_qualifier_list_opt',1,'p_specifier_qualifier_list_opt','../pycparser/plyparser.py',42), - ('specifier_qualifier_list_opt -> specifier_qualifier_list','specifier_qualifier_list_opt',1,'p_specifier_qualifier_list_opt','../pycparser/plyparser.py',43), - ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','../pycparser/plyparser.py',42), - ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','../pycparser/plyparser.py',43), - ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','../pycparser/plyparser.py',42), - ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','../pycparser/plyparser.py',43), - ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','../pycparser/c_parser.py',494), - ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','../pycparser/c_parser.py',495), - ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','../pycparser/c_parser.py',503), - ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','../pycparser/c_parser.py',510), - ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','../pycparser/c_parser.py',522), - ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','../pycparser/c_parser.py',527), - ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','../pycparser/c_parser.py',532), - ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','../pycparser/c_parser.py',537), - ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','../pycparser/c_parser.py',542), - ('function_definition -> declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','../pycparser/c_parser.py',551), - ('function_definition -> declaration_specifiers declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','../pycparser/c_parser.py',568), - ('statement -> labeled_statement','statement',1,'p_statement','../pycparser/c_parser.py',579), - ('statement -> expression_statement','statement',1,'p_statement','../pycparser/c_parser.py',580), - ('statement -> compound_statement','statement',1,'p_statement','../pycparser/c_parser.py',581), - ('statement -> selection_statement','statement',1,'p_statement','../pycparser/c_parser.py',582), - ('statement -> iteration_statement','statement',1,'p_statement','../pycparser/c_parser.py',583), - ('statement -> jump_statement','statement',1,'p_statement','../pycparser/c_parser.py',584), - ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','../pycparser/c_parser.py',598), - ('declaration -> decl_body SEMI','declaration',2,'p_declaration','../pycparser/c_parser.py',657), - ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','../pycparser/c_parser.py',666), - ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','../pycparser/c_parser.py',667), - ('declaration_specifiers -> type_qualifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_1','../pycparser/c_parser.py',672), - ('declaration_specifiers -> type_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_2','../pycparser/c_parser.py',677), - ('declaration_specifiers -> storage_class_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_3','../pycparser/c_parser.py',682), - ('declaration_specifiers -> function_specifier declaration_specifiers_opt','declaration_specifiers',2,'p_declaration_specifiers_4','../pycparser/c_parser.py',687), - ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',692), - ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',693), - ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',694), - ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',695), - ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','../pycparser/c_parser.py',696), - ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','../pycparser/c_parser.py',701), - ('type_specifier -> VOID','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',706), - ('type_specifier -> _BOOL','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',707), - ('type_specifier -> CHAR','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',708), - ('type_specifier -> SHORT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',709), - ('type_specifier -> INT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',710), - ('type_specifier -> LONG','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',711), - ('type_specifier -> FLOAT','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',712), - ('type_specifier -> DOUBLE','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',713), - ('type_specifier -> _COMPLEX','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',714), - ('type_specifier -> SIGNED','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',715), - ('type_specifier -> UNSIGNED','type_specifier',1,'p_type_specifier_1','../pycparser/c_parser.py',716), - ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',721), - ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',722), - ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier_2','../pycparser/c_parser.py',723), - ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',728), - ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',729), - ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','../pycparser/c_parser.py',730), - ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list_1','../pycparser/c_parser.py',735), - ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list_1','../pycparser/c_parser.py',736), - ('init_declarator_list -> EQUALS initializer','init_declarator_list',2,'p_init_declarator_list_2','../pycparser/c_parser.py',746), - ('init_declarator_list -> abstract_declarator','init_declarator_list',1,'p_init_declarator_list_3','../pycparser/c_parser.py',754), - ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','../pycparser/c_parser.py',762), - ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','../pycparser/c_parser.py',763), - ('specifier_qualifier_list -> type_qualifier specifier_qualifier_list_opt','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','../pycparser/c_parser.py',768), - ('specifier_qualifier_list -> type_specifier specifier_qualifier_list_opt','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','../pycparser/c_parser.py',773), - ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','../pycparser/c_parser.py',781), - ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','../pycparser/c_parser.py',782), - ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','../pycparser/c_parser.py',791), - ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','../pycparser/c_parser.py',800), - ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','../pycparser/c_parser.py',801), - ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','../pycparser/c_parser.py',810), - ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','../pycparser/c_parser.py',811), - ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','../pycparser/c_parser.py',818), - ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','../pycparser/c_parser.py',819), - ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','../pycparser/c_parser.py',824), - ('struct_declaration -> specifier_qualifier_list abstract_declarator SEMI','struct_declaration',3,'p_struct_declaration_2','../pycparser/c_parser.py',862), - ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','../pycparser/c_parser.py',876), - ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','../pycparser/c_parser.py',877), - ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','../pycparser/c_parser.py',885), - ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','../pycparser/c_parser.py',890), - ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','../pycparser/c_parser.py',891), - ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','../pycparser/c_parser.py',899), - ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','../pycparser/c_parser.py',900), - ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','../pycparser/c_parser.py',905), - ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','../pycparser/c_parser.py',910), - ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','../pycparser/c_parser.py',911), - ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','../pycparser/c_parser.py',916), - ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','../pycparser/c_parser.py',917), - ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','../pycparser/c_parser.py',918), - ('enumerator -> ID','enumerator',1,'p_enumerator','../pycparser/c_parser.py',929), - ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','../pycparser/c_parser.py',930), - ('declarator -> direct_declarator','declarator',1,'p_declarator_1','../pycparser/c_parser.py',945), - ('declarator -> pointer direct_declarator','declarator',2,'p_declarator_2','../pycparser/c_parser.py',950), - ('declarator -> pointer TYPEID','declarator',2,'p_declarator_3','../pycparser/c_parser.py',959), - ('direct_declarator -> ID','direct_declarator',1,'p_direct_declarator_1','../pycparser/c_parser.py',970), - ('direct_declarator -> LPAREN declarator RPAREN','direct_declarator',3,'p_direct_declarator_2','../pycparser/c_parser.py',979), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_declarator',5,'p_direct_declarator_3','../pycparser/c_parser.py',984), - ('direct_declarator -> direct_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_declarator',6,'p_direct_declarator_4','../pycparser/c_parser.py',998), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_declarator',6,'p_direct_declarator_4','../pycparser/c_parser.py',999), - ('direct_declarator -> direct_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_declarator',5,'p_direct_declarator_5','../pycparser/c_parser.py',1019), - ('direct_declarator -> direct_declarator LPAREN parameter_type_list RPAREN','direct_declarator',4,'p_direct_declarator_6','../pycparser/c_parser.py',1030), - ('direct_declarator -> direct_declarator LPAREN identifier_list_opt RPAREN','direct_declarator',4,'p_direct_declarator_6','../pycparser/c_parser.py',1031), - ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','../pycparser/c_parser.py',1058), - ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','../pycparser/c_parser.py',1059), - ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','../pycparser/c_parser.py',1088), - ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','../pycparser/c_parser.py',1089), - ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','../pycparser/c_parser.py',1094), - ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','../pycparser/c_parser.py',1095), - ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','../pycparser/c_parser.py',1103), - ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','../pycparser/c_parser.py',1104), - ('parameter_declaration -> declaration_specifiers declarator','parameter_declaration',2,'p_parameter_declaration_1','../pycparser/c_parser.py',1113), - ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','../pycparser/c_parser.py',1124), - ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','../pycparser/c_parser.py',1155), - ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','../pycparser/c_parser.py',1156), - ('initializer -> assignment_expression','initializer',1,'p_initializer_1','../pycparser/c_parser.py',1165), - ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','../pycparser/c_parser.py',1170), - ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','../pycparser/c_parser.py',1171), - ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','../pycparser/c_parser.py',1179), - ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','../pycparser/c_parser.py',1180), - ('designation -> designator_list EQUALS','designation',2,'p_designation','../pycparser/c_parser.py',1191), - ('designator_list -> designator','designator_list',1,'p_designator_list','../pycparser/c_parser.py',1199), - ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','../pycparser/c_parser.py',1200), - ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','../pycparser/c_parser.py',1205), - ('designator -> PERIOD identifier','designator',2,'p_designator','../pycparser/c_parser.py',1206), - ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','../pycparser/c_parser.py',1211), - ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','../pycparser/c_parser.py',1228), - ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','../pycparser/c_parser.py',1236), - ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','../pycparser/c_parser.py',1241), - ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','../pycparser/c_parser.py',1251), - ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','../pycparser/c_parser.py',1255), - ('direct_abstract_declarator -> LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_3','../pycparser/c_parser.py',1266), - ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','../pycparser/c_parser.py',1275), - ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','../pycparser/c_parser.py',1286), - ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','../pycparser/c_parser.py',1295), - ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','../pycparser/c_parser.py',1305), - ('block_item -> declaration','block_item',1,'p_block_item','../pycparser/c_parser.py',1316), - ('block_item -> statement','block_item',1,'p_block_item','../pycparser/c_parser.py',1317), - ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','../pycparser/c_parser.py',1324), - ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','../pycparser/c_parser.py',1325), - ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','../pycparser/c_parser.py',1331), - ('labeled_statement -> ID COLON statement','labeled_statement',3,'p_labeled_statement_1','../pycparser/c_parser.py',1337), - ('labeled_statement -> CASE constant_expression COLON statement','labeled_statement',4,'p_labeled_statement_2','../pycparser/c_parser.py',1341), - ('labeled_statement -> DEFAULT COLON statement','labeled_statement',3,'p_labeled_statement_3','../pycparser/c_parser.py',1345), - ('selection_statement -> IF LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_1','../pycparser/c_parser.py',1349), - ('selection_statement -> IF LPAREN expression RPAREN statement ELSE statement','selection_statement',7,'p_selection_statement_2','../pycparser/c_parser.py',1353), - ('selection_statement -> SWITCH LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_3','../pycparser/c_parser.py',1357), - ('iteration_statement -> WHILE LPAREN expression RPAREN statement','iteration_statement',5,'p_iteration_statement_1','../pycparser/c_parser.py',1362), - ('iteration_statement -> DO statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','../pycparser/c_parser.py',1366), - ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement','iteration_statement',9,'p_iteration_statement_3','../pycparser/c_parser.py',1370), - ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN statement','iteration_statement',8,'p_iteration_statement_4','../pycparser/c_parser.py',1374), - ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','../pycparser/c_parser.py',1379), - ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','../pycparser/c_parser.py',1383), - ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','../pycparser/c_parser.py',1387), - ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','../pycparser/c_parser.py',1391), - ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','../pycparser/c_parser.py',1392), - ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','../pycparser/c_parser.py',1397), - ('expression -> assignment_expression','expression',1,'p_expression','../pycparser/c_parser.py',1404), - ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','../pycparser/c_parser.py',1405), - ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','../pycparser/c_parser.py',1417), - ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','../pycparser/c_parser.py',1421), - ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','../pycparser/c_parser.py',1422), - ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1435), - ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1436), - ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1437), - ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1438), - ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1439), - ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1440), - ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1441), - ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1442), - ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1443), - ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1444), - ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','../pycparser/c_parser.py',1445), - ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','../pycparser/c_parser.py',1450), - ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','../pycparser/c_parser.py',1454), - ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','../pycparser/c_parser.py',1455), - ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','../pycparser/c_parser.py',1463), - ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1464), - ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1465), - ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1466), - ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1467), - ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1468), - ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1469), - ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1470), - ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1471), - ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1472), - ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1473), - ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1474), - ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1475), - ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1476), - ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1477), - ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1478), - ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1479), - ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1480), - ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','../pycparser/c_parser.py',1481), - ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','../pycparser/c_parser.py',1489), - ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','../pycparser/c_parser.py',1493), - ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','../pycparser/c_parser.py',1497), - ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1501), - ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1502), - ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','../pycparser/c_parser.py',1503), - ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','../pycparser/c_parser.py',1508), - ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','../pycparser/c_parser.py',1509), - ('unary_operator -> AND','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1517), - ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1518), - ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1519), - ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1520), - ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1521), - ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','../pycparser/c_parser.py',1522), - ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','../pycparser/c_parser.py',1527), - ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','../pycparser/c_parser.py',1531), - ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','../pycparser/c_parser.py',1535), - ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','../pycparser/c_parser.py',1536), - ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1541), - ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1542), - ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1543), - ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','../pycparser/c_parser.py',1544), - ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','../pycparser/c_parser.py',1550), - ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','../pycparser/c_parser.py',1551), - ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','../pycparser/c_parser.py',1556), - ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','../pycparser/c_parser.py',1557), - ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','../pycparser/c_parser.py',1562), - ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','../pycparser/c_parser.py',1566), - ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','../pycparser/c_parser.py',1570), - ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','../pycparser/c_parser.py',1571), - ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','../pycparser/c_parser.py',1576), - ('primary_expression -> OFFSETOF LPAREN type_name COMMA identifier RPAREN','primary_expression',6,'p_primary_expression_5','../pycparser/c_parser.py',1580), - ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','../pycparser/c_parser.py',1588), - ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','../pycparser/c_parser.py',1589), - ('identifier -> ID','identifier',1,'p_identifier','../pycparser/c_parser.py',1598), - ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','../pycparser/c_parser.py',1602), - ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','../pycparser/c_parser.py',1603), - ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','../pycparser/c_parser.py',1604), - ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','../pycparser/c_parser.py',1605), - ('constant -> FLOAT_CONST','constant',1,'p_constant_2','../pycparser/c_parser.py',1611), - ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','../pycparser/c_parser.py',1612), - ('constant -> CHAR_CONST','constant',1,'p_constant_3','../pycparser/c_parser.py',1618), - ('constant -> WCHAR_CONST','constant',1,'p_constant_3','../pycparser/c_parser.py',1619), - ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','../pycparser/c_parser.py',1630), - ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','../pycparser/c_parser.py',1631), - ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','../pycparser/c_parser.py',1641), - ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','../pycparser/c_parser.py',1642), - ('brace_open -> LBRACE','brace_open',1,'p_brace_open','../pycparser/c_parser.py',1652), - ('brace_close -> RBRACE','brace_close',1,'p_brace_close','../pycparser/c_parser.py',1657), - ('empty -> ','empty',0,'p_empty','../pycparser/c_parser.py',1662), + ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',43), + ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',44), + ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',43), + ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',44), + ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',43), + ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',44), + ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',43), + ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',44), + ('declaration_specifiers_no_type_opt -> empty','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',43), + ('declaration_specifiers_no_type_opt -> declaration_specifiers_no_type','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',44), + ('designation_opt -> empty','designation_opt',1,'p_designation_opt','plyparser.py',43), + ('designation_opt -> designation','designation_opt',1,'p_designation_opt','plyparser.py',44), + ('expression_opt -> empty','expression_opt',1,'p_expression_opt','plyparser.py',43), + ('expression_opt -> expression','expression_opt',1,'p_expression_opt','plyparser.py',44), + ('id_init_declarator_list_opt -> empty','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',43), + ('id_init_declarator_list_opt -> id_init_declarator_list','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',44), + ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',43), + ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',44), + ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',43), + ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',44), + ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',43), + ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',44), + ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',43), + ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',44), + ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',43), + ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',44), + ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',43), + ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',44), + ('direct_id_declarator -> ID','direct_id_declarator',1,'p_direct_id_declarator_1','plyparser.py',126), + ('direct_id_declarator -> LPAREN id_declarator RPAREN','direct_id_declarator',3,'p_direct_id_declarator_2','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_3','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',127), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_5','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN parameter_type_list RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN identifier_list_opt RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',127), + ('direct_typeid_declarator -> TYPEID','direct_typeid_declarator',1,'p_direct_typeid_declarator_1','plyparser.py',126), + ('direct_typeid_declarator -> LPAREN typeid_declarator RPAREN','direct_typeid_declarator',3,'p_direct_typeid_declarator_2','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_3','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',127), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_5','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN parameter_type_list RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',127), + ('direct_typeid_noparen_declarator -> TYPEID','direct_typeid_noparen_declarator',1,'p_direct_typeid_noparen_declarator_1','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_3','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',127), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_5','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',127), + ('id_declarator -> direct_id_declarator','id_declarator',1,'p_id_declarator_1','plyparser.py',126), + ('id_declarator -> pointer direct_id_declarator','id_declarator',2,'p_id_declarator_2','plyparser.py',126), + ('typeid_declarator -> direct_typeid_declarator','typeid_declarator',1,'p_typeid_declarator_1','plyparser.py',126), + ('typeid_declarator -> pointer direct_typeid_declarator','typeid_declarator',2,'p_typeid_declarator_2','plyparser.py',126), + ('typeid_noparen_declarator -> direct_typeid_noparen_declarator','typeid_noparen_declarator',1,'p_typeid_noparen_declarator_1','plyparser.py',126), + ('typeid_noparen_declarator -> pointer direct_typeid_noparen_declarator','typeid_noparen_declarator',2,'p_typeid_noparen_declarator_2','plyparser.py',126), + ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',514), + ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',515), + ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','c_parser.py',523), + ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','c_parser.py',530), + ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','c_parser.py',541), + ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','c_parser.py',546), + ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',551), + ('external_declaration -> pppragma_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',552), + ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','c_parser.py',557), + ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','c_parser.py',562), + ('pppragma_directive -> PPPRAGMA','pppragma_directive',1,'p_pppragma_directive','c_parser.py',568), + ('pppragma_directive -> PPPRAGMA PPPRAGMASTR','pppragma_directive',2,'p_pppragma_directive','c_parser.py',569), + ('function_definition -> id_declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','c_parser.py',580), + ('function_definition -> declaration_specifiers id_declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','c_parser.py',597), + ('statement -> labeled_statement','statement',1,'p_statement','c_parser.py',608), + ('statement -> expression_statement','statement',1,'p_statement','c_parser.py',609), + ('statement -> compound_statement','statement',1,'p_statement','c_parser.py',610), + ('statement -> selection_statement','statement',1,'p_statement','c_parser.py',611), + ('statement -> iteration_statement','statement',1,'p_statement','c_parser.py',612), + ('statement -> jump_statement','statement',1,'p_statement','c_parser.py',613), + ('statement -> pppragma_directive','statement',1,'p_statement','c_parser.py',614), + ('pragmacomp_or_statement -> pppragma_directive statement','pragmacomp_or_statement',2,'p_pragmacomp_or_statement','c_parser.py',661), + ('pragmacomp_or_statement -> statement','pragmacomp_or_statement',1,'p_pragmacomp_or_statement','c_parser.py',662), + ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',681), + ('decl_body -> declaration_specifiers_no_type id_init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',682), + ('declaration -> decl_body SEMI','declaration',2,'p_declaration','c_parser.py',741), + ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','c_parser.py',750), + ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','c_parser.py',751), + ('declaration_specifiers_no_type -> type_qualifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_1','c_parser.py',761), + ('declaration_specifiers_no_type -> storage_class_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_2','c_parser.py',766), + ('declaration_specifiers_no_type -> function_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_3','c_parser.py',771), + ('declaration_specifiers -> declaration_specifiers type_qualifier','declaration_specifiers',2,'p_declaration_specifiers_1','c_parser.py',777), + ('declaration_specifiers -> declaration_specifiers storage_class_specifier','declaration_specifiers',2,'p_declaration_specifiers_2','c_parser.py',782), + ('declaration_specifiers -> declaration_specifiers function_specifier','declaration_specifiers',2,'p_declaration_specifiers_3','c_parser.py',787), + ('declaration_specifiers -> declaration_specifiers type_specifier_no_typeid','declaration_specifiers',2,'p_declaration_specifiers_4','c_parser.py',792), + ('declaration_specifiers -> type_specifier','declaration_specifiers',1,'p_declaration_specifiers_5','c_parser.py',797), + ('declaration_specifiers -> declaration_specifiers_no_type type_specifier','declaration_specifiers',2,'p_declaration_specifiers_6','c_parser.py',802), + ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',808), + ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',809), + ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',810), + ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',811), + ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',812), + ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','c_parser.py',817), + ('type_specifier_no_typeid -> VOID','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',822), + ('type_specifier_no_typeid -> _BOOL','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',823), + ('type_specifier_no_typeid -> CHAR','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',824), + ('type_specifier_no_typeid -> SHORT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',825), + ('type_specifier_no_typeid -> INT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',826), + ('type_specifier_no_typeid -> LONG','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',827), + ('type_specifier_no_typeid -> FLOAT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',828), + ('type_specifier_no_typeid -> DOUBLE','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',829), + ('type_specifier_no_typeid -> _COMPLEX','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',830), + ('type_specifier_no_typeid -> SIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',831), + ('type_specifier_no_typeid -> UNSIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',832), + ('type_specifier_no_typeid -> __INT128','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',833), + ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier','c_parser.py',838), + ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier','c_parser.py',839), + ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier','c_parser.py',840), + ('type_specifier -> type_specifier_no_typeid','type_specifier',1,'p_type_specifier','c_parser.py',841), + ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','c_parser.py',846), + ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','c_parser.py',847), + ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','c_parser.py',848), + ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list','c_parser.py',853), + ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list','c_parser.py',854), + ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','c_parser.py',862), + ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','c_parser.py',863), + ('id_init_declarator_list -> id_init_declarator','id_init_declarator_list',1,'p_id_init_declarator_list','c_parser.py',868), + ('id_init_declarator_list -> id_init_declarator_list COMMA init_declarator','id_init_declarator_list',3,'p_id_init_declarator_list','c_parser.py',869), + ('id_init_declarator -> id_declarator','id_init_declarator',1,'p_id_init_declarator','c_parser.py',874), + ('id_init_declarator -> id_declarator EQUALS initializer','id_init_declarator',3,'p_id_init_declarator','c_parser.py',875), + ('specifier_qualifier_list -> specifier_qualifier_list type_specifier_no_typeid','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','c_parser.py',882), + ('specifier_qualifier_list -> specifier_qualifier_list type_qualifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','c_parser.py',887), + ('specifier_qualifier_list -> type_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_3','c_parser.py',892), + ('specifier_qualifier_list -> type_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_4','c_parser.py',897), + ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',906), + ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',907), + ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','c_parser.py',917), + ('struct_or_union_specifier -> struct_or_union brace_open brace_close','struct_or_union_specifier',3,'p_struct_or_union_specifier_2','c_parser.py',918), + ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',935), + ('struct_or_union_specifier -> struct_or_union ID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',936), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',937), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',938), + ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','c_parser.py',954), + ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','c_parser.py',955), + ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','c_parser.py',962), + ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','c_parser.py',963), + ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','c_parser.py',971), + ('struct_declaration -> SEMI','struct_declaration',1,'p_struct_declaration_2','c_parser.py',1009), + ('struct_declaration -> pppragma_directive','struct_declaration',1,'p_struct_declaration_3','c_parser.py',1014), + ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','c_parser.py',1019), + ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','c_parser.py',1020), + ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','c_parser.py',1028), + ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','c_parser.py',1033), + ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','c_parser.py',1034), + ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1042), + ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1043), + ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','c_parser.py',1048), + ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1053), + ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1054), + ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','c_parser.py',1059), + ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','c_parser.py',1060), + ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','c_parser.py',1061), + ('enumerator -> ID','enumerator',1,'p_enumerator','c_parser.py',1072), + ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','c_parser.py',1073), + ('declarator -> id_declarator','declarator',1,'p_declarator','c_parser.py',1088), + ('declarator -> typeid_declarator','declarator',1,'p_declarator','c_parser.py',1089), + ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','c_parser.py',1200), + ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','c_parser.py',1201), + ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','c_parser.py',1230), + ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','c_parser.py',1231), + ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','c_parser.py',1236), + ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','c_parser.py',1237), + ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','c_parser.py',1245), + ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','c_parser.py',1246), + ('parameter_declaration -> declaration_specifiers id_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1265), + ('parameter_declaration -> declaration_specifiers typeid_noparen_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1266), + ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','c_parser.py',1277), + ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','c_parser.py',1308), + ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','c_parser.py',1309), + ('initializer -> assignment_expression','initializer',1,'p_initializer_1','c_parser.py',1318), + ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','c_parser.py',1323), + ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','c_parser.py',1324), + ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','c_parser.py',1332), + ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','c_parser.py',1333), + ('designation -> designator_list EQUALS','designation',2,'p_designation','c_parser.py',1344), + ('designator_list -> designator','designator_list',1,'p_designator_list','c_parser.py',1352), + ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','c_parser.py',1353), + ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','c_parser.py',1358), + ('designator -> PERIOD identifier','designator',2,'p_designator','c_parser.py',1359), + ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','c_parser.py',1364), + ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','c_parser.py',1375), + ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','c_parser.py',1383), + ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','c_parser.py',1388), + ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','c_parser.py',1398), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','c_parser.py',1402), + ('direct_abstract_declarator -> LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_3','c_parser.py',1413), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','c_parser.py',1423), + ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','c_parser.py',1434), + ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','c_parser.py',1443), + ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','c_parser.py',1453), + ('block_item -> declaration','block_item',1,'p_block_item','c_parser.py',1464), + ('block_item -> statement','block_item',1,'p_block_item','c_parser.py',1465), + ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','c_parser.py',1472), + ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','c_parser.py',1473), + ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','c_parser.py',1479), + ('labeled_statement -> ID COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_1','c_parser.py',1485), + ('labeled_statement -> CASE constant_expression COLON pragmacomp_or_statement','labeled_statement',4,'p_labeled_statement_2','c_parser.py',1489), + ('labeled_statement -> DEFAULT COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_3','c_parser.py',1493), + ('selection_statement -> IF LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_1','c_parser.py',1497), + ('selection_statement -> IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement','selection_statement',7,'p_selection_statement_2','c_parser.py',1501), + ('selection_statement -> SWITCH LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_3','c_parser.py',1505), + ('iteration_statement -> WHILE LPAREN expression RPAREN pragmacomp_or_statement','iteration_statement',5,'p_iteration_statement_1','c_parser.py',1510), + ('iteration_statement -> DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','c_parser.py',1514), + ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',9,'p_iteration_statement_3','c_parser.py',1518), + ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',8,'p_iteration_statement_4','c_parser.py',1522), + ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','c_parser.py',1527), + ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','c_parser.py',1531), + ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','c_parser.py',1535), + ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','c_parser.py',1539), + ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','c_parser.py',1540), + ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','c_parser.py',1545), + ('expression -> assignment_expression','expression',1,'p_expression','c_parser.py',1552), + ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','c_parser.py',1553), + ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','c_parser.py',1565), + ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','c_parser.py',1569), + ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','c_parser.py',1570), + ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','c_parser.py',1583), + ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1584), + ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1585), + ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1586), + ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1587), + ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1588), + ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1589), + ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1590), + ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1591), + ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1592), + ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1593), + ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','c_parser.py',1598), + ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','c_parser.py',1602), + ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','c_parser.py',1603), + ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','c_parser.py',1611), + ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1612), + ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1613), + ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1614), + ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1615), + ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1616), + ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1617), + ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1618), + ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1619), + ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1620), + ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1621), + ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1622), + ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1623), + ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1624), + ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1625), + ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1626), + ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1627), + ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1628), + ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1629), + ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','c_parser.py',1637), + ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','c_parser.py',1641), + ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','c_parser.py',1645), + ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1649), + ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1650), + ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1651), + ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','c_parser.py',1656), + ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1657), + ('unary_operator -> AND','unary_operator',1,'p_unary_operator','c_parser.py',1665), + ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','c_parser.py',1666), + ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','c_parser.py',1667), + ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','c_parser.py',1668), + ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','c_parser.py',1669), + ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','c_parser.py',1670), + ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','c_parser.py',1675), + ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','c_parser.py',1679), + ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','c_parser.py',1683), + ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','c_parser.py',1684), + ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1689), + ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1690), + ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1691), + ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1692), + ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1698), + ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1699), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','c_parser.py',1704), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','c_parser.py',1705), + ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','c_parser.py',1710), + ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','c_parser.py',1714), + ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1718), + ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1719), + ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','c_parser.py',1724), + ('primary_expression -> OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN','primary_expression',6,'p_primary_expression_5','c_parser.py',1728), + ('offsetof_member_designator -> identifier','offsetof_member_designator',1,'p_offsetof_member_designator','c_parser.py',1736), + ('offsetof_member_designator -> offsetof_member_designator PERIOD identifier','offsetof_member_designator',3,'p_offsetof_member_designator','c_parser.py',1737), + ('offsetof_member_designator -> offsetof_member_designator LBRACKET expression RBRACKET','offsetof_member_designator',4,'p_offsetof_member_designator','c_parser.py',1738), + ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','c_parser.py',1751), + ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','c_parser.py',1752), + ('identifier -> ID','identifier',1,'p_identifier','c_parser.py',1761), + ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','c_parser.py',1765), + ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','c_parser.py',1766), + ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','c_parser.py',1767), + ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','c_parser.py',1768), + ('constant -> FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1787), + ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1788), + ('constant -> CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1804), + ('constant -> WCHAR_CONST','constant',1,'p_constant_3','c_parser.py',1805), + ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','c_parser.py',1816), + ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','c_parser.py',1817), + ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1827), + ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1828), + ('brace_open -> LBRACE','brace_open',1,'p_brace_open','c_parser.py',1838), + ('brace_close -> RBRACE','brace_close',1,'p_brace_close','c_parser.py',1844), + ('empty -> ','empty',0,'p_empty','c_parser.py',1850), ] diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst --- a/pypy/doc/release-v7.2.0.rst +++ b/pypy/doc/release-v7.2.0.rst @@ -49,6 +49,9 @@ Thanks to Anvil_, we revived the `PyPy Sandbox`_, which allows total control over a python interpreter's interactions with the external world. +We implemented a new JSON decoder that is much faster, uses less memory, and +uses a JIT-friendly specialized dictionary. + As always, this release is 100% compatible with the previous one and fixed several issues and bugs raised by the growing community of PyPy users. We strongly recommend updating. Many of the fixes are the direct result of @@ -126,7 +129,7 @@ * Package windows DLLs needed by cffi modules next to the cffi c-extensions (`issue 2988`_) * Cleanup and refactor JIT code to remove ``rpython.jit.metainterp.typesystem`` -* Fix memoryviews of ctype structures with padding, (cpython issue 32780_) +* Fix memoryviews of ctype structures with padding, (CPython issue 32780_) Changes to Python 3.6 released in v7.1.1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,6 +188,23 @@ * Correctly wrap the I/O errors we can get when importing modules * Fix bad output from JSON with ``'skipkeys=True'`` (`issue 3052`_) * Fix compatibility with latest virtualenv HEAD +* Avoid ``RuntimeError`` in ``repr()`` of recursive ``dictviews`` (CPython + issue 18533_) +* Fix for printing after ``gc.get_objects()`` (`issue 2979`) +* Optimize many fast-paths through utf-8 code when we know it is ascii or no + surroagates are present +* Check for a rare case of someone shrinking a buffer from another thread + while using it in a ``read()`` variant. One of the issues discovered when + reviewing the code for the sandbox. +* Prevent segfault when slicing ``array.array`` with a large step size +* Support building ``ncurses`` on Suse Linux +* Update statically-linked ``_ssl`` OpenSSL to 1.1.0c on ``darwin`` +* Optimize ``W_TextIOWrapper._readline`` and ``ByteBuffer.getslice`` +* Fix possible race condition in threading ``Lock.release()`` (`issue 3072`_) +* Make ``CDLL(None)`` on win32 raise ``TypeError`` +* Change ``sys.getfilesystemcodeerors()`` to ``'strict'`` on win32 +* Update vendored version of ``pycparser`` to version 2.19 +* Implement a much faster JSON decoder (3x speedup for large json files, 2x less memory) C-API (cpyext) and c-extensions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -211,7 +231,7 @@ 3003`_) * Fix parsing for converting strings with underscore into ints * Add ``memoryview.obj`` which stores a reference, (`issue 3016`_) -* Fix datetime.fromtimestamp for win32 (cpython issue 29097_) +* Fix datetime.fromtimestamp for win32 (CPython issue 29097_) * Improve multiprocessing support on win32 * Support negative offsets in ``lnotab`` (`issue 2943`_) * Fix leak of file descriptor with `_io.FileIO('dir/')` @@ -232,19 +252,62 @@ * Fix case where ``int()`` would go into infinite recursion * Don't ignore fold parameter in ``(date,)time.replace()`` * Fix logic bug for ``memoryview.cast`` (when ``view.format`` is not ``'B'``) +* Implement retry-on-EINTR in fcntl module (CPython issue 35189_) +* Fix handling of 1st argument to ``hashlib.blake2{b,s}()`` (CPython issue + 33729_) +* Prevent overflow in ``_hashlib`` ``digest()`` (CPython issue 34922_) +* ``IOBase.readlines()`` relies on the iterator protocol instead of calling + ``readline()`` directly +* Don't inherit ``IS_ABSTRACT`` flag in classes +* Reset raw_pos after unwinding the raw stream (CPython issue 32228_) +* Add existing options ``-b`` and ``-d`` to ``pypy3 --help`` text +* Clean up ``_codecs`` error handling code +* Add support for using stdlib as a zipfile +* Check return type of ``__prepare__()`` (CPython issue 31588_) +* Fix logic in ``_curses.get_wch`` (`issue 3064`_) +* Match CPython exit code when failing to flush stdout/stderr at exit +* Improve SyntaxError message output +* Add ``range.__bool__`` +* Add cursor validity check to ``_sqlite.Cursor.close`` +* Improve message when mistakenly using ``print something`` in Python3 +* Handle generator exit in ``athrow()`` (CPython issue 33786_) +* Support unmarshalling ``TYPE_INT64`` and turn ``OverflowErrors`` from + ``marshal.loads`` into ``ValueErrors`` +* Update ``_posixsubprocess.c`` to match CPython (CPython issue 32270_) +* Remove unused ``_posixsubprocess.cloexec_pipe()`` +* Add missing constants to ``stat`` and ``kill _stat`` (`issue 3073`_) +* Fix argument handling in ``select.poll().poll()`` +* Raise ``SyntaxError`` instead of ``DeprecationWarning`` when treating invalid + escapes in bytes as errors (CPython issue 28691_) +* Handle locale in `time.strftime()`. (`issue 3079`_) +* Fix an issue when calling ``PyFrame.fset_f_lineno`` (`issue 3066`_) Python 3.6 c-API ~~~~~~~~~~~~~~~~ * Add ``PyStructSequence_InitType2``, ``Py_RETURN_NOTIMPLEMENTED``, - ``PyGILState_Check``, ``PyUnicode_AsUCS4``, ``PyUnicode_AsUCS4Copy`` + ``PyGILState_Check``, ``PyUnicode_AsUCS4``, ``PyUnicode_AsUCS4Copy``, + ``PyErr_SetFromWindowsErr``, * Sync the various ``Py**Flag`` constants with CPython +* Allow ``PyTypeObject`` with ``tp_doc==""`` (`issue 3055`_) +* Update ``pymacro.h`` to match CPython 3.6.9 +* Support more datetime C functions and definitions .. _`Lehmer's algorithm`: https://en.wikipedia.org/wiki/Lehmer's_GCD_algorithm .. _29097: https://bugs.python.org/issue29097 .. _32780: https://bugs.python.org/issue32780 .. _35409 : https://bugs.python.org/issue35409 .. _27169 : https://bugs.python.org/issue27169 +.. _18533 : https://bugs.python.org/issue18533 +.. _35189 : https://bugs.python.org/issue35189 +.. _33279 : https://bugs.python.org/issue33279 +.. _34922 : https://bugs.python.org/issue34922 +.. _32228 : https://bugs.python.org/issue32228 +.. _31588 : https://bugs.python.org/issue31588 +.. _33786 : https://bugs.python.org/issue33786 +.. _32270 : https://bugs.python.org/issue32270 +.. _28691 : https://bugs.python.org/issue28691 + .. _opencv2: https://github.com/skvark/opencv-python/ .. _`issue 2617`: https://bitbucket.com/pypy/pypy/issues/2617 .. _`issue 2722`: https://bitbucket.com/pypy/pypy/issues/2722 @@ -273,3 +336,10 @@ .. _`issue 3049`: https://bitbucket.com/pypy/pypy/issues/3049 .. _`issue 3050`: https://bitbucket.com/pypy/pypy/issues/3050 .. _`issue 3052`: https://bitbucket.com/pypy/pypy/issues/3052 +.. _`issue 3055`: https://bitbucket.com/pypy/pypy/issues/3055 +.. _`issue 2979`: https://bitbucket.com/pypy/pypy/issues/2979 +.. _`issue 3064`: https://bitbucket.com/pypy/pypy/issues/3064 +.. _`issue 3072`: https://bitbucket.com/pypy/pypy/issues/3072 +.. _`issue 3073`: https://bitbucket.com/pypy/pypy/issues/3073 +.. _`issue 3079`: https://bitbucket.com/pypy/pypy/issues/3079 +.. _`issue 3066`: https://bitbucket.com/pypy/pypy/issues/3066 diff --git a/pypy/doc/sandbox.rst b/pypy/doc/sandbox.rst --- a/pypy/doc/sandbox.rst +++ b/pypy/doc/sandbox.rst @@ -3,10 +3,11 @@ PyPy's sandboxing features ========================== -.. warning:: This is not actively maintained. You will likely have to fix - some issues yourself, or otherwise play around on your own. We provide - this documentation for historical reasions, it will not translate or - run on the latest PyPy code base. +.. warning:: This describes the old, unmaintained version. A new version + is in progress and should be merged back to trunk at some point soon. + Please see its description here: + https://mail.python.org/pipermail/pypy-dev/2019-August/015797.html + Introduction ------------ diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst --- a/pypy/doc/whatsnew-head.rst +++ b/pypy/doc/whatsnew-head.rst @@ -5,3 +5,9 @@ .. this is a revision shortly after release-pypy-7.2.0 .. startrev: 78cd4acbcbec + +.. branch: json-decoder-maps + +Much faster and more memory-efficient JSON decoding. The resulting +dictionaries that come out of the JSON decoder have faster lookups too. + diff --git a/pypy/doc/whatsnew-pypy3-head.rst b/pypy/doc/whatsnew-pypy3-head.rst --- a/pypy/doc/whatsnew-pypy3-head.rst +++ b/pypy/doc/whatsnew-pypy3-head.rst @@ -49,3 +49,10 @@ Add support for the entire stdlib being inside a zipfile + +.. branch: json-decoder-maps-py3.6 + +Much faster and more memory-efficient JSON decoding. The resulting +dictionaries that come out of the JSON decoder have faster lookups too. + + diff --git a/pypy/interpreter/astcompiler/assemble.py b/pypy/interpreter/astcompiler/assemble.py --- a/pypy/interpreter/astcompiler/assemble.py +++ b/pypy/interpreter/astcompiler/assemble.py @@ -226,7 +226,7 @@ def is_dead_code(self): """Return False if any code can be meaningfully added to the current block, or True if it would be dead code.""" - # currently only True after a RETURN_VALUE. + # currently only True after a RETURN_VALUE. return self.current_block.have_return def emit_op(self, op): diff --git a/pypy/interpreter/executioncontext.py b/pypy/interpreter/executioncontext.py --- a/pypy/interpreter/executioncontext.py +++ b/pypy/interpreter/executioncontext.py @@ -329,8 +329,11 @@ # if it does not exist yet and the tracer accesses it via # frame.f_locals, it is filled by PyFrame.getdictscope frame.fast2locals() + prev_line_tracing = d.is_in_line_tracing self.is_tracing += 1 try: + if event == 'line': + d.is_in_line_tracing = True try: w_result = space.call_function(w_callback, frame, space.newtext(event), w_arg) if space.is_w(w_result, space.w_None): @@ -345,6 +348,7 @@ raise finally: self.is_tracing -= 1 + d.is_in_line_tracing = prev_line_tracing if d.w_locals is not None: frame.locals2fast() diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py --- a/pypy/interpreter/pyframe.py +++ b/pypy/interpreter/pyframe.py @@ -23,7 +23,7 @@ # Define some opcodes used for op in '''DUP_TOP POP_TOP SETUP_LOOP SETUP_EXCEPT SETUP_FINALLY SETUP_WITH -SETUP_ASYNC_WITH POP_BLOCK END_FINALLY'''.split(): +SETUP_ASYNC_WITH POP_BLOCK END_FINALLY WITH_CLEANUP_START'''.split(): globals()[op] = stdlib_opcode.opmap[op] class FrameDebugData(object): @@ -35,6 +35,7 @@ instr_prev_plus_one = 0 f_lineno = 0 # current lineno for tracing is_being_profiled = False + is_in_line_tracing = False w_locals = None hidden_operationerr = None @@ -667,20 +668,33 @@ except OperationError: raise oefmt(space.w_ValueError, "lineno must be an integer") + # You can only do this from within a trace function, not via + # _getframe or similar hackery. + if space.int_w(self.fget_f_lasti(space)) == -1: + raise oefmt(space.w_ValueError, + "can't jump from the 'call' trace event of a new frame") if self.get_w_f_trace() is None: raise oefmt(space.w_ValueError, - "f_lineno can only be set by a trace function.") + "f_lineno can only be set by a trace function") + + # Only allow jumps when we're tracing a line event. + d = self.getorcreatedebug() + if not d.is_in_line_tracing: + raise oefmt(space.w_ValueError, + "can only jump from a 'line' trace event") line = self.pycode.co_firstlineno if new_lineno < line: raise oefmt(space.w_ValueError, - "line %d comes before the current code.", new_lineno) + "line %d comes before the current code block", new_lineno) elif new_lineno == line: new_lasti = 0 else: + # Find the bytecode offset for the start of the given + # line, or the first code-owning line after it. + lnotab = self.pycode.co_lnotab + addr = 0 new_lasti = -1 - addr = 0 - lnotab = self.pycode.co_lnotab for offset in xrange(0, len(lnotab), 2): addr += ord(lnotab[offset]) line_offset = ord(lnotab[offset + 1]) @@ -692,23 +706,47 @@ new_lineno = line break + # If we didn't reach the requested line, return an error. if new_lasti == -1: raise oefmt(space.w_ValueError, - "line %d comes after the current code.", new_lineno) + "line %d comes after the current code block", new_lineno) - # Don't jump to a line with an except in it. + min_addr = min(new_lasti, self.last_instr) + max_addr = max(new_lasti, self.last_instr) + + # You can't jump onto a line with an 'except' statement on it - + # they expect to have an exception on the top of the stack, which + # won't be true if you jump to them. They always start with code + # that either pops the exception using POP_TOP (plain 'except:' + # lines do this) or duplicates the exception on the stack using + # DUP_TOP (if there's an exception type specified). See compile.c, + # 'com_try_except' for the full details. There aren't any other + # cases (AFAIK) where a line's code can start with DUP_TOP or + # POP_TOP, but if any ever appear, they'll be subject to the same + # restriction (but with a different error message). code = self.pycode.co_code if ord(code[new_lasti]) in (DUP_TOP, POP_TOP): raise oefmt(space.w_ValueError, "can't jump to 'except' line as there's no exception") - # Don't jump inside or out of an except or a finally block. - # Note that CPython doesn't check except blocks, - # but that results in crashes (tested on 3.5.2+). - f_lasti_handler_addr = -1 - new_lasti_handler_addr = -1 + # You can't jump into or out of a 'finally' block because the 'try' + # block leaves something on the stack for the END_FINALLY to clean + # up. So we walk the bytecode, maintaining a simulated blockstack. + # When we reach the old or new address and it's in a 'finally' block + # we note the address of the corresponding SETUP_FINALLY. The jump + # is only legal if neither address is in a 'finally' block or + # they're both in the same one. 'blockstack' is a stack of the + # bytecode addresses of the SETUP_X opcodes, and 'in_finally' tracks + # whether we're in a 'finally' block at each blockstack level. + + # PYPY NOTE: CPython (at least 3.5.2+) doesn't check except blocks, + # but that results in crashes. But for now I'm going to follow the + # logic of CPython 3.6.9 exactly anyway, which is quite messy already. + + f_lasti_setup_addr = -1 + new_lasti_setup_addr = -1 blockstack = [] # current blockstack (addresses of SETUP_*) - endblock = [-1] # current finally/except block stack + in_finally = [] # list of flags "is this a finally block?" addr = 0 while addr < len(code): assert addr & 1 == 0 @@ -716,47 +754,69 @@ if op in (SETUP_LOOP, SETUP_EXCEPT, SETUP_FINALLY, SETUP_WITH, SETUP_ASYNC_WITH): blockstack.append(addr) + in_finally.append(False) elif op == POP_BLOCK: if len(blockstack) == 0: raise oefmt(space.w_SystemError, "POP_BLOCK not properly nested in this bytecode") - setup_op = ord(code[blockstack.pop()]) - if setup_op != SETUP_LOOP: - endblock.append(addr) + setup_op = ord(code[blockstack[-1]]) + if setup_op in (SETUP_FINALLY, SETUP_WITH, SETUP_ASYNC_WITH): + in_finally[-1] = True + else: + del blockstack[-1] elif op == END_FINALLY: - if len(endblock) <= 1: - raise oefmt(space.w_SystemError, - "END_FINALLY not properly nested in this bytecode") - endblock.pop() + # Ignore END_FINALLYs for SETUP_EXCEPTs - they exist + # in the bytecode but don't correspond to an actual + # 'finally' block. (If len(blockstack) is 0, we must + # be seeing such an END_FINALLY.) + if len(blockstack) > 0: + setup_op = ord(code[blockstack[-1]]) + if setup_op in (SETUP_FINALLY, SETUP_WITH, SETUP_ASYNC_WITH): + del blockstack[-1] - if addr == new_lasti: - new_lasti_handler_addr = endblock[-1] - if addr == self.last_instr: - f_lasti_handler_addr = endblock[-1] + # For the addresses we're interested in, see whether they're + # within a 'finally' block and if so, remember the address + # of the SETUP_FINALLY. + if addr == new_lasti or addr == self.last_instr: + setup_addr = -1 + for i in xrange(len(blockstack) - 1, -1, -1): + if in_finally[i]: + setup_addr = blockstack[i] + break + if setup_addr != -1: + if addr == new_lasti: + new_lasti_setup_addr = setup_addr + if addr == self.last_instr: + f_lasti_setup_addr = setup_addr addr += 2 - if len(blockstack) != 0 or len(endblock) != 1: + # Verify that the blockstack tracking code didn't get lost. + if len(blockstack) != 0: raise oefmt(space.w_SystemError, "blocks not properly nested in this bytecode") - if new_lasti_handler_addr != f_lasti_handler_addr: + # After all that, are we jumping into / out of a 'finally' block? + if new_lasti_setup_addr != f_lasti_setup_addr: raise oefmt(space.w_ValueError, - "can't jump into or out of an 'expect' or " - "'finally' block (%d -> %d)", - f_lasti_handler_addr, new_lasti_handler_addr) + "can't jump into or out of a 'finally' block " + "(%d -> %d)", + f_lasti_setup_addr, new_lasti_setup_addr) # now we know we're not jumping into or out of a place which # needs a SysExcInfoRestorer. Check that we're not jumping # *into* a block, but only (potentially) out of some blocks. - if new_lasti < self.last_instr: - min_addr = new_lasti - max_addr = self.last_instr - else: - min_addr = self.last_instr - max_addr = new_lasti - delta_iblock = min_delta_iblock = 0 # see below for comment + # Police block-jumping (you can't jump into the middle of a block) + # and ensure that the blockstack finishes up in a sensible state (by + # popping any blocks we're jumping out of). We look at all the + # blockstack operations between the current position and the new + # one, and keep track of how many blocks we drop out of on the way. + # By also keeping track of the lowest blockstack position we see, we + # can tell whether the jump goes into any blocks without coming out + # again - in that case we raise an exception below. + + delta_iblock = min_delta_iblock = 0 addr = min_addr while addr < max_addr: assert addr & 1 == 0 @@ -767,29 +827,33 @@ delta_iblock += 1 elif op == POP_BLOCK: delta_iblock -= 1 - if delta_iblock < min_delta_iblock: - min_delta_iblock = delta_iblock + min_delta_iblock = min(min_delta_iblock, delta_iblock) addr += 2 # 'min_delta_iblock' is <= 0; its absolute value is the number of # blocks we exit. 'go_iblock' is the delta number of blocks # between the last_instr and the new_lasti, in this order. if new_lasti > self.last_instr: - go_iblock = delta_iblock + go_iblock = delta_iblock # Forwards jump. else: - go_iblock = -delta_iblock + go_iblock = -delta_iblock # Backwards jump. if go_iblock > min_delta_iblock: raise oefmt(space.w_ValueError, "can't jump into the middle of a block") assert go_iblock <= 0 + # Pop any blocks that we're jumping out of. + from pypy.interpreter.pyopcode import FinallyBlock for ii in range(-go_iblock): block = self.pop_block() block.cleanupstack(self) + if (isinstance(block, FinallyBlock) and + ord(code[block.handlerposition]) == WITH_CLEANUP_START): + self.popvalue() # Pop the exit function. - self.getorcreatedebug().f_lineno = new_lineno + d.f_lineno = new_lineno assert new_lasti & 1 == 0 self.last_instr = new_lasti diff --git a/pypy/interpreter/pyparser/test/apptest_parsestring.py b/pypy/interpreter/pyparser/test/apptest_parsestring.py --- a/pypy/interpreter/pyparser/test/apptest_parsestring.py +++ b/pypy/interpreter/pyparser/test/apptest_parsestring.py @@ -8,3 +8,11 @@ eval("b'''\n\\z'''") assert not w assert excinfo.value.filename == '' + +def test_str_invalid_escape(): + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('error', category=DeprecationWarning) + with raises(SyntaxError) as excinfo: + eval("'''\n\\z'''") + assert not w + assert excinfo.value.filename == '' diff --git a/pypy/interpreter/test/apptest_pyframe.py b/pypy/interpreter/test/apptest_pyframe.py --- a/pypy/interpreter/test/apptest_pyframe.py +++ b/pypy/interpreter/test/apptest_pyframe.py @@ -117,6 +117,8 @@ # assert did not crash def test_f_lineno_set_2(): + skip("this test is known to crash CPython (verified in 3.6.9). " + "Now it crashes PyPy too. Too bad?") counter = [0] errors = [] @@ -167,7 +169,6 @@ assert output == [2, 9] def test_f_lineno_set_4(): - pytest.skip("test is failing on pypy") def jump_in_nested_finally(output): try: output.append(2) @@ -322,7 +323,10 @@ def test_trace_ignore_hidden(): import sys - import _testing + try: + import _testing + except ImportError: + skip('PyPy only test') _testing.Hidden # avoid module lazy-loading weirdness when untranslated l = [] diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -130,6 +130,15 @@ final=True, errorhandler=state.decode_error_handler, ud_handler=unicodedata_handler) + if first_escape_error_char is not None: + msg = "invalid escape sequence '%s'" + try: + space.warn(space.newtext(msg % first_escape_error_char), space.w_DeprecationWarning) + except OperationError as e: + if e.match(space, space.w_DeprecationWarning): + raise oefmt(space.w_SyntaxError, msg, first_escape_error_char) + else: + raise return s, ulen, blen def decode_raw_unicode_escape(space, string): diff --git a/pypy/module/_codecs/test/test_locale.py b/pypy/module/_codecs/test/test_locale.py --- a/pypy/module/_codecs/test/test_locale.py +++ b/pypy/module/_codecs/test/test_locale.py @@ -60,6 +60,12 @@ assert (locale_decoder(val) == utf8_decoder(val, 'strict', True, None)[:2]) + def test_decode_locale_latin1(self): + self.setlocale("fr_FR") + uni = u"août" + string = uni.encode('latin1') + assert str_decode_locale_surrogateescape(string) == (uni.encode('utf8'), len(uni)) + def test_decode_locale_errorhandler(self): self.setlocale("en_US.UTF-8") locale_decoder = str_decode_locale_surrogateescape diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py --- a/pypy/module/_pypyjson/interp_decoder.py +++ b/pypy/module/_pypyjson/interp_decoder.py @@ -1,11 +1,13 @@ import sys from rpython.rlib.rstring import StringBuilder -from rpython.rlib.objectmodel import specialize, always_inline, r_dict -from rpython.rlib import rfloat, rutf8 +from rpython.rlib.objectmodel import specialize, always_inline +from rpython.rlib import rfloat, runicode, jit, objectmodel, rutf8 from rpython.rtyper.lltypesystem import lltype, rffi from pypy.interpreter.error import oefmt, OperationError from rpython.rlib.rarithmetic import r_uint from pypy.interpreter import unicodehelper +from pypy.interpreter.baseobjspace import W_Root +from pypy.module._pypyjson import simd OVF_DIGITS = len(str(sys.maxint)) @@ -15,50 +17,111 @@ # precomputing negative powers of 10 is MUCH faster than using e.g. math.pow # at runtime NEG_POW_10 = [10.0**-i for i in range(16)] +del i + def neg_pow_10(x, exp): if exp >= len(NEG_POW_10): return 0.0 return x * NEG_POW_10[exp] -def slice_eq(a, b): - (ll_chars1, start1, length1, _) = a - (ll_chars2, start2, length2, _) = b - if length1 != length2: - return False - j = start2 - for i in range(start1, start1 + length1): - if ll_chars1[i] != ll_chars2[j]: - return False - j += 1 - return True -def slice_hash(a): - (ll_chars, start, length, h) = a - return h +class IntCache(object): + """ A cache for wrapped ints between START and END """ + + # I also tried various combinations of having an LRU cache for ints as + # well, didn't really help. + + # XXX one thing to do would be to use withintprebuilt in general again, + # hidden behind a 'we_are_jitted' + + START = -10 + END = 256 + + def __init__(self, space): + self.space = space + self.cache = [self.space.newint(i) + for i in range(self.START, self.END)] + + def newint(self, intval): + if self.START <= intval < self.END: + return self.cache[intval - self.START] + return self.space.newint(intval) class DecoderError(Exception): def __init__(self, msg, pos): self.msg = msg self.pos = pos -TYPE_UNKNOWN = 0 -TYPE_STRING = 1 -class JSONDecoder(object): +class JSONDecoder(W_Root): + + LRU_SIZE = 16 + LRU_MASK = LRU_SIZE - 1 + + DEFAULT_SIZE_SCRATCH = 20 + + # string caching is only used if the total size of the message is larger + # than a megabyte. Below that, there can't be that many repeated big + # strings anyway (some experiments showed this to be a reasonable cutoff + # size) + MIN_SIZE_FOR_STRING_CACHE = 1024 * 1024 + + # evaluate the string cache for 200 strings, before looking at the hit rate + # and deciding whether to keep doing it + STRING_CACHE_EVALUATION_SIZE = 200 + + # keep using the string cache if at least 25% of all decoded strings are a + # hit in the cache + STRING_CACHE_USEFULNESS_FACTOR = 4 + + def __init__(self, space, s): self.space = space + self.w_empty_string = space.newutf8("", 0) + self.s = s + # we put our string in a raw buffer so: # 1) we automatically get the '\0' sentinel at the end of the string, # which means that we never have to check for the "end of string" # 2) we can pass the buffer directly to strtod - self.ll_chars = rffi.str2charp(s) + self.ll_chars, self.llobj, self.flag = rffi.get_nonmovingbuffer_ll_final_null(self.s) self.end_ptr = lltype.malloc(rffi.CCHARPP.TO, 1, flavor='raw') self.pos = 0 - self.cache = r_dict(slice_eq, slice_hash, simple_hash_eq=True) + self.intcache = space.fromcache(IntCache) + + # two caches, one for keys, one for general strings. they both have the + # form {hash-as-int: StringCacheEntry} and they don't deal with + # collisions at all. For every hash there is simply one string stored + # and we ignore collisions. + self.cache_keys = {} + self.cache_values = {} + + # we don't cache *all* non-key strings, that would be too expensive. + # instead, keep a cache of the last 16 strings hashes around and add a + # string to the cache only if its hash is seen a second time + self.lru_cache = [0] * self.LRU_SIZE + self.lru_index = 0 + + self.startmap = self.space.fromcache(Terminator) + + # keep a list of objects that are created with maps that aren't clearly + # useful. If they turn out to be useful in the end we are good, + # otherwise convert them to dicts (see .close()) + self.unclear_objects = [] + + # this is a freelist of lists that store the decoded value of an + # object, before they get copied into the eventual dict + self.scratch = [[None] * self.DEFAULT_SIZE_SCRATCH] + def close(self): - rffi.free_charp(self.ll_chars) + rffi.free_nonmovingbuffer_ll(self.ll_chars, self.llobj, self.flag) lltype.free(self.end_ptr, flavor='raw') + # clean up objects that are instances of now blocked maps + for w_obj in self.unclear_objects: + jsonmap = self._get_jsonmap_from_dict(w_obj) + if jsonmap.is_state_blocked(): + self._devolve_jsonmap_dict(w_obj) def getslice(self, start, end): assert start >= 0 @@ -66,19 +129,22 @@ return self.s[start:end] def skip_whitespace(self, i): + ll_chars = self.ll_chars while True: - ch = self.ll_chars[i] + ch = ll_chars[i] if is_whitespace(ch): - i+=1 + i += 1 else: break return i - def decode_any(self, i): + def decode_any(self, i, contextmap=None): + """ Decode an object at position i. Optionally pass a contextmap, if + the value is decoded as the value of a dict. """ i = self.skip_whitespace(i) ch = self.ll_chars[i] if ch == '"': - return self.decode_string(i+1) + return self.decode_string(i+1, contextmap) elif ch == '[': return self.decode_array(i+1) elif ch == '{': @@ -100,7 +166,11 @@ elif ch.isdigit(): return self.decode_numeric(i) else: - raise DecoderError("Unexpected '%s' at" % ch, i) + raise DecoderError("Unexpected '%s'" % ch, i) + + + def _raise(self, msg, pos): + raise DecoderError(msg, pos) def decode_null(self, i): if (self.ll_chars[i] == 'u' and @@ -108,7 +178,7 @@ self.ll_chars[i+2] == 'l'): self.pos = i+3 return self.space.w_None - raise DecoderError("Error when decoding null at", i) + raise DecoderError("Error when decoding null", i) def decode_true(self, i): if (self.ll_chars[i] == 'r' and @@ -116,7 +186,7 @@ self.ll_chars[i+2] == 'e'): self.pos = i+3 return self.space.w_True - raise DecoderError("Error when decoding true at", i) + raise DecoderError("Error when decoding true", i) def decode_false(self, i): if (self.ll_chars[i] == 'a' and @@ -125,7 +195,7 @@ self.ll_chars[i+3] == 'e'): self.pos = i+4 return self.space.w_False - raise DecoderError("Error when decoding false at", i) + raise DecoderError("Error when decoding false", i) def decode_infinity(self, i, sign=1): if (self.ll_chars[i] == 'n' and @@ -137,14 +207,14 @@ self.ll_chars[i+6] == 'y'): self.pos = i+7 return self.space.newfloat(rfloat.INFINITY * sign) - raise DecoderError("Error when decoding Infinity at", i) + raise DecoderError("Error when decoding Infinity", i) def decode_nan(self, i): if (self.ll_chars[i] == 'a' and self.ll_chars[i+1] == 'N'): self.pos = i+2 return self.space.newfloat(rfloat.NAN) - raise DecoderError("Error when decoding NaN at", i) + raise DecoderError("Error when decoding NaN", i) def decode_numeric(self, i): start = i @@ -154,7 +224,7 @@ ch = self.ll_chars[i] if ch == '.': if not self.ll_chars[i+1].isdigit(): - raise DecoderError("Expected digit at", i+1) + raise DecoderError("Expected digit", i+1) return self.decode_float(start) elif ch == 'e' or ch == 'E': return self.decode_float(start) @@ -162,7 +232,7 @@ return self.decode_int_slow(start) self.pos = i - return self.space.newint(intval) + return self.intcache.newint(intval) def decode_float(self, i): from rpython.rlib import rdtoa @@ -208,13 +278,27 @@ break count = i - start if count == 0: - raise DecoderError("Expected digit at", i) + raise DecoderError("Expected digit", i) # if the number has more digits than OVF_DIGITS, it might have # overflowed ovf_maybe = (count >= OVF_DIGITS) return i, ovf_maybe, sign * intval + def _raise_control_char_in_string(self, ch, startindex, currindex): + if ch == '\0': + self._raise("Unterminated string starting at", + startindex - 1) + else: + self._raise("Invalid control character at", currindex-1) + + def _raise_object_error(self, ch, start, i): + if ch == '\0': + self._raise("Unterminated object starting at", start) + else: + self._raise("Unexpected '%s' when decoding object" % ch, i) + def decode_array(self, i): + """ Decode a list. i must be after the opening '[' """ w_list = self.space.newlist([]) start = i i = self.skip_whitespace(start) @@ -248,63 +332,116 @@ self.pos = i+1 return self.space.newdict() - d = self._create_empty_dict() + if self.scratch: + values_w = self.scratch.pop() + else: + values_w = [None] * self.DEFAULT_SIZE_SCRATCH + nextindex = 0 + currmap = self.startmap while True: # parse a key: value - w_name = self.decode_key(i) + currmap = self.decode_key_map(i, currmap) i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] if ch != ':': raise DecoderError("No ':' found at", i) i += 1 - i = self.skip_whitespace(i) - # - w_value = self.decode_any(i) - d[w_name] = w_value + + w_value = self.decode_any(i, currmap) + + if nextindex == len(values_w): # full + values_w = values_w + [None] * len(values_w) # double + values_w[nextindex] = w_value + nextindex += 1 i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] i += 1 if ch == '}': self.pos = i - return self._create_dict(d) + self.scratch.append(values_w) # can reuse next time + if currmap.is_state_blocked(): + dict_w = self._switch_to_dict(currmap, values_w, nextindex) + return self._create_dict(dict_w) + values_w = values_w[:nextindex] + w_res = self._create_dict_map(values_w, currmap) + if not currmap.is_state_useful(): + self.unclear_objects.append(w_res) + return w_res elif ch == ',': - pass - elif ch == '\0': - raise DecoderError("Unterminated object starting at", start) + i = self.skip_whitespace(i) + if currmap.is_state_blocked(): + self.scratch.append(values_w) # can reuse next time + dict_w = self._switch_to_dict(currmap, values_w, nextindex) + return self.decode_object_dict(i, start, dict_w) else: - raise DecoderError("Unexpected '%s' when decoding object" % ch, - i-1) + self._raise_object_error(ch, start, i - 1) - def decode_string(self, i): - start = i - bits = 0 + def _create_dict_map(self, values_w, jsonmap): + from pypy.objspace.std.jsondict import from_values_and_jsonmap + return from_values_and_jsonmap(self.space, values_w, jsonmap) + + def _devolve_jsonmap_dict(self, w_dict): + from pypy.objspace.std.jsondict import devolve_jsonmap_dict + devolve_jsonmap_dict(w_dict) + + def _get_jsonmap_from_dict(self, w_dict): + from pypy.objspace.std.jsondict import get_jsonmap_from_dict + return get_jsonmap_from_dict(w_dict) + + def _switch_to_dict(self, currmap, values_w, nextindex): + dict_w = self._create_empty_dict() + currmap.fill_dict(dict_w, values_w) + assert len(dict_w) == nextindex + return dict_w + + def decode_object_dict(self, i, start, dict_w): while True: - # this loop is a fast path for strings which do not contain escape - # characters + # parse a key: value + w_key = self.decode_key_string(i) + i = self.skip_whitespace(self.pos) + ch = self.ll_chars[i] + if ch != ':': + self._raise("No ':' found at", i) + i += 1 + + w_value = self.decode_any(i) + dict_w[w_key] = w_value + i = self.skip_whitespace(self.pos) ch = self.ll_chars[i] i += 1 - bits |= ord(ch) - if ch == '"': + if ch == '}': self.pos = i - return self._create_string(start, i - 1, bits) - elif ch == '\\' or ch < '\x20': - self.pos = i-1 - return self.decode_string_escaped(start) + return self._create_dict(dict_w) + elif ch == ',': + i = self.skip_whitespace(i) + else: + self._raise_object_error(ch, start, i - 1) - def _create_string(self, start, end, bits): - if bits & 0x80: - # the 8th bit is set, it's an utf8 string - content_utf8 = self.getslice(start, end) + def decode_string_uncached(self, i): + start = i + ll_chars = self.ll_chars + nonascii, i = simd.find_end_of_string_no_hash(ll_chars, i, len(self.s)) + ch = ll_chars[i] + if ch == '\\': + self.pos = i + return self.decode_string_escaped(start, nonascii) + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + else: + assert ch == '"' + + self.pos = i + 1 + return self._create_string_wrapped(start, i, nonascii) + + def _create_string_wrapped(self, start, end, nonascii): + content = self.getslice(start, end) + if nonascii: + # contains non-ascii chars, we need to check that it's valid utf-8 lgt = unicodehelper.check_utf8_or_raise(self.space, - content_utf8) - return self.space.newutf8(content_utf8, lgt) + content) else: - # ascii only, fast path (ascii is a strict subset of - # latin1, and we already checked that all the chars are < - # 128) lgt = end - start - assert lgt >= 0 - return self.space.newutf8(self.getslice(start, end), lgt) + return self.space.newutf8(content, lgt) def _create_dict(self, d): from pypy.objspace.std.dictmultiobject import from_unicode_key_dict @@ -314,8 +451,7 @@ from pypy.objspace.std.dictmultiobject import create_empty_unicode_key_dict return create_empty_unicode_key_dict(self.space) - - def decode_string_escaped(self, start): + def decode_string_escaped(self, start, nonascii): i = self.pos builder = StringBuilder((i - start) * 2) # just an estimate assert start >= 0 @@ -326,25 +462,21 @@ i += 1 if ch == '"': content_utf8 = builder.build() - lgt = unicodehelper.check_utf8_or_raise(self.space, + length = unicodehelper.check_utf8_or_raise(self.space, content_utf8) self.pos = i - return self.space.newutf8(content_utf8, lgt) + return self.space.newutf8(content_utf8, length) elif ch == '\\': - i = self.decode_escape_sequence(i, builder) + i = self.decode_escape_sequence_to_utf8(i, builder) elif ch < '\x20': - if ch == '\0': - raise DecoderError("Unterminated string starting at", - start - 1) - else: - raise DecoderError("Invalid control character at", i-1) + self._raise_control_char_in_string(ch, start, i) else: builder.append(ch) - def decode_escape_sequence(self, i, builder): + def decode_escape_sequence_to_utf8(self, i, stringbuilder): ch = self.ll_chars[i] i += 1 - put = builder.append + put = stringbuilder.append if ch == '\\': put('\\') elif ch == '"': put('"' ) elif ch == '/': put('/' ) @@ -354,22 +486,37 @@ elif ch == 'r': put('\r') elif ch == 't': put('\t') elif ch == 'u': - return self.decode_escape_sequence_unicode(i, builder) + # may be a surrogate pair + return self.decode_escape_sequence_unicode(i, stringbuilder) else: raise DecoderError("Invalid \\escape: %s" % ch, i-1) return i + def _get_int_val_from_hex4(self, i): + ll_chars = self.ll_chars + res = 0 + for i in range(i, i + 4): + ch = ord(ll_chars[i]) + if ord('a') <= ch <= ord('f'): + digit = ch - ord('a') + 10 + elif ord('A') <= ch <= ord('F'): + digit = ch - ord('A') + 10 + elif ord('0') <= ch <= ord('9'): + digit = ch - ord('0') + else: + raise ValueError + res = (res << 4) + digit + return res + def decode_escape_sequence_unicode(self, i, builder): # at this point we are just after the 'u' of the \u1234 sequence. start = i i += 4 - hexdigits = self.getslice(start, i) try: - val = int(hexdigits, 16) + val = self._get_int_val_from_hex4(start) if (0xd800 <= val <= 0xdbff and self.ll_chars[i] == '\\' and self.ll_chars[i+1] == 'u'): - hexdigits = self.getslice(i+2, i+6) - lowsurr = int(hexdigits, 16) + lowsurr = self._get_int_val_from_hex4(i + 2) if 0xdc00 <= lowsurr <= 0xdfff: # decode surrogate pair val = 0x10000 + (((val - 0xd800) << 10) | @@ -384,45 +531,618 @@ builder.append(utf8_ch) return i - def decode_key(self, i): - """ returns a wrapped unicode """ - from rpython.rlib.rarithmetic import intmask - i = self.skip_whitespace(i) + def decode_string(self, i, contextmap=None): + """ Decode a string at position i (which is right after the opening "). + Optionally pass a contextmap, if the value is decoded as the value of a + dict.""" + ll_chars = self.ll_chars + start = i + ch = ll_chars[i] + if ch == '"': + self.pos = i + 1 + return self.w_empty_string # surprisingly common + + cache = True + if contextmap is not None: + # keep some statistics about the usefulness of the string cache on + # the contextmap + # the intuition about the contextmap is as follows: + # often there are string values stored in dictionaries that can + # never be usefully cached, like unique ids of objects. Then the + # strings *in those fields* of all objects should never be cached. + # However, the content of other fields can still be useful to + # cache. + contextmap.decoded_strings += 1 + if not contextmap.should_cache_strings(): + cache = False + if len(self.s) < self.MIN_SIZE_FOR_STRING_CACHE: + cache = False + + if not cache: + return self.decode_string_uncached(i) + + strhash, nonascii, i = simd.find_end_of_string(ll_chars, i, len(self.s)) + ch = ll_chars[i] + if ch == '\\': + self.pos = i + return self.decode_string_escaped(start, nonascii) + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + else: + assert ch == '"' + + self.pos = i + 1 + + length = i - start + strhash ^= length + + # check cache first: + try: + entry = self.cache_values[strhash] + except KeyError: + w_res = self._create_string_wrapped(start, i, nonascii) + # only add *some* strings to the cache, because keeping them all is + # way too expensive. first we check if the contextmap has caching + # disabled completely. if not, we check whether we have recently + # seen the same hash already, if yes, we cache the string. + if ((contextmap is not None and + contextmap.decoded_strings < self.STRING_CACHE_EVALUATION_SIZE) or + strhash in self.lru_cache): + entry = StringCacheEntry( + self.getslice(start, start + length), w_res) + self.cache_values[strhash] = entry + else: + self.lru_cache[self.lru_index] = strhash + self.lru_index = (self.lru_index + 1) & self.LRU_MASK + return w_res + if not entry.compare(ll_chars, start, length): + # collision! hopefully rare + return self._create_string_wrapped(start, i, nonascii) + if contextmap is not None: + contextmap.cache_hits += 1 + return entry.w_uni + + def decode_key_map(self, i, currmap): + """ Given the current map currmap of an object, decode the next key at + position i. This returns the new map of the object. """ + newmap = self._decode_key_map(i, currmap) + currmap.observe_transition(newmap, self.startmap) + return newmap + + def _decode_key_map(self, i, currmap): + ll_chars = self.ll_chars + # first try to see whether we happen to find currmap.nextmap_first + nextmap = currmap.fast_path_key_parse(self, i) + if nextmap is not None: + return nextmap + + start = i ch = ll_chars[i] if ch != '"': raise DecoderError("Key name must be string at char", i) i += 1 + w_key = self._decode_key_string(i) + return currmap.get_next(w_key, self.s, start, self.pos, self.startmap) + def _decode_key_string(self, i): + """ decode key at position i as a string. Key strings are always + cached, since they repeat a lot. """ + ll_chars = self.ll_chars start = i - bits = 0 - strhash = ord(ll_chars[i]) << 7 - while True: - ch = ll_chars[i] + + strhash, nonascii, i = simd.find_end_of_string(ll_chars, i, len(self.s)) + + ch = ll_chars[i] + if ch == '\\': + self.pos = i + w_key = self.decode_string_escaped(start, nonascii) + return w_key + if ch < '\x20': + self._raise_control_char_in_string(ch, start, i) + length = i - start + strhash ^= length + self.pos = i + 1 + # check cache first: + try: + entry = self.cache_keys[strhash] + except KeyError: + w_res = self._create_string_wrapped(start, i, nonascii) + entry = StringCacheEntry( + self.getslice(start, start + length), w_res) + self.cache_keys[strhash] = entry + return w_res + if not entry.compare(ll_chars, start, length): + # collision! hopefully rare + w_res = self._create_string_wrapped(start, i, nonascii) + else: + w_res = entry.w_uni + return w_res + + def decode_key_string(self, i): + ll_chars = self.ll_chars + ch = ll_chars[i] + if ch != '"': + self._raise("Key name must be string at char %d", i) + i += 1 + return self._decode_key_string(i) + + +class StringCacheEntry(object): + """ A cache entry, bundling the encoded version of a string as it appears + in the input string, and its wrapped decoded variant. """ + def __init__(self, repr, w_uni): + # repr is the escaped string + self.repr = repr + # uni is the wrapped decoded string + self.w_uni = w_uni + + def compare(self, ll_chars, start, length): + """ Check whether self.repr occurs at ll_chars[start:start+length] """ + if length != len(self.repr): + return False + index = start + for c in self.repr: + if not ll_chars[index] == c: + return False + index += 1 + return True + + +class MapBase(object): + """ A map implementation to speed up parsing of json dicts, and to + represent the resulting dicts more compactly and make access faster. """ + + # the basic problem we are trying to solve is the following: dicts in + # json can either be used as objects, or as dictionaries with arbitrary + # string keys. We want to use maps for the former, but not for the + # latter. But we don't know in advance which kind of dict is which. + + # Therefore we create "preliminary" maps where we aren't quite sure yet + # whether they are really useful maps or not. If we see them used often + # enough, we promote them to "useful" maps, which we will actually + # instantiate objects with. + + # If we determine that a map is not used often enough, we can turn it + # into a "blocked" map, which is a point in the map tree where we will + # switch to regular dicts, when we reach that part of the tree. + + # One added complication: We want to keep the number of preliminary maps + # bounded to prevent generating tons of useless maps. but also not too + # small, to support having a json file that contains many uniform objects + # with tons of keys. That's where the idea of "fringe" maps comes into + # play. They are maps that sit between known useful nodes and preliminary + # nodes in the map transition tree. We bound only the number of fringe + # nodes we are considering (to MAX_FRINGE), but not the number of + # preliminary maps. When we have too many fringe maps, we remove the least + # commonly instantiated fringe map and mark it as blocked. + + # allowed graph edges or nodes in nextmap_all: + # USEFUL ------- + # / \ \ + # v v v + # FRINGE USEFUL BLOCKED + # | + # v + # PRELIMINARY + # | + # v + # PRELIMINARY + + # state transitions: + # PRELIMINARY + # / | \ + # | v v + # | FRINGE -> USEFUL + # | | + # \ | + # v v + # BLOCKED + + # the nextmap_first edge can only be these graph edges: + # USEFUL + # | + # v + # USEFUL + # + # FRINGE + # | + # v + # PRELIMINARY + # | + # v + # PRELIMINARY + + USEFUL = 'u' + PRELIMINARY = 'p' + FRINGE = 'f' # buffer between PRELIMINARY and USEFUL + BLOCKED = 'b' + + # tunable parameters + MAX_FRINGE = 40 + USEFUL_THRESHOLD = 5 + + def __init__(self, space): + self.space = space + + # a single transition is stored in .nextmap_first + self.nextmap_first = None + + # nextmap_all is only initialized after seeing the *second* transition + # but then it also contains .nextmap_first + self.nextmap_all = None # later dict {key: nextmap} + + # keep some statistics about every map: how often it was instantiated + # and how many non-blocked leaves the map transition tree has, starting + # from self + self.instantiation_count = 0 + self.number_of_leaves = 1 + + def _check_invariants(self): + if self.nextmap_all: + for next in self.nextmap_all.itervalues(): + next._check_invariants() + elif self.nextmap_first: From pypy.commits at gmail.com Wed Sep 25 11:50:47 2019 From: pypy.commits at gmail.com (rlamy) Date: Wed, 25 Sep 2019 08:50:47 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: Fix race condition with SemLock that would sometimes cause a deadlock Message-ID: <5d8b8cd7.1c69fb81.6a00a.6256@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97612:22433dc6e71c Date: 2019-09-25 16:37 +0100 http://bitbucket.org/pypy/pypy/changeset/22433dc6e71c/ Log: Fix race condition with SemLock that would sometimes cause a deadlock when using multiprocessing and threads together. diff --git a/pypy/interpreter/gateway.py b/pypy/interpreter/gateway.py --- a/pypy/interpreter/gateway.py +++ b/pypy/interpreter/gateway.py @@ -538,7 +538,7 @@ def visit_kwonly(self, typ): raise FastFuncNotSupported - + @staticmethod def make_fastfunc(unwrap_spec, func): unwrap_info = UnwrapSpec_FastFunc_Unwrap() diff --git a/pypy/module/_multiprocessing/interp_semaphore.py b/pypy/module/_multiprocessing/interp_semaphore.py --- a/pypy/module/_multiprocessing/interp_semaphore.py +++ b/pypy/module/_multiprocessing/interp_semaphore.py @@ -33,7 +33,7 @@ _ReleaseSemaphore = rwin32.winexternal( 'ReleaseSemaphore', [rwin32.HANDLE, rffi.LONG, rffi.LONGP], rwin32.BOOL, - save_err=rffi.RFFI_SAVE_LASTERROR) + save_err=rffi.RFFI_SAVE_LASTERROR, releasegil=True) def sem_unlink(name): return None @@ -100,7 +100,7 @@ save_err=rffi.RFFI_SAVE_ERRNO) _sem_trywait = external('sem_trywait', [SEM_T], rffi.INT, save_err=rffi.RFFI_SAVE_ERRNO) - _sem_post = external('sem_post', [SEM_T], rffi.INT, + _sem_post = external('sem_post', [SEM_T], rffi.INT, releasegil=False, save_err=rffi.RFFI_SAVE_ERRNO) _sem_getvalue = external('sem_getvalue', [SEM_T, rffi.INTP], rffi.INT, save_err=rffi.RFFI_SAVE_ERRNO) @@ -384,7 +384,7 @@ elif e.errno in (errno.EAGAIN, errno.ETIMEDOUT): return False raise - _check_signals(space) + _check_signals(space) self.last_tid = rthread.get_ident() self.count += 1 return True @@ -506,7 +506,7 @@ # sets self.last_tid and increments self.count # those steps need to be as close as possible to # acquiring the semlock for self._ismine() to support - # multiple threads + # multiple threads got = semlock_acquire(self, space, block, w_timeout) except OSError as e: raise wrap_oserror(space, e) @@ -526,6 +526,8 @@ return try: + # Note: a succesful semlock_release() must not release the GIL, + # otherwise there is a race condition on self.count semlock_release(self, space) self.count -= 1 except OSError as e: diff --git a/pypy/module/_multiprocessing/test/test_interp_semaphore.py b/pypy/module/_multiprocessing/test/test_interp_semaphore.py new file mode 100644 --- /dev/null +++ b/pypy/module/_multiprocessing/test/test_interp_semaphore.py @@ -0,0 +1,46 @@ +import time +from rpython.rlib.rgil import yield_thread +from pypy.tool.pytest.objspace import gettestobjspace +from pypy.interpreter.gateway import interp2app +from pypy.module.thread.os_lock import _set_sentinel +from pypy.module.thread.os_thread import start_new_thread +from pypy.module._multiprocessing.interp_semaphore import ( + create_semaphore, sem_unlink, W_SemLock) + +def test_stuff(space): + space = gettestobjspace(usemodules=['_multiprocessing', 'thread']) + sem_name = '/test7' + _handle = create_semaphore(space, sem_name, 1, 1) + sem_unlink(sem_name) + w_lock = W_SemLock(space, _handle, 0, 1, None) + created = [] + successful = [] + N_THREADS = 16 + + def run(space): + w_sentinel = _set_sentinel(space) + yield_thread() + w_sentinel.descr_lock_acquire(space) # releases GIL + yield_thread() + created.append(w_sentinel) + w_got = w_lock.acquire(space, w_timeout=space.newfloat(5.)) # releases GIL + if space.is_true(w_got): + yield_thread() + w_lock.release(space) + successful.append(w_sentinel) + w_run = space.wrap(interp2app(run)) + + w_lock.acquire(space) + for _ in range(N_THREADS): + start_new_thread(space, w_run, space.newtuple([])) # releases GIL + deadline = time.time() + 5. + while len(created) < N_THREADS: + assert time.time() < deadline + yield_thread() + w_lock.release(space) + + for w_sentinel in created: + # Join thread + w_sentinel.descr_lock_acquire(space) # releases GIL + w_sentinel.descr_lock_release(space) + assert len(successful) == N_THREADS From pypy.commits at gmail.com Thu Sep 26 07:00:28 2019 From: pypy.commits at gmail.com (rlamy) Date: Thu, 26 Sep 2019 04:00:28 -0700 (PDT) Subject: [pypy-commit] pypy default: backport 22433dc6e71cd01669c45a6ef3b2ca7bdd721686: Message-ID: <5d8c9a4c.1c69fb81.d371e.d8d1@mx.google.com> Author: Ronan Lamy Branch: Changeset: r97616:263ac72641a2 Date: 2019-09-25 16:37 +0100 http://bitbucket.org/pypy/pypy/changeset/263ac72641a2/ Log: backport 22433dc6e71cd01669c45a6ef3b2ca7bdd721686: Fix race condition with SemLock that would sometimes cause a deadlock when using multiprocessing and threads together. diff --git a/pypy/module/_multiprocessing/interp_semaphore.py b/pypy/module/_multiprocessing/interp_semaphore.py --- a/pypy/module/_multiprocessing/interp_semaphore.py +++ b/pypy/module/_multiprocessing/interp_semaphore.py @@ -33,7 +33,7 @@ _ReleaseSemaphore = rwin32.winexternal( 'ReleaseSemaphore', [rwin32.HANDLE, rffi.LONG, rffi.LONGP], rwin32.BOOL, - save_err=rffi.RFFI_SAVE_LASTERROR) + save_err=rffi.RFFI_SAVE_LASTERROR, releasegil=True) else: from rpython.rlib import rposix @@ -98,7 +98,7 @@ save_err=rffi.RFFI_SAVE_ERRNO) _sem_trywait = external('sem_trywait', [SEM_T], rffi.INT, save_err=rffi.RFFI_SAVE_ERRNO) - _sem_post = external('sem_post', [SEM_T], rffi.INT, + _sem_post = external('sem_post', [SEM_T], rffi.INT, releasegil=False, save_err=rffi.RFFI_SAVE_ERRNO) _sem_getvalue = external('sem_getvalue', [SEM_T, rffi.INTP], rffi.INT, save_err=rffi.RFFI_SAVE_ERRNO) @@ -374,7 +374,7 @@ elif e.errno in (errno.EAGAIN, errno.ETIMEDOUT): return False raise - _check_signals(space) + _check_signals(space) self.last_tid = rthread.get_ident() self.count += 1 return True @@ -487,7 +487,7 @@ # sets self.last_tid and increments self.count # those steps need to be as close as possible to # acquiring the semlock for self._ismine() to support - # multiple threads + # multiple threads got = semlock_acquire(self, space, block, w_timeout) except OSError as e: raise wrap_oserror(space, e) @@ -507,6 +507,8 @@ return try: + # Note: a succesful semlock_release() must not release the GIL, + # otherwise there is a race condition on self.count semlock_release(self, space) self.count -= 1 except OSError as e: diff --git a/pypy/module/_multiprocessing/test/test_interp_semaphore.py b/pypy/module/_multiprocessing/test/test_interp_semaphore.py new file mode 100644 --- /dev/null +++ b/pypy/module/_multiprocessing/test/test_interp_semaphore.py @@ -0,0 +1,46 @@ +import time +from rpython.rlib.rgil import yield_thread +from pypy.tool.pytest.objspace import gettestobjspace +from pypy.interpreter.gateway import interp2app +from pypy.module.thread.os_lock import allocate_lock +from pypy.module.thread.os_thread import start_new_thread +from pypy.module._multiprocessing.interp_semaphore import ( + create_semaphore, sem_unlink, W_SemLock) + +def test_stuff(space): + space = gettestobjspace(usemodules=['_multiprocessing', 'thread']) + sem_name = '/test7' + _handle = create_semaphore(space, sem_name, 1, 1) + w_lock = W_SemLock(space, _handle, 0, 1) + created = [] + successful = [] + N_THREADS = 16 + + def run(space): + w_sentinel = allocate_lock(space) + yield_thread() + w_sentinel.descr_lock_acquire(space) # releases GIL + yield_thread() + created.append(w_sentinel) + w_got = w_lock.acquire(space, w_timeout=space.newfloat(5.)) # releases GIL + if space.is_true(w_got): + yield_thread() + w_lock.release(space) + successful.append(w_sentinel) + w_sentinel.descr_lock_release(space) + w_run = space.wrap(interp2app(run)) + + w_lock.acquire(space) + for _ in range(N_THREADS): + start_new_thread(space, w_run, space.newtuple([])) # releases GIL + deadline = time.time() + 5. + while len(created) < N_THREADS: + assert time.time() < deadline + yield_thread() + w_lock.release(space) + + for w_sentinel in created: + # Join thread + w_sentinel.descr_lock_acquire(space) # releases GIL + w_sentinel.descr_lock_release(space) + assert len(successful) == N_THREADS From pypy.commits at gmail.com Thu Sep 26 08:35:36 2019 From: pypy.commits at gmail.com (rlamy) Date: Thu, 26 Sep 2019 05:35:36 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: hg merge default Message-ID: <5d8cb098.1c69fb81.b9db3.fea3@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97617:8de7da835fc9 Date: 2019-09-26 13:34 +0100 http://bitbucket.org/pypy/pypy/changeset/8de7da835fc9/ Log: hg merge default diff --git a/extra_tests/test_semlock.py b/extra_tests/test_semlock.py new file mode 100644 --- /dev/null +++ b/extra_tests/test_semlock.py @@ -0,0 +1,26 @@ +from _multiprocessing import SemLock +from threading import Thread +import time + + +def test_notify_all(): + """A low-level variation on test_notify_all() in lib-python's + _test_multiprocessing.py + """ + N_THREADS = 1000 + lock = SemLock(0, 1, 1, "/test_notify_all", True) + results = [] + + def f(n): + if lock.acquire(timeout=5.): + results.append(n) + lock.release() + + threads = [Thread(target=f, args=(i,)) for i in range(N_THREADS)] + with lock: + for t in threads: + t.start() + time.sleep(0.1) + for t in threads: + t.join() + assert len(results) == N_THREADS diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst --- a/pypy/doc/release-v7.2.0.rst +++ b/pypy/doc/release-v7.2.0.rst @@ -14,7 +14,7 @@ The interpreters are based on much the same codebase, thus the double release. -With the support of ARM Holdings Ltd. and `Crossbar.io`_, this release supports +With the support of Arm Holdings Ltd. and `Crossbar.io`_, this release supports the 64-bit ``aarch64`` ARM architecture. More about the work and the performance data around this welcome development can be found in the `blog post`_. diff --git a/pypy/tool/release/force-builds.py b/pypy/tool/release/force-builds.py --- a/pypy/tool/release/force-builds.py +++ b/pypy/tool/release/force-builds.py @@ -28,6 +28,7 @@ 'own-win-x86-32', 'own-linux-s390x', # 'own-macosx-x86-32', + 'own-linux-aarch64', 'pypy-c-jit-linux-x86-32', 'pypy-c-jit-linux-x86-64', # 'pypy-c-jit-freebsd-9-x86-64', @@ -36,6 +37,7 @@ 'pypy-c-jit-linux-s390x', # 'build-pypy-c-jit-linux-armhf-raspbian', # 'build-pypy-c-jit-linux-armel', + 'pypy-c-jit-linux-aarch64', 'rpython-linux-x86-32', 'rpython-linux-x86-64', 'rpython-win-x86-32' diff --git a/pypy/tool/release/repackage.sh b/pypy/tool/release/repackage.sh --- a/pypy/tool/release/repackage.sh +++ b/pypy/tool/release/repackage.sh @@ -28,7 +28,7 @@ # Download latest builds from the buildmaster, rename the top # level directory, and repackage ready to be uploaded to bitbucket actual_ver=xxxxxxxxxxxxxxx -for plat in linux linux64 osx64 s390x # linux-armhf-raspbian linux-armel +for plat in linux linux64 osx64 s390x aarch64 # linux-armhf-raspbian linux-armel do echo downloading package for $plat if wget -q --show-progress http://buildbot.pypy.org/nightly/$branchname/pypy-c-jit-latest-$plat.tar.bz2 From pypy.commits at gmail.com Thu Sep 26 10:57:05 2019 From: pypy.commits at gmail.com (rlamy) Date: Thu, 26 Sep 2019 07:57:05 -0700 (PDT) Subject: [pypy-commit] pypy default: Allow per-test parametrisation of the space fixture Message-ID: <5d8cd1c1.1c69fb81.9e189.7702@mx.google.com> Author: Ronan Lamy Branch: Changeset: r97618:f5fae9818da9 Date: 2019-09-26 15:48 +0100 http://bitbucket.org/pypy/pypy/changeset/f5fae9818da9/ Log: Allow per-test parametrisation of the space fixture diff --git a/pypy/conftest.py b/pypy/conftest.py --- a/pypy/conftest.py +++ b/pypy/conftest.py @@ -72,10 +72,13 @@ default=False, dest="applevel_rewrite", help="Use assert rewriting in app-level test files (slow)") + at pytest.fixture(scope='class') +def spaceconfig(request): + return getattr(request.cls, 'spaceconfig', {}) + @pytest.fixture(scope='function') -def space(request): +def space(spaceconfig): from pypy.tool.pytest.objspace import gettestobjspace - spaceconfig = getattr(request.cls, 'spaceconfig', {}) return gettestobjspace(**spaceconfig) diff --git a/pypy/module/_multiprocessing/test/test_interp_semaphore.py b/pypy/module/_multiprocessing/test/test_interp_semaphore.py --- a/pypy/module/_multiprocessing/test/test_interp_semaphore.py +++ b/pypy/module/_multiprocessing/test/test_interp_semaphore.py @@ -1,3 +1,4 @@ +import pytest import time from rpython.rlib.rgil import yield_thread from pypy.tool.pytest.objspace import gettestobjspace @@ -7,8 +8,9 @@ from pypy.module._multiprocessing.interp_semaphore import ( create_semaphore, sem_unlink, W_SemLock) + at pytest.mark.parametrize('spaceconfig', [ + {'usemodules': ['_multiprocessing', 'thread']}]) def test_stuff(space): - space = gettestobjspace(usemodules=['_multiprocessing', 'thread']) sem_name = '/test7' _handle = create_semaphore(space, sem_name, 1, 1) w_lock = W_SemLock(space, _handle, 0, 1) diff --git a/pypy/tool/pytest/test/test_appsupport.py b/pypy/tool/pytest/test/test_appsupport.py --- a/pypy/tool/pytest/test/test_appsupport.py +++ b/pypy/tool/pytest/test/test_appsupport.py @@ -40,22 +40,38 @@ "*AppTestMethod*", ]) -class TestSpaceConfig: - def test_interp_spaceconfig(self, testdir): - setpypyconftest(testdir) - p = testdir.makepyfile(""" - class TestClass: - spaceconfig = {"objspace.usemodules._random": False} - def setup_class(cls): - assert not cls.space.config.objspace.usemodules._random - def test_interp(self, space): - assert self.space is space - def test_interp2(self, space): - assert self.space is space - """) - result = testdir.runpytest(p) - assert result.ret == 0 - result.stdout.fnmatch_lines(["*2 passed*"]) +def test_interp_spaceconfig(testdir): + setpypyconftest(testdir) + p = testdir.makepyfile(""" + class TestClass: + spaceconfig = {"objspace.usemodules._random": False} + def setup_class(cls): + assert not cls.space.config.objspace.usemodules._random + def test_interp(self, space): + assert self.space is space + def test_interp2(self, space): + assert self.space is space + """) + result = testdir.runpytest(p) + assert result.ret == 0 + result.stdout.fnmatch_lines(["*2 passed*"]) + +def test_spaceconfig_param(testdir): + setpypyconftest(testdir) + p = testdir.makepyfile(""" + import pytest + + @pytest.mark.parametrize('spaceconfig', + [{"objspace.usemodules._random": False}]) + def test_interp(space): + assert not space.config.objspace.usemodules._random + + def test_interp2(space): + assert space.config.objspace.usemodules._random + """) + result = testdir.runpytest(p) + assert result.ret == 0 + result.stdout.fnmatch_lines(["*2 passed*"]) def test_applevel_raises_simple_display(testdir): setpypyconftest(testdir) From pypy.commits at gmail.com Thu Sep 26 10:57:07 2019 From: pypy.commits at gmail.com (rlamy) Date: Thu, 26 Sep 2019 07:57:07 -0700 (PDT) Subject: [pypy-commit] pypy default: give test a meaningful name Message-ID: <5d8cd1c3.1c69fb81.d340c.da9b@mx.google.com> Author: Ronan Lamy Branch: Changeset: r97619:6deb34eb72c8 Date: 2019-09-26 15:50 +0100 http://bitbucket.org/pypy/pypy/changeset/6deb34eb72c8/ Log: give test a meaningful name diff --git a/pypy/module/_multiprocessing/test/test_interp_semaphore.py b/pypy/module/_multiprocessing/test/test_interp_semaphore.py --- a/pypy/module/_multiprocessing/test/test_interp_semaphore.py +++ b/pypy/module/_multiprocessing/test/test_interp_semaphore.py @@ -10,7 +10,7 @@ @pytest.mark.parametrize('spaceconfig', [ {'usemodules': ['_multiprocessing', 'thread']}]) -def test_stuff(space): +def test_semlock_release(space): sem_name = '/test7' _handle = create_semaphore(space, sem_name, 1, 1) w_lock = W_SemLock(space, _handle, 0, 1) From pypy.commits at gmail.com Thu Sep 26 10:57:09 2019 From: pypy.commits at gmail.com (rlamy) Date: Thu, 26 Sep 2019 07:57:09 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: hg merge default Message-ID: <5d8cd1c5.1c69fb81.ad370.1bba@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97620:16472df37081 Date: 2019-09-26 15:56 +0100 http://bitbucket.org/pypy/pypy/changeset/16472df37081/ Log: hg merge default diff --git a/pypy/conftest.py b/pypy/conftest.py --- a/pypy/conftest.py +++ b/pypy/conftest.py @@ -90,10 +90,13 @@ default=False, dest="applevel_rewrite", help="Use assert rewriting in app-level test files (slow)") + at pytest.fixture(scope='class') +def spaceconfig(request): + return getattr(request.cls, 'spaceconfig', {}) + @pytest.fixture(scope='function') -def space(request): +def space(spaceconfig): from pypy.tool.pytest.objspace import gettestobjspace - spaceconfig = getattr(request.cls, 'spaceconfig', {}) return gettestobjspace(**spaceconfig) diff --git a/pypy/module/_multiprocessing/test/test_interp_semaphore.py b/pypy/module/_multiprocessing/test/test_interp_semaphore.py --- a/pypy/module/_multiprocessing/test/test_interp_semaphore.py +++ b/pypy/module/_multiprocessing/test/test_interp_semaphore.py @@ -1,3 +1,4 @@ +import pytest import time from rpython.rlib.rgil import yield_thread from pypy.tool.pytest.objspace import gettestobjspace @@ -7,8 +8,9 @@ from pypy.module._multiprocessing.interp_semaphore import ( create_semaphore, sem_unlink, W_SemLock) -def test_stuff(space): - space = gettestobjspace(usemodules=['_multiprocessing', 'thread']) + at pytest.mark.parametrize('spaceconfig', [ + {'usemodules': ['_multiprocessing', 'thread']}]) +def test_semlock_release(space): sem_name = '/test7' _handle = create_semaphore(space, sem_name, 1, 1) sem_unlink(sem_name) diff --git a/pypy/tool/pytest/test/test_appsupport.py b/pypy/tool/pytest/test/test_appsupport.py --- a/pypy/tool/pytest/test/test_appsupport.py +++ b/pypy/tool/pytest/test/test_appsupport.py @@ -41,23 +41,38 @@ "*AppTestMethod*", ]) -class TestSpaceConfig: - @pytest.mark.xfail(reason="Can't check config with -A in pypy3") - def test_interp_spaceconfig(self, testdir): - setpypyconftest(testdir) - p = testdir.makepyfile(""" - class TestClass: - spaceconfig = {"objspace.usemodules._random": False} - def setup_class(cls): - assert not cls.space.config.objspace.usemodules._random - def test_interp(self, space): - assert self.space is space - def test_interp2(self, space): - assert self.space is space - """) - result = testdir.runpytest(p) - assert result.ret == 0 - result.stdout.fnmatch_lines(["*2 passed*"]) +def test_interp_spaceconfig(testdir): + setpypyconftest(testdir) + p = testdir.makepyfile(""" + class TestClass: + spaceconfig = {"objspace.usemodules._random": False} + def setup_class(cls): + assert not cls.space.config.objspace.usemodules._random + def test_interp(self, space): + assert self.space is space + def test_interp2(self, space): + assert self.space is space + """) + result = testdir.runpytest(p) + assert result.ret == 0 + result.stdout.fnmatch_lines(["*2 passed*"]) + +def test_spaceconfig_param(testdir): + setpypyconftest(testdir) + p = testdir.makepyfile(""" + import pytest + + @pytest.mark.parametrize('spaceconfig', + [{"objspace.usemodules._random": False}]) + def test_interp(space): + assert not space.config.objspace.usemodules._random + + def test_interp2(space): + assert space.config.objspace.usemodules._random + """) + result = testdir.runpytest(p) + assert result.ret == 0 + result.stdout.fnmatch_lines(["*2 passed*"]) def test_applevel_raises_simple_display(testdir): setpypyconftest(testdir) From pypy.commits at gmail.com Fri Sep 27 01:35:11 2019 From: pypy.commits at gmail.com (mattip) Date: Thu, 26 Sep 2019 22:35:11 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy2.7-v7.x: merge default into release Message-ID: <5d8d9f8f.1c69fb81.6f1e.14f2@mx.google.com> Author: Matti Picus Branch: release-pypy2.7-v7.x Changeset: r97621:f6503c320810 Date: 2019-09-27 08:33 +0300 http://bitbucket.org/pypy/pypy/changeset/f6503c320810/ Log: merge default into release diff --git a/extra_tests/test_semlock.py b/extra_tests/test_semlock.py new file mode 100644 --- /dev/null +++ b/extra_tests/test_semlock.py @@ -0,0 +1,26 @@ +from _multiprocessing import SemLock +from threading import Thread +import time + + +def test_notify_all(): + """A low-level variation on test_notify_all() in lib-python's + test_multiprocessing.py + """ + N_THREADS = 1000 + lock = SemLock(0, 1, 1) + results = [] + + def f(n): + if lock.acquire(timeout=5.): + results.append(n) + lock.release() + + threads = [Thread(target=f, args=(i,)) for i in range(N_THREADS)] + with lock: + for t in threads: + t.start() + time.sleep(0.1) + for t in threads: + t.join() + assert len(results) == N_THREADS diff --git a/pypy/conftest.py b/pypy/conftest.py --- a/pypy/conftest.py +++ b/pypy/conftest.py @@ -72,10 +72,13 @@ default=False, dest="applevel_rewrite", help="Use assert rewriting in app-level test files (slow)") + at pytest.fixture(scope='class') +def spaceconfig(request): + return getattr(request.cls, 'spaceconfig', {}) + @pytest.fixture(scope='function') -def space(request): +def space(spaceconfig): from pypy.tool.pytest.objspace import gettestobjspace - spaceconfig = getattr(request.cls, 'spaceconfig', {}) return gettestobjspace(**spaceconfig) diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst --- a/pypy/doc/release-v7.2.0.rst +++ b/pypy/doc/release-v7.2.0.rst @@ -14,7 +14,7 @@ The interpreters are based on much the same codebase, thus the double release. -With the support of ARM Holdings Ltd. and `Crossbar.io`_, this release supports +With the support of Arm Holdings Ltd. and `Crossbar.io`_, this release supports the 64-bit ``aarch64`` ARM architecture. More about the work and the performance data around this welcome development can be found in the `blog post`_. diff --git a/pypy/module/_multiprocessing/interp_semaphore.py b/pypy/module/_multiprocessing/interp_semaphore.py --- a/pypy/module/_multiprocessing/interp_semaphore.py +++ b/pypy/module/_multiprocessing/interp_semaphore.py @@ -33,7 +33,7 @@ _ReleaseSemaphore = rwin32.winexternal( 'ReleaseSemaphore', [rwin32.HANDLE, rffi.LONG, rffi.LONGP], rwin32.BOOL, - save_err=rffi.RFFI_SAVE_LASTERROR) + save_err=rffi.RFFI_SAVE_LASTERROR, releasegil=True) else: from rpython.rlib import rposix @@ -98,7 +98,7 @@ save_err=rffi.RFFI_SAVE_ERRNO) _sem_trywait = external('sem_trywait', [SEM_T], rffi.INT, save_err=rffi.RFFI_SAVE_ERRNO) - _sem_post = external('sem_post', [SEM_T], rffi.INT, + _sem_post = external('sem_post', [SEM_T], rffi.INT, releasegil=False, save_err=rffi.RFFI_SAVE_ERRNO) _sem_getvalue = external('sem_getvalue', [SEM_T, rffi.INTP], rffi.INT, save_err=rffi.RFFI_SAVE_ERRNO) @@ -374,7 +374,7 @@ elif e.errno in (errno.EAGAIN, errno.ETIMEDOUT): return False raise - _check_signals(space) + _check_signals(space) self.last_tid = rthread.get_ident() self.count += 1 return True @@ -487,7 +487,7 @@ # sets self.last_tid and increments self.count # those steps need to be as close as possible to # acquiring the semlock for self._ismine() to support - # multiple threads + # multiple threads got = semlock_acquire(self, space, block, w_timeout) except OSError as e: raise wrap_oserror(space, e) @@ -507,6 +507,8 @@ return try: + # Note: a succesful semlock_release() must not release the GIL, + # otherwise there is a race condition on self.count semlock_release(self, space) self.count -= 1 except OSError as e: diff --git a/pypy/module/_multiprocessing/test/test_interp_semaphore.py b/pypy/module/_multiprocessing/test/test_interp_semaphore.py new file mode 100644 --- /dev/null +++ b/pypy/module/_multiprocessing/test/test_interp_semaphore.py @@ -0,0 +1,48 @@ +import pytest +import time +from rpython.rlib.rgil import yield_thread +from pypy.tool.pytest.objspace import gettestobjspace +from pypy.interpreter.gateway import interp2app +from pypy.module.thread.os_lock import allocate_lock +from pypy.module.thread.os_thread import start_new_thread +from pypy.module._multiprocessing.interp_semaphore import ( + create_semaphore, sem_unlink, W_SemLock) + + at pytest.mark.parametrize('spaceconfig', [ + {'usemodules': ['_multiprocessing', 'thread']}]) +def test_semlock_release(space): + sem_name = '/test7' + _handle = create_semaphore(space, sem_name, 1, 1) + w_lock = W_SemLock(space, _handle, 0, 1) + created = [] + successful = [] + N_THREADS = 16 + + def run(space): + w_sentinel = allocate_lock(space) + yield_thread() + w_sentinel.descr_lock_acquire(space) # releases GIL + yield_thread() + created.append(w_sentinel) + w_got = w_lock.acquire(space, w_timeout=space.newfloat(5.)) # releases GIL + if space.is_true(w_got): + yield_thread() + w_lock.release(space) + successful.append(w_sentinel) + w_sentinel.descr_lock_release(space) + w_run = space.wrap(interp2app(run)) + + w_lock.acquire(space) + for _ in range(N_THREADS): + start_new_thread(space, w_run, space.newtuple([])) # releases GIL + deadline = time.time() + 5. + while len(created) < N_THREADS: + assert time.time() < deadline + yield_thread() + w_lock.release(space) + + for w_sentinel in created: + # Join thread + w_sentinel.descr_lock_acquire(space) # releases GIL + w_sentinel.descr_lock_release(space) + assert len(successful) == N_THREADS diff --git a/pypy/tool/pytest/test/test_appsupport.py b/pypy/tool/pytest/test/test_appsupport.py --- a/pypy/tool/pytest/test/test_appsupport.py +++ b/pypy/tool/pytest/test/test_appsupport.py @@ -40,22 +40,38 @@ "*AppTestMethod*", ]) -class TestSpaceConfig: - def test_interp_spaceconfig(self, testdir): - setpypyconftest(testdir) - p = testdir.makepyfile(""" - class TestClass: - spaceconfig = {"objspace.usemodules._random": False} - def setup_class(cls): - assert not cls.space.config.objspace.usemodules._random - def test_interp(self, space): - assert self.space is space - def test_interp2(self, space): - assert self.space is space - """) - result = testdir.runpytest(p) - assert result.ret == 0 - result.stdout.fnmatch_lines(["*2 passed*"]) +def test_interp_spaceconfig(testdir): + setpypyconftest(testdir) + p = testdir.makepyfile(""" + class TestClass: + spaceconfig = {"objspace.usemodules._random": False} + def setup_class(cls): + assert not cls.space.config.objspace.usemodules._random + def test_interp(self, space): + assert self.space is space + def test_interp2(self, space): + assert self.space is space + """) + result = testdir.runpytest(p) + assert result.ret == 0 + result.stdout.fnmatch_lines(["*2 passed*"]) + +def test_spaceconfig_param(testdir): + setpypyconftest(testdir) + p = testdir.makepyfile(""" + import pytest + + @pytest.mark.parametrize('spaceconfig', + [{"objspace.usemodules._random": False}]) + def test_interp(space): + assert not space.config.objspace.usemodules._random + + def test_interp2(space): + assert space.config.objspace.usemodules._random + """) + result = testdir.runpytest(p) + assert result.ret == 0 + result.stdout.fnmatch_lines(["*2 passed*"]) def test_applevel_raises_simple_display(testdir): setpypyconftest(testdir) diff --git a/pypy/tool/release/force-builds.py b/pypy/tool/release/force-builds.py --- a/pypy/tool/release/force-builds.py +++ b/pypy/tool/release/force-builds.py @@ -28,6 +28,7 @@ 'own-win-x86-32', 'own-linux-s390x', # 'own-macosx-x86-32', + 'own-linux-aarch64', 'pypy-c-jit-linux-x86-32', 'pypy-c-jit-linux-x86-64', # 'pypy-c-jit-freebsd-9-x86-64', @@ -36,6 +37,7 @@ 'pypy-c-jit-linux-s390x', # 'build-pypy-c-jit-linux-armhf-raspbian', # 'build-pypy-c-jit-linux-armel', + 'pypy-c-jit-linux-aarch64', 'rpython-linux-x86-32', 'rpython-linux-x86-64', 'rpython-win-x86-32' diff --git a/pypy/tool/release/repackage.sh b/pypy/tool/release/repackage.sh --- a/pypy/tool/release/repackage.sh +++ b/pypy/tool/release/repackage.sh @@ -28,7 +28,7 @@ # Download latest builds from the buildmaster, rename the top # level directory, and repackage ready to be uploaded to bitbucket actual_ver=xxxxxxxxxxxxxxx -for plat in linux linux64 osx64 s390x # linux-armhf-raspbian linux-armel +for plat in linux linux64 osx64 s390x aarch64 # linux-armhf-raspbian linux-armel do echo downloading package for $plat if wget -q --show-progress http://buildbot.pypy.org/nightly/$branchname/pypy-c-jit-latest-$plat.tar.bz2 From pypy.commits at gmail.com Fri Sep 27 01:35:13 2019 From: pypy.commits at gmail.com (mattip) Date: Thu, 26 Sep 2019 22:35:13 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy3.6-7.x: merge py3.6 into release Message-ID: <5d8d9f91.1c69fb81.2f655.bfd4@mx.google.com> Author: Matti Picus Branch: release-pypy3.6-7.x Changeset: r97622:87e85ded557b Date: 2019-09-27 08:34 +0300 http://bitbucket.org/pypy/pypy/changeset/87e85ded557b/ Log: merge py3.6 into release diff --git a/extra_tests/test_semlock.py b/extra_tests/test_semlock.py new file mode 100644 --- /dev/null +++ b/extra_tests/test_semlock.py @@ -0,0 +1,26 @@ +from _multiprocessing import SemLock +from threading import Thread +import time + + +def test_notify_all(): + """A low-level variation on test_notify_all() in lib-python's + _test_multiprocessing.py + """ + N_THREADS = 1000 + lock = SemLock(0, 1, 1, "/test_notify_all", True) + results = [] + + def f(n): + if lock.acquire(timeout=5.): + results.append(n) + lock.release() + + threads = [Thread(target=f, args=(i,)) for i in range(N_THREADS)] + with lock: + for t in threads: + t.start() + time.sleep(0.1) + for t in threads: + t.join() + assert len(results) == N_THREADS diff --git a/pypy/conftest.py b/pypy/conftest.py --- a/pypy/conftest.py +++ b/pypy/conftest.py @@ -90,10 +90,13 @@ default=False, dest="applevel_rewrite", help="Use assert rewriting in app-level test files (slow)") + at pytest.fixture(scope='class') +def spaceconfig(request): + return getattr(request.cls, 'spaceconfig', {}) + @pytest.fixture(scope='function') -def space(request): +def space(spaceconfig): from pypy.tool.pytest.objspace import gettestobjspace - spaceconfig = getattr(request.cls, 'spaceconfig', {}) return gettestobjspace(**spaceconfig) diff --git a/pypy/doc/release-v7.2.0.rst b/pypy/doc/release-v7.2.0.rst --- a/pypy/doc/release-v7.2.0.rst +++ b/pypy/doc/release-v7.2.0.rst @@ -14,7 +14,7 @@ The interpreters are based on much the same codebase, thus the double release. -With the support of ARM Holdings Ltd. and `Crossbar.io`_, this release supports +With the support of Arm Holdings Ltd. and `Crossbar.io`_, this release supports the 64-bit ``aarch64`` ARM architecture. More about the work and the performance data around this welcome development can be found in the `blog post`_. diff --git a/pypy/interpreter/gateway.py b/pypy/interpreter/gateway.py --- a/pypy/interpreter/gateway.py +++ b/pypy/interpreter/gateway.py @@ -538,7 +538,7 @@ def visit_kwonly(self, typ): raise FastFuncNotSupported - + @staticmethod def make_fastfunc(unwrap_spec, func): unwrap_info = UnwrapSpec_FastFunc_Unwrap() diff --git a/pypy/module/_multiprocessing/interp_semaphore.py b/pypy/module/_multiprocessing/interp_semaphore.py --- a/pypy/module/_multiprocessing/interp_semaphore.py +++ b/pypy/module/_multiprocessing/interp_semaphore.py @@ -33,7 +33,7 @@ _ReleaseSemaphore = rwin32.winexternal( 'ReleaseSemaphore', [rwin32.HANDLE, rffi.LONG, rffi.LONGP], rwin32.BOOL, - save_err=rffi.RFFI_SAVE_LASTERROR) + save_err=rffi.RFFI_SAVE_LASTERROR, releasegil=True) def sem_unlink(name): return None @@ -100,7 +100,7 @@ save_err=rffi.RFFI_SAVE_ERRNO) _sem_trywait = external('sem_trywait', [SEM_T], rffi.INT, save_err=rffi.RFFI_SAVE_ERRNO) - _sem_post = external('sem_post', [SEM_T], rffi.INT, + _sem_post = external('sem_post', [SEM_T], rffi.INT, releasegil=False, save_err=rffi.RFFI_SAVE_ERRNO) _sem_getvalue = external('sem_getvalue', [SEM_T, rffi.INTP], rffi.INT, save_err=rffi.RFFI_SAVE_ERRNO) @@ -384,7 +384,7 @@ elif e.errno in (errno.EAGAIN, errno.ETIMEDOUT): return False raise - _check_signals(space) + _check_signals(space) self.last_tid = rthread.get_ident() self.count += 1 return True @@ -506,7 +506,7 @@ # sets self.last_tid and increments self.count # those steps need to be as close as possible to # acquiring the semlock for self._ismine() to support - # multiple threads + # multiple threads got = semlock_acquire(self, space, block, w_timeout) except OSError as e: raise wrap_oserror(space, e) @@ -526,6 +526,8 @@ return try: + # Note: a succesful semlock_release() must not release the GIL, + # otherwise there is a race condition on self.count semlock_release(self, space) self.count -= 1 except OSError as e: diff --git a/pypy/module/_multiprocessing/test/test_interp_semaphore.py b/pypy/module/_multiprocessing/test/test_interp_semaphore.py new file mode 100644 --- /dev/null +++ b/pypy/module/_multiprocessing/test/test_interp_semaphore.py @@ -0,0 +1,48 @@ +import pytest +import time +from rpython.rlib.rgil import yield_thread +from pypy.tool.pytest.objspace import gettestobjspace +from pypy.interpreter.gateway import interp2app +from pypy.module.thread.os_lock import _set_sentinel +from pypy.module.thread.os_thread import start_new_thread +from pypy.module._multiprocessing.interp_semaphore import ( + create_semaphore, sem_unlink, W_SemLock) + + at pytest.mark.parametrize('spaceconfig', [ + {'usemodules': ['_multiprocessing', 'thread']}]) +def test_semlock_release(space): + sem_name = '/test7' + _handle = create_semaphore(space, sem_name, 1, 1) + sem_unlink(sem_name) + w_lock = W_SemLock(space, _handle, 0, 1, None) + created = [] + successful = [] + N_THREADS = 16 + + def run(space): + w_sentinel = _set_sentinel(space) + yield_thread() + w_sentinel.descr_lock_acquire(space) # releases GIL + yield_thread() + created.append(w_sentinel) + w_got = w_lock.acquire(space, w_timeout=space.newfloat(5.)) # releases GIL + if space.is_true(w_got): + yield_thread() + w_lock.release(space) + successful.append(w_sentinel) + w_run = space.wrap(interp2app(run)) + + w_lock.acquire(space) + for _ in range(N_THREADS): + start_new_thread(space, w_run, space.newtuple([])) # releases GIL + deadline = time.time() + 5. + while len(created) < N_THREADS: + assert time.time() < deadline + yield_thread() + w_lock.release(space) + + for w_sentinel in created: + # Join thread + w_sentinel.descr_lock_acquire(space) # releases GIL + w_sentinel.descr_lock_release(space) + assert len(successful) == N_THREADS diff --git a/pypy/tool/pytest/test/test_appsupport.py b/pypy/tool/pytest/test/test_appsupport.py --- a/pypy/tool/pytest/test/test_appsupport.py +++ b/pypy/tool/pytest/test/test_appsupport.py @@ -41,23 +41,38 @@ "*AppTestMethod*", ]) -class TestSpaceConfig: - @pytest.mark.xfail(reason="Can't check config with -A in pypy3") - def test_interp_spaceconfig(self, testdir): - setpypyconftest(testdir) - p = testdir.makepyfile(""" - class TestClass: - spaceconfig = {"objspace.usemodules._random": False} - def setup_class(cls): - assert not cls.space.config.objspace.usemodules._random - def test_interp(self, space): - assert self.space is space - def test_interp2(self, space): - assert self.space is space - """) - result = testdir.runpytest(p) - assert result.ret == 0 - result.stdout.fnmatch_lines(["*2 passed*"]) +def test_interp_spaceconfig(testdir): + setpypyconftest(testdir) + p = testdir.makepyfile(""" + class TestClass: + spaceconfig = {"objspace.usemodules._random": False} + def setup_class(cls): + assert not cls.space.config.objspace.usemodules._random + def test_interp(self, space): + assert self.space is space + def test_interp2(self, space): + assert self.space is space + """) + result = testdir.runpytest(p) + assert result.ret == 0 + result.stdout.fnmatch_lines(["*2 passed*"]) + +def test_spaceconfig_param(testdir): + setpypyconftest(testdir) + p = testdir.makepyfile(""" + import pytest + + @pytest.mark.parametrize('spaceconfig', + [{"objspace.usemodules._random": False}]) + def test_interp(space): + assert not space.config.objspace.usemodules._random + + def test_interp2(space): + assert space.config.objspace.usemodules._random + """) + result = testdir.runpytest(p) + assert result.ret == 0 + result.stdout.fnmatch_lines(["*2 passed*"]) def test_applevel_raises_simple_display(testdir): setpypyconftest(testdir) diff --git a/pypy/tool/release/force-builds.py b/pypy/tool/release/force-builds.py --- a/pypy/tool/release/force-builds.py +++ b/pypy/tool/release/force-builds.py @@ -28,6 +28,7 @@ 'own-win-x86-32', 'own-linux-s390x', # 'own-macosx-x86-32', + 'own-linux-aarch64', 'pypy-c-jit-linux-x86-32', 'pypy-c-jit-linux-x86-64', # 'pypy-c-jit-freebsd-9-x86-64', @@ -36,6 +37,7 @@ 'pypy-c-jit-linux-s390x', # 'build-pypy-c-jit-linux-armhf-raspbian', # 'build-pypy-c-jit-linux-armel', + 'pypy-c-jit-linux-aarch64', 'rpython-linux-x86-32', 'rpython-linux-x86-64', 'rpython-win-x86-32' diff --git a/pypy/tool/release/repackage.sh b/pypy/tool/release/repackage.sh --- a/pypy/tool/release/repackage.sh +++ b/pypy/tool/release/repackage.sh @@ -28,7 +28,7 @@ # Download latest builds from the buildmaster, rename the top # level directory, and repackage ready to be uploaded to bitbucket actual_ver=xxxxxxxxxxxxxxx -for plat in linux linux64 osx64 s390x # linux-armhf-raspbian linux-armel +for plat in linux linux64 osx64 s390x aarch64 # linux-armhf-raspbian linux-armel do echo downloading package for $plat if wget -q --show-progress http://buildbot.pypy.org/nightly/$branchname/pypy-c-jit-latest-$plat.tar.bz2 From pypy.commits at gmail.com Fri Sep 27 05:45:09 2019 From: pypy.commits at gmail.com (mattip) Date: Fri, 27 Sep 2019 02:45:09 -0700 (PDT) Subject: [pypy-commit] pypy default: update JIT test and file encoding Message-ID: <5d8dda25.1c69fb81.566c8.9118@mx.google.com> Author: Matti Picus Branch: Changeset: r97623:028812d11211 Date: 2019-09-27 12:04 +0300 http://bitbucket.org/pypy/pypy/changeset/028812d11211/ Log: update JIT test and file encoding diff --git a/pypy/module/pypyjit/test_pypy_c/test_ffi.py b/pypy/module/pypyjit/test_pypy_c/test_ffi.py --- a/pypy/module/pypyjit/test_pypy_c/test_ffi.py +++ b/pypy/module/pypyjit/test_pypy_c/test_ffi.py @@ -425,11 +425,9 @@ setarrayitem_raw(i153, 0, i106, descr=...) p156 = getfield_gc_r(p48, descr=...) i158 = getfield_raw_i(..., descr=...) - i160 = int_sub(i158, 16) - setfield_raw(#, i160, descr=...) setfield_gc(p48, p49, descr=...) setfield_gc(p134, ConstPtr(null), descr=...) - i160 = int_lt(i160, 0) - guard_false(i160, descr=...) + i159 = int_lt(i158, 0) + guard_false(i159, descr=...) jump(..., descr=...) """) diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py b/pypy/module/pypyjit/test_pypy_c/test_string.py --- a/pypy/module/pypyjit/test_pypy_c/test_string.py +++ b/pypy/module/pypyjit/test_pypy_c/test_string.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import sys from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC From pypy.commits at gmail.com Fri Sep 27 05:45:10 2019 From: pypy.commits at gmail.com (mattip) Date: Fri, 27 Sep 2019 02:45:10 -0700 (PDT) Subject: [pypy-commit] pypy default: adjust test for systems with limited threads Message-ID: <5d8dda26.1c69fb81.6d5bf.8e6b@mx.google.com> Author: Matti Picus Branch: Changeset: r97624:000e74685f0b Date: 2019-09-27 12:17 +0300 http://bitbucket.org/pypy/pypy/changeset/000e74685f0b/ Log: adjust test for systems with limited threads diff --git a/extra_tests/test_semlock.py b/extra_tests/test_semlock.py --- a/extra_tests/test_semlock.py +++ b/extra_tests/test_semlock.py @@ -1,5 +1,6 @@ from _multiprocessing import SemLock from threading import Thread +import thread import time @@ -17,10 +18,19 @@ lock.release() threads = [Thread(target=f, args=(i,)) for i in range(N_THREADS)] + n_started = N_THREADS with lock: for t in threads: - t.start() + try: + t.start() + except thread.error: + # too many threads for this system + t.started = False + n_started -= 1 + else: + t.started = True time.sleep(0.1) for t in threads: - t.join() - assert len(results) == N_THREADS + if t.started: + t.join() + assert len(results) == n_started From pypy.commits at gmail.com Sat Sep 28 13:43:49 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:43:49 -0700 (PDT) Subject: [pypy-commit] pypy utf8-unicode2: close abandoned branch Message-ID: <5d8f9bd5.1c69fb81.d3e6a.67a6@mx.google.com> Author: Matti Picus Branch: utf8-unicode2 Changeset: r97625:74012b3efb6a Date: 2019-09-28 20:21 +0300 http://bitbucket.org/pypy/pypy/changeset/74012b3efb6a/ Log: close abandoned branch From pypy.commits at gmail.com Sat Sep 28 13:43:51 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:43:51 -0700 (PDT) Subject: [pypy-commit] pypy utf8-unicode: close abandoned branch Message-ID: <5d8f9bd7.1c69fb81.5fd18.6cb8@mx.google.com> Author: Matti Picus Branch: utf8-unicode Changeset: r97626:5c1dd534b063 Date: 2019-09-28 20:21 +0300 http://bitbucket.org/pypy/pypy/changeset/5c1dd534b063/ Log: close abandoned branch From pypy.commits at gmail.com Sat Sep 28 13:43:53 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:43:53 -0700 (PDT) Subject: [pypy-commit] pypy fix_test_unicode_outofrange: close abandoned branch Message-ID: <5d8f9bd9.1c69fb81.af631.0f3a@mx.google.com> Author: Matti Picus Branch: fix_test_unicode_outofrange Changeset: r97627:ca7e5b14bb58 Date: 2019-09-28 20:22 +0300 http://bitbucket.org/pypy/pypy/changeset/ca7e5b14bb58/ Log: close abandoned branch From pypy.commits at gmail.com Sat Sep 28 13:43:55 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:43:55 -0700 (PDT) Subject: [pypy-commit] pypy unicode-fix: close abandoned branch Message-ID: <5d8f9bdb.1c69fb81.f9990.53d2@mx.google.com> Author: Matti Picus Branch: unicode-fix Changeset: r97628:82f53d5da066 Date: 2019-09-28 20:22 +0300 http://bitbucket.org/pypy/pypy/changeset/82f53d5da066/ Log: close abandoned branch From pypy.commits at gmail.com Sat Sep 28 13:43:56 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:43:56 -0700 (PDT) Subject: [pypy-commit] pypy release-2.3.x: close old release branch Message-ID: <5d8f9bdc.1c69fb81.471b.9668@mx.google.com> Author: Matti Picus Branch: release-2.3.x Changeset: r97629:fae4310cc9a4 Date: 2019-09-28 20:23 +0300 http://bitbucket.org/pypy/pypy/changeset/fae4310cc9a4/ Log: close old release branch From pypy.commits at gmail.com Sat Sep 28 13:43:58 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:43:58 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy2.7-5.x: close old release branch Message-ID: <5d8f9bde.1c69fb81.b0332.1ff3@mx.google.com> Author: Matti Picus Branch: release-pypy2.7-5.x Changeset: r97630:dc0d1ad4b705 Date: 2019-09-28 20:24 +0300 http://bitbucket.org/pypy/pypy/changeset/dc0d1ad4b705/ Log: close old release branch From pypy.commits at gmail.com Sat Sep 28 13:43:59 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:43:59 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy3.5-5.x: close old release branch Message-ID: <5d8f9bdf.1c69fb81.a143d.887a@mx.google.com> Author: Matti Picus Branch: release-pypy3.5-5.x Changeset: r97631:282c049cb55d Date: 2019-09-28 20:25 +0300 http://bitbucket.org/pypy/pypy/changeset/282c049cb55d/ Log: close old release branch From pypy.commits at gmail.com Sat Sep 28 13:44:01 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:01 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy2.7-v5.9.x: close old release branch Message-ID: <5d8f9be1.1c69fb81.9382c.4645@mx.google.com> Author: Matti Picus Branch: release-pypy2.7-v5.9.x Changeset: r97632:e916b676b63f Date: 2019-09-28 20:25 +0300 http://bitbucket.org/pypy/pypy/changeset/e916b676b63f/ Log: close old release branch From pypy.commits at gmail.com Sat Sep 28 13:44:03 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:03 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy3.5-v5.9.x: close old release branch Message-ID: <5d8f9be3.1c69fb81.1e066.dc04@mx.google.com> Author: Matti Picus Branch: release-pypy3.5-v5.9.x Changeset: r97633:f9cb3f0c51d3 Date: 2019-09-28 20:26 +0300 http://bitbucket.org/pypy/pypy/changeset/f9cb3f0c51d3/ Log: close old release branch From pypy.commits at gmail.com Sat Sep 28 13:44:04 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:04 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy3.6-7.x: close old release branch Message-ID: <5d8f9be4.1c69fb81.c7a09.20f7@mx.google.com> Author: Matti Picus Branch: release-pypy3.6-7.x Changeset: r97634:87ace2419baf Date: 2019-09-28 20:26 +0300 http://bitbucket.org/pypy/pypy/changeset/87ace2419baf/ Log: close old release branch From pypy.commits at gmail.com Sat Sep 28 13:44:06 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:06 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy3.3-5.x: close old release branch Message-ID: <5d8f9be6.1c69fb81.1d31e.144c@mx.google.com> Author: Matti Picus Branch: release-pypy3.3-5.x Changeset: r97635:be662e1da8fa Date: 2019-09-28 20:27 +0300 http://bitbucket.org/pypy/pypy/changeset/be662e1da8fa/ Log: close old release branch From pypy.commits at gmail.com Sat Sep 28 13:44:07 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:07 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy2.7-6.x: close old release branch Message-ID: <5d8f9be7.1c69fb81.90f7c.c521@mx.google.com> Author: Matti Picus Branch: release-pypy2.7-6.x Changeset: r97636:d8fec912d479 Date: 2019-09-28 20:27 +0300 http://bitbucket.org/pypy/pypy/changeset/d8fec912d479/ Log: close old release branch From pypy.commits at gmail.com Sat Sep 28 13:44:09 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:09 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy3.5-6.x: close old release branch Message-ID: <5d8f9be9.1c69fb81.637c8.7752@mx.google.com> Author: Matti Picus Branch: release-pypy3.5-6.x Changeset: r97637:4682175c07a0 Date: 2019-09-28 20:27 +0300 http://bitbucket.org/pypy/pypy/changeset/4682175c07a0/ Log: close old release branch From pypy.commits at gmail.com Sat Sep 28 13:44:10 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:10 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy2.7-7.x: close old release branch Message-ID: <5d8f9bea.1c69fb81.e7eb7.e05b@mx.google.com> Author: Matti Picus Branch: release-pypy2.7-7.x Changeset: r97638:81ae764ead91 Date: 2019-09-28 20:28 +0300 http://bitbucket.org/pypy/pypy/changeset/81ae764ead91/ Log: close old release branch From pypy.commits at gmail.com Sat Sep 28 13:44:12 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:12 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy3.5-7.x: close old release branch Message-ID: <5d8f9bec.1c69fb81.cc40a.d5cc@mx.google.com> Author: Matti Picus Branch: release-pypy3.5-7.x Changeset: r97639:3e255ae2282f Date: 2019-09-28 20:28 +0300 http://bitbucket.org/pypy/pypy/changeset/3e255ae2282f/ Log: close old release branch From pypy.commits at gmail.com Sat Sep 28 13:44:13 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:13 -0700 (PDT) Subject: [pypy-commit] pypy techtonik/release240rst-fix-indentation-and-some-o-1410020236989: close merged branch Message-ID: <5d8f9bed.1c69fb81.e0657.7884@mx.google.com> Author: Matti Picus Branch: techtonik/release240rst-fix-indentation-and-some-o-1410020236989 Changeset: r97640:e315429becb1 Date: 2019-09-28 20:28 +0300 http://bitbucket.org/pypy/pypy/changeset/e315429becb1/ Log: close merged branch From pypy.commits at gmail.com Sat Sep 28 13:44:15 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:15 -0700 (PDT) Subject: [pypy-commit] pypy techtonik/introductionrst-simplify-explanation-abo-1460879168046: close merged branch Message-ID: <5d8f9bef.1c69fb81.79c8d.31bc@mx.google.com> Author: Matti Picus Branch: techtonik/introductionrst-simplify-explanation-abo-1460879168046 Changeset: r97641:4ca91b8a7121 Date: 2019-09-28 20:29 +0300 http://bitbucket.org/pypy/pypy/changeset/4ca91b8a7121/ Log: close merged branch From pypy.commits at gmail.com Sat Sep 28 13:44:16 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:16 -0700 (PDT) Subject: [pypy-commit] pypy py3.5-mac-embedding: close abandoned branch Message-ID: <5d8f9bf0.1c69fb81.b9db3.c303@mx.google.com> Author: Matti Picus Branch: py3.5-mac-embedding Changeset: r97642:2b8893eda16d Date: 2019-09-28 20:30 +0300 http://bitbucket.org/pypy/pypy/changeset/2b8893eda16d/ Log: close abandoned branch From pypy.commits at gmail.com Sat Sep 28 13:44:18 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:18 -0700 (PDT) Subject: [pypy-commit] pypy py3.5-appexec: close abandoned branch Message-ID: <5d8f9bf2.1c69fb81.56266.74b6@mx.google.com> Author: Matti Picus Branch: py3.5-appexec Changeset: r97643:c9efee3c1f21 Date: 2019-09-28 20:31 +0300 http://bitbucket.org/pypy/pypy/changeset/c9efee3c1f21/ Log: close abandoned branch From pypy.commits at gmail.com Sat Sep 28 13:44:19 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:19 -0700 (PDT) Subject: [pypy-commit] pypy freelibrary: close abandoned branch Message-ID: <5d8f9bf3.1c69fb81.79c8d.31c0@mx.google.com> Author: Matti Picus Branch: freelibrary Changeset: r97644:e54b16dd02ba Date: 2019-09-28 20:33 +0300 http://bitbucket.org/pypy/pypy/changeset/e54b16dd02ba/ Log: close abandoned branch From pypy.commits at gmail.com Sat Sep 28 13:44:21 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:21 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head ab27979d22ca on branch issue2996 Message-ID: <5d8f9bf5.1c69fb81.f72a7.0998@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97645:63754c7ff8ce Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/63754c7ff8ce/ Log: Merge closed head ab27979d22ca on branch issue2996 From pypy.commits at gmail.com Sat Sep 28 13:44:22 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:22 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head 9c5ebfaa4643 on branch vendor/stdlib-2.7.16 Message-ID: <5d8f9bf6.1c69fb81.4ea67.9363@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97646:4d0078908282 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/4d0078908282/ Log: Merge closed head 9c5ebfaa4643 on branch vendor/stdlib-2.7.16 From pypy.commits at gmail.com Sat Sep 28 13:44:24 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:24 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head b8fc8739c04a on branch cffi-libs2 Message-ID: <5d8f9bf8.1c69fb81.716f5.46af@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97647:68f39bbd8a19 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/68f39bbd8a19/ Log: Merge closed head b8fc8739c04a on branch cffi-libs2 From pypy.commits at gmail.com Sat Sep 28 13:44:25 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:25 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head 74012b3efb6a on branch utf8-unicode2 Message-ID: <5d8f9bf9.1c69fb81.64de9.b2c7@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97648:a95f267feb4e Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/a95f267feb4e/ Log: Merge closed head 74012b3efb6a on branch utf8-unicode2 From pypy.commits at gmail.com Sat Sep 28 13:44:27 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:27 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head 5c1dd534b063 on branch utf8-unicode Message-ID: <5d8f9bfb.1c69fb81.4ea67.936f@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97649:15c08089a24e Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/15c08089a24e/ Log: Merge closed head 5c1dd534b063 on branch utf8-unicode From pypy.commits at gmail.com Sat Sep 28 13:44:28 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:28 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head ca7e5b14bb58 on branch fix_test_unicode_outofrange Message-ID: <5d8f9bfc.1c69fb81.cf010.901f@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97650:d1cc728a22eb Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/d1cc728a22eb/ Log: Merge closed head ca7e5b14bb58 on branch fix_test_unicode_outofrange From pypy.commits at gmail.com Sat Sep 28 13:44:30 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:30 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head 82f53d5da066 on branch unicode-fix Message-ID: <5d8f9bfe.1c69fb81.c1a6d.ff91@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97651:e4823a772faa Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/e4823a772faa/ Log: Merge closed head 82f53d5da066 on branch unicode-fix From pypy.commits at gmail.com Sat Sep 28 13:44:31 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:31 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head fae4310cc9a4 on branch release-2.3.x Message-ID: <5d8f9bff.1c69fb81.125b8.5a88@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97652:985886d8874a Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/985886d8874a/ Log: Merge closed head fae4310cc9a4 on branch release-2.3.x From pypy.commits at gmail.com Sat Sep 28 13:44:33 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:33 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head dc0d1ad4b705 on branch release-pypy2.7-5.x Message-ID: <5d8f9c01.1c69fb81.08ed.d94e@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97653:fe5dae22b6e4 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/fe5dae22b6e4/ Log: Merge closed head dc0d1ad4b705 on branch release-pypy2.7-5.x From pypy.commits at gmail.com Sat Sep 28 13:44:34 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:34 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head 282c049cb55d on branch release-pypy3.5-5.x Message-ID: <5d8f9c02.1c69fb81.761e.1c9d@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97654:d74ee2a427c2 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/d74ee2a427c2/ Log: Merge closed head 282c049cb55d on branch release-pypy3.5-5.x From pypy.commits at gmail.com Sat Sep 28 13:44:36 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:36 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head e916b676b63f on branch release-pypy2.7-v5.9.x Message-ID: <5d8f9c04.1c69fb81.4ea67.9388@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97655:26e6d6bd93df Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/26e6d6bd93df/ Log: Merge closed head e916b676b63f on branch release-pypy2.7-v5.9.x From pypy.commits at gmail.com Sat Sep 28 13:44:38 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:38 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head f9cb3f0c51d3 on branch release-pypy3.5-v5.9.x Message-ID: <5d8f9c06.1c69fb81.37537.fec1@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97656:8c4d82122015 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/8c4d82122015/ Log: Merge closed head f9cb3f0c51d3 on branch release-pypy3.5-v5.9.x From pypy.commits at gmail.com Sat Sep 28 13:44:39 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:39 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head 87ace2419baf on branch release-pypy3.6-7.x Message-ID: <5d8f9c07.1c69fb81.99c51.152d@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97657:e7ba78e72c13 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/e7ba78e72c13/ Log: Merge closed head 87ace2419baf on branch release-pypy3.6-7.x From pypy.commits at gmail.com Sat Sep 28 13:44:41 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:41 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head be662e1da8fa on branch release-pypy3.3-5.x Message-ID: <5d8f9c09.1c69fb81.5a77e.c295@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97658:a15d9accfc49 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/a15d9accfc49/ Log: Merge closed head be662e1da8fa on branch release-pypy3.3-5.x From pypy.commits at gmail.com Sat Sep 28 13:44:42 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:42 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head d8fec912d479 on branch release-pypy2.7-6.x Message-ID: <5d8f9c0a.1c69fb81.3540b.c510@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97659:09bb6855c96d Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/09bb6855c96d/ Log: Merge closed head d8fec912d479 on branch release-pypy2.7-6.x From pypy.commits at gmail.com Sat Sep 28 13:44:44 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:44 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head 4682175c07a0 on branch release-pypy3.5-6.x Message-ID: <5d8f9c0c.1c69fb81.76ed4.4e0b@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97660:f980f70d5f23 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/f980f70d5f23/ Log: Merge closed head 4682175c07a0 on branch release-pypy3.5-6.x From pypy.commits at gmail.com Sat Sep 28 13:44:45 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:45 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head 81ae764ead91 on branch release-pypy2.7-7.x Message-ID: <5d8f9c0d.1c69fb81.f693c.8cd2@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97661:52c860b4e893 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/52c860b4e893/ Log: Merge closed head 81ae764ead91 on branch release-pypy2.7-7.x From pypy.commits at gmail.com Sat Sep 28 13:44:47 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:47 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head 3e255ae2282f on branch release-pypy3.5-7.x Message-ID: <5d8f9c0f.1c69fb81.80138.a911@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97662:46f5211f6b8b Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/46f5211f6b8b/ Log: Merge closed head 3e255ae2282f on branch release-pypy3.5-7.x From pypy.commits at gmail.com Sat Sep 28 13:44:48 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:48 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head e315429becb1 on branch techtonik/release240rst-fix-indentation-and-some-o-1410020236989 Message-ID: <5d8f9c10.1c69fb81.7ddbe.3ffb@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97663:af4a51d30aa2 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/af4a51d30aa2/ Log: Merge closed head e315429becb1 on branch techtonik/release240rst- fix-indentation-and-some-o-1410020236989 From pypy.commits at gmail.com Sat Sep 28 13:44:50 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:50 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head 4ca91b8a7121 on branch techtonik/introductionrst-simplify-explanation-abo-1460879168046 Message-ID: <5d8f9c12.1c69fb81.1e066.dc91@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97664:00dd7c6aefe2 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/00dd7c6aefe2/ Log: Merge closed head 4ca91b8a7121 on branch techtonik/introductionrst- simplify-explanation-abo-1460879168046 From pypy.commits at gmail.com Sat Sep 28 13:44:51 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:51 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head 2b8893eda16d on branch py3.5-mac-embedding Message-ID: <5d8f9c13.1c69fb81.9dd00.de81@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97665:a26d02f53173 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/a26d02f53173/ Log: Merge closed head 2b8893eda16d on branch py3.5-mac-embedding From pypy.commits at gmail.com Sat Sep 28 13:44:53 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:53 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head c9efee3c1f21 on branch py3.5-appexec Message-ID: <5d8f9c15.1c69fb81.f9990.543a@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97666:42a78661bcf8 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/42a78661bcf8/ Log: Merge closed head c9efee3c1f21 on branch py3.5-appexec From pypy.commits at gmail.com Sat Sep 28 13:44:55 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:55 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: Merge closed head e54b16dd02ba on branch freelibrary Message-ID: <5d8f9c17.1c69fb81.e4ea2.d023@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97667:aef6a9b34bb2 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/aef6a9b34bb2/ Log: Merge closed head e54b16dd02ba on branch freelibrary From pypy.commits at gmail.com Sat Sep 28 13:44:56 2019 From: pypy.commits at gmail.com (mattip) Date: Sat, 28 Sep 2019 10:44:56 -0700 (PDT) Subject: [pypy-commit] pypy closed-branches: re-close this branch Message-ID: <5d8f9c18.1c69fb81.64de9.b2e1@mx.google.com> Author: Matti Picus Branch: closed-branches Changeset: r97668:18fd8430a718 Date: 2019-09-28 20:39 +0300 http://bitbucket.org/pypy/pypy/changeset/18fd8430a718/ Log: re-close this branch From pypy.commits at gmail.com Sat Sep 28 13:56:06 2019 From: pypy.commits at gmail.com (andrewjlawrence) Date: Sat, 28 Sep 2019 10:56:06 -0700 (PDT) Subject: [pypy-commit] pypy winconsoleio: Implemented more tests for winconsole io. Message-ID: <5d8f9eb6.1c69fb81.2f655.7f22@mx.google.com> Author: andrewjlawrence Branch: winconsoleio Changeset: r97670:ff5130e8c568 Date: 2019-09-28 18:54 +0100 http://bitbucket.org/pypy/pypy/changeset/ff5130e8c568/ Log: Implemented more tests for winconsole io. Add interp tests for get_console_type method. Fixed a few things. diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -172,7 +172,7 @@ buf[n] = self.buf[0] for i in range(1, SMALLBUF): self.buf[i-1] = self.buf[i] - self.buf[SMALLBUF-1] = 0 + self.buf[SMALLBUF-1] = rffi.cast(rffi.CCHARP.TO, 0) len -= 1 n += 1 return n @@ -193,7 +193,7 @@ self.blksize = 0 rwa = False console_type = '\0' - self.buf = lltype.malloc(rffi.CCHARPP.TO,SMALLBUF,flavor='raw') + self.buf = lltype.malloc(rffi.CCHARP.TO,SMALLBUF,flavor='raw') try: if space.isinstance_w(w_nameobj, space.w_int): @@ -330,9 +330,9 @@ win32traits = make_win32_traits(traits) if self.fd < 0 and self.handle != rwin32.INVALID_HANDLE_VALUE: if self.writable: - self.fd = rwin32.open_osfhandle(self.handle, win32traits._O_WRONLY | win32traits._O_BINARY) + self.fd = rwin32.open_osfhandle(rffi.cast(rffi.INTP, self.handle), win32traits._O_WRONLY | win32traits._O_BINARY) else: - self.fd = rwin32.open_osfhandle(self.handle, win32traits._O_RDONLY | win32traits._O_BINARY) + self.fd = rwin32.open_osfhandle(rffi.cast(rffi.INTP, self.handle), win32traits._O_RDONLY | win32traits._O_BINARY) if self.fd < 0: return err_mode(space, "fileno") return space.newint(self.fd) @@ -377,8 +377,7 @@ return space.newint(read_len) u8n = 0 - - + if len < 4: if rwin32.WideCharToMultiByte(rwin32.CP_UTF8, 0, wbuf, n, self.buf, diff --git a/pypy/module/_io/test/test_win32consoleio.py b/pypy/module/_io/test/test_win32consoleio.py --- a/pypy/module/_io/test/test_win32consoleio.py +++ b/pypy/module/_io/test/test_win32consoleio.py @@ -1,4 +1,6 @@ from rpython.tool.udir import udir +from pypy.module._io import interp_win32consoleio +import os class AppTestWinConsoleIO: spaceconfig = dict(usemodules=['_io']) @@ -6,13 +8,17 @@ def setup_method(self, meth): tmpfile = udir.join('tmpfile') tmpfile.write("a\nb\nc", mode='wb') - self.tmpfile = tmpfile - self.conout_path = self.space.wrap(str(udir.join('CONOUT$'))) + self.w_tmpfile = self.space.wrap(str(tmpfile)) + self.w_posix = self.space.appexec([], """(): + import %s as m; + return m""" % os.name) + self.w_conout_path = self.space.wrap(str(udir.join('CONOUT$'))) def test_open_fd(self): import _io - - w_fd = self.tempfile.fileno() + os = self.posix + fd = os.open(self.tmpfile, os.O_RDONLY, 0o666) + #w_fd = self.tmpfile.fileno() # Windows 10: "Cannot open non-console file" # Earlier: "Cannot open console output buffer for reading" raises(ValueError, _io._WindowsConsoleIO, fd) @@ -79,8 +85,8 @@ f.close() f.close() - f = open('C:/con', 'rb', buffering=0) - assert f is _io._WindowsConsoleIO + f = open('C:\\con', 'rb', buffering=0) + assert isinstance(f,_io._WindowsConsoleIO) f.close() def test_conin_conout_names(self): @@ -90,7 +96,7 @@ f.close() f = open('//?/conout$', 'wb', buffering=0) - assert type(f) is _io._WindowsConsoleIO + assert isinstance(f , _io._WindowsConsoleIO) f.close() def test_conout_path(self): @@ -102,4 +108,31 @@ def test_write_empty_data(self): import _io with _io._WindowsConsoleIO('CONOUT$', 'w') as f: - assert f.write(b'') == 0 \ No newline at end of file + assert f.write(b'') == 0 + + +class TestGetConsoleType: + def test_conout(self, space): + w_file = space.newtext('CONOUT$') + consoletype = interp_win32consoleio._pyio_get_console_type(space, w_file) + assert consoletype == 'w' + + def test_conin(self, space): + w_file = space.newtext('CONIN$') + consoletype = interp_win32consoleio._pyio_get_console_type(space, w_file) + assert consoletype == 'r' + + def test_con(self, space): + w_file = space.newtext('CON') + consoletype = interp_win32consoleio._pyio_get_console_type(space, w_file) + assert consoletype == 'x' + + def test_conin2(self, space): + w_file = space.newtext('\\\\.\\conin$') + consoletype = interp_win32consoleio._pyio_get_console_type(space, w_file) + assert consoletype == 'r' + + def test_con2(self, space): + w_file = space.newtext('\\\\?\\con') + consoletype = interp_win32consoleio._pyio_get_console_type(space, w_file) + assert consoletype == 'x' \ No newline at end of file From pypy.commits at gmail.com Sun Sep 29 02:49:03 2019 From: pypy.commits at gmail.com (arigo) Date: Sat, 28 Sep 2019 23:49:03 -0700 (PDT) Subject: [pypy-commit] cffi release-1.13: Issue 421: integer overflow when computing structure sizes in bits and there are more than sys.maxint bits Message-ID: <5d9053df.1c69fb81.25774.b250@mx.google.com> Author: Armin Rigo Branch: release-1.13 Changeset: r3292:85b64280d248 Date: 2019-09-29 08:48 +0200 http://bitbucket.org/cffi/cffi/changeset/85b64280d248/ Log: Issue 421: integer overflow when computing structure sizes in bits and there are more than sys.maxint bits diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c --- a/c/_cffi_backend.c +++ b/c/_cffi_backend.c @@ -4986,12 +4986,16 @@ return 0; } +#define ROUNDUP_BYTES(bytes, bits) ((bytes) + ((bits) > 0)) + static PyObject *b_complete_struct_or_union(PyObject *self, PyObject *args) { CTypeDescrObject *ct; PyObject *fields, *interned_fields, *ignored; int is_union, alignment; - Py_ssize_t boffset, i, nb_fields, boffsetmax, alignedsize, boffsetorg; + Py_ssize_t byteoffset, i, nb_fields, byteoffsetmax, alignedsize; + int bitoffset; + Py_ssize_t byteoffsetorg; Py_ssize_t totalsize = -1; int totalalignment = -1; CFieldObject **previous; @@ -5030,8 +5034,9 @@ ct->ct_flags &= ~(CT_CUSTOM_FIELD_POS | CT_WITH_PACKED_CHANGE); alignment = 1; - boffset = 0; /* this number is in *bits*, not bytes! */ - boffsetmax = 0; /* the maximum value of boffset, in bits too */ + byteoffset = 0; /* the real value is 'byteoffset+bitoffset*8', which */ + bitoffset = 0; /* counts the offset in bits */ + byteoffsetmax = 0; /* the maximum value of byteoffset-rounded-up-to-byte */ prev_bitfield_size = 0; prev_bitfield_free = 0; nb_fields = PyList_GET_SIZE(fields); @@ -5081,7 +5086,7 @@ } if (is_union) - boffset = 0; /* reset each field at offset 0 */ + byteoffset = bitoffset = 0; /* reset each field at offset 0 */ /* update the total alignment requirement, but skip it if the field is an anonymous bitfield or if SF_PACKED */ @@ -5116,20 +5121,26 @@ bs_flag = BS_REGULAR; /* align this field to its own 'falign' by inserting padding */ - boffsetorg = (boffset + falignorg*8-1) & ~(falignorg*8-1); /*bits!*/ - boffset = (boffset + falign*8-1) & ~(falign*8-1); /* bits! */ - if (boffsetorg != boffset) { + + /* first, pad to the next byte, + * then pad to 'falign' or 'falignorg' bytes */ + byteoffset = ROUNDUP_BYTES(byteoffset, bitoffset); + bitoffset = 0; + byteoffsetorg = (byteoffset + falignorg-1) & ~(falignorg-1); + byteoffset = (byteoffset + falign-1) & ~(falign-1); + + if (byteoffsetorg != byteoffset) { ct->ct_flags |= CT_WITH_PACKED_CHANGE; } if (foffset >= 0) { /* a forced field position: ignore the offset just computed, except to know if we must set CT_CUSTOM_FIELD_POS */ - if (detect_custom_layout(ct, sflags, boffset / 8, foffset, + if (detect_custom_layout(ct, sflags, byteoffset, foffset, "wrong offset for field '", PyText_AS_UTF8(fname), "'") < 0) goto error; - boffset = foffset * 8; + byteoffset = foffset; } if (PyText_GetSize(fname) == 0 && @@ -5143,7 +5154,7 @@ *previous = _add_field(interned_fields, get_field_name(ftype, cfsrc), cfsrc->cf_type, - boffset / 8 + cfsrc->cf_offset, + byteoffset + cfsrc->cf_offset, cfsrc->cf_bitshift, cfsrc->cf_bitsize, cfsrc->cf_flags | fflags); @@ -5156,13 +5167,13 @@ } else { *previous = _add_field(interned_fields, fname, ftype, - boffset / 8, bs_flag, -1, fflags); + byteoffset, bs_flag, -1, fflags); if (*previous == NULL) goto error; previous = &(*previous)->cf_next; } if (ftype->ct_size >= 0) - boffset += ftype->ct_size * 8; + byteoffset += ftype->ct_size; prev_bitfield_size = 0; } else { @@ -5199,7 +5210,7 @@ /* compute the starting position of the theoretical field that covers a complete 'ftype', inside of which we will locate the real bitfield */ - field_offset_bytes = boffset / 8; + field_offset_bytes = byteoffset; field_offset_bytes &= ~(falign - 1); if (fbitsize == 0) { @@ -5212,12 +5223,13 @@ if (!(sflags & SF_MSVC_BITFIELDS)) { /* GCC's notion of "ftype :0;" */ - /* pad boffset to a value aligned for "ftype" */ - if (boffset > field_offset_bytes * 8) { + /* pad byteoffset to a value aligned for "ftype" */ + if (ROUNDUP_BYTES(byteoffset, bitoffset) > field_offset_bytes) { field_offset_bytes += falign; - assert(boffset < field_offset_bytes * 8); + assert(byteoffset < field_offset_bytes); } - boffset = field_offset_bytes * 8; + byteoffset = field_offset_bytes; + bitoffset = 0; } else { /* MSVC's notion of "ftype :0;" */ @@ -5234,7 +5246,8 @@ /* Can the field start at the offset given by 'boffset'? It can if it would entirely fit into an aligned ftype field. */ - bits_already_occupied = boffset - (field_offset_bytes * 8); + bits_already_occupied = (byteoffset-field_offset_bytes) * 8 + + bitoffset; if (bits_already_occupied + fbitsize > 8 * ftype->ct_size) { /* it would not fit, we need to start at the next @@ -5248,15 +5261,18 @@ goto error; } field_offset_bytes += falign; - assert(boffset < field_offset_bytes * 8); - boffset = field_offset_bytes * 8; + assert(byteoffset < field_offset_bytes); + byteoffset = field_offset_bytes; + bitoffset = 0; bitshift = 0; } else { bitshift = bits_already_occupied; assert(bitshift >= 0); } - boffset += fbitsize; + bitoffset += fbitsize; + byteoffset += (bitoffset >> 3); + bitoffset &= 7; } else { /* MSVC's algorithm */ @@ -5272,14 +5288,17 @@ } else { /* no: start a new full field */ - boffset = (boffset + falign*8-1) & ~(falign*8-1); /*align*/ - boffset += ftype->ct_size * 8; + byteoffset = ROUNDUP_BYTES(byteoffset, bitoffset); + bitoffset = 0; + /* align */ + byteoffset = (byteoffset + falign-1) & ~(falign-1); + byteoffset += ftype->ct_size; bitshift = 0; prev_bitfield_size = ftype->ct_size; prev_bitfield_free = 8 * prev_bitfield_size; } prev_bitfield_free -= fbitsize; - field_offset_bytes = boffset / 8 - ftype->ct_size; + field_offset_bytes = byteoffset - ftype->ct_size; } if (sflags & SF_GCC_BIG_ENDIAN) bitshift = 8 * ftype->ct_size - fbitsize - bitshift; @@ -5296,16 +5315,16 @@ } } - if (boffset > boffsetmax) - boffsetmax = boffset; + assert(bitoffset == (bitoffset & 7)); + if (ROUNDUP_BYTES(byteoffset, bitoffset) > byteoffsetmax) + byteoffsetmax = ROUNDUP_BYTES(byteoffset, bitoffset); } *previous = NULL; /* Like C, if the size of this structure would be zero, we compute it as 1 instead. But for ctypes support, we allow the manually- specified totalsize to be zero in this case. */ - boffsetmax = (boffsetmax + 7) / 8; /* bits -> bytes */ - alignedsize = (boffsetmax + alignment - 1) & ~(alignment-1); + alignedsize = (byteoffsetmax + alignment - 1) & ~(alignment-1); if (alignedsize == 0) alignedsize = 1; @@ -5316,10 +5335,10 @@ if (detect_custom_layout(ct, sflags, alignedsize, totalsize, "wrong total size", "", "") < 0) goto error; - if (totalsize < boffsetmax) { + if (totalsize < byteoffsetmax) { PyErr_Format(PyExc_TypeError, "%s cannot be of size %zd: there are fields at least " - "up to %zd", ct->ct_name, totalsize, boffsetmax); + "up to %zd", ct->ct_name, totalsize, byteoffsetmax); goto error; } } diff --git a/c/test_c.py b/c/test_c.py --- a/c/test_c.py +++ b/c/test_c.py @@ -4445,3 +4445,11 @@ f = cast(BFunc, 0) with pytest.raises(RuntimeError): f(40, 2) + +def test_huge_structure(): + BChar = new_primitive_type("char") + BArray = new_array_type(new_pointer_type(BChar), sys.maxsize) + assert sizeof(BArray) == sys.maxsize + BStruct = new_struct_type("struct foo") + complete_struct_or_union(BStruct, [('a1', BArray, -1)]) + assert sizeof(BStruct) == sys.maxsize From pypy.commits at gmail.com Sun Sep 29 02:49:55 2019 From: pypy.commits at gmail.com (arigo) Date: Sat, 28 Sep 2019 23:49:55 -0700 (PDT) Subject: [pypy-commit] cffi default: hg merge release 1.13 Message-ID: <5d905413.1c69fb81.9f5ef.bf49@mx.google.com> Author: Armin Rigo Branch: Changeset: r3293:46c06e1fd666 Date: 2019-09-29 08:49 +0200 http://bitbucket.org/cffi/cffi/changeset/46c06e1fd666/ Log: hg merge release 1.13 diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c --- a/c/_cffi_backend.c +++ b/c/_cffi_backend.c @@ -4986,12 +4986,16 @@ return 0; } +#define ROUNDUP_BYTES(bytes, bits) ((bytes) + ((bits) > 0)) + static PyObject *b_complete_struct_or_union(PyObject *self, PyObject *args) { CTypeDescrObject *ct; PyObject *fields, *interned_fields, *ignored; int is_union, alignment; - Py_ssize_t boffset, i, nb_fields, boffsetmax, alignedsize, boffsetorg; + Py_ssize_t byteoffset, i, nb_fields, byteoffsetmax, alignedsize; + int bitoffset; + Py_ssize_t byteoffsetorg; Py_ssize_t totalsize = -1; int totalalignment = -1; CFieldObject **previous; @@ -5030,8 +5034,9 @@ ct->ct_flags &= ~(CT_CUSTOM_FIELD_POS | CT_WITH_PACKED_CHANGE); alignment = 1; - boffset = 0; /* this number is in *bits*, not bytes! */ - boffsetmax = 0; /* the maximum value of boffset, in bits too */ + byteoffset = 0; /* the real value is 'byteoffset+bitoffset*8', which */ + bitoffset = 0; /* counts the offset in bits */ + byteoffsetmax = 0; /* the maximum value of byteoffset-rounded-up-to-byte */ prev_bitfield_size = 0; prev_bitfield_free = 0; nb_fields = PyList_GET_SIZE(fields); @@ -5081,7 +5086,7 @@ } if (is_union) - boffset = 0; /* reset each field at offset 0 */ + byteoffset = bitoffset = 0; /* reset each field at offset 0 */ /* update the total alignment requirement, but skip it if the field is an anonymous bitfield or if SF_PACKED */ @@ -5116,20 +5121,26 @@ bs_flag = BS_REGULAR; /* align this field to its own 'falign' by inserting padding */ - boffsetorg = (boffset + falignorg*8-1) & ~(falignorg*8-1); /*bits!*/ - boffset = (boffset + falign*8-1) & ~(falign*8-1); /* bits! */ - if (boffsetorg != boffset) { + + /* first, pad to the next byte, + * then pad to 'falign' or 'falignorg' bytes */ + byteoffset = ROUNDUP_BYTES(byteoffset, bitoffset); + bitoffset = 0; + byteoffsetorg = (byteoffset + falignorg-1) & ~(falignorg-1); + byteoffset = (byteoffset + falign-1) & ~(falign-1); + + if (byteoffsetorg != byteoffset) { ct->ct_flags |= CT_WITH_PACKED_CHANGE; } if (foffset >= 0) { /* a forced field position: ignore the offset just computed, except to know if we must set CT_CUSTOM_FIELD_POS */ - if (detect_custom_layout(ct, sflags, boffset / 8, foffset, + if (detect_custom_layout(ct, sflags, byteoffset, foffset, "wrong offset for field '", PyText_AS_UTF8(fname), "'") < 0) goto error; - boffset = foffset * 8; + byteoffset = foffset; } if (PyText_GetSize(fname) == 0 && @@ -5143,7 +5154,7 @@ *previous = _add_field(interned_fields, get_field_name(ftype, cfsrc), cfsrc->cf_type, - boffset / 8 + cfsrc->cf_offset, + byteoffset + cfsrc->cf_offset, cfsrc->cf_bitshift, cfsrc->cf_bitsize, cfsrc->cf_flags | fflags); @@ -5156,13 +5167,13 @@ } else { *previous = _add_field(interned_fields, fname, ftype, - boffset / 8, bs_flag, -1, fflags); + byteoffset, bs_flag, -1, fflags); if (*previous == NULL) goto error; previous = &(*previous)->cf_next; } if (ftype->ct_size >= 0) - boffset += ftype->ct_size * 8; + byteoffset += ftype->ct_size; prev_bitfield_size = 0; } else { @@ -5199,7 +5210,7 @@ /* compute the starting position of the theoretical field that covers a complete 'ftype', inside of which we will locate the real bitfield */ - field_offset_bytes = boffset / 8; + field_offset_bytes = byteoffset; field_offset_bytes &= ~(falign - 1); if (fbitsize == 0) { @@ -5212,12 +5223,13 @@ if (!(sflags & SF_MSVC_BITFIELDS)) { /* GCC's notion of "ftype :0;" */ - /* pad boffset to a value aligned for "ftype" */ - if (boffset > field_offset_bytes * 8) { + /* pad byteoffset to a value aligned for "ftype" */ + if (ROUNDUP_BYTES(byteoffset, bitoffset) > field_offset_bytes) { field_offset_bytes += falign; - assert(boffset < field_offset_bytes * 8); + assert(byteoffset < field_offset_bytes); } - boffset = field_offset_bytes * 8; + byteoffset = field_offset_bytes; + bitoffset = 0; } else { /* MSVC's notion of "ftype :0;" */ @@ -5234,7 +5246,8 @@ /* Can the field start at the offset given by 'boffset'? It can if it would entirely fit into an aligned ftype field. */ - bits_already_occupied = boffset - (field_offset_bytes * 8); + bits_already_occupied = (byteoffset-field_offset_bytes) * 8 + + bitoffset; if (bits_already_occupied + fbitsize > 8 * ftype->ct_size) { /* it would not fit, we need to start at the next @@ -5248,15 +5261,18 @@ goto error; } field_offset_bytes += falign; - assert(boffset < field_offset_bytes * 8); - boffset = field_offset_bytes * 8; + assert(byteoffset < field_offset_bytes); + byteoffset = field_offset_bytes; + bitoffset = 0; bitshift = 0; } else { bitshift = bits_already_occupied; assert(bitshift >= 0); } - boffset += fbitsize; + bitoffset += fbitsize; + byteoffset += (bitoffset >> 3); + bitoffset &= 7; } else { /* MSVC's algorithm */ @@ -5272,14 +5288,17 @@ } else { /* no: start a new full field */ - boffset = (boffset + falign*8-1) & ~(falign*8-1); /*align*/ - boffset += ftype->ct_size * 8; + byteoffset = ROUNDUP_BYTES(byteoffset, bitoffset); + bitoffset = 0; + /* align */ + byteoffset = (byteoffset + falign-1) & ~(falign-1); + byteoffset += ftype->ct_size; bitshift = 0; prev_bitfield_size = ftype->ct_size; prev_bitfield_free = 8 * prev_bitfield_size; } prev_bitfield_free -= fbitsize; - field_offset_bytes = boffset / 8 - ftype->ct_size; + field_offset_bytes = byteoffset - ftype->ct_size; } if (sflags & SF_GCC_BIG_ENDIAN) bitshift = 8 * ftype->ct_size - fbitsize - bitshift; @@ -5296,16 +5315,16 @@ } } - if (boffset > boffsetmax) - boffsetmax = boffset; + assert(bitoffset == (bitoffset & 7)); + if (ROUNDUP_BYTES(byteoffset, bitoffset) > byteoffsetmax) + byteoffsetmax = ROUNDUP_BYTES(byteoffset, bitoffset); } *previous = NULL; /* Like C, if the size of this structure would be zero, we compute it as 1 instead. But for ctypes support, we allow the manually- specified totalsize to be zero in this case. */ - boffsetmax = (boffsetmax + 7) / 8; /* bits -> bytes */ - alignedsize = (boffsetmax + alignment - 1) & ~(alignment-1); + alignedsize = (byteoffsetmax + alignment - 1) & ~(alignment-1); if (alignedsize == 0) alignedsize = 1; @@ -5316,10 +5335,10 @@ if (detect_custom_layout(ct, sflags, alignedsize, totalsize, "wrong total size", "", "") < 0) goto error; - if (totalsize < boffsetmax) { + if (totalsize < byteoffsetmax) { PyErr_Format(PyExc_TypeError, "%s cannot be of size %zd: there are fields at least " - "up to %zd", ct->ct_name, totalsize, boffsetmax); + "up to %zd", ct->ct_name, totalsize, byteoffsetmax); goto error; } } diff --git a/c/test_c.py b/c/test_c.py --- a/c/test_c.py +++ b/c/test_c.py @@ -4445,3 +4445,11 @@ f = cast(BFunc, 0) with pytest.raises(RuntimeError): f(40, 2) + +def test_huge_structure(): + BChar = new_primitive_type("char") + BArray = new_array_type(new_pointer_type(BChar), sys.maxsize) + assert sizeof(BArray) == sys.maxsize + BStruct = new_struct_type("struct foo") + complete_struct_or_union(BStruct, [('a1', BArray, -1)]) + assert sizeof(BStruct) == sys.maxsize diff --git a/cffi/backend_ctypes.py b/cffi/backend_ctypes.py --- a/cffi/backend_ctypes.py +++ b/cffi/backend_ctypes.py @@ -403,7 +403,7 @@ source = _cast_source_to_int(source) return cls(bool(source)) def __int__(self): - return self._value + return int(self._value) if kind == 'char': @classmethod diff --git a/testing/cffi1/test_re_python.py b/testing/cffi1/test_re_python.py --- a/testing/cffi1/test_re_python.py +++ b/testing/cffi1/test_re_python.py @@ -65,7 +65,7 @@ int add43(int, ...); int globalvar42; const int globalconst42; - const char *const globalconsthello = "hello"; + const char *const globalconsthello; int no_such_function(int); int no_such_globalvar; struct foo_s; From pypy.commits at gmail.com Sun Sep 29 03:57:27 2019 From: pypy.commits at gmail.com (arigo) Date: Sun, 29 Sep 2019 00:57:27 -0700 (PDT) Subject: [pypy-commit] pypy default: update to cffi/46c06e1fd666 Message-ID: <5d9063e7.1c69fb81.9a8d9.c27b@mx.google.com> Author: Armin Rigo Branch: Changeset: r97671:d648cf5b8009 Date: 2019-09-29 09:56 +0200 http://bitbucket.org/pypy/pypy/changeset/d648cf5b8009/ Log: update to cffi/46c06e1fd666 diff --git a/extra_tests/cffi_tests/cffi1/test_re_python.py b/extra_tests/cffi_tests/cffi1/test_re_python.py --- a/extra_tests/cffi_tests/cffi1/test_re_python.py +++ b/extra_tests/cffi_tests/cffi1/test_re_python.py @@ -66,7 +66,7 @@ int add43(int, ...); int globalvar42; const int globalconst42; - const char *const globalconsthello = "hello"; + const char *const globalconsthello; int no_such_function(int); int no_such_globalvar; struct foo_s; diff --git a/lib_pypy/cffi/backend_ctypes.py b/lib_pypy/cffi/backend_ctypes.py --- a/lib_pypy/cffi/backend_ctypes.py +++ b/lib_pypy/cffi/backend_ctypes.py @@ -403,7 +403,7 @@ source = _cast_source_to_int(source) return cls(bool(source)) def __int__(self): - return self._value + return int(self._value) if kind == 'char': @classmethod diff --git a/pypy/module/_cffi_backend/newtype.py b/pypy/module/_cffi_backend/newtype.py --- a/pypy/module/_cffi_backend/newtype.py +++ b/pypy/module/_cffi_backend/newtype.py @@ -313,6 +313,10 @@ cdef_value, compiler_value, w_ctype.name) w_ctype._custom_field_pos = True +def roundup_bytes(bytes, bit): + assert bit == (bit & 7) + return bytes + (bit > 0) + @unwrap_spec(w_ctype=ctypeobj.W_CType, totalsize=int, totalalignment=int, sflags=int, pack=int) def complete_struct_or_union(space, w_ctype, w_fields, w_ignored=None, @@ -334,8 +338,9 @@ is_union = isinstance(w_ctype, ctypestruct.W_CTypeUnion) alignment = 1 - boffset = 0 # this number is in *bits*, not bytes! - boffsetmax = 0 # the maximum value of boffset, in bits too + byteoffset = 0 # the real value is 'byteoffset+bitoffset*8', which + bitoffset = 0 # counts the offset in bits + byteoffsetmax = 0 # the maximum value of byteoffset-rounded-up-to-byte prev_bitfield_size = 0 prev_bitfield_free = 0 fields_w = space.listview(w_fields) @@ -380,7 +385,7 @@ with_var_array = True # if is_union: - boffset = 0 # reset each field at offset 0 + byteoffset = bitoffset = 0 # reset each field at offset 0 # # update the total alignment requirement, but skip it if the # field is an anonymous bitfield or if SF_PACKED @@ -410,19 +415,24 @@ else: bs_flag = ctypestruct.W_CField.BS_REGULAR - # align this field to its own 'falign' by inserting padding - boffsetorg = (boffset + falignorg*8-1) & ~(falignorg*8-1) - boffset = (boffset + falign*8-1) & ~(falign*8-1) - if boffsetorg != boffset: + # align this field to its own 'falign' by inserting padding. + # first, pad to the next byte, + # then pad to 'falign' or 'falignorg' bytes + byteoffset = roundup_bytes(byteoffset, bitoffset) + bitoffset = 0 + byteoffsetorg = (byteoffset + falignorg-1) & ~(falignorg-1) + byteoffset = (byteoffset + falign-1) & ~(falign-1) + + if byteoffsetorg != byteoffset: with_packed_change = True if foffset >= 0: # a forced field position: ignore the offset just computed, # except to know if we must set 'custom_field_pos' - detect_custom_layout(w_ctype, sflags, boffset // 8, foffset, + detect_custom_layout(w_ctype, sflags, byteoffset, foffset, "wrong offset for field '", fname, "'") - boffset = foffset * 8 + byteoffset = foffset if (fname == '' and isinstance(ftype, ctypestruct.W_CTypeStructOrUnion)): @@ -432,7 +442,7 @@ for name, srcfld in ftype._fields_dict.items(): srcfield2names[srcfld] = name for srcfld in ftype._fields_list: - fld = srcfld.make_shifted(boffset // 8, fflags) + fld = srcfld.make_shifted(byteoffset, fflags) fields_list.append(fld) try: fields_dict[srcfield2names[srcfld]] = fld @@ -442,13 +452,13 @@ w_ctype._custom_field_pos = True else: # a regular field - fld = ctypestruct.W_CField(ftype, boffset // 8, bs_flag, -1, + fld = ctypestruct.W_CField(ftype, byteoffset, bs_flag, -1, fflags) fields_list.append(fld) fields_dict[fname] = fld if ftype.size >= 0: - boffset += ftype.size * 8 + byteoffset += ftype.size prev_bitfield_size = 0 else: @@ -474,7 +484,7 @@ # compute the starting position of the theoretical field # that covers a complete 'ftype', inside of which we will # locate the real bitfield - field_offset_bytes = boffset // 8 + field_offset_bytes = byteoffset field_offset_bytes &= ~(falign - 1) if fbitsize == 0: @@ -484,11 +494,13 @@ w_ctype.name, fname) if (sflags & SF_MSVC_BITFIELDS) == 0: # GCC's notion of "ftype :0;" - # pad boffset to a value aligned for "ftype" - if boffset > field_offset_bytes * 8: + # pad byteoffset to a value aligned for "ftype" + if (roundup_bytes(byteoffset, bitoffset) > + field_offset_bytes): field_offset_bytes += falign - assert boffset < field_offset_bytes * 8 - boffset = field_offset_bytes * 8 + assert byteoffset < field_offset_bytes + byteoffset = field_offset_bytes + bitoffset = 0 else: # MSVC's notion of "ftype :0; # Mostly ignored. It seems they only serve as @@ -503,7 +515,8 @@ # Can the field start at the offset given by 'boffset'? It # can if it would entirely fit into an aligned ftype field. - bits_already_occupied = boffset - (field_offset_bytes * 8) + bits_already_occupied = ( + (byteoffset-field_offset_bytes) * 8 + bitoffset) if bits_already_occupied + fbitsize > 8 * ftype.size: # it would not fit, we need to start at the next @@ -516,13 +529,16 @@ "the previous field", w_ctype.name, fname) field_offset_bytes += falign - assert boffset < field_offset_bytes * 8 - boffset = field_offset_bytes * 8 + assert byteoffset < field_offset_bytes + byteoffset = field_offset_bytes + bitoffset = 0 bitshift = 0 else: bitshift = bits_already_occupied assert bitshift >= 0 - boffset += fbitsize + bitoffset += fbitsize + byteoffset += (bitoffset >> 3) + bitoffset &= 7 else: # MSVC's algorithm @@ -537,14 +553,17 @@ bitshift = 8 * prev_bitfield_size - prev_bitfield_free else: # no: start a new full field - boffset = (boffset + falign*8-1) & ~(falign*8-1) - boffset += ftype.size * 8 + byteoffset = roundup_bytes(byteoffset, bitoffset) + bitoffset = 0 + # align + byteoffset = (byteoffset + falign-1) & ~(falign-1) + byteoffset += ftype.size bitshift = 0 prev_bitfield_size = ftype.size prev_bitfield_free = 8 * prev_bitfield_size # prev_bitfield_free -= fbitsize - field_offset_bytes = boffset / 8 - ftype.size + field_offset_bytes = byteoffset - ftype.size if sflags & SF_GCC_BIG_ENDIAN: bitshift = 8 * ftype.size - fbitsize- bitshift @@ -555,14 +574,13 @@ fields_list.append(fld) fields_dict[fname] = fld - if boffset > boffsetmax: - boffsetmax = boffset + if roundup_bytes(byteoffset, bitoffset) > byteoffsetmax: + byteoffsetmax = roundup_bytes(byteoffset, bitoffset) # Like C, if the size of this structure would be zero, we compute it # as 1 instead. But for ctypes support, we allow the manually- # specified totalsize to be zero in this case. - boffsetmax = (boffsetmax + 7) // 8 # bits -> bytes - alignedsize = (boffsetmax + alignment - 1) & ~(alignment - 1) + alignedsize = (byteoffsetmax + alignment - 1) & ~(alignment - 1) alignedsize = alignedsize or 1 if totalsize < 0: @@ -570,10 +588,10 @@ else: detect_custom_layout(w_ctype, sflags, alignedsize, totalsize, "wrong total size") - if totalsize < boffsetmax: + if totalsize < byteoffsetmax: raise oefmt(space.w_TypeError, "%s cannot be of size %d: there are fields at least up to %d", - w_ctype.name, totalsize, boffsetmax) + w_ctype.name, totalsize, byteoffsetmax) if totalalignment < 0: totalalignment = alignment else: diff --git a/pypy/module/_cffi_backend/test/_backend_test_c.py b/pypy/module/_cffi_backend/test/_backend_test_c.py --- a/pypy/module/_cffi_backend/test/_backend_test_c.py +++ b/pypy/module/_cffi_backend/test/_backend_test_c.py @@ -4432,3 +4432,11 @@ f = cast(BFunc, 0) with pytest.raises(RuntimeError): f(40, 2) + +def test_huge_structure(): + BChar = new_primitive_type("char") + BArray = new_array_type(new_pointer_type(BChar), sys.maxsize) + assert sizeof(BArray) == sys.maxsize + BStruct = new_struct_type("struct foo") + complete_struct_or_union(BStruct, [('a1', BArray, -1)]) + assert sizeof(BStruct) == sys.maxsize diff --git a/pypy/tool/import_cffi.py b/pypy/tool/import_cffi.py --- a/pypy/tool/import_cffi.py +++ b/pypy/tool/import_cffi.py @@ -20,6 +20,10 @@ else: raise AssertionError(ext) +def fixeol(s): + s = s.replace('\r\n', '\n') + return s + def main(cffi_dir): cffi_dir = py.path.local(cffi_dir) rootdir = py.path.local(__file__).join('..', '..', '..') @@ -29,13 +33,13 @@ test_dest.ensure(dir=1) for p in (list(cffi_dir.join('cffi').visit(fil='*.py')) + list(cffi_dir.join('cffi').visit(fil='*.h'))): - cffi_dest.join('..', p.relto(cffi_dir)).write(p.read()) + cffi_dest.join('..', p.relto(cffi_dir)).write_binary(fixeol(p.read())) for p in (list(cffi_dir.join('testing').visit(fil='*.py')) + list(cffi_dir.join('testing').visit(fil='*.h')) + list(cffi_dir.join('testing').visit(fil='*.c'))): path = test_dest.join(p.relto(cffi_dir.join('testing'))) path.join('..').ensure(dir=1) - path.write(''.join(mangle(p.readlines(), p.ext))) + path.write_binary(fixeol(''.join(mangle(p.readlines(), p.ext)))) if __name__ == '__main__': if len(sys.argv) != 2: From pypy.commits at gmail.com Sun Sep 29 06:04:52 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 29 Sep 2019 03:04:52 -0700 (PDT) Subject: [pypy-commit] pypy default: update repackage script Message-ID: <5d9081c4.1c69fb81.2b290.6e17@mx.google.com> Author: Matti Picus Branch: Changeset: r97672:bd1f15a5b03e Date: 2019-09-29 13:02 +0300 http://bitbucket.org/pypy/pypy/changeset/bd1f15a5b03e/ Log: update repackage script diff --git a/pypy/tool/release/repackage.sh b/pypy/tool/release/repackage.sh --- a/pypy/tool/release/repackage.sh +++ b/pypy/tool/release/repackage.sh @@ -3,7 +3,7 @@ pmin=7 # python minor version exe=pypy3 # pypy3 or pypy maj=7 -min=1 +min=2 rev=0 From pypy.commits at gmail.com Sun Sep 29 06:04:54 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 29 Sep 2019 03:04:54 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy2.7-v7.x: merge default into release Message-ID: <5d9081c6.1c69fb81.95df7.6115@mx.google.com> Author: Matti Picus Branch: release-pypy2.7-v7.x Changeset: r97673:85dae4fd5c23 Date: 2019-09-29 13:02 +0300 http://bitbucket.org/pypy/pypy/changeset/85dae4fd5c23/ Log: merge default into release diff --git a/extra_tests/cffi_tests/cffi1/test_re_python.py b/extra_tests/cffi_tests/cffi1/test_re_python.py --- a/extra_tests/cffi_tests/cffi1/test_re_python.py +++ b/extra_tests/cffi_tests/cffi1/test_re_python.py @@ -66,7 +66,7 @@ int add43(int, ...); int globalvar42; const int globalconst42; - const char *const globalconsthello = "hello"; + const char *const globalconsthello; int no_such_function(int); int no_such_globalvar; struct foo_s; diff --git a/extra_tests/test_semlock.py b/extra_tests/test_semlock.py --- a/extra_tests/test_semlock.py +++ b/extra_tests/test_semlock.py @@ -1,5 +1,6 @@ from _multiprocessing import SemLock from threading import Thread +import thread import time @@ -17,10 +18,19 @@ lock.release() threads = [Thread(target=f, args=(i,)) for i in range(N_THREADS)] + n_started = N_THREADS with lock: for t in threads: - t.start() + try: + t.start() + except thread.error: + # too many threads for this system + t.started = False + n_started -= 1 + else: + t.started = True time.sleep(0.1) for t in threads: - t.join() - assert len(results) == N_THREADS + if t.started: + t.join() + assert len(results) == n_started diff --git a/lib_pypy/cffi/backend_ctypes.py b/lib_pypy/cffi/backend_ctypes.py --- a/lib_pypy/cffi/backend_ctypes.py +++ b/lib_pypy/cffi/backend_ctypes.py @@ -403,7 +403,7 @@ source = _cast_source_to_int(source) return cls(bool(source)) def __int__(self): - return self._value + return int(self._value) if kind == 'char': @classmethod diff --git a/pypy/module/_cffi_backend/newtype.py b/pypy/module/_cffi_backend/newtype.py --- a/pypy/module/_cffi_backend/newtype.py +++ b/pypy/module/_cffi_backend/newtype.py @@ -313,6 +313,10 @@ cdef_value, compiler_value, w_ctype.name) w_ctype._custom_field_pos = True +def roundup_bytes(bytes, bit): + assert bit == (bit & 7) + return bytes + (bit > 0) + @unwrap_spec(w_ctype=ctypeobj.W_CType, totalsize=int, totalalignment=int, sflags=int, pack=int) def complete_struct_or_union(space, w_ctype, w_fields, w_ignored=None, @@ -334,8 +338,9 @@ is_union = isinstance(w_ctype, ctypestruct.W_CTypeUnion) alignment = 1 - boffset = 0 # this number is in *bits*, not bytes! - boffsetmax = 0 # the maximum value of boffset, in bits too + byteoffset = 0 # the real value is 'byteoffset+bitoffset*8', which + bitoffset = 0 # counts the offset in bits + byteoffsetmax = 0 # the maximum value of byteoffset-rounded-up-to-byte prev_bitfield_size = 0 prev_bitfield_free = 0 fields_w = space.listview(w_fields) @@ -380,7 +385,7 @@ with_var_array = True # if is_union: - boffset = 0 # reset each field at offset 0 + byteoffset = bitoffset = 0 # reset each field at offset 0 # # update the total alignment requirement, but skip it if the # field is an anonymous bitfield or if SF_PACKED @@ -410,19 +415,24 @@ else: bs_flag = ctypestruct.W_CField.BS_REGULAR - # align this field to its own 'falign' by inserting padding - boffsetorg = (boffset + falignorg*8-1) & ~(falignorg*8-1) - boffset = (boffset + falign*8-1) & ~(falign*8-1) - if boffsetorg != boffset: + # align this field to its own 'falign' by inserting padding. + # first, pad to the next byte, + # then pad to 'falign' or 'falignorg' bytes + byteoffset = roundup_bytes(byteoffset, bitoffset) + bitoffset = 0 + byteoffsetorg = (byteoffset + falignorg-1) & ~(falignorg-1) + byteoffset = (byteoffset + falign-1) & ~(falign-1) + + if byteoffsetorg != byteoffset: with_packed_change = True if foffset >= 0: # a forced field position: ignore the offset just computed, # except to know if we must set 'custom_field_pos' - detect_custom_layout(w_ctype, sflags, boffset // 8, foffset, + detect_custom_layout(w_ctype, sflags, byteoffset, foffset, "wrong offset for field '", fname, "'") - boffset = foffset * 8 + byteoffset = foffset if (fname == '' and isinstance(ftype, ctypestruct.W_CTypeStructOrUnion)): @@ -432,7 +442,7 @@ for name, srcfld in ftype._fields_dict.items(): srcfield2names[srcfld] = name for srcfld in ftype._fields_list: - fld = srcfld.make_shifted(boffset // 8, fflags) + fld = srcfld.make_shifted(byteoffset, fflags) fields_list.append(fld) try: fields_dict[srcfield2names[srcfld]] = fld @@ -442,13 +452,13 @@ w_ctype._custom_field_pos = True else: # a regular field - fld = ctypestruct.W_CField(ftype, boffset // 8, bs_flag, -1, + fld = ctypestruct.W_CField(ftype, byteoffset, bs_flag, -1, fflags) fields_list.append(fld) fields_dict[fname] = fld if ftype.size >= 0: - boffset += ftype.size * 8 + byteoffset += ftype.size prev_bitfield_size = 0 else: @@ -474,7 +484,7 @@ # compute the starting position of the theoretical field # that covers a complete 'ftype', inside of which we will # locate the real bitfield - field_offset_bytes = boffset // 8 + field_offset_bytes = byteoffset field_offset_bytes &= ~(falign - 1) if fbitsize == 0: @@ -484,11 +494,13 @@ w_ctype.name, fname) if (sflags & SF_MSVC_BITFIELDS) == 0: # GCC's notion of "ftype :0;" - # pad boffset to a value aligned for "ftype" - if boffset > field_offset_bytes * 8: + # pad byteoffset to a value aligned for "ftype" + if (roundup_bytes(byteoffset, bitoffset) > + field_offset_bytes): field_offset_bytes += falign - assert boffset < field_offset_bytes * 8 - boffset = field_offset_bytes * 8 + assert byteoffset < field_offset_bytes + byteoffset = field_offset_bytes + bitoffset = 0 else: # MSVC's notion of "ftype :0; # Mostly ignored. It seems they only serve as @@ -503,7 +515,8 @@ # Can the field start at the offset given by 'boffset'? It # can if it would entirely fit into an aligned ftype field. - bits_already_occupied = boffset - (field_offset_bytes * 8) + bits_already_occupied = ( + (byteoffset-field_offset_bytes) * 8 + bitoffset) if bits_already_occupied + fbitsize > 8 * ftype.size: # it would not fit, we need to start at the next @@ -516,13 +529,16 @@ "the previous field", w_ctype.name, fname) field_offset_bytes += falign - assert boffset < field_offset_bytes * 8 - boffset = field_offset_bytes * 8 + assert byteoffset < field_offset_bytes + byteoffset = field_offset_bytes + bitoffset = 0 bitshift = 0 else: bitshift = bits_already_occupied assert bitshift >= 0 - boffset += fbitsize + bitoffset += fbitsize + byteoffset += (bitoffset >> 3) + bitoffset &= 7 else: # MSVC's algorithm @@ -537,14 +553,17 @@ bitshift = 8 * prev_bitfield_size - prev_bitfield_free else: # no: start a new full field - boffset = (boffset + falign*8-1) & ~(falign*8-1) - boffset += ftype.size * 8 + byteoffset = roundup_bytes(byteoffset, bitoffset) + bitoffset = 0 + # align + byteoffset = (byteoffset + falign-1) & ~(falign-1) + byteoffset += ftype.size bitshift = 0 prev_bitfield_size = ftype.size prev_bitfield_free = 8 * prev_bitfield_size # prev_bitfield_free -= fbitsize - field_offset_bytes = boffset / 8 - ftype.size + field_offset_bytes = byteoffset - ftype.size if sflags & SF_GCC_BIG_ENDIAN: bitshift = 8 * ftype.size - fbitsize- bitshift @@ -555,14 +574,13 @@ fields_list.append(fld) fields_dict[fname] = fld - if boffset > boffsetmax: - boffsetmax = boffset + if roundup_bytes(byteoffset, bitoffset) > byteoffsetmax: + byteoffsetmax = roundup_bytes(byteoffset, bitoffset) # Like C, if the size of this structure would be zero, we compute it # as 1 instead. But for ctypes support, we allow the manually- # specified totalsize to be zero in this case. - boffsetmax = (boffsetmax + 7) // 8 # bits -> bytes - alignedsize = (boffsetmax + alignment - 1) & ~(alignment - 1) + alignedsize = (byteoffsetmax + alignment - 1) & ~(alignment - 1) alignedsize = alignedsize or 1 if totalsize < 0: @@ -570,10 +588,10 @@ else: detect_custom_layout(w_ctype, sflags, alignedsize, totalsize, "wrong total size") - if totalsize < boffsetmax: + if totalsize < byteoffsetmax: raise oefmt(space.w_TypeError, "%s cannot be of size %d: there are fields at least up to %d", - w_ctype.name, totalsize, boffsetmax) + w_ctype.name, totalsize, byteoffsetmax) if totalalignment < 0: totalalignment = alignment else: diff --git a/pypy/module/_cffi_backend/test/_backend_test_c.py b/pypy/module/_cffi_backend/test/_backend_test_c.py --- a/pypy/module/_cffi_backend/test/_backend_test_c.py +++ b/pypy/module/_cffi_backend/test/_backend_test_c.py @@ -4432,3 +4432,11 @@ f = cast(BFunc, 0) with pytest.raises(RuntimeError): f(40, 2) + +def test_huge_structure(): + BChar = new_primitive_type("char") + BArray = new_array_type(new_pointer_type(BChar), sys.maxsize) + assert sizeof(BArray) == sys.maxsize + BStruct = new_struct_type("struct foo") + complete_struct_or_union(BStruct, [('a1', BArray, -1)]) + assert sizeof(BStruct) == sys.maxsize diff --git a/pypy/module/pypyjit/test_pypy_c/test_ffi.py b/pypy/module/pypyjit/test_pypy_c/test_ffi.py --- a/pypy/module/pypyjit/test_pypy_c/test_ffi.py +++ b/pypy/module/pypyjit/test_pypy_c/test_ffi.py @@ -425,11 +425,9 @@ setarrayitem_raw(i153, 0, i106, descr=...) p156 = getfield_gc_r(p48, descr=...) i158 = getfield_raw_i(..., descr=...) - i160 = int_sub(i158, 16) - setfield_raw(#, i160, descr=...) setfield_gc(p48, p49, descr=...) setfield_gc(p134, ConstPtr(null), descr=...) - i160 = int_lt(i160, 0) - guard_false(i160, descr=...) + i159 = int_lt(i158, 0) + guard_false(i159, descr=...) jump(..., descr=...) """) diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py b/pypy/module/pypyjit/test_pypy_c/test_string.py --- a/pypy/module/pypyjit/test_pypy_c/test_string.py +++ b/pypy/module/pypyjit/test_pypy_c/test_string.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import sys from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC diff --git a/pypy/tool/import_cffi.py b/pypy/tool/import_cffi.py --- a/pypy/tool/import_cffi.py +++ b/pypy/tool/import_cffi.py @@ -20,6 +20,10 @@ else: raise AssertionError(ext) +def fixeol(s): + s = s.replace('\r\n', '\n') + return s + def main(cffi_dir): cffi_dir = py.path.local(cffi_dir) rootdir = py.path.local(__file__).join('..', '..', '..') @@ -29,13 +33,13 @@ test_dest.ensure(dir=1) for p in (list(cffi_dir.join('cffi').visit(fil='*.py')) + list(cffi_dir.join('cffi').visit(fil='*.h'))): - cffi_dest.join('..', p.relto(cffi_dir)).write(p.read()) + cffi_dest.join('..', p.relto(cffi_dir)).write_binary(fixeol(p.read())) for p in (list(cffi_dir.join('testing').visit(fil='*.py')) + list(cffi_dir.join('testing').visit(fil='*.h')) + list(cffi_dir.join('testing').visit(fil='*.c'))): path = test_dest.join(p.relto(cffi_dir.join('testing'))) path.join('..').ensure(dir=1) - path.write(''.join(mangle(p.readlines(), p.ext))) + path.write_binary(fixeol(''.join(mangle(p.readlines(), p.ext)))) if __name__ == '__main__': if len(sys.argv) != 2: diff --git a/pypy/tool/release/repackage.sh b/pypy/tool/release/repackage.sh --- a/pypy/tool/release/repackage.sh +++ b/pypy/tool/release/repackage.sh @@ -3,7 +3,7 @@ pmin=7 # python minor version exe=pypy3 # pypy3 or pypy maj=7 -min=1 +min=2 rev=0 From pypy.commits at gmail.com Sun Sep 29 06:04:56 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 29 Sep 2019 03:04:56 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: merge default into py3.6 Message-ID: <5d9081c8.1c69fb81.88d5c.3113@mx.google.com> Author: Matti Picus Branch: py3.6 Changeset: r97674:23f38371a41d Date: 2019-09-29 13:03 +0300 http://bitbucket.org/pypy/pypy/changeset/23f38371a41d/ Log: merge default into py3.6 diff --git a/extra_tests/cffi_tests/cffi1/test_re_python.py b/extra_tests/cffi_tests/cffi1/test_re_python.py --- a/extra_tests/cffi_tests/cffi1/test_re_python.py +++ b/extra_tests/cffi_tests/cffi1/test_re_python.py @@ -66,7 +66,7 @@ int add43(int, ...); int globalvar42; const int globalconst42; - const char *const globalconsthello = "hello"; + const char *const globalconsthello; int no_such_function(int); int no_such_globalvar; struct foo_s; diff --git a/extra_tests/test_semlock.py b/extra_tests/test_semlock.py --- a/extra_tests/test_semlock.py +++ b/extra_tests/test_semlock.py @@ -1,5 +1,6 @@ from _multiprocessing import SemLock from threading import Thread +import thread import time @@ -17,10 +18,19 @@ lock.release() threads = [Thread(target=f, args=(i,)) for i in range(N_THREADS)] + n_started = N_THREADS with lock: for t in threads: - t.start() + try: + t.start() + except thread.error: + # too many threads for this system + t.started = False + n_started -= 1 + else: + t.started = True time.sleep(0.1) for t in threads: - t.join() - assert len(results) == N_THREADS + if t.started: + t.join() + assert len(results) == n_started diff --git a/lib_pypy/cffi/backend_ctypes.py b/lib_pypy/cffi/backend_ctypes.py --- a/lib_pypy/cffi/backend_ctypes.py +++ b/lib_pypy/cffi/backend_ctypes.py @@ -403,7 +403,7 @@ source = _cast_source_to_int(source) return cls(bool(source)) def __int__(self): - return self._value + return int(self._value) if kind == 'char': @classmethod diff --git a/pypy/module/_cffi_backend/newtype.py b/pypy/module/_cffi_backend/newtype.py --- a/pypy/module/_cffi_backend/newtype.py +++ b/pypy/module/_cffi_backend/newtype.py @@ -313,6 +313,10 @@ cdef_value, compiler_value, w_ctype.name) w_ctype._custom_field_pos = True +def roundup_bytes(bytes, bit): + assert bit == (bit & 7) + return bytes + (bit > 0) + @unwrap_spec(w_ctype=ctypeobj.W_CType, totalsize=int, totalalignment=int, sflags=int, pack=int) def complete_struct_or_union(space, w_ctype, w_fields, w_ignored=None, @@ -334,8 +338,9 @@ is_union = isinstance(w_ctype, ctypestruct.W_CTypeUnion) alignment = 1 - boffset = 0 # this number is in *bits*, not bytes! - boffsetmax = 0 # the maximum value of boffset, in bits too + byteoffset = 0 # the real value is 'byteoffset+bitoffset*8', which + bitoffset = 0 # counts the offset in bits + byteoffsetmax = 0 # the maximum value of byteoffset-rounded-up-to-byte prev_bitfield_size = 0 prev_bitfield_free = 0 fields_w = space.listview(w_fields) @@ -380,7 +385,7 @@ with_var_array = True # if is_union: - boffset = 0 # reset each field at offset 0 + byteoffset = bitoffset = 0 # reset each field at offset 0 # # update the total alignment requirement, but skip it if the # field is an anonymous bitfield or if SF_PACKED @@ -410,19 +415,24 @@ else: bs_flag = ctypestruct.W_CField.BS_REGULAR - # align this field to its own 'falign' by inserting padding - boffsetorg = (boffset + falignorg*8-1) & ~(falignorg*8-1) - boffset = (boffset + falign*8-1) & ~(falign*8-1) - if boffsetorg != boffset: + # align this field to its own 'falign' by inserting padding. + # first, pad to the next byte, + # then pad to 'falign' or 'falignorg' bytes + byteoffset = roundup_bytes(byteoffset, bitoffset) + bitoffset = 0 + byteoffsetorg = (byteoffset + falignorg-1) & ~(falignorg-1) + byteoffset = (byteoffset + falign-1) & ~(falign-1) + + if byteoffsetorg != byteoffset: with_packed_change = True if foffset >= 0: # a forced field position: ignore the offset just computed, # except to know if we must set 'custom_field_pos' - detect_custom_layout(w_ctype, sflags, boffset // 8, foffset, + detect_custom_layout(w_ctype, sflags, byteoffset, foffset, "wrong offset for field '", fname, "'") - boffset = foffset * 8 + byteoffset = foffset if (fname == '' and isinstance(ftype, ctypestruct.W_CTypeStructOrUnion)): @@ -432,7 +442,7 @@ for name, srcfld in ftype._fields_dict.items(): srcfield2names[srcfld] = name for srcfld in ftype._fields_list: - fld = srcfld.make_shifted(boffset // 8, fflags) + fld = srcfld.make_shifted(byteoffset, fflags) fields_list.append(fld) try: fields_dict[srcfield2names[srcfld]] = fld @@ -442,13 +452,13 @@ w_ctype._custom_field_pos = True else: # a regular field - fld = ctypestruct.W_CField(ftype, boffset // 8, bs_flag, -1, + fld = ctypestruct.W_CField(ftype, byteoffset, bs_flag, -1, fflags) fields_list.append(fld) fields_dict[fname] = fld if ftype.size >= 0: - boffset += ftype.size * 8 + byteoffset += ftype.size prev_bitfield_size = 0 else: @@ -474,7 +484,7 @@ # compute the starting position of the theoretical field # that covers a complete 'ftype', inside of which we will # locate the real bitfield - field_offset_bytes = boffset // 8 + field_offset_bytes = byteoffset field_offset_bytes &= ~(falign - 1) if fbitsize == 0: @@ -484,11 +494,13 @@ w_ctype.name, fname) if (sflags & SF_MSVC_BITFIELDS) == 0: # GCC's notion of "ftype :0;" - # pad boffset to a value aligned for "ftype" - if boffset > field_offset_bytes * 8: + # pad byteoffset to a value aligned for "ftype" + if (roundup_bytes(byteoffset, bitoffset) > + field_offset_bytes): field_offset_bytes += falign - assert boffset < field_offset_bytes * 8 - boffset = field_offset_bytes * 8 + assert byteoffset < field_offset_bytes + byteoffset = field_offset_bytes + bitoffset = 0 else: # MSVC's notion of "ftype :0; # Mostly ignored. It seems they only serve as @@ -503,7 +515,8 @@ # Can the field start at the offset given by 'boffset'? It # can if it would entirely fit into an aligned ftype field. - bits_already_occupied = boffset - (field_offset_bytes * 8) + bits_already_occupied = ( + (byteoffset-field_offset_bytes) * 8 + bitoffset) if bits_already_occupied + fbitsize > 8 * ftype.size: # it would not fit, we need to start at the next @@ -516,13 +529,16 @@ "the previous field", w_ctype.name, fname) field_offset_bytes += falign - assert boffset < field_offset_bytes * 8 - boffset = field_offset_bytes * 8 + assert byteoffset < field_offset_bytes + byteoffset = field_offset_bytes + bitoffset = 0 bitshift = 0 else: bitshift = bits_already_occupied assert bitshift >= 0 - boffset += fbitsize + bitoffset += fbitsize + byteoffset += (bitoffset >> 3) + bitoffset &= 7 else: # MSVC's algorithm @@ -537,14 +553,17 @@ bitshift = 8 * prev_bitfield_size - prev_bitfield_free else: # no: start a new full field - boffset = (boffset + falign*8-1) & ~(falign*8-1) - boffset += ftype.size * 8 + byteoffset = roundup_bytes(byteoffset, bitoffset) + bitoffset = 0 + # align + byteoffset = (byteoffset + falign-1) & ~(falign-1) + byteoffset += ftype.size bitshift = 0 prev_bitfield_size = ftype.size prev_bitfield_free = 8 * prev_bitfield_size # prev_bitfield_free -= fbitsize - field_offset_bytes = boffset / 8 - ftype.size + field_offset_bytes = byteoffset - ftype.size if sflags & SF_GCC_BIG_ENDIAN: bitshift = 8 * ftype.size - fbitsize- bitshift @@ -555,14 +574,13 @@ fields_list.append(fld) fields_dict[fname] = fld - if boffset > boffsetmax: - boffsetmax = boffset + if roundup_bytes(byteoffset, bitoffset) > byteoffsetmax: + byteoffsetmax = roundup_bytes(byteoffset, bitoffset) # Like C, if the size of this structure would be zero, we compute it # as 1 instead. But for ctypes support, we allow the manually- # specified totalsize to be zero in this case. - boffsetmax = (boffsetmax + 7) // 8 # bits -> bytes - alignedsize = (boffsetmax + alignment - 1) & ~(alignment - 1) + alignedsize = (byteoffsetmax + alignment - 1) & ~(alignment - 1) alignedsize = alignedsize or 1 if totalsize < 0: @@ -570,10 +588,10 @@ else: detect_custom_layout(w_ctype, sflags, alignedsize, totalsize, "wrong total size") - if totalsize < boffsetmax: + if totalsize < byteoffsetmax: raise oefmt(space.w_TypeError, "%s cannot be of size %d: there are fields at least up to %d", - w_ctype.name, totalsize, boffsetmax) + w_ctype.name, totalsize, byteoffsetmax) if totalalignment < 0: totalalignment = alignment else: diff --git a/pypy/module/_cffi_backend/test/_backend_test_c.py b/pypy/module/_cffi_backend/test/_backend_test_c.py --- a/pypy/module/_cffi_backend/test/_backend_test_c.py +++ b/pypy/module/_cffi_backend/test/_backend_test_c.py @@ -4432,3 +4432,11 @@ f = cast(BFunc, 0) with pytest.raises(RuntimeError): f(40, 2) + +def test_huge_structure(): + BChar = new_primitive_type("char") + BArray = new_array_type(new_pointer_type(BChar), sys.maxsize) + assert sizeof(BArray) == sys.maxsize + BStruct = new_struct_type("struct foo") + complete_struct_or_union(BStruct, [('a1', BArray, -1)]) + assert sizeof(BStruct) == sys.maxsize diff --git a/pypy/module/pypyjit/test_pypy_c/test_ffi.py b/pypy/module/pypyjit/test_pypy_c/test_ffi.py --- a/pypy/module/pypyjit/test_pypy_c/test_ffi.py +++ b/pypy/module/pypyjit/test_pypy_c/test_ffi.py @@ -427,12 +427,10 @@ setarrayitem_raw(i153, 0, i106, descr=...) p156 = getfield_gc_r(p48, descr=...) i158 = getfield_raw_i(..., descr=...) - i160 = int_sub(i158, 16) - setfield_raw(#, i160, descr=...) setfield_gc(p48, p49, descr=...) setfield_gc(p48, p50, descr=...) setfield_gc(p134, ConstPtr(null), descr=...) - i160 = int_lt(i160, 0) - guard_false(i160, descr=...) + i159 = int_lt(i158, 0) + guard_false(i159, descr=...) jump(..., descr=...) """) diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py b/pypy/module/pypyjit/test_pypy_c/test_string.py --- a/pypy/module/pypyjit/test_pypy_c/test_string.py +++ b/pypy/module/pypyjit/test_pypy_c/test_string.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import sys from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC diff --git a/pypy/tool/import_cffi.py b/pypy/tool/import_cffi.py --- a/pypy/tool/import_cffi.py +++ b/pypy/tool/import_cffi.py @@ -20,6 +20,10 @@ else: raise AssertionError(ext) +def fixeol(s): + s = s.replace('\r\n', '\n') + return s + def main(cffi_dir): cffi_dir = py.path.local(cffi_dir) rootdir = py.path.local(__file__).join('..', '..', '..') @@ -29,13 +33,13 @@ test_dest.ensure(dir=1) for p in (list(cffi_dir.join('cffi').visit(fil='*.py')) + list(cffi_dir.join('cffi').visit(fil='*.h'))): - cffi_dest.join('..', p.relto(cffi_dir)).write(p.read()) + cffi_dest.join('..', p.relto(cffi_dir)).write_binary(fixeol(p.read())) for p in (list(cffi_dir.join('testing').visit(fil='*.py')) + list(cffi_dir.join('testing').visit(fil='*.h')) + list(cffi_dir.join('testing').visit(fil='*.c'))): path = test_dest.join(p.relto(cffi_dir.join('testing'))) path.join('..').ensure(dir=1) - path.write(''.join(mangle(p.readlines(), p.ext))) + path.write_binary(fixeol(''.join(mangle(p.readlines(), p.ext)))) if __name__ == '__main__': if len(sys.argv) != 2: diff --git a/pypy/tool/release/repackage.sh b/pypy/tool/release/repackage.sh --- a/pypy/tool/release/repackage.sh +++ b/pypy/tool/release/repackage.sh @@ -3,7 +3,7 @@ pmin=7 # python minor version exe=pypy3 # pypy3 or pypy maj=7 -min=1 +min=2 rev=0 From pypy.commits at gmail.com Sun Sep 29 06:04:57 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 29 Sep 2019 03:04:57 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy3.6-v7.x: merge py3.6 into release Message-ID: <5d9081c9.1c69fb81.e23e4.f4fd@mx.google.com> Author: Matti Picus Branch: release-pypy3.6-v7.x Changeset: r97675:7ffb92269488 Date: 2019-09-29 13:04 +0300 http://bitbucket.org/pypy/pypy/changeset/7ffb92269488/ Log: merge py3.6 into release diff --git a/extra_tests/cffi_tests/cffi1/test_re_python.py b/extra_tests/cffi_tests/cffi1/test_re_python.py --- a/extra_tests/cffi_tests/cffi1/test_re_python.py +++ b/extra_tests/cffi_tests/cffi1/test_re_python.py @@ -66,7 +66,7 @@ int add43(int, ...); int globalvar42; const int globalconst42; - const char *const globalconsthello = "hello"; + const char *const globalconsthello; int no_such_function(int); int no_such_globalvar; struct foo_s; diff --git a/extra_tests/test_semlock.py b/extra_tests/test_semlock.py --- a/extra_tests/test_semlock.py +++ b/extra_tests/test_semlock.py @@ -1,5 +1,6 @@ from _multiprocessing import SemLock from threading import Thread +import thread import time @@ -17,10 +18,19 @@ lock.release() threads = [Thread(target=f, args=(i,)) for i in range(N_THREADS)] + n_started = N_THREADS with lock: for t in threads: - t.start() + try: + t.start() + except thread.error: + # too many threads for this system + t.started = False + n_started -= 1 + else: + t.started = True time.sleep(0.1) for t in threads: - t.join() - assert len(results) == N_THREADS + if t.started: + t.join() + assert len(results) == n_started diff --git a/lib_pypy/cffi/backend_ctypes.py b/lib_pypy/cffi/backend_ctypes.py --- a/lib_pypy/cffi/backend_ctypes.py +++ b/lib_pypy/cffi/backend_ctypes.py @@ -403,7 +403,7 @@ source = _cast_source_to_int(source) return cls(bool(source)) def __int__(self): - return self._value + return int(self._value) if kind == 'char': @classmethod diff --git a/pypy/module/_cffi_backend/newtype.py b/pypy/module/_cffi_backend/newtype.py --- a/pypy/module/_cffi_backend/newtype.py +++ b/pypy/module/_cffi_backend/newtype.py @@ -313,6 +313,10 @@ cdef_value, compiler_value, w_ctype.name) w_ctype._custom_field_pos = True +def roundup_bytes(bytes, bit): + assert bit == (bit & 7) + return bytes + (bit > 0) + @unwrap_spec(w_ctype=ctypeobj.W_CType, totalsize=int, totalalignment=int, sflags=int, pack=int) def complete_struct_or_union(space, w_ctype, w_fields, w_ignored=None, @@ -334,8 +338,9 @@ is_union = isinstance(w_ctype, ctypestruct.W_CTypeUnion) alignment = 1 - boffset = 0 # this number is in *bits*, not bytes! - boffsetmax = 0 # the maximum value of boffset, in bits too + byteoffset = 0 # the real value is 'byteoffset+bitoffset*8', which + bitoffset = 0 # counts the offset in bits + byteoffsetmax = 0 # the maximum value of byteoffset-rounded-up-to-byte prev_bitfield_size = 0 prev_bitfield_free = 0 fields_w = space.listview(w_fields) @@ -380,7 +385,7 @@ with_var_array = True # if is_union: - boffset = 0 # reset each field at offset 0 + byteoffset = bitoffset = 0 # reset each field at offset 0 # # update the total alignment requirement, but skip it if the # field is an anonymous bitfield or if SF_PACKED @@ -410,19 +415,24 @@ else: bs_flag = ctypestruct.W_CField.BS_REGULAR - # align this field to its own 'falign' by inserting padding - boffsetorg = (boffset + falignorg*8-1) & ~(falignorg*8-1) - boffset = (boffset + falign*8-1) & ~(falign*8-1) - if boffsetorg != boffset: + # align this field to its own 'falign' by inserting padding. + # first, pad to the next byte, + # then pad to 'falign' or 'falignorg' bytes + byteoffset = roundup_bytes(byteoffset, bitoffset) + bitoffset = 0 + byteoffsetorg = (byteoffset + falignorg-1) & ~(falignorg-1) + byteoffset = (byteoffset + falign-1) & ~(falign-1) + + if byteoffsetorg != byteoffset: with_packed_change = True if foffset >= 0: # a forced field position: ignore the offset just computed, # except to know if we must set 'custom_field_pos' - detect_custom_layout(w_ctype, sflags, boffset // 8, foffset, + detect_custom_layout(w_ctype, sflags, byteoffset, foffset, "wrong offset for field '", fname, "'") - boffset = foffset * 8 + byteoffset = foffset if (fname == '' and isinstance(ftype, ctypestruct.W_CTypeStructOrUnion)): @@ -432,7 +442,7 @@ for name, srcfld in ftype._fields_dict.items(): srcfield2names[srcfld] = name for srcfld in ftype._fields_list: - fld = srcfld.make_shifted(boffset // 8, fflags) + fld = srcfld.make_shifted(byteoffset, fflags) fields_list.append(fld) try: fields_dict[srcfield2names[srcfld]] = fld @@ -442,13 +452,13 @@ w_ctype._custom_field_pos = True else: # a regular field - fld = ctypestruct.W_CField(ftype, boffset // 8, bs_flag, -1, + fld = ctypestruct.W_CField(ftype, byteoffset, bs_flag, -1, fflags) fields_list.append(fld) fields_dict[fname] = fld if ftype.size >= 0: - boffset += ftype.size * 8 + byteoffset += ftype.size prev_bitfield_size = 0 else: @@ -474,7 +484,7 @@ # compute the starting position of the theoretical field # that covers a complete 'ftype', inside of which we will # locate the real bitfield - field_offset_bytes = boffset // 8 + field_offset_bytes = byteoffset field_offset_bytes &= ~(falign - 1) if fbitsize == 0: @@ -484,11 +494,13 @@ w_ctype.name, fname) if (sflags & SF_MSVC_BITFIELDS) == 0: # GCC's notion of "ftype :0;" - # pad boffset to a value aligned for "ftype" - if boffset > field_offset_bytes * 8: + # pad byteoffset to a value aligned for "ftype" + if (roundup_bytes(byteoffset, bitoffset) > + field_offset_bytes): field_offset_bytes += falign - assert boffset < field_offset_bytes * 8 - boffset = field_offset_bytes * 8 + assert byteoffset < field_offset_bytes + byteoffset = field_offset_bytes + bitoffset = 0 else: # MSVC's notion of "ftype :0; # Mostly ignored. It seems they only serve as @@ -503,7 +515,8 @@ # Can the field start at the offset given by 'boffset'? It # can if it would entirely fit into an aligned ftype field. - bits_already_occupied = boffset - (field_offset_bytes * 8) + bits_already_occupied = ( + (byteoffset-field_offset_bytes) * 8 + bitoffset) if bits_already_occupied + fbitsize > 8 * ftype.size: # it would not fit, we need to start at the next @@ -516,13 +529,16 @@ "the previous field", w_ctype.name, fname) field_offset_bytes += falign - assert boffset < field_offset_bytes * 8 - boffset = field_offset_bytes * 8 + assert byteoffset < field_offset_bytes + byteoffset = field_offset_bytes + bitoffset = 0 bitshift = 0 else: bitshift = bits_already_occupied assert bitshift >= 0 - boffset += fbitsize + bitoffset += fbitsize + byteoffset += (bitoffset >> 3) + bitoffset &= 7 else: # MSVC's algorithm @@ -537,14 +553,17 @@ bitshift = 8 * prev_bitfield_size - prev_bitfield_free else: # no: start a new full field - boffset = (boffset + falign*8-1) & ~(falign*8-1) - boffset += ftype.size * 8 + byteoffset = roundup_bytes(byteoffset, bitoffset) + bitoffset = 0 + # align + byteoffset = (byteoffset + falign-1) & ~(falign-1) + byteoffset += ftype.size bitshift = 0 prev_bitfield_size = ftype.size prev_bitfield_free = 8 * prev_bitfield_size # prev_bitfield_free -= fbitsize - field_offset_bytes = boffset / 8 - ftype.size + field_offset_bytes = byteoffset - ftype.size if sflags & SF_GCC_BIG_ENDIAN: bitshift = 8 * ftype.size - fbitsize- bitshift @@ -555,14 +574,13 @@ fields_list.append(fld) fields_dict[fname] = fld - if boffset > boffsetmax: - boffsetmax = boffset + if roundup_bytes(byteoffset, bitoffset) > byteoffsetmax: + byteoffsetmax = roundup_bytes(byteoffset, bitoffset) # Like C, if the size of this structure would be zero, we compute it # as 1 instead. But for ctypes support, we allow the manually- # specified totalsize to be zero in this case. - boffsetmax = (boffsetmax + 7) // 8 # bits -> bytes - alignedsize = (boffsetmax + alignment - 1) & ~(alignment - 1) + alignedsize = (byteoffsetmax + alignment - 1) & ~(alignment - 1) alignedsize = alignedsize or 1 if totalsize < 0: @@ -570,10 +588,10 @@ else: detect_custom_layout(w_ctype, sflags, alignedsize, totalsize, "wrong total size") - if totalsize < boffsetmax: + if totalsize < byteoffsetmax: raise oefmt(space.w_TypeError, "%s cannot be of size %d: there are fields at least up to %d", - w_ctype.name, totalsize, boffsetmax) + w_ctype.name, totalsize, byteoffsetmax) if totalalignment < 0: totalalignment = alignment else: diff --git a/pypy/module/_cffi_backend/test/_backend_test_c.py b/pypy/module/_cffi_backend/test/_backend_test_c.py --- a/pypy/module/_cffi_backend/test/_backend_test_c.py +++ b/pypy/module/_cffi_backend/test/_backend_test_c.py @@ -4432,3 +4432,11 @@ f = cast(BFunc, 0) with pytest.raises(RuntimeError): f(40, 2) + +def test_huge_structure(): + BChar = new_primitive_type("char") + BArray = new_array_type(new_pointer_type(BChar), sys.maxsize) + assert sizeof(BArray) == sys.maxsize + BStruct = new_struct_type("struct foo") + complete_struct_or_union(BStruct, [('a1', BArray, -1)]) + assert sizeof(BStruct) == sys.maxsize diff --git a/pypy/module/pypyjit/test_pypy_c/test_ffi.py b/pypy/module/pypyjit/test_pypy_c/test_ffi.py --- a/pypy/module/pypyjit/test_pypy_c/test_ffi.py +++ b/pypy/module/pypyjit/test_pypy_c/test_ffi.py @@ -427,12 +427,10 @@ setarrayitem_raw(i153, 0, i106, descr=...) p156 = getfield_gc_r(p48, descr=...) i158 = getfield_raw_i(..., descr=...) - i160 = int_sub(i158, 16) - setfield_raw(#, i160, descr=...) setfield_gc(p48, p49, descr=...) setfield_gc(p48, p50, descr=...) setfield_gc(p134, ConstPtr(null), descr=...) - i160 = int_lt(i160, 0) - guard_false(i160, descr=...) + i159 = int_lt(i158, 0) + guard_false(i159, descr=...) jump(..., descr=...) """) diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py b/pypy/module/pypyjit/test_pypy_c/test_string.py --- a/pypy/module/pypyjit/test_pypy_c/test_string.py +++ b/pypy/module/pypyjit/test_pypy_c/test_string.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import sys from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC diff --git a/pypy/tool/import_cffi.py b/pypy/tool/import_cffi.py --- a/pypy/tool/import_cffi.py +++ b/pypy/tool/import_cffi.py @@ -20,6 +20,10 @@ else: raise AssertionError(ext) +def fixeol(s): + s = s.replace('\r\n', '\n') + return s + def main(cffi_dir): cffi_dir = py.path.local(cffi_dir) rootdir = py.path.local(__file__).join('..', '..', '..') @@ -29,13 +33,13 @@ test_dest.ensure(dir=1) for p in (list(cffi_dir.join('cffi').visit(fil='*.py')) + list(cffi_dir.join('cffi').visit(fil='*.h'))): - cffi_dest.join('..', p.relto(cffi_dir)).write(p.read()) + cffi_dest.join('..', p.relto(cffi_dir)).write_binary(fixeol(p.read())) for p in (list(cffi_dir.join('testing').visit(fil='*.py')) + list(cffi_dir.join('testing').visit(fil='*.h')) + list(cffi_dir.join('testing').visit(fil='*.c'))): path = test_dest.join(p.relto(cffi_dir.join('testing'))) path.join('..').ensure(dir=1) - path.write(''.join(mangle(p.readlines(), p.ext))) + path.write_binary(fixeol(''.join(mangle(p.readlines(), p.ext)))) if __name__ == '__main__': if len(sys.argv) != 2: diff --git a/pypy/tool/release/repackage.sh b/pypy/tool/release/repackage.sh --- a/pypy/tool/release/repackage.sh +++ b/pypy/tool/release/repackage.sh @@ -3,7 +3,7 @@ pmin=7 # python minor version exe=pypy3 # pypy3 or pypy maj=7 -min=1 +min=2 rev=0 From pypy.commits at gmail.com Sun Sep 29 07:35:52 2019 From: pypy.commits at gmail.com (mattip) Date: Sun, 29 Sep 2019 04:35:52 -0700 (PDT) Subject: [pypy-commit] pypy default: check release branch has a -v in the name, avoid building old branches Message-ID: <5d909718.1c69fb81.17569.3a96@mx.google.com> Author: Matti Picus Branch: Changeset: r97676:01482ac43e82 Date: 2019-09-29 14:35 +0300 http://bitbucket.org/pypy/pypy/changeset/01482ac43e82/ Log: check release branch has a -v in the name, avoid building old branches diff --git a/pypy/tool/release/force-builds.py b/pypy/tool/release/force-builds.py --- a/pypy/tool/release/force-builds.py +++ b/pypy/tool/release/force-builds.py @@ -95,4 +95,7 @@ except subprocess.CalledProcessError: print('branch', options.branch, 'could not be found in local repository') sys.exit(-1) + if options.branch.startswith('release') and not '-v' in options.branch: + print('release branches must be of the form "release.*-v.*') + sys.exit(-1) main(options.branch, options.server, user=options.user) From pypy.commits at gmail.com Sun Sep 29 08:12:49 2019 From: pypy.commits at gmail.com (arigo) Date: Sun, 29 Sep 2019 05:12:49 -0700 (PDT) Subject: [pypy-commit] pypy default: Got a translation error on Windows that appears random, but this should fix it Message-ID: <5d909fc1.1c69fb81.e4ea2.75b3@mx.google.com> Author: Armin Rigo Branch: Changeset: r97677:a55eb5aca533 Date: 2019-09-29 14:12 +0200 http://bitbucket.org/pypy/pypy/changeset/a55eb5aca533/ Log: Got a translation error on Windows that appears random, but this should fix it diff --git a/rpython/rlib/runicode.py b/rpython/rlib/runicode.py --- a/rpython/rlib/runicode.py +++ b/rpython/rlib/runicode.py @@ -407,8 +407,9 @@ _encodeUCS4(result, ch) return result.build() unicode_encode_utf_8_elidable = jit.elidable( + enforceargs(s=unicode, allow_surrogates=bool)( func_with_new_name(unicode_encode_utf_8_impl, - "unicode_encode_utf_8_elidable")) + "unicode_encode_utf_8_elidable"))) def unicode_encode_utf8sp(s, size): # Surrogate-preserving utf-8 encoding. Any surrogate character From pypy.commits at gmail.com Mon Sep 30 09:54:59 2019 From: pypy.commits at gmail.com (rlamy) Date: Mon, 30 Sep 2019 06:54:59 -0700 (PDT) Subject: [pypy-commit] pypy default: Add missing method to fake objspace Message-ID: <5d920933.1c69fb81.4255b.a681@mx.google.com> Author: Ronan Lamy Branch: Changeset: r97678:50925e571213 Date: 2019-09-30 14:53 +0100 http://bitbucket.org/pypy/pypy/changeset/50925e571213/ Log: Add missing method to fake objspace diff --git a/pypy/objspace/fake/objspace.py b/pypy/objspace/fake/objspace.py --- a/pypy/objspace/fake/objspace.py +++ b/pypy/objspace/fake/objspace.py @@ -167,6 +167,7 @@ for w_x in list_w: is_root(w_x) return w_some_obj() + newfrozenset = newset def newlist(self, list_w): for w_x in list_w: From pypy.commits at gmail.com Mon Sep 30 10:03:19 2019 From: pypy.commits at gmail.com (rlamy) Date: Mon, 30 Sep 2019 07:03:19 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: port test to py3 Message-ID: <5d920b27.1c69fb81.13ac1.4d96@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97679:40bd3a3fb028 Date: 2019-09-30 15:02 +0100 http://bitbucket.org/pypy/pypy/changeset/40bd3a3fb028/ Log: port test to py3 diff --git a/extra_tests/test_semlock.py b/extra_tests/test_semlock.py --- a/extra_tests/test_semlock.py +++ b/extra_tests/test_semlock.py @@ -1,6 +1,6 @@ from _multiprocessing import SemLock from threading import Thread -import thread +import _thread import time @@ -23,7 +23,7 @@ for t in threads: try: t.start() - except thread.error: + except _thread.error: # too many threads for this system t.started = False n_started -= 1 From pypy.commits at gmail.com Mon Sep 30 10:24:00 2019 From: pypy.commits at gmail.com (stefanor) Date: Mon, 30 Sep 2019 07:24:00 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy2.7-v7.x: This will be the 7.2.0 release Message-ID: <5d921000.1c69fb81.63829.8566@mx.google.com> Author: Stefano Rivera Branch: release-pypy2.7-v7.x Changeset: r97680:cec6bcfd8150 Date: 2019-09-30 17:22 +0300 http://bitbucket.org/pypy/pypy/changeset/cec6bcfd8150/ Log: This will be the 7.2.0 release diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py --- a/pypy/doc/conf.py +++ b/pypy/doc/conf.py @@ -71,9 +71,9 @@ # module/cpyext/include/patchlevel.h # # The short X.Y version. -version = '7.3' +version = '7.2' # The full version, including alpha/beta/rc tags. -release = '7.3.0' +release = '7.2.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From pypy.commits at gmail.com Mon Sep 30 10:24:02 2019 From: pypy.commits at gmail.com (stefanor) Date: Mon, 30 Sep 2019 07:24:02 -0700 (PDT) Subject: [pypy-commit] pypy release-pypy3.6-v7.x: This will be the 7.2.0 release Message-ID: <5d921002.1c69fb81.88de6.0f79@mx.google.com> Author: Stefano Rivera Branch: release-pypy3.6-v7.x Changeset: r97681:4d6761df14ff Date: 2019-09-30 17:23 +0300 http://bitbucket.org/pypy/pypy/changeset/4d6761df14ff/ Log: This will be the 7.2.0 release diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py --- a/pypy/doc/conf.py +++ b/pypy/doc/conf.py @@ -71,9 +71,9 @@ # module/cpyext/include/patchlevel.h # # The short X.Y version. -version = '7.3' +version = '7.2' # The full version, including alpha/beta/rc tags. -release = '7.3.0' +release = '7.2.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From pypy.commits at gmail.com Mon Sep 30 10:33:50 2019 From: pypy.commits at gmail.com (rlamy) Date: Mon, 30 Sep 2019 07:33:50 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: remove obsolete tests Message-ID: <5d92124e.1c69fb81.acf4d.2355@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97682:a8b031cd3e04 Date: 2019-09-30 15:33 +0100 http://bitbucket.org/pypy/pypy/changeset/a8b031cd3e04/ Log: remove obsolete tests diff --git a/pypy/tool/pytest/test/test_pytestsupport.py b/pypy/tool/pytest/test/test_pytestsupport.py --- a/pypy/tool/pytest/test/test_pytestsupport.py +++ b/pypy/tool/pytest/test/test_pytestsupport.py @@ -1,54 +1,11 @@ from pypy.interpreter.error import OperationError -from pypy.interpreter.gateway import app2interp_temp -from pypy.interpreter.argument import Arguments -from pypy.interpreter.pycode import PyCode -from pypy.tool.pytest.appsupport import (AppFrame, build_pytest_assertion, - AppExceptionInfo, interpret) +from pypy.tool.pytest.appsupport import AppExceptionInfo import py -from rpython.tool.udir import udir -import os -import sys import pypy conftestpath = py.path.local(pypy.__file__).dirpath("conftest.py") pytest_plugins = "pytester" -def somefunc(x): - print x - -def test_AppFrame(space): - import sys - co = PyCode._from_code(space, somefunc.func_code) - pyframe = space.FrameClass(space, co, space.newdict(), None) - runner = AppFrame(space, pyframe) - # XXX the following, in two calls to interpret(), no longer seems to - # work---the name 'f' is not defined in the second call. We must - # build the 'f' manually with a space.appexec(). - #interpret("f = lambda x: x+1", runner, should_fail=False) - space.appexec([runner.get_w_globals()], """(dict): - dict['f'] = lambda x: x+1 - """) - msg = interpret("assert isinstance(f(2), float)", runner) - assert msg.startswith("assert isinstance(3, float)\n" - " + where 3 = ") - - -def test_myexception(space): - def app_test_func(): - x = 6*7 - assert x == 43 - t = app2interp_temp(app_test_func) - f = t.get_function(space) - space.setitem(space.builtin.w_dict, space.wrap('AssertionError'), - build_pytest_assertion(space)) - try: - f.call_args(Arguments(None, [])) - except OperationError as e: - assert e.match(space, space.w_AssertionError) - assert space.unwrap(space.str(e.get_w_value(space))) == 'assert 42 == 43' - else: - assert False, "got no exception!" - def app_test_exception(): try: raise AssertionError("42") @@ -63,12 +20,6 @@ except AssertionError as e: assert e.msg == "Failed" -def app_test_comparison(): - try: - assert 3 > 4 - except AssertionError as e: - assert "3 > 4" in e.msg - def test_appexecinfo(space): try: From pypy.commits at gmail.com Mon Sep 30 10:54:34 2019 From: pypy.commits at gmail.com (rlamy) Date: Mon, 30 Sep 2019 07:54:34 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: port test to py3 Message-ID: <5d92172a.1c69fb81.cc40a.0c1a@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97683:7f855aa7cb62 Date: 2019-09-30 15:53 +0100 http://bitbucket.org/pypy/pypy/changeset/7f855aa7cb62/ Log: port test to py3 diff --git a/extra_tests/cffi_tests/test_version.py b/extra_tests/cffi_tests/test_version.py --- a/extra_tests/cffi_tests/test_version.py +++ b/extra_tests/cffi_tests/test_version.py @@ -1,7 +1,7 @@ from email.parser import Parser import py -import urllib2 +from urllib.request import urlopen import cffi import pypy @@ -14,9 +14,8 @@ def test_pycparser_version(): url = 'https://raw.githubusercontent.com/eliben/pycparser/master/pycparser/__init__.py' - source = urllib2.urlopen(url).read() + source = urlopen(url).read().decode('utf8') dest = py.path.local(__file__).join('..', '..', '..', 'lib_pypy', 'cffi', '_pycparser', '__init__.py').read() # if this fails, the vendored pycparser is not the latest version assert source.strip() == dest.strip() - From pypy.commits at gmail.com Mon Sep 30 11:31:20 2019 From: pypy.commits at gmail.com (cfbolz) Date: Mon, 30 Sep 2019 08:31:20 -0700 (PDT) Subject: [pypy-commit] pypy default: ouch, prevent iterating over a unicode string from making bridges Message-ID: <5d921fc8.1c69fb81.eb894.dcf1@mx.google.com> Author: Carl Friedrich Bolz-Tereick Branch: Changeset: r97684:60c4f97fb850 Date: 2019-09-30 17:30 +0200 http://bitbucket.org/pypy/pypy/changeset/60c4f97fb850/ Log: ouch, prevent iterating over a unicode string from making bridges diff --git a/pypy/objspace/std/iterobject.py b/pypy/objspace/std/iterobject.py --- a/pypy/objspace/std/iterobject.py +++ b/pypy/objspace/std/iterobject.py @@ -113,7 +113,7 @@ self.w_seq = None raise OperationError(space.w_StopIteration, space.w_None) start = self.byteindex - end = rutf8.next_codepoint_pos(w_seq._utf8, start) + end = w_seq.next_codepoint_pos_dont_look_inside(start) w_res = W_UnicodeObject(w_seq._utf8[start:end], 1) self.byteindex = end self.index += 1 From pypy.commits at gmail.com Mon Sep 30 11:45:34 2019 From: pypy.commits at gmail.com (rlamy) Date: Mon, 30 Sep 2019 08:45:34 -0700 (PDT) Subject: [pypy-commit] pypy py3.6: fix some tests Message-ID: <5d92231e.1c69fb81.86afa.ccf8@mx.google.com> Author: Ronan Lamy Branch: py3.6 Changeset: r97686:0a4f164d71ba Date: 2019-09-30 16:44 +0100 http://bitbucket.org/pypy/pypy/changeset/0a4f164d71ba/ Log: fix some tests diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py b/pypy/module/pypyjit/test_pypy_c/test_string.py --- a/pypy/module/pypyjit/test_pypy_c/test_string.py +++ b/pypy/module/pypyjit/test_pypy_c/test_string.py @@ -80,12 +80,10 @@ guard_not_invalidated(descr=...) i99 = int_ge(i94, i46) guard_false(i99, descr=...) - i120 = strgetitem(p45, i94) - i113 = int_le(i120, 127) - guard_true(i113, descr=...) i115 = int_add(i94, 1) i116 = int_gt(i115, i71) guard_false(i116, descr=...) + i120 = strgetitem(p45, i94) i122 = call_i(ConstClass(_ll_2_str_eq_checknull_char__rpy_stringPtr_Char), p116, i120, descr=) guard_true(i122, descr=...) i124 = int_add(i83, 1) @@ -123,11 +121,9 @@ i87 = int_mul(i85, 10) i19 = int_sub(i6, i87) - i23 = strgetitem(ConstPtr(ptr92), i19) - i83 = int_le(i23, 127) - guard_true(i83, descr=...) i85 = int_add(i19, 1) # not used p25 = newstr(1) + i23 = strgetitem(ConstPtr(ptr92), i19) strsetitem(p25, 0, i23) i107 = call_i(ConstClass(string_to_int), p25, 16, 1, 1, descr=) guard_no_exception(descr=...) @@ -280,9 +276,8 @@ # XXX remove the guard_nonnull above? def test_unicode_indexing_makes_no_bridges(self): - log = self.run(""" - b = b"b'aaaaa\xc3\xa4\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa7\xe2\x80\x8d\xf0\x9f\x91\xa6'" - u = b.decode("utf-8") * 1000 + log = self.run(r""" + u = 'abä👨‍👩‍👧‍👦 ' * 1000 def main(): for j in range(10): for i in range(len(u)): @@ -329,8 +324,7 @@ def test_unicode_slicing_small_constant_indices(self): log = self.run(""" def main(n): - b = b'ab\xc3\xa4\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa7\xe2\x80\x8d\xf0\x9f\x91\xa6' - u = b.decode("utf-8") * 1000 + u = 'abä👨‍👩‍👧‍👦 ' * 1000 global s count = 0 while u: @@ -340,12 +334,12 @@ """, [1000]) loop, = log.loops_by_filename(self.filepath) assert loop.match_by_id('index', ''' - i51 = int_eq(1, i38) + i51 = int_ge(1, i38) guard_false(i51, descr=...) + i59 = int_sub(i38, 1) i52 = strlen(p47) i53 = int_eq(i38, i52) guard_false(i53, descr=...) i56 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p47, 0, descr=...) i57 = int_sub(i52, i56) - i59 = int_sub(i38, 1) ''')